Port trivial connects to the new style

This commit is contained in:
Aleix Pol 2019-08-30 17:26:54 +02:00
parent f53365633c
commit d3b22f8828
19 changed files with 55 additions and 55 deletions

View File

@ -32,13 +32,13 @@ SortFilterModel::SortFilterModel(QObject *parent)
{
setObjectName(QStringLiteral("SortFilterModel"));
setDynamicSortFilter(true);
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(modelReset()),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(countChanged()), this, SLOT(syncRoleNames()));
connect(this, &QAbstractItemModel::rowsInserted,
this, &SortFilterModel::countChanged);
connect(this, &QAbstractItemModel::rowsRemoved,
this, &SortFilterModel::countChanged);
connect(this, &QAbstractItemModel::modelReset,
this, &SortFilterModel::countChanged);
connect(this, &SortFilterModel::countChanged, this, &SortFilterModel::syncRoleNames);
}
SortFilterModel::~SortFilterModel()
@ -82,13 +82,13 @@ void SortFilterModel::setModel(QAbstractItemModel *model)
}
if (sourceModel()) {
disconnect(sourceModel(), SIGNAL(modelReset()), this, SLOT(syncRoleNames()));
disconnect(sourceModel(), &QAbstractItemModel::modelReset, this, &SortFilterModel::syncRoleNames);
}
QSortFilterProxyModel::setSourceModel(model);
if (model) {
connect(model, SIGNAL(modelReset()), this, SLOT(syncRoleNames()));
connect(model, &QAbstractItemModel::modelReset, this, &SortFilterModel::syncRoleNames);
syncRoleNames();
}
@ -245,12 +245,12 @@ DataModel::DataModel(QObject *parent)
++m_maxRoleId;
setObjectName(QStringLiteral("DataModel"));
connect(this, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SIGNAL(countChanged()));
connect(this, SIGNAL(modelReset()),
this, SIGNAL(countChanged()));
connect(this, &QAbstractItemModel::rowsInserted,
this, &DataModel::countChanged);
connect(this, &QAbstractItemModel::rowsRemoved,
this, &DataModel::countChanged);
connect(this, &QAbstractItemModel::modelReset,
this, &DataModel::countChanged);
}
DataModel::~DataModel()

View File

@ -116,12 +116,12 @@ void DataSource::setEngine(const QString &e)
* recommendations engine.
*/
m_dataEngine = engine;
connect(m_dataEngine, SIGNAL(sourceAdded(QString)), this, SLOT(updateSources()), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SLOT(updateSources()));
connect(m_dataEngine, &DataEngine::sourceAdded, this, &DataSource::updateSources, Qt::QueuedConnection);
connect(m_dataEngine, &DataEngine::sourceRemoved, this, &DataSource::updateSources);
connect(m_dataEngine, SIGNAL(sourceAdded(QString)), this, SIGNAL(sourceAdded(QString)), Qt::QueuedConnection);
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SLOT(removeSource(QString)));
connect(m_dataEngine, SIGNAL(sourceRemoved(QString)), this, SIGNAL(sourceRemoved(QString)));
connect(m_dataEngine, &DataEngine::sourceAdded, this, &DataSource::sourceAdded, Qt::QueuedConnection);
connect(m_dataEngine, &DataEngine::sourceRemoved, this, &DataSource::removeSource);
connect(m_dataEngine, &DataEngine::sourceRemoved, this, &DataSource::sourceRemoved);
updateSources();

View File

@ -77,7 +77,7 @@ Units::Units(QObject *parent)
updateSpacing(); // updates gridUnit and *Spacing properties
connect(KIconLoader::global(), &KIconLoader::iconLoaderSettingsChanged, this, &Units::iconLoaderSettingsChanged);
QObject::connect(s_sharedAppFilter, SIGNAL(fontChanged()), this, SLOT(updateSpacing()));
QObject::connect(s_sharedAppFilter, &SharedAppFilter::fontChanged, this, &Units::updateSpacing);
const QString configFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + QLatin1Char('/') + plasmarc();
KDirWatch::self()->addFile(configFile);

View File

@ -63,8 +63,8 @@ QQmlEngine *EngineBookKeeping::engine() const
void EngineBookKeeping::insertEngine(QQmlEngine *engine)
{
connect(engine, SIGNAL(destroyed(QObject*)),
this, SLOT(engineDestroyed(QObject*)));
connect(engine, &QObject::destroyed,
this, &EngineBookKeeping::engineDestroyed);
m_engines.insert(engine);
}

View File

@ -58,7 +58,7 @@ void QMenuItem::setAction(QAction *a)
connect(m_action, &QAction::changed, this, &QMenuItem::textChanged);
connect(m_action, &QAction::changed, this, &QMenuItem::checkableChanged);
connect(m_action, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool)));
connect(m_action, &QAction::toggled, this, &QMenuItem::toggled);
connect(m_action, &QAction::triggered, this, &QMenuItem::clicked);
connect(this, &QQuickItem::visibleChanged, this, &QMenuItem::updateAction);

View File

@ -30,8 +30,8 @@ Application::Private::Private(Application *parent)
, q(parent)
{
connect(
&process, SIGNAL(stateChanged(QProcess::ProcessState)),
this, SLOT(stateChanged(QProcess::ProcessState))
&process, &QProcess::stateChanged,
this, &Private::stateChanged
);
connect(
&process, SIGNAL(error(QProcess::ProcessError)),

View File

@ -557,7 +557,7 @@ void Applet::flushPendingConstraintsEvents()
QAction *runAssociatedApplication = d->actions->action(QStringLiteral("run associated application"));
if (runAssociatedApplication) {
connect(runAssociatedApplication, SIGNAL(triggered(bool)), this, SLOT(runAssociatedApplication()), Qt::UniqueConnection);
connect(runAssociatedApplication, &QAction::triggered, this, &Applet::runAssociatedApplication, Qt::UniqueConnection);
}
d->updateShortcuts();
@ -670,7 +670,7 @@ void Applet::setGlobalShortcut(const QKeySequence &shortcut)
d->activationAction = new QAction(this);
d->activationAction->setText(i18n("Activate %1 Widget", title()));
d->activationAction->setObjectName(QStringLiteral("activate widget %1").arg(id())); // NO I18N
connect(d->activationAction, SIGNAL(triggered()), this, SIGNAL(activated()));
connect(d->activationAction, &QAction::triggered, this, &Applet::activated);
connect(d->activationAction, SIGNAL(changed()),
this, SLOT(globalShortcutChanged()));
} else if (d->activationAction->shortcut() == shortcut) {

View File

@ -412,7 +412,7 @@ void Containment::addApplet(Applet *applet)
oldConfig.reparent(&c);
applet->d->resetConfigurationObject();
disconnect(applet, SIGNAL(activated()), currentContainment, SIGNAL(activated()));
disconnect(applet, &Applet::activated, currentContainment, &Applet::activated);
//change the group to its configloader, if any
//FIXME: this is very, very brutal
if (applet->configScheme()) {
@ -439,10 +439,10 @@ void Containment::addApplet(Applet *applet)
d->loadingApplets << applet;
}
connect(applet, SIGNAL(configNeedsSaving()), this, SIGNAL(configNeedsSaving()));
connect(applet, &Applet::configNeedsSaving, this, &Applet::configNeedsSaving);
connect(applet, SIGNAL(appletDeleted(Plasma::Applet*)), this, SLOT(appletDeleted(Plasma::Applet*)));
connect(applet, SIGNAL(statusChanged(Plasma::Types::ItemStatus)), this, SLOT(checkStatus(Plasma::Types::ItemStatus)));
connect(applet, SIGNAL(activated()), this, SIGNAL(activated()));
connect(applet, &Applet::activated, this, &Applet::activated);
if (!currentContainment) {
const bool isNew = applet->d->mainConfigGroup()->entryMap().isEmpty();

View File

@ -561,10 +561,10 @@ Containment *CoronaPrivate::addContainment(const QString &name, const QVariantLi
QObject::connect(containment, SIGNAL(destroyed(QObject*)),
q, SLOT(containmentDestroyed(QObject*)));
QObject::connect(containment, SIGNAL(configNeedsSaving()),
q, SLOT(requestConfigSync()));
QObject::connect(containment, SIGNAL(screenChanged(int)),
q, SIGNAL(screenOwnerChanged(int)));
QObject::connect(containment, &Applet::configNeedsSaving,
q, &Corona::requestConfigSync);
QObject::connect(containment, &Containment::screenChanged,
q, &Corona::screenOwnerChanged);
if (!delayedInit) {
containment->init();

View File

@ -158,8 +158,8 @@ void DataContainer::connectVisualization(QObject *visualization, uint pollingInt
}
}
} else {
connect(visualization, SIGNAL(destroyed(QObject*)),
this, SLOT(disconnectVisualization(QObject*))); //, Qt::QueuedConnection);
connect(visualization, &QObject::destroyed,
this, &DataContainer::disconnectVisualization); //, Qt::QueuedConnection);
}
if (pollingInterval < 1) {
@ -312,8 +312,8 @@ void DataContainerPrivate::populateFromStoredData(KJob *job)
void DataContainer::disconnectVisualization(QObject *visualization)
{
QMap<QObject *, SignalRelay *>::iterator objIt = d->relayObjects.find(visualization);
disconnect(visualization, SIGNAL(destroyed(QObject*)),
this, SLOT(disconnectVisualization(QObject*))); //, Qt::QueuedConnection);
disconnect(visualization, &QObject::destroyed,
this, &DataContainer::disconnectVisualization); //, Qt::QueuedConnection);
if (objIt == d->relayObjects.end() || !objIt.value()) {
// it is connected directly to the DataContainer itself

View File

@ -597,7 +597,7 @@ DataContainer *DataEnginePrivate::requestSource(const QString &sourceName, bool
if (newSource) {
*newSource = true;
}
QObject::connect(s, SIGNAL(becameUnused(QString)), q, SLOT(removeSource(QString)));
QObject::connect(s, &DataContainer::becameUnused, q, &DataEngine::removeSource);
emit q->sourceAdded(sourceName);
}
}

View File

@ -46,7 +46,7 @@ StorageJob::StorageJob(const QString &destination,
m_clientName(destination)
{
Plasma::StorageThread::self()->start();
connect(Plasma::StorageThread::self(), SIGNAL(newResult(StorageJob*,QVariant)), this, SLOT(resultSlot(StorageJob*,QVariant)));
connect(Plasma::StorageThread::self(), &Plasma::StorageThread::newResult, this, &StorageJob::resultSlot);
qRegisterMetaType<StorageJob *>();
qRegisterMetaType<QPointer<StorageJob> >();
}

View File

@ -84,18 +84,18 @@ ThemePrivate::ThemePrivate(QObject *parent)
pixmapSaveTimer = new QTimer(this);
pixmapSaveTimer->setSingleShot(true);
pixmapSaveTimer->setInterval(600);
QObject::connect(pixmapSaveTimer, SIGNAL(timeout()), this, SLOT(scheduledCacheUpdate()));
QObject::connect(pixmapSaveTimer, &QTimer::timeout, this, &ThemePrivate::scheduledCacheUpdate);
rectSaveTimer = new QTimer(this);
rectSaveTimer->setSingleShot(true);
//2 minutes
rectSaveTimer->setInterval(2 * 60 * 1000);
QObject::connect(rectSaveTimer, SIGNAL(timeout()), this, SLOT(saveSvgElementsCache()));
QObject::connect(rectSaveTimer, &QTimer::timeout, this, &ThemePrivate::saveSvgElementsCache);
updateNotificationTimer = new QTimer(this);
updateNotificationTimer->setSingleShot(true);
updateNotificationTimer->setInterval(100);
QObject::connect(updateNotificationTimer, SIGNAL(timeout()), this, SLOT(notifyOfChanged()));
QObject::connect(updateNotificationTimer, &QTimer::timeout, this, &ThemePrivate::notifyOfChanged);
if (QPixmap::defaultDepth() > 8) {
#if HAVE_X11
@ -200,11 +200,11 @@ bool ThemePrivate::useCache()
// watch the metadata file for changes at runtime
KDirWatch::self()->addFile(themeMetadataPath);
QObject::connect(KDirWatch::self(), SIGNAL(created(QString)),
this, SLOT(settingsFileChanged(QString)),
QObject::connect(KDirWatch::self(), &KDirWatch::created,
this, &ThemePrivate::settingsFileChanged,
Qt::UniqueConnection);
QObject::connect(KDirWatch::self(), SIGNAL(dirty(QString)),
this, SLOT(settingsFileChanged(QString)),
QObject::connect(KDirWatch::self(), &KDirWatch::dirty,
this, &ThemePrivate::settingsFileChanged,
Qt::UniqueConnection);
if (!iconThemeMetadataPath.isEmpty()) {

View File

@ -88,7 +88,7 @@ TimeTracker::TimeTracker(QObject* o)
QTimer* t = new QTimer(this);
t->setInterval(2000);
t->setSingleShot(false);
connect(t, SIGNAL(timeout()), this, SLOT(sync()));
connect(t, &QTimer::timeout, this, &TimeTracker::sync);
t->start();
QMetaObject::invokeMethod(this, "init", Qt::QueuedConnection);

View File

@ -56,7 +56,7 @@ struct ObjectHistory
* as the process has quit.
*/
class PLASMA_EXPORT TimeTracker : QObject
class PLASMA_EXPORT TimeTracker : public QObject
{
Q_OBJECT
public:

View File

@ -741,8 +741,8 @@ Dialog::Dialog(QQuickItem *parent)
}
});
connect(this, SIGNAL(visibleChanged(bool)),
this, SIGNAL(visibleChangedProxy()));
connect(this, &QWindow::visibleChanged,
this, &Dialog::visibleChangedProxy);
connect(this, SIGNAL(visibleChanged(bool)),
this, SLOT(updateInputShape()));
connect(this, SIGNAL(outputOnlyChanged()),

View File

@ -472,7 +472,7 @@ void ContainmentInterface::processMimeData(QMimeData *mimeData, int x, int y, KI
KIO::MimetypeJob *job = KIO::mimetype(url, flags);
m_dropPoints[job] = QPoint(x, y);
QObject::connect(job, SIGNAL(result(KJob*)), this, SLOT(dropJobResult(KJob*)));
QObject::connect(job, &KJob::result, this, &ContainmentInterface::dropJobResult);
QObject::connect(job, SIGNAL(mimetype(KIO::Job*,QString)),
this, SLOT(mimeTypeRetrieved(KIO::Job*,QString)));

View File

@ -43,7 +43,7 @@ DPITest::DPITest(int &argc, char **argv, QCommandLineParser *parser) :
{
d = new DPITestPrivate;
d->parser = parser;
QTimer::singleShot(0, this, SLOT(runMain()));
QTimer::singleShot(0, this, &DPITest::runMain);
}
DPITest::~DPITest()

View File

@ -62,7 +62,7 @@ PluginTest::PluginTest(int &argc, char **argv, QCommandLineParser *parser) :
{
d = new PluginTestPrivate;
d->parser = parser;
QTimer::singleShot(0, this, SLOT(runMain()));
QTimer::singleShot(0, this, &PluginTest::runMain);
}
PluginTest::~PluginTest()