src/urllineedit.h \
src/spacer.h \
src/constants.h \
- src/iconloader/qticonloader.h \
src/playlistitemdelegate.h \
src/networkaccess.h \
src/videomimedata.h \
src/videosourcewidget.h \
src/regionsview.h \
src/ytsinglevideosource.h \
- src/sidebarheader.h
+ src/sidebarheader.h \
+ src/utils.h
SOURCES += src/main.cpp \
src/searchlineedit.cpp \
src/urllineedit.cpp \
src/spacer.cpp \
src/video.cpp \
- src/iconloader/qticonloader.cpp \
src/videomimedata.cpp \
src/updatechecker.cpp \
src/networkaccess.cpp \
src/videosourcewidget.cpp \
src/regionsview.cpp \
src/ytsinglevideosource.cpp \
- src/sidebarheader.cpp
+ src/sidebarheader.cpp \
+ src/utils.cpp
RESOURCES += resources.qrc
DESTDIR = build/target/
OBJECTS_DIR = build/obj/
#include "constants.h"
#include "mainwindow.h"
#include "searchparams.h"
-#include "iconloader/qticonloader.h"
+#include "utils.h"
#ifndef Q_WS_X11
#include "extra.h"
#endif
#ifndef APP_MAC
QIcon appIcon;
if (QDir(dataDir).exists()) {
- appIcon = QtIconLoader::icon(Constants::UNIX_NAME);
+ appIcon = Utils::icon(Constants::UNIX_NAME);
} else {
dataDir = qApp->applicationDirPath() + "/data";
const int iconSizes [] = { 16, 22, 32, 48, 64, 128, 256, 512 };
#include "playlistmodel.h"
#include "fontutils.h"
#include "downloaditem.h"
-#include "iconloader/qticonloader.h"
+#include "utils.h"
#include "videodefinition.h"
#include "video.h"
if (status != Finished && status != Failed && status != Idle) {
if (downloadButtonHovered) message = tr("Stop downloading");
painter->save();
- QIcon closeIcon = QtIconLoader::icon("window-close");
+ QIcon closeIcon = Utils::icon("window-close");
painter->drawPixmap(downloadButtonRect(line), closeIcon.pixmap(16, 16, iconMode));
painter->restore();
}
message = tr("Open parent folder");
#endif
painter->save();
- QIcon searchIcon = QtIconLoader::icon("system-search");
+ QIcon searchIcon = Utils::icon("system-search");
painter->drawPixmap(downloadButtonRect(line), searchIcon.pixmap(16, 16, iconMode));
painter->restore();
}
else if (status == Failed || status == Idle) {
if (downloadButtonHovered) message = tr("Restart downloading");
painter->save();
- QIcon searchIcon = QtIconLoader::icon("view-refresh");
+ QIcon searchIcon = Utils::icon("view-refresh");
painter->drawPixmap(downloadButtonRect(line), searchIcon.pixmap(16, 16, iconMode));
painter->restore();
}
#include "sidebarheader.h"
-#include "iconloader/qticonloader.h"
+#include "utils.h"
#include "mediaview.h"
#include "videosource.h"
#include "fontutils.h"
isSetup = true;
backAction = new QAction(
- QtIconLoader::icon("go-previous"),
+ Utils::icon("go-previous"),
tr("&Back"), this);
connect(backAction, SIGNAL(triggered()), MediaView::instance(), SLOT(goBack()));
addAction(backAction);
forwardAction = new QAction(
- QtIconLoader::icon("go-next"),
+ Utils::icon("go-next"),
tr("&Back"), this);
connect(forwardAction, SIGNAL(triggered()), MediaView::instance(), SLOT(goForward()));
addAction(forwardAction);
--- /dev/null
+#include "utils.h"
+#ifndef Q_WS_X11
+#include "extra.h"
+#endif
+
+QIcon Utils::icon(const QString &name) {
+#ifdef Q_WS_X11
+ return QIcon::fromTheme(name);
+#else
+ return Extra::getIcon(name);
+#endif
+}
--- /dev/null
+#ifndef UTILS_H
+#define UTILS_H
+
+#include <QtCore>
+
+class Utils {
+
+public:
+ static QIcon icon(const QString &name);
+
+private:
+ Utils() { }
+
+};
+
+#endif // UTILS_H