X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.cpp;h=3bdb6e1c1ee74818a291aefb1831f386736daa63;hp=a6c48c35cafc28b62243822f9bf451318fc97b17;hb=6eefdfc697067d184a589fc8a231b16316c09106;hpb=72473527f99cbe68dcfcb4ca17f828bd3775bba7 diff --git a/src/qtui/qtui.cpp b/src/qtui/qtui.cpp index a6c48c35..3bdb6e1c 100644 --- a/src/qtui/qtui.cpp +++ b/src/qtui/qtui.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "abstractnotificationbackend.h" #include "buffermodel.h" @@ -79,12 +80,12 @@ void QtUi::init() setContextMenuActionProvider(new ContextMenuActionProvider(this)); setToolBarActionProvider(new ToolBarActionProvider(this)); - _mainWin.reset(new MainWin()); // TODO C++14: std::make_unique + _mainWin = std::make_unique(); setMainWidget(_mainWin.get()); - connect(_mainWin.get(), SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &))); - connect(_mainWin.get(), SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore())); - connect(Client::instance(), SIGNAL(bufferMarkedAsRead(BufferId)), SLOT(closeNotifications(BufferId))); + connect(_mainWin.get(), &MainWin::connectToCore, this, &QtUi::connectToCore); + connect(_mainWin.get(), &MainWin::disconnectFromCore, this, &QtUi::disconnectFromCore); + connect(Client::instance(), &Client::bufferMarkedAsRead, this, &QtUi::closeNotifications); _mainWin->init(); @@ -166,7 +167,7 @@ void QtUi::registerNotificationBackend(AbstractNotificationBackend *backend) { if (!_notificationBackends.contains(backend)) { _notificationBackends.append(backend); - instance()->connect(backend, SIGNAL(activated(uint)), SLOT(notificationActivated(uint))); + connect(backend, &AbstractNotificationBackend::activated, instance(), &QtUi::notificationActivated); } } @@ -347,7 +348,6 @@ void QtUi::refreshIconTheme() return; } -#if QT_VERSION >= 0x050000 // At this point, we have a system theme that we don't want to override, but that may not contain all // required icons. // We create a dummy theme that inherits first from the system theme, then from the supported fallback. @@ -356,7 +356,7 @@ void QtUi::refreshIconTheme() // Since we can't get notified when the system theme changes, this means that a restart may be required // to apply a theme change... but you can't have everything, I guess. if (!_dummyThemeDir) { - _dummyThemeDir.reset(new QTemporaryDir{}); + _dummyThemeDir = std::make_unique(); 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); @@ -397,10 +397,4 @@ void QtUi::refreshIconTheme() } indexFile.close(); QIcon::setThemeName("quassel-icon-proxy"); -#else - // 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 }