X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fdockmanagernotificationbackend.cpp;h=2a6ea9bffd2623d8dbb3443c8e1fea90819098bf;hp=5654776337f465ec5383aac81725c336f4616f76;hb=900cce213a6ed000b7131a05a0dec7d04b35b023;hpb=df48c9a36377de3c9e9deeaf539e1446ef7bd49b diff --git a/src/qtui/dockmanagernotificationbackend.cpp b/src/qtui/dockmanagernotificationbackend.cpp index 56547763..2a6ea9bf 100644 --- a/src/qtui/dockmanagernotificationbackend.cpp +++ b/src/qtui/dockmanagernotificationbackend.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2013 by the Quassel Project * + * Copyright (C) 2013-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -28,9 +28,10 @@ #include "clientsettings.h" #include "coreconnection.h" #include "clientbacklogmanager.h" +#include "util.h" DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent) - : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()), _dock(0), _item(0), _count(0) + : AbstractNotificationBackend(parent), _bus(QDBusConnection::sessionBus()) { NotificationSettings notificationSettings; _enabled = notificationSettings.value("DockManager/Enabled", false).toBool(); @@ -54,8 +55,8 @@ DockManagerNotificationBackend::DockManagerNotificationBackend(QObject *parent) itemAdded(QDBusObjectPath()); - connect(Client::coreConnection(), SIGNAL(progressValueChanged(int)), this, SLOT(updateProgress(int))); - connect(Client::coreConnection(), SIGNAL(synchronized()), this, SLOT(synchronized())); + connect(Client::coreConnection(), &CoreConnection::progressValueChanged, this, selectOverload(&DockManagerNotificationBackend::updateProgress)); + connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized); } @@ -110,7 +111,7 @@ void DockManagerNotificationBackend::updateProgress(int done, int total) int perc = 0; if (done == total) { - disconnect(Client::backlogManager(), 0, this, 0); + disconnect(Client::backlogManager(), nullptr, this, nullptr); perc = -1; } else perc = (done * 100) / total; @@ -123,7 +124,7 @@ void DockManagerNotificationBackend::updateProgress(int done, int total) void DockManagerNotificationBackend::synchronized() { - connect(Client::backlogManager(), SIGNAL(updateProgress(int, int)), this, SLOT(updateProgress(int, int))); + connect(Client::backlogManager(), &ClientBacklogManager::updateProgress, this, selectOverload(&DockManagerNotificationBackend::updateProgress)); } @@ -180,11 +181,11 @@ SettingsPage *DockManagerNotificationBackend::createConfigWidget() const DockManagerNotificationBackend::ConfigWidget::ConfigWidget(bool enabled, QWidget *parent) : SettingsPage("Internal", "DockManagerNotification", parent) { - QHBoxLayout *layout = new QHBoxLayout(this); + auto *layout = new QHBoxLayout(this); layout->addWidget(enabledBox = new QCheckBox(tr("Mark dockmanager entry"), this)); - enabledBox->setEnabled(enabled); + enabledBox->setVisible(enabled); - connect(enabledBox, SIGNAL(toggled(bool)), SLOT(widgetChanged())); + connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged); }