From e745c7c7c8385cf8f12f9e305fc905cf86c8a14c Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 24 Oct 2019 19:51:45 +0100 Subject: [PATCH] Port old style connects Done with clazy --- applets/appmenu/lib/appmenuapplet.cpp | 2 +- applets/appmenu/plugin/appmenumodel.cpp | 2 +- applets/icon/iconapplet.cpp | 2 +- applets/kicker/plugin/forwardingmodel.cpp | 56 +++++++++---------- applets/kicker/plugin/recentcontactsmodel.cpp | 18 +++--- applets/kicker/plugin/runnermodel.cpp | 6 +- .../appletslayout.cpp | 2 +- components/sessionsprivate/sessionsmodel.cpp | 2 +- containmentactions/switchwindow/switch.cpp | 2 +- .../statusnotifieritemjob.cpp | 2 +- .../statusnotifieritemsource.cpp | 2 +- gmenu-dbusmenu-proxy/menu.cpp | 2 +- libdbusmenuqt/dbusmenuimporter.cpp | 2 +- shell/currentcontainmentactionsmodel.cpp | 2 +- 14 files changed, 51 insertions(+), 51 deletions(-) diff --git a/applets/appmenu/lib/appmenuapplet.cpp b/applets/appmenu/lib/appmenuapplet.cpp index fd7b660d7..8b25ebc2b 100644 --- a/applets/appmenu/lib/appmenuapplet.cpp +++ b/applets/appmenu/lib/appmenuapplet.cpp @@ -55,7 +55,7 @@ AppMenuApplet::AppMenuApplet(QObject *parent, const QVariantList &data) another destroyedchanged and destroyed will be false. When this happens, if we are the only appmenu applet existing, the dbus interface will have to be registered again*/ - connect(this, &Applet::destroyedChanged, this, [this](bool destroyed) { + connect(this, &Applet::destroyedChanged, this, [](bool destroyed) { if (destroyed) { //if we were the last, unregister if (--s_refs == 0) { diff --git a/applets/appmenu/plugin/appmenumodel.cpp b/applets/appmenu/plugin/appmenumodel.cpp index 397838d75..ffeb9a342 100644 --- a/applets/appmenu/plugin/appmenumodel.cpp +++ b/applets/appmenu/plugin/appmenumodel.cpp @@ -175,7 +175,7 @@ void AppMenuModel::onActiveWindowChanged(WId id) if (KWindowSystem::isPlatformX11()) { auto *c = QX11Info::connection(); - auto getWindowPropertyString = [c, this](WId id, const QByteArray &name) -> QByteArray { + auto getWindowPropertyString = [c](WId id, const QByteArray &name) -> QByteArray { QByteArray value; if (!s_atoms.contains(name)) { const xcb_intern_atom_cookie_t atomCookie = xcb_intern_atom(c, false, name.length(), name.constData()); diff --git a/applets/icon/iconapplet.cpp b/applets/icon/iconapplet.cpp index e745b1712..dec37e37c 100644 --- a/applets/icon/iconapplet.cpp +++ b/applets/icon/iconapplet.cpp @@ -388,7 +388,7 @@ QList IconApplet::contextualActions() if (!m_openContainingFolderAction) { if (KProtocolManager::supportsListing(linkUrl)) { m_openContainingFolderAction = new QAction(QIcon::fromTheme(QStringLiteral("document-open-folder")), i18n("Open Containing Folder"), this); - connect(m_openContainingFolderAction, &QAction::triggered, this, [this, linkUrl] { + connect(m_openContainingFolderAction, &QAction::triggered, this, [ linkUrl] { KIO::highlightInFileManager({linkUrl}); }); } diff --git a/applets/kicker/plugin/forwardingmodel.cpp b/applets/kicker/plugin/forwardingmodel.cpp index a0cb86a8f..96ec8878d 100644 --- a/applets/kicker/plugin/forwardingmodel.cpp +++ b/applets/kicker/plugin/forwardingmodel.cpp @@ -213,45 +213,45 @@ void ForwardingModel::connectSignals() } connect(m_sourceModel, SIGNAL(destroyed()), this, SLOT(reset())); - connect(m_sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), - this, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector)), + connect(m_sourceModel.data(), &QAbstractItemModel::dataChanged, + this, &QAbstractItemModel::dataChanged, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), - this, SIGNAL(rowsAboutToBeInserted(QModelIndex,int,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsAboutToBeInserted, + this, &QAbstractItemModel::rowsAboutToBeInserted, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), - this, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsAboutToBeMoved, + this, &QAbstractItemModel::rowsAboutToBeMoved, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), - this, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsAboutToBeRemoved, + this, &QAbstractItemModel::rowsAboutToBeRemoved, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(layoutAboutToBeChanged(QList,QAbstractItemModel::LayoutChangeHint)), - this, SIGNAL(layoutAboutToBeChanged(QList,QAbstractItemModel::LayoutChangeHint)), + connect(m_sourceModel.data(), &QAbstractItemModel::layoutAboutToBeChanged, + this, &QAbstractItemModel::layoutAboutToBeChanged, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SIGNAL(rowsInserted(QModelIndex,int,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsInserted, + this, &QAbstractItemModel::rowsInserted, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SIGNAL(countChanged()), Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), - this, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsInserted, + this, &AbstractModel::countChanged, Qt::UniqueConnection); + connect(m_sourceModel.data(), &QAbstractItemModel::rowsMoved, + this, &QAbstractItemModel::rowsMoved, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SIGNAL(rowsRemoved(QModelIndex,int,int)), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsRemoved, + this, &QAbstractItemModel::rowsRemoved, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SIGNAL(countChanged()), Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(modelAboutToBeReset()), - this, SIGNAL(modelAboutToBeReset()), + connect(m_sourceModel.data(), &QAbstractItemModel::rowsRemoved, + this, &AbstractModel::countChanged, Qt::UniqueConnection); + connect(m_sourceModel.data(), &QAbstractItemModel::modelAboutToBeReset, + this, &QAbstractItemModel::modelAboutToBeReset, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(modelReset()), - this, SIGNAL(modelReset()), + connect(m_sourceModel.data(), &QAbstractItemModel::modelReset, + this, &QAbstractItemModel::modelReset, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(modelReset()), - this, SIGNAL(countChanged()), + connect(m_sourceModel.data(), &QAbstractItemModel::modelReset, + this, &AbstractModel::countChanged, Qt::UniqueConnection); - connect(m_sourceModel, SIGNAL(layoutChanged(QList,QAbstractItemModel::LayoutChangeHint)), - this, SIGNAL(layoutChanged(QList,QAbstractItemModel::LayoutChangeHint)), + connect(m_sourceModel.data(), &QAbstractItemModel::layoutChanged, + this, &QAbstractItemModel::layoutChanged, Qt::UniqueConnection); } diff --git a/applets/kicker/plugin/recentcontactsmodel.cpp b/applets/kicker/plugin/recentcontactsmodel.cpp index 5b875b59e..7f3396647 100644 --- a/applets/kicker/plugin/recentcontactsmodel.cpp +++ b/applets/kicker/plugin/recentcontactsmodel.cpp @@ -189,14 +189,14 @@ void RecentContactsModel::refresh() } // FIXME TODO: Don't wipe entire cache on transactions. - connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)), - this, SLOT(buildCache()), Qt::UniqueConnection); - connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), - this, SLOT(buildCache()), Qt::UniqueConnection); - connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), - this, SLOT(buildCache()), Qt::UniqueConnection); - connect(model, SIGNAL(modelReset()), - this, SLOT(buildCache()), Qt::UniqueConnection); + connect(model, &QAbstractItemModel::rowsInserted, + this, &RecentContactsModel::buildCache, Qt::UniqueConnection); + connect(model, &QAbstractItemModel::rowsRemoved, + this, &RecentContactsModel::buildCache, Qt::UniqueConnection); + connect(model, &QAbstractItemModel::rowsMoved, + this, &RecentContactsModel::buildCache, Qt::UniqueConnection); + connect(model, &QAbstractItemModel::modelReset, + this, &RecentContactsModel::buildCache, Qt::UniqueConnection); setSourceModel(model); @@ -229,7 +229,7 @@ void RecentContactsModel::insertPersonData(const QString& id, int row) m_idToData[id] = data; m_dataToRow[data] = row; - connect(data, SIGNAL(dataChanged()), this, SLOT(personDataChanged())); + connect(data, &KPeople::PersonData::dataChanged, this, &RecentContactsModel::personDataChanged); } void RecentContactsModel::personDataChanged() diff --git a/applets/kicker/plugin/runnermodel.cpp b/applets/kicker/plugin/runnermodel.cpp index 6a9b8188e..0d7b9178b 100644 --- a/applets/kicker/plugin/runnermodel.cpp +++ b/applets/kicker/plugin/runnermodel.cpp @@ -36,7 +36,7 @@ RunnerModel::RunnerModel(QObject *parent) : QAbstractListModel(parent) { m_queryTimer.setSingleShot(true); m_queryTimer.setInterval(10); - connect(&m_queryTimer, SIGNAL(timeout()), this, SLOT(startQuery())); + connect(&m_queryTimer, &QTimer::timeout, this, &RunnerModel::startQuery); } RunnerModel::~RunnerModel() @@ -311,8 +311,8 @@ void RunnerModel::createManager() if (!m_runnerManager) { m_runnerManager = new Plasma::RunnerManager(this); // FIXME: Which KConfigGroup is this using now? m_runnerManager->setAllowedRunners(m_runners); - connect(m_runnerManager, SIGNAL(matchesChanged(QList)), - this, SLOT(matchesChanged(QList))); + connect(m_runnerManager, &Plasma::RunnerManager::matchesChanged, + this, &RunnerModel::matchesChanged); } } diff --git a/components/containmentlayoutmanager/appletslayout.cpp b/components/containmentlayoutmanager/appletslayout.cpp index a2f8ad765..e0cbb9db0 100644 --- a/components/containmentlayoutmanager/appletslayout.cpp +++ b/components/containmentlayoutmanager/appletslayout.cpp @@ -508,7 +508,7 @@ void AppletsLayout::componentComplete() } if (m_containment && m_containment->corona()) { - connect(m_containment->corona(), &Plasma::Corona::startupCompleted, this, [this](){ + connect(m_containment->corona(), &Plasma::Corona::startupCompleted, this, [](){ // m_savedSize = size(); }); // When the screen geometry changes, we need to know the geometry just before it did, so we can apply out heuristic of keeping the distance with borders constant diff --git a/components/sessionsprivate/sessionsmodel.cpp b/components/sessionsprivate/sessionsmodel.cpp index 25d3f3d19..71e6fd21d 100644 --- a/components/sessionsprivate/sessionsmodel.cpp +++ b/components/sessionsprivate/sessionsmodel.cpp @@ -209,7 +209,7 @@ void SessionsModel::checkScreenLocked(const std::function &cb) { auto reply = m_screensaverInterface->GetActive(); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); - QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, cb](QDBusPendingCallWatcher *watcher) { + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, [ cb](QDBusPendingCallWatcher *watcher) { QDBusPendingReply reply = *watcher; if (!reply.isError()) { cb(reply.value()); diff --git a/containmentactions/switchwindow/switch.cpp b/containmentactions/switchwindow/switch.cpp index 3181208b2..fff60145d 100644 --- a/containmentactions/switchwindow/switch.cpp +++ b/containmentactions/switchwindow/switch.cpp @@ -52,7 +52,7 @@ SwitchWindow::SwitchWindow(QObject *parent, const QVariantList &args) s_tasksModel->setActivity(s_activityInfo->currentActivity()); s_tasksModel->setFilterByActivity(true); connect(s_activityInfo, &ActivityInfo::currentActivityChanged, - this, [this]() { s_tasksModel->setActivity(s_activityInfo->currentActivity()); }); + this, []() { s_tasksModel->setActivity(s_activityInfo->currentActivity()); }); } } diff --git a/dataengines/statusnotifieritem/statusnotifieritemjob.cpp b/dataengines/statusnotifieritem/statusnotifieritemjob.cpp index d4047ee9e..809f6b45d 100644 --- a/dataengines/statusnotifieritem/statusnotifieritemjob.cpp +++ b/dataengines/statusnotifieritem/statusnotifieritemjob.cpp @@ -25,7 +25,7 @@ StatusNotifierItemJob::StatusNotifierItemJob(StatusNotifierItemSource *source, c m_source(source) { connect(source, SIGNAL(contextMenuReady(QMenu*)), this, SLOT(contextMenuReady(QMenu*))); - connect(source, SIGNAL(activateResult(bool)), this, SLOT(activateCallback(bool))); + connect(source, &StatusNotifierItemSource::activateResult, this, &StatusNotifierItemJob::activateCallback); } StatusNotifierItemJob::~StatusNotifierItemJob() diff --git a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp index 1370a981d..d4e45d547 100644 --- a/dataengines/statusnotifieritem/statusnotifieritemsource.cpp +++ b/dataengines/statusnotifieritem/statusnotifieritemsource.cpp @@ -132,7 +132,7 @@ StatusNotifierItemSource::StatusNotifierItemSource(const QString ¬ifierItemId connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewAttentionIcon, this, &StatusNotifierItemSource::refreshIcons); connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewOverlayIcon, this, &StatusNotifierItemSource::refreshIcons); connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewToolTip, this, &StatusNotifierItemSource::refreshToolTip); - connect(m_statusNotifierItemInterface, SIGNAL(NewStatus(QString)), this, SLOT(syncStatus(QString))); + connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewStatus, this, &StatusNotifierItemSource::syncStatus); refresh(); } } diff --git a/gmenu-dbusmenu-proxy/menu.cpp b/gmenu-dbusmenu-proxy/menu.cpp index b45661500..8f986df0f 100644 --- a/gmenu-dbusmenu-proxy/menu.cpp +++ b/gmenu-dbusmenu-proxy/menu.cpp @@ -335,7 +335,7 @@ void Menu::actionsChanged(const QStringList &dirtyActions, const QString &prefix for (const QString &action : dirtyActions) { const QString prefixedAction = prefix + action; - forEachMenuItem([this, &prefixedAction, &dirtyItems](int subscription, int section, int index, const QVariantMap &item) { + forEachMenuItem([ &prefixedAction, &dirtyItems](int subscription, int section, int index, const QVariantMap &item) { const QString actionName = Utils::itemActionName(item); if (actionName == prefixedAction) { diff --git a/libdbusmenuqt/dbusmenuimporter.cpp b/libdbusmenuqt/dbusmenuimporter.cpp index 9f7028b40..50a8f4d83 100644 --- a/libdbusmenuqt/dbusmenuimporter.cpp +++ b/libdbusmenuqt/dbusmenuimporter.cpp @@ -431,7 +431,7 @@ void DBusMenuImporter::slotGetLayoutFinished(QDBusPendingCallWatcher *watcher) d->m_actionForId.remove(id); }); - connect(action, &QAction::triggered, this, [action, id, this]() { + connect(action, &QAction::triggered, this, [ id, this]() { sendClickedEvent(id); }); diff --git a/shell/currentcontainmentactionsmodel.cpp b/shell/currentcontainmentactionsmodel.cpp index 92f83898a..48300d36f 100644 --- a/shell/currentcontainmentactionsmodel.cpp +++ b/shell/currentcontainmentactionsmodel.cpp @@ -223,7 +223,7 @@ void CurrentContainmentActionsModel::showConfiguration(int row, QQuickItem *ctx) connect(buttons, &QDialogButtonBox::rejected, configDlg, &QDialog::reject); QObject::connect(configDlg, &QDialog::accepted, pluginInstance, - [configDlg, pluginInstance] () { + [ pluginInstance] () { pluginInstance->configurationAccepted(); });