X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.cpp;h=d899ba8e5858e1422843d1320ea72e896eb6db51;hp=0082bd06d1a869d762bce80d36f8f3bef2dba92f;hb=932ab289c1482a8069cc320a16aca9216058523a;hpb=3abd4b7d5ab303f8d990c104748e5d5aef4db355 diff --git a/src/qtui/qtui.cpp b/src/qtui/qtui.cpp index 0082bd06..d899ba8e 100644 --- a/src/qtui/qtui.cpp +++ b/src/qtui/qtui.cpp @@ -30,6 +30,7 @@ #include "buffermodel.h" #include "chatlinemodel.h" #include "contextmenuactionprovider.h" +#include "icon.h" #include "mainwin.h" #include "qtuimessageprocessor.h" #include "qtuisettings.h" @@ -64,7 +65,7 @@ QtUi::QtUi() setupIconTheme(); - QApplication::setWindowIcon(QIcon::fromTheme("quassel")); + QApplication::setWindowIcon(icon::get("quassel")); setContextMenuActionProvider(new ContextMenuActionProvider(this)); setToolBarActionProvider(new ToolBarActionProvider(this)); @@ -273,7 +274,9 @@ std::vector> QtUi::availableIconThemes() const static const std::vector> supported { { "breeze", tr("Breeze") }, { "breeze-dark", tr("Breeze Dark") }, +#ifdef WITH_OXYGEN_ICONS { "oxygen", tr("Oxygen") } +#endif }; std::vector> result; @@ -290,6 +293,12 @@ std::vector> QtUi::availableIconThemes() const } +QString QtUi::systemIconTheme() const +{ + return _systemIconTheme; +} + + void QtUi::setupIconTheme() { // Add paths to our own icon sets to the theme search paths @@ -336,9 +345,10 @@ void QtUi::refreshIconTheme() } } - if (_systemIconTheme.isEmpty() || _systemIconTheme == fallbackTheme || s.value("Icons/OverrideSystemTheme", false).toBool()) { + if (_systemIconTheme.isEmpty() || _systemIconTheme == fallbackTheme || s.value("Icons/OverrideSystemTheme", true).toBool()) { // We have a valid fallback theme and want to override the system theme (if it's even defined), so we're basically done QIcon::setThemeName(fallbackTheme); + emit iconThemeRefreshed(); return; } @@ -355,6 +365,7 @@ void QtUi::refreshIconTheme() if (!_dummyThemeDir->isValid() || !QDir{_dummyThemeDir->path()}.mkpath("icons/quassel-icon-proxy/apps/32")) { qWarning() << "Could not create temporary directory for proxying the system icon theme, using fallback"; QIcon::setThemeName(fallbackTheme); + emit iconThemeRefreshed(); return; } // Add this to XDG_DATA_DIRS, otherwise KIconLoader complains @@ -371,6 +382,7 @@ void QtUi::refreshIconTheme() if (!indexFile.open(QFile::WriteOnly|QFile::Truncate)) { qWarning() << "Could not create index file for proxying the system icon theme, using fallback"; QIcon::setThemeName(fallbackTheme); + emit iconThemeRefreshed(); return; } @@ -385,6 +397,7 @@ void QtUi::refreshIconTheme() if (indexFile.write(indexContents.toLatin1()) < 0) { qWarning() << "Could not write index file for proxying the system icon theme, using fallback"; QIcon::setThemeName(fallbackTheme); + emit iconThemeRefreshed(); return; } indexFile.close(); @@ -393,5 +406,6 @@ void QtUi::refreshIconTheme() // Qt4 doesn't support QTemporaryDir. Since it's deprecated and slated to be removed soon anyway, we don't bother // writing a replacement and simply don't support not overriding the system theme. QIcon::setThemeName(fallbackTheme); + emit iconThemeRefreshed(); #endif }