#include "types.h"
#include "util.h"
-QtUi *QtUi::_instance = nullptr;
MainWin *QtUi::_mainWin = nullptr;
QList<AbstractNotificationBackend *> QtUi::_notificationBackends;
QList<AbstractNotificationBackend::Notification> QtUi::_notifications;
+namespace {
+
+QtUi *_instance{nullptr};
+
+}
+
+
+QtUi *QtUi::instance()
+{
+ if (!_instance) {
+ _instance = new QtUi();
+ }
+ return _instance;
+}
+
+
QtUi::QtUi()
: GraphicalUi()
, _systemIconTheme{QIcon::themeName()}
{
- if (_instance != nullptr) {
- qWarning() << "QtUi has been instantiated again!";
- return;
- }
- _instance = this;
-
if (Quassel::isOptionSet("icontheme")) {
_systemIconTheme = Quassel::optionValue("icontheme");
QIcon::setThemeName(_systemIconTheme);
}
}
- 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();