X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtuiapplication.cpp;h=3d1d3780a09cb591cba4f27b75929cd381cbbbcf;hb=f3d6f8088d8be6af9319a99fb8d2fee2837b540a;hp=e13fa0ff039914b6c4124d2956e439ce41aaeb8a;hpb=4a5065255e652dd0c301bac0db41b7afb777ef49;p=quassel.git diff --git a/src/qtui/qtuiapplication.cpp b/src/qtui/qtuiapplication.cpp index e13fa0ff..3d1d3780 100644 --- a/src/qtui/qtuiapplication.cpp +++ b/src/qtui/qtuiapplication.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2014 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,6 +20,7 @@ #include "qtuiapplication.h" +#include #include #ifdef HAVE_KDE @@ -62,7 +63,11 @@ QtUiApplication::QtUiApplication(int &argc, char **argv) #endif /* HAVE_KDE || Q_OS_MAC */ setRunMode(Quassel::ClientOnly); +#if QT_VERSION < 0x050000 qInstallMsgHandler(Client::logMessage); +#else + qInstallMessageHandler(Client::logMessage); +#endif } @@ -71,11 +76,11 @@ bool QtUiApplication::init() if (Quassel::init()) { // FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location // Move settings, note this does not delete the old files -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC QSettings newSettings("quassel-irc.org", "quasselclient"); #else -# ifdef Q_WS_WIN +# ifdef Q_OS_WIN QSettings::Format format = QSettings::IniFormat; # else QSettings::Format format = QSettings::NativeFormat; @@ -84,10 +89,10 @@ bool QtUiApplication::init() QString newFilePath = Quassel::configDirPath() + "quasselclient" + ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini")); QSettings newSettings(newFilePath, format); -#endif /* Q_WS_MAC */ +#endif /* Q_OS_MAC */ if (newSettings.value("Config/Version").toUInt() == 0) { -# ifdef Q_WS_MAC +# ifdef Q_OS_MAC QString org = "quassel-irc.org"; # else QString org = "Quassel Project"; @@ -113,6 +118,13 @@ bool QtUiApplication::init() return false; } + // Set the icon theme + if (Quassel::isOptionSet("icontheme")) + QIcon::setThemeName(Quassel::optionValue("icontheme")); + else if (QIcon::themeName().isEmpty()) + // Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though + QIcon::setThemeName("oxygen"); + // session resume QtUi *gui = new QtUi(); Client::init(gui);