Skip to content

Commit 78735d5

Browse files
luis-pereiraagaida
authored andcommitted
Use XdgIconLoader library (#10)
We now use our XdgIconLoader all the time and not only when using XdgIcon as before.
1 parent 4a3d790 commit 78735d5

File tree

4 files changed

+9
-197
lines changed

4 files changed

+9
-197
lines changed

src/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ target_link_libraries(qtlxqt
3131
Qt5::DBus
3232
dbusmenu-qt5
3333
lxqt
34+
Qt5XdgIconLoader
3435
)
3536

3637
# there is no standard way to get the plugin dir of Qt5 with cmake

src/lxqtplatformtheme.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include <QFileInfo>
4545
#include <QFileSystemWatcher>
4646
#include <QStyle>
47-
#include "qiconloader_p.h"
47+
#include <private/xdgiconloader/xdgiconloader_p.h>
4848

4949
LXQtPlatformTheme::LXQtPlatformTheme():
5050
settingsWatcher_(NULL)
@@ -162,7 +162,7 @@ void LXQtPlatformTheme::onSettingsChanged() {
162162
}
163163

164164
if(iconTheme_ != oldIconTheme) { // the icon theme is changed
165-
QIconLoader::instance()->updateSystemTheme(); // this is a private internal API of Qt5.
165+
XdgIconLoader::instance()->updateSystemTheme(); // this is a private internal API of Qt5.
166166
}
167167

168168
// if font is changed
@@ -294,6 +294,11 @@ QVariant LXQtPlatformTheme::themeHint(ThemeHint hint) const {
294294
return QPlatformTheme::themeHint(hint);
295295
}
296296

297+
QIconEngine *LXQtPlatformTheme::createIconEngine(const QString &iconName) const
298+
{
299+
return new XdgIconLoaderEngine(iconName);
300+
}
301+
297302
// Helper to return the icon theme paths from XDG.
298303
QStringList LXQtPlatformTheme::xdgIconThemePaths() const
299304
{

src/lxqtplatformtheme.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class Q_GUI_EXPORT LXQtPlatformTheme : public QObject, public QPlatformTheme {
7272
// virtual QPixmap fileIconPixmap(const QFileInfo &fileInfo, const QSizeF &size,
7373
// QPlatformTheme::IconOptions iconOptions = 0) const;
7474

75-
// virtual QIconEngine *createIconEngine(const QString &iconName) const;
75+
virtual QIconEngine *createIconEngine(const QString &iconName) const;
7676

7777
// virtual QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const;
7878

src/qiconloader_p.h

-194
This file was deleted.

0 commit comments

Comments
 (0)