X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtui.cpp;h=3ef32014b82aab375c82e29796dd23f02ee6fc25;hb=b7447afe8e836376776dac26704e227a678d2913;hp=0082bd06d1a869d762bce80d36f8f3bef2dba92f;hpb=3abd4b7d5ab303f8d990c104748e5d5aef4db355;p=quassel.git diff --git a/src/qtui/qtui.cpp b/src/qtui/qtui.cpp index 0082bd06..3ef32014 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)); @@ -290,6 +291,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 @@ -339,6 +346,7 @@ void QtUi::refreshIconTheme() if (_systemIconTheme.isEmpty() || _systemIconTheme == fallbackTheme || s.value("Icons/OverrideSystemTheme", false).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 +363,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 +380,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 +395,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 +404,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 }