Commit e745c7c7 authored by David Edmundson's avatar David Edmundson
Browse files

Port old style connects

Done with clazy
parent 1f95ea34
......@@ -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) {
......
......@@ -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());
......
......@@ -388,7 +388,7 @@ QList<QAction *> 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});
});
}
......
......@@ -213,45 +213,45 @@ void ForwardingModel::connectSignals()
}
connect(m_sourceModel, SIGNAL(destroyed()), this, SLOT(reset()));
connect(m_sourceModel, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
this, SIGNAL(dataChanged(QModelIndex,QModelIndex,QVector<int>)),
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<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,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<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
connect(m_sourceModel.data(), &QAbstractItemModel::layoutChanged,
this, &QAbstractItemModel::layoutChanged,
Qt::UniqueConnection);
}
......
......@@ -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()
......
......@@ -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<Plasma::QueryMatch>)),
this, SLOT(matchesChanged(QList<Plasma::QueryMatch>)));
connect(m_runnerManager, &Plasma::RunnerManager::matchesChanged,
this, &RunnerModel::matchesChanged);
}
}
......
......@@ -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
......
......@@ -209,7 +209,7 @@ void SessionsModel::checkScreenLocked(const std::function<void (bool)> &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<bool> reply = *watcher;
if (!reply.isError()) {
cb(reply.value());
......
......@@ -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()); });
}
}
......
......@@ -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()
......
......@@ -132,7 +132,7 @@ StatusNotifierItemSource::StatusNotifierItemSource(const QString &notifierItemId
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();
}
}
......
......@@ -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) {
......
......@@ -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);
});
......
......@@ -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();
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment