Commit 73e047c3 authored by Fabian Kosmale's avatar Fabian Kosmale

clazy: autofix: old-style-connect

parent 3f0d28dc
......@@ -624,7 +624,7 @@ QUuid Backend::queryGroups(const QString& sql)
auto watcher = new QFutureWatcher< QList< Group* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(groupQueryFinished()));
connect(watcher, &QFutureWatcherBase::finished, d, &BackendPrivate::groupQueryFinished);
d->queryGroupFuturePool.insert(uuid, watcher);
QFuture< QList< Group* > > future = QtConcurrent::mapped(allDbs, ConcurrentGroupQuery(sql));
......@@ -645,7 +645,7 @@ QUuid Backend::queryPackages(const QString& sql)
auto watcher = new QFutureWatcher< QList< Package* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(packageQueryFinished()));
connect(watcher, &QFutureWatcherBase::finished, d, &BackendPrivate::packageQueryFinished);
d->queryPackageFuturePool.insert(uuid, watcher);
QFuture< QList< Package* > > future = QtConcurrent::mapped(allDbs, ConcurrentPackageQuery(sql));
......@@ -662,7 +662,7 @@ QUuid Backend::orphanPackages()
auto watcher = new QFutureWatcher< QList< Package* > >();
watcher->setProperty("__Akabei_Query_Uuid", uuid.toString());
connect(watcher, SIGNAL(finished()), d, SLOT(orphanQueryFinished()));
connect(watcher, &QFutureWatcherBase::finished, d, &BackendPrivate::orphanQueryFinished);
d->orphanPackageFuturePool.insert(uuid, watcher);
QFuture< QList< Package* > > future = QtConcurrent::run( ConcurrentOrphanQuery() );
......
......@@ -53,8 +53,8 @@ QList< Akabei::Package* > Group::packages() const
Q_D(const Group);
QReadLocker locker(d->mutex);
Helpers::PackageEventLoop e;
e.connect(Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)),
&e, SLOT(requestQuit(QUuid,QList<Akabei::Package*>)));
e.connect(Backend::instance(), &Backend::queryPackagesCompleted,
&e, &Helpers::PackageEventLoop::requestQuit);
e.setUuid( Backend::instance()->queryPackages( Queries::allPackagesInGroup(d->name) ) );
e.exec();
return e.result();
......@@ -65,8 +65,8 @@ QList< Package* > Group::search(const QString& token) const
Q_D(const Group);
QReadLocker locker(d->mutex);
Helpers::PackageEventLoop e;
e.connect(Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)),
&e, SLOT(requestQuit(QUuid,QList<Akabei::Package*>)));
e.connect(Backend::instance(), &Backend::queryPackagesCompleted,
&e, &Helpers::PackageEventLoop::requestQuit);
e.setUuid(Backend::instance()->queryPackages( Queries::packagesInGroup(d->name, token) ));
e.exec();
return e.result();
......
......@@ -275,14 +275,14 @@ void OperationRunnerPrivate::__k__connectToRunnerStatus()
q, SLOT(__k__errorsOccurred(Akabei::Error::List)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), SIGNAL(runFinished(bool)),
q, SLOT(__k__finished(bool)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), SIGNAL(phaseStarted(Akabei::Operation::Phase)),
q, SIGNAL(phaseStarted(Akabei::Operation::Phase)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), SIGNAL(phaseFinished(Akabei::Operation::Phase)),
q, SIGNAL(phaseFinished(Akabei::Operation::Phase)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), SIGNAL(operationStarted(Akabei::Operation *)),
q, SIGNAL(operationStarted(Akabei::Operation *)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), SIGNAL(operationFinished(Akabei::Operation *)),
q, SIGNAL(operationFinished(Akabei::Operation *)), Qt::DirectConnection);
q->connect(runThread.data()->worker(), &RunnerWorker::phaseStarted,
q, &OperationRunner::phaseStarted, Qt::DirectConnection);
q->connect(runThread.data()->worker(), &RunnerWorker::phaseFinished,
q, &OperationRunner::phaseFinished, Qt::DirectConnection);
q->connect(runThread.data()->worker(), &RunnerWorker::operationStarted,
q, &OperationRunner::operationStarted, Qt::DirectConnection);
q->connect(runThread.data()->worker(), &RunnerWorker::operationFinished,
q, &OperationRunner::operationFinished, Qt::DirectConnection);
}
void OperationRunner::cancel()
......
......@@ -154,7 +154,7 @@ Akabei::Error::List RunnerWorker::runConcurrent(const QList< Operation* >& ops)
emit operationStarted(op);
QEventLoop e;
s_runFutureWatcher = new QFutureWatcher<void>;
connect(s_runFutureWatcher.data(), SIGNAL(finished()), &e, SLOT(quit()));
connect(s_runFutureWatcher.data(), &QFutureWatcherBase::finished, &e, &QEventLoop::quit);
QFuture< void > future = QtConcurrent::map(ops, RunnerWorker::runSingle);
s_runFutureWatcher.data()->setFuture(future);
e.exec();
......@@ -247,7 +247,7 @@ void RunnerRunnable::run()
}
emit ready();
QTimer::singleShot(0, m_worker, SLOT(run()));
QTimer::singleShot(0, m_worker, &RunnerWorker::run);
m_thread->start();
}
......
......@@ -166,8 +166,8 @@ void ValidatorWorker::processNextPhase()
// Start the concurrent validation
QEventLoop e;
s_validateFutureWatcher = new QFutureWatcher<void>();
connect(s_validateFutureWatcher.data(), SIGNAL(finished()), &e, SLOT(quit()));
connect(s_validateFutureWatcher.data(), SIGNAL(progressValueChanged(int)), this, SLOT(streamValidationProgress(int)));
connect(s_validateFutureWatcher.data(), &QFutureWatcherBase::finished, &e, &QEventLoop::quit);
connect(s_validateFutureWatcher.data(), &QFutureWatcherBase::progressValueChanged, this, &ValidatorWorker::streamValidationProgress);
QFuture< void > future = QtConcurrent::map(processOps, concurrentValidate);
s_validateFutureWatcher.data()->setFuture(future);
e.exec();
......@@ -259,8 +259,8 @@ void ValidatorWorker::processNextPhase()
// The dependency is hereby missing. Is it resolvable? Let's see.
Helpers::PackageEventLoop loop;
connect(Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)),
&loop, SLOT(requestQuit(QUuid,QList<Akabei::Package*>)));
connect(Backend::instance(), &Backend::queryPackagesCompleted,
&loop, &Helpers::PackageEventLoop::requestQuit);
loop.setUuid(Backend::instance()->queryPackages(queryFromName(dependency.first)));
loop.exec();
Package *package = nullptr;
......@@ -476,7 +476,7 @@ void ValidatorRunnable::run()
}
emit ready();
// m_worker->run();
QTimer::singleShot(0, m_worker, SLOT(run()));
QTimer::singleShot(0, m_worker, &ValidatorWorker::run);
m_thread->start();
}
......
......@@ -17,6 +17,7 @@ int main(int argc, char *argv[])
#include <akabeiconfig.h>
#include <akabeibackend.h>
#include <akabeihelpers.h>
#include <akabeigroup.h>
void DatabaseBenchmark::benchmark_start()
{
......@@ -28,7 +29,7 @@ void DatabaseBenchmark::benchmark_start()
QBENCHMARK_ONCE {
QEventLoop e;
connect(Akabei::Backend::instance(), SIGNAL(statusChanged(Akabei::Backend::Status)), &e, SLOT(quit()));
connect(Akabei::Backend::instance(), &Akabei::Backend::statusChanged, &e, &QEventLoop::quit);
Akabei::Backend::instance()->initialize();
e.exec();
}
......@@ -40,8 +41,8 @@ void DatabaseBenchmark::benchmark_start()
void DatabaseBenchmark::benchmark_QueryGroups()
{
GroupEventLoop e;
connect(Akabei::Backend::instance(), SIGNAL(queryGroupsCompleted(QUuid,QList<Akabei::Group*>)),
&e, SLOT(requestQuit(QUuid,QList<Akabei::Group*>)));
connect(Akabei::Backend::instance(), &Akabei::Backend::queryGroupsCompleted,
&e, &GroupEventLoop::requestQuit);
QBENCHMARK_ONCE {
e.setUuid(Akabei::Backend::instance()->groups());
......@@ -56,8 +57,8 @@ void DatabaseBenchmark::benchmark_QueryGroups()
void DatabaseBenchmark::benchmark_QueryPackages()
{
Akabei::Helpers::PackageEventLoop e;
connect(Akabei::Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)),
&e, SLOT(requestQuit(QUuid,QList<Akabei::Package*>)));
connect(Akabei::Backend::instance(), &Akabei::Backend::queryPackagesCompleted,
&e, &Akabei::Helpers::PackageEventLoop::requestQuit);
QBENCHMARK_ONCE {
e.setUuid(Akabei::Backend::instance()->packages());
......
......@@ -31,7 +31,7 @@ ChrootedProcess::ChrootedProcess(Operation *op, const QString& chroot, QObject*
, m_operation(op)
{
setReadChannelMode(QProcess::MergedChannels);
connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReadyRead()));
connect(this, &QProcess::readyReadStandardOutput, this, &ChrootedProcess::slotReadyRead);
connect(this, SIGNAL(finished(int)), this, SLOT(slotFinished(int)));
}
......@@ -125,8 +125,8 @@ void PlainScriptletOperation::run()
d->process = new ChrootedProcess(this, root);
connect(d->process, SIGNAL(errorsOccured(Akabei::Error::List)), SLOT(slotErrors(Akabei::Error::List)), Qt::DirectConnection);
connect(d->process, SIGNAL(scriptFinished(bool)), SLOT(slotFinished(bool)), Qt::DirectConnection);
connect(d->process, SIGNAL(addMessage(QString)), SLOT(slotMessage(QString)), Qt::DirectConnection);
connect(d->process, &ChrootedProcess::scriptFinished, this, &PlainScriptletOperation::slotFinished, Qt::DirectConnection);
connect(d->process, &ChrootedProcess::addMessage, this, &PlainScriptletOperation::slotMessage, Qt::DirectConnection);
d->process->run(d->temp->fileName(), d->temp);
}
......
......@@ -37,11 +37,11 @@ int main(int argc, char **argv)
CreateDb db(newDbPath, targets);
if (command == QLatin1String("generate")) {
QTimer::singleShot(0, &db, SLOT(start()));
QTimer::singleShot(0, &db, &CreateDb::start);
} else if (command == QLatin1String("add")) {
QTimer::singleShot(0, &db, SLOT(add()));
QTimer::singleShot(0, &db, &CreateDb::add);
} else if (command == QLatin1String("remove")) {
QTimer::singleShot(0, &db, SLOT(remove()));
QTimer::singleShot(0, &db, &CreateDb::remove);
} else {
qWarning() << "No command specified, exiting.";
exit(1);
......
......@@ -74,8 +74,8 @@ void InstallHelper::install(const QString& filename, const QString& root, int pr
Akabei::ProcessingOptions options = (Akabei::ProcessingOptions)processingOptions;
if (!options.testFlag(Akabei::DatabaseOnly)) {
m_archiveHelper->setFilename(filename);
connect(m_archiveHelper, SIGNAL(newMessage(QString,QString)), SIGNAL(newMessage(QString,QString)));
connect(m_archiveHelper, SIGNAL(updateProgress(QString,int)), SIGNAL(updateProgress(QString,int)));
connect(m_archiveHelper, &ArchiveHandlerHelper::newMessage, this, &InstallHelper::newMessage);
connect(m_archiveHelper, &ArchiveHandlerHelper::updateProgress, this, &InstallHelper::updateProgress);
m_archiveHelper->install(root, backups, processingOptions);
}
......@@ -174,8 +174,8 @@ void InstallHelper::upgrade(const QString& filename, const QString& root, int pr
Akabei::ProcessingOptions options = (Akabei::ProcessingOptions)processingOptions;
if (!options.testFlag(Akabei::DatabaseOnly)) {
m_archiveHelper->setFilename(filename);
connect(m_archiveHelper, SIGNAL(newMessage(QString,QString)), SIGNAL(newMessage(QString,QString)));
connect(m_archiveHelper, SIGNAL(updateProgress(QString,int)), SIGNAL(updateProgress(QString,int)));
connect(m_archiveHelper, &ArchiveHandlerHelper::newMessage, this, &InstallHelper::newMessage);
connect(m_archiveHelper, &ArchiveHandlerHelper::updateProgress, this, &InstallHelper::updateProgress);
m_archiveHelper->upgrade(root, backups, processingOptions);
}
......
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