diff --git a/CMakeLists.txt b/CMakeLists.txt index 09796d253..0df014052 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -451,7 +451,7 @@ if(WIN32) install(FILES ${APP_DLLS_QT5_MSVC2013_PLATFORMS} DESTINATION ./platforms) install(FILES ${APP_DLLS_QT5_MSVC2013_SQLDRIVERS} DESTINATION ./sqldrivers) - install(FILES ${MISC_ICONS} DESTINATION ./icons/) + install(DIRECTORY resources/graphics/misc DESTINATION ./icons) install(FILES resources/graphics/Faenza/index.theme DESTINATION ./icons/Faenza) install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ./icons/Faenza) @@ -498,7 +498,7 @@ elseif(APPLE) # Setup custom "bundle" prefix. set(APPLE_PREFIX ${CMAKE_INSTALL_PREFIX}/${EXE_NAME}.app/Contents/Resources) - install(FILES ${MISC_ICONS} DESTINATION ${APPLE_PREFIX}/icons/) + install(DIRECTORY resources/graphics/misc DESTINATION ${APPLE_PREFIX}/icons) install(FILES resources/graphics/Faenza/index.theme DESTINATION ${APPLE_PREFIX}/icons/Faenza) install(DIRECTORY ${FAENZA_FOLDERS} DESTINATION ${APPLE_PREFIX}/icons/Faenza) @@ -514,7 +514,7 @@ elseif(UNIX) install(TARGETS ${EXE_NAME} RUNTIME DESTINATION bin) - install(FILES ${MISC_ICONS} DESTINATION share/${APP_LOW_NAME}/icons) + install(DIRECTORY resources/graphics/misc DESTINATION share/${APP_LOW_NAME}/icons) install(DIRECTORY resources/initial_feeds DESTINATION share/${APP_LOW_NAME}) install(DIRECTORY resources/skins/base DESTINATION share/${APP_LOW_NAME}/skins) install(DIRECTORY resources/misc DESTINATION share/${APP_LOW_NAME}) diff --git a/resources/graphics/misc/flags/cs_CZ.png b/resources/graphics/misc/flags/cs_CZ.png new file mode 100644 index 000000000..b50e69ec0 Binary files /dev/null and b/resources/graphics/misc/flags/cs_CZ.png differ diff --git a/resources/graphics/misc/flags/da_DK.png b/resources/graphics/misc/flags/da_DK.png new file mode 100644 index 000000000..3f4dac36d Binary files /dev/null and b/resources/graphics/misc/flags/da_DK.png differ diff --git a/resources/graphics/misc/flags/de_DE.png b/resources/graphics/misc/flags/de_DE.png new file mode 100644 index 000000000..463f855d7 Binary files /dev/null and b/resources/graphics/misc/flags/de_DE.png differ diff --git a/resources/graphics/misc/flags/en_GB.png b/resources/graphics/misc/flags/en_GB.png new file mode 100644 index 000000000..bfe631c02 Binary files /dev/null and b/resources/graphics/misc/flags/en_GB.png differ diff --git a/resources/graphics/misc/flags/en_US.png b/resources/graphics/misc/flags/en_US.png new file mode 100644 index 000000000..48c448fc9 Binary files /dev/null and b/resources/graphics/misc/flags/en_US.png differ diff --git a/resources/graphics/misc/flags/fr_FR.png b/resources/graphics/misc/flags/fr_FR.png new file mode 100644 index 000000000..33156c6a6 Binary files /dev/null and b/resources/graphics/misc/flags/fr_FR.png differ diff --git a/resources/graphics/misc/flags/he_IL.png b/resources/graphics/misc/flags/he_IL.png new file mode 100644 index 000000000..3ba7553d3 Binary files /dev/null and b/resources/graphics/misc/flags/he_IL.png differ diff --git a/resources/graphics/misc/flags/id_ID.png b/resources/graphics/misc/flags/id_ID.png new file mode 100644 index 000000000..ed42d1f98 Binary files /dev/null and b/resources/graphics/misc/flags/id_ID.png differ diff --git a/resources/graphics/misc/flags/it_IT.png b/resources/graphics/misc/flags/it_IT.png new file mode 100644 index 000000000..ea0b791b5 Binary files /dev/null and b/resources/graphics/misc/flags/it_IT.png differ diff --git a/resources/graphics/misc/flags/ja_JP.png b/resources/graphics/misc/flags/ja_JP.png new file mode 100644 index 000000000..29c45d586 Binary files /dev/null and b/resources/graphics/misc/flags/ja_JP.png differ diff --git a/resources/graphics/misc/flags/lt_LT.png b/resources/graphics/misc/flags/lt_LT.png new file mode 100644 index 000000000..875dd3f90 Binary files /dev/null and b/resources/graphics/misc/flags/lt_LT.png differ diff --git a/resources/graphics/misc/flags/nl_NL.png b/resources/graphics/misc/flags/nl_NL.png new file mode 100644 index 000000000..2e7ac6191 Binary files /dev/null and b/resources/graphics/misc/flags/nl_NL.png differ diff --git a/resources/graphics/misc/flags/pt_BR.png b/resources/graphics/misc/flags/pt_BR.png new file mode 100644 index 000000000..47a007f2d Binary files /dev/null and b/resources/graphics/misc/flags/pt_BR.png differ diff --git a/resources/graphics/misc/flags/sv_SE.png b/resources/graphics/misc/flags/sv_SE.png new file mode 100644 index 000000000..2c9bd9dbf Binary files /dev/null and b/resources/graphics/misc/flags/sv_SE.png differ diff --git a/resources/graphics/image-placeholder.png b/resources/graphics/misc/image-placeholder.png similarity index 100% rename from resources/graphics/image-placeholder.png rename to resources/graphics/misc/image-placeholder.png diff --git a/resources/graphics/owncloud.png b/resources/graphics/misc/owncloud.png similarity index 100% rename from resources/graphics/owncloud.png rename to resources/graphics/misc/owncloud.png diff --git a/resources/graphics/tt-rss.png b/resources/graphics/misc/tt-rss.png similarity index 100% rename from resources/graphics/tt-rss.png rename to resources/graphics/misc/tt-rss.png diff --git a/src/gui/dialogs/formsettings.cpp b/src/gui/dialogs/formsettings.cpp index 411931afd..a653fcd42 100755 --- a/src/gui/dialogs/formsettings.cpp +++ b/src/gui/dialogs/formsettings.cpp @@ -455,7 +455,7 @@ void FormSettings::loadLanguage() { item->setText(1, language.m_code); item->setText(2, language.m_version); item->setText(3, language.m_author); - item->setIcon(0, qApp->icons()->fromTheme(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code)); + item->setIcon(0, qApp->icons()->miscIcon(QString(FLAG_ICON_SUBFOLDER) + QDir::separator() + language.m_code)); } QList matching_items = m_ui->m_treeLanguages->findItems(qApp->localization()->loadedLanguage(), Qt::MatchContains, 1); diff --git a/src/gui/messagetextbrowser.cpp b/src/gui/messagetextbrowser.cpp index b7e112c1a..9e7dd7441 100644 --- a/src/gui/messagetextbrowser.cpp +++ b/src/gui/messagetextbrowser.cpp @@ -17,10 +17,7 @@ QVariant MessageTextBrowser::loadResource(int type, const QUrl &name) { switch (type) { case QTextDocument::ImageResource: { if (m_imagePlaceholder.isNull()) { - // TODO: opravit, zahrnout ten obrázek asi. - m_imagePlaceholder = QPixmap(QString(APP_THEME_PATH) + - QDir::separator() + - QSL("image-placeholder.png")).scaledToWidth(20, Qt::FastTransformation); + m_imagePlaceholder = qApp->icons()->miscPixmap(QSL("image-placeholder")).scaledToWidth(20, Qt::FastTransformation); } emit imageRequested(name.toString()); diff --git a/src/miscellaneous/iconfactory.cpp b/src/miscellaneous/iconfactory.cpp index 77f7431de..c776fd100 100755 --- a/src/miscellaneous/iconfactory.cpp +++ b/src/miscellaneous/iconfactory.cpp @@ -70,6 +70,14 @@ QIcon IconFactory::fromTheme(const QString &name) { return QIcon::fromTheme(name); } +QPixmap IconFactory::miscPixmap(const QString &name) { + return QPixmap(QString(APP_THEME_PATH) + QDir::separator() + "misc" + QDir::separator() + name + ".png"); +} + +QIcon IconFactory::miscIcon(const QString &name) { + return QIcon(QString(APP_THEME_PATH) + QDir::separator() + "misc" + QDir::separator() + name + ".png"); +} + void IconFactory::setupSearchPaths() { QIcon::setThemeSearchPaths(QIcon::themeSearchPaths() << APP_THEME_PATH); qDebug("Available icon theme paths: %s.", @@ -120,7 +128,7 @@ QStringList IconFactory::installedIconThemes() const { icon_themes_paths.removeDuplicates(); foreach (const QString &icon_path, icon_themes_paths) { - const QDir icon_dir(icon_path); + const QDir icon_dir(icon_path); // Iterate all icon themes in this directory. foreach (const QFileInfo &icon_theme_path, icon_dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | diff --git a/src/miscellaneous/iconfactory.h b/src/miscellaneous/iconfactory.h index 9d48577bf..23809b0e9 100755 --- a/src/miscellaneous/iconfactory.h +++ b/src/miscellaneous/iconfactory.h @@ -50,6 +50,9 @@ class IconFactory : public QObject { // "no icon theme" is set. QIcon fromTheme(const QString &name); + QPixmap miscPixmap(const QString &name); + QIcon miscIcon(const QString &name); + // Adds custom application path to be search for icons. void setupSearchPaths(); diff --git a/src/services/owncloud/owncloudserviceentrypoint.cpp b/src/services/owncloud/owncloudserviceentrypoint.cpp index 4dde65b6e..f2b80a621 100755 --- a/src/services/owncloud/owncloudserviceentrypoint.cpp +++ b/src/services/owncloud/owncloudserviceentrypoint.cpp @@ -70,8 +70,6 @@ QString OwnCloudServiceEntryPoint::author() const { } QIcon OwnCloudServiceEntryPoint::icon() const { - return QIcon(QString(APP_THEME_PATH) + - QDir::separator() + - QSL("owncloud.png")); + return qApp->icons()->miscIcon(QSL("owncloud")); } diff --git a/src/services/tt-rss/ttrssserviceentrypoint.cpp b/src/services/tt-rss/ttrssserviceentrypoint.cpp index d6e3292b6..6fddd3e38 100755 --- a/src/services/tt-rss/ttrssserviceentrypoint.cpp +++ b/src/services/tt-rss/ttrssserviceentrypoint.cpp @@ -59,9 +59,7 @@ QString TtRssServiceEntryPoint::author() const { } QIcon TtRssServiceEntryPoint::icon() const { - return QIcon(QString(APP_THEME_PATH) + - QDir::separator() + - QSL("tt-rss.png")); + return qApp->icons()->miscIcon(QSL("tt-rss")); } QString TtRssServiceEntryPoint::code() const {