X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.cpp;h=7b658b9c296a9bdbc08b1c1e6fb32fa624d86256;hp=0082bd06d1a869d762bce80d36f8f3bef2dba92f;hb=911f181e0e179eb51279c0880eb701a43163b8b5;hpb=3abd4b7d5ab303f8d990c104748e5d5aef4db355 diff --git a/src/qtui/qtui.cpp b/src/qtui/qtui.cpp index 0082bd06..7b658b9c 100644 --- a/src/qtui/qtui.cpp +++ b/src/qtui/qtui.cpp @@ -290,6 +290,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 +345,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 +362,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 +379,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 +394,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 +403,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 }