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