/***************************************************************************
- * 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 *
#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();
- notificationSettings.notify("DockManager/Enabled", this, SLOT(enabledChanged(const QVariant &)));
+ notificationSettings.notify("DockManager/Enabled", this, &DockManagerNotificationBackend::enabledChanged);
_dock = new QDBusInterface("net.launchpad.DockManager", "/net/launchpad/DockManager", "net.launchpad.DockManager", _bus, this);
if (_dock->isValid()) {
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<int>(&DockManagerNotificationBackend::updateProgress));
+ connect(Client::coreConnection(), &CoreConnection::synchronized, this, &DockManagerNotificationBackend::synchronized);
}
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;
void DockManagerNotificationBackend::synchronized()
{
- connect(Client::backlogManager(), SIGNAL(updateProgress(int, int)), this, SLOT(updateProgress(int, int)));
+ connect(Client::backlogManager(), &ClientBacklogManager::updateProgress, this, selectOverload<int, int>(&DockManagerNotificationBackend::updateProgress));
}
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);
}