Commit b7b83edd authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port signals to Qt5 connect syntax using clazy fixits

parent 40ea5b17
......@@ -17,7 +17,7 @@ CheckNewStrips::CheckNewStrips( const QStringList &identifiers, Plasma::DataEngi
{
QTimer *timer = new QTimer( this );
timer->setInterval( minutes * 60 * 1000 );
connect( timer, SIGNAL(timeout()), this, SLOT(start()) );
connect( timer, &QTimer::timeout, this, &CheckNewStrips::start );
timer->start();
//start at once, that way the user does not have to wait for minutes to get the initial result
......
......@@ -36,8 +36,8 @@ ComicArchiveDialog::ComicArchiveDialog( const QString &pluginName, const QString
ui.toDate->setMinimumDate( first );
}
connect( ui.fromDate, SIGNAL(dateChanged(QDate)), this, SLOT(fromDateChanged(QDate)) );
connect( ui.toDate, SIGNAL(dateChanged(QDate)), this, SLOT(toDateChanged(QDate)) );
connect( ui.fromDate, &QDateTimeEdit::dateChanged, this, &ComicArchiveDialog::fromDateChanged );
connect( ui.toDate, &QDateTimeEdit::dateChanged, this, &ComicArchiveDialog::toDateChanged );
break;
}
case Number: {
......@@ -57,8 +57,8 @@ ComicArchiveDialog::ComicArchiveDialog( const QString &pluginName, const QString
case String: {
ui.fromString->setText( currentIdentifierSuffix );
ui.toString->setText( currentIdentifierSuffix );
connect( ui.fromString, SIGNAL(textEdited(QString)), this, SLOT(updateOkButton()) );
connect( ui.toString, SIGNAL(textEdited(QString)), this, SLOT(updateOkButton()) );
connect( ui.fromString, &QLineEdit::textEdited, this, &ComicArchiveDialog::updateOkButton );
connect( ui.toString, &QLineEdit::textEdited, this, &ComicArchiveDialog::updateOkButton );
break;
}
}
......@@ -74,7 +74,7 @@ ComicArchiveDialog::ComicArchiveDialog( const QString &pluginName, const QString
}
connect( ui.archiveType, SIGNAL(currentIndexChanged(int)), this, SLOT(archiveTypeChanged(int)) );
connect( ui.dest, SIGNAL(textChanged(QString)), this, SLOT(updateOkButton()) );
connect( ui.dest, &KUrlRequester::textChanged, this, &ComicArchiveDialog::updateOkButton );
connect( this, SIGNAL(okClicked()), this, SLOT(slotOkClicked()) );
}
......
......@@ -286,7 +286,7 @@ void MediaFrame::get(QJSValue successCallback, QJSValue errorCallback)
qDebug() << path << "doesn't exist locally, trying remote.";
KIO::StoredTransferJob * job = KIO::storedGet( url, KIO::NoReload, KIO::HideProgressInfo);
connect(job, SIGNAL(finished(KJob*)), this, SLOT(slotFinished(KJob*)));
connect(job, &KJob::finished, this, &MediaFrame::slotFinished);
} else {
if(successCallback.isCallable()) {
......
......@@ -22,8 +22,8 @@ ContentTracker::ContentTracker(QObject *parent)
connectToActivityManager();
QDBusServiceWatcher *watcher = new QDBusServiceWatcher(QStringLiteral("org.kde.ActivityManager"), QDBusConnection::sessionBus(),
QDBusServiceWatcher::WatchForOwnerChange, this);
connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
this, SLOT(serviceChange(QString,QString,QString)));
connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged,
this, &ContentTracker::serviceChange);
}
ContentTracker::~ContentTracker()
......
......@@ -28,7 +28,7 @@ static QString identifierToPath(const QString &identifier)
CachedProvider::CachedProvider(QObject *parent, const QVariantList &args)
: ComicProvider(parent, args)
{
QTimer::singleShot(0, this, SLOT(triggerFinished()));
QTimer::singleShot(0, this, &CachedProvider::triggerFinished);
}
CachedProvider::~CachedProvider()
......
......@@ -92,8 +92,8 @@ bool ComicEngine::updateSourceEvent(const QString &identifier)
ComicProvider *provider = new CachedProvider(this, args);
m_jobs[identifier] = provider;
connect(provider, SIGNAL(finished(ComicProvider*)), this, SLOT(finished(ComicProvider*)));
connect(provider, SIGNAL(error(ComicProvider*)), this, SLOT(error(ComicProvider*)));
connect(provider, &ComicProvider::finished, this, &ComicEngine::finished);
connect(provider, &ComicProvider::error, this, &ComicEngine::error);
return true;
}
......@@ -156,8 +156,8 @@ bool ComicEngine::updateSourceEvent(const QString &identifier)
m_jobs[identifier] = provider;
connect(provider, SIGNAL(finished(ComicProvider*)), this, SLOT(finished(ComicProvider*)));
connect(provider, SIGNAL(error(ComicProvider*)), this, SLOT(error(ComicProvider*)));
connect(provider, &ComicProvider::finished, this, &ComicEngine::finished);
connect(provider, &ComicProvider::error, this, &ComicEngine::error);
return true;
}
}
......
......@@ -269,7 +269,7 @@ ComicProviderWrapper::ComicProviderWrapper(ComicProviderKross *parent)
mIsLeftToRight(true),
mIsTopToBottom(true)
{
QTimer::singleShot(0, this, SLOT(init()));
QTimer::singleShot(0, this, &ComicProviderWrapper::init);
}
ComicProviderWrapper::~ComicProviderWrapper()
......
......@@ -55,7 +55,7 @@ CachedProvider::CachedProvider( const QString &identifier, QObject *parent )
: PotdProvider( parent ), mIdentifier( identifier )
{
LoadImageThread *thread = new LoadImageThread( identifierToPath( mIdentifier ) );
connect(thread, SIGNAL(done(QImage)), this, SLOT(triggerFinished(QImage)));
connect(thread, &LoadImageThread::done, this, &CachedProvider::triggerFinished);
QThreadPool::globalInstance()->start(thread);
}
......
......@@ -33,7 +33,7 @@ PotdEngine::PotdEngine( QObject* parent, const QVariantList& args )
// set polling to every 5 minutes
setMinimumPollingInterval(5 * 60 * 1000);
m_checkDatesTimer = new QTimer( this );//change picture after 24 hours
connect( m_checkDatesTimer, SIGNAL(timeout()), this, SLOT(checkDayChanged()) );
connect( m_checkDatesTimer, &QTimer::timeout, this, &PotdEngine::checkDayChanged );
//FIXME: would be nice to stop and start this timer ONLY as needed, e.g. only when there are
// time insensitive sources to serve; still, this is better than how i found it, checking
// every 2 seconds (!)
......@@ -71,8 +71,8 @@ bool PotdEngine::updateSource( const QString &identifier, bool loadCachedAlways
args << QLatin1String( "String" ) << identifier;
CachedProvider *provider = new CachedProvider( identifier, this );
connect( provider, SIGNAL(finished(PotdProvider*)), this, SLOT(finished(PotdProvider*)) );
connect( provider, SIGNAL(error(PotdProvider*)), this, SLOT(error(PotdProvider*)) );
connect( provider, &PotdProvider::finished, this, &PotdEngine::finished );
connect( provider, &PotdProvider::error, this, &PotdEngine::error );
m_canDiscardCache = loadCachedAlways;
if (!loadCachedAlways) {
......@@ -103,8 +103,8 @@ bool PotdEngine::updateSource( const QString &identifier, bool loadCachedAlways
provider = factory->create<PotdProvider>(this, args);
}
if (provider) {
connect( provider, SIGNAL(finished(PotdProvider*)), this, SLOT(finished(PotdProvider*)) );
connect( provider, SIGNAL(error(PotdProvider*)), this, SLOT(error(PotdProvider*)) );
connect( provider, &PotdProvider::finished, this, &PotdEngine::finished );
connect( provider, &PotdProvider::error, this, &PotdEngine::error );
return true;
}
......@@ -135,7 +135,7 @@ void PotdEngine::finished( PotdProvider *provider )
// store in cache if it's not the response of a CachedProvider
if ( qobject_cast<CachedProvider*>( provider ) == nullptr && !img.isNull() ) {
SaveImageThread *thread = new SaveImageThread( provider->identifier(), img );
connect(thread, SIGNAL(done(QString,QString,QImage)), this, SLOT(cachingFinished(QString,QString,QImage)));
connect(thread, &SaveImageThread::done, this, &PotdEngine::cachingFinished);
QThreadPool::globalInstance()->start(thread);
} else {
setData(provider->identifier(), DataKeys::image(), img);
......
......@@ -18,7 +18,7 @@ DictionaryMatchEngine::DictionaryMatchEngine(Plasma::DataEngine *dictionaryEngin
* how the connection is made based on data availability. There are two cases,
* and this extra connection handles the second case. */
Q_ASSERT(m_dictionaryEngine);
connect(m_dictionaryEngine, SIGNAL(sourceAdded(QString)), this, SLOT(sourceAdded(QString)));
connect(m_dictionaryEngine, &Plasma::DataEngine::sourceAdded, this, &DictionaryMatchEngine::sourceAdded);
}
/* This function should be called from a different thread. */
......
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