diff --git a/src/kfinddlg.cpp b/src/kfinddlg.cpp --- a/src/kfinddlg.cpp +++ b/src/kfinddlg.cpp @@ -108,8 +108,8 @@ connect(win, &KFindTreeView::resultSelected, this, &KfindDlg::resultSelected); query = new KQuery(frame); - connect(query, SIGNAL(result(int)), SLOT(slotResult(int))); - connect(query, SIGNAL(foundFileList(QList >)), SLOT(addFiles(QList >))); + connect(query, &KQuery::result, this, &KfindDlg::slotResult); + connect(query, &KQuery::foundFileList, this, &KfindDlg::addFiles); KHelpMenu *helpMenu = new KHelpMenu(this, KAboutData::applicationData(), true); buttonBox->button(QDialogButtonBox::Help)->setMenu(helpMenu->menu()); @@ -158,8 +158,8 @@ delete dirwatch; dirwatch = new KDirWatch(); - connect(dirwatch, SIGNAL(created(QString)), this, SLOT(slotNewItems(QString))); - connect(dirwatch, SIGNAL(deleted(QString)), this, SLOT(slotDeleteItem(QString))); + connect(dirwatch, &KDirWatch::created, this, &KfindDlg::slotNewItems); + connect(dirwatch, &KDirWatch::deleted, this, &KfindDlg::slotDeleteItem); dirwatch->addDir(query->url().toLocalFile(), KDirWatch::WatchFiles); #if 0 diff --git a/src/kquery.h b/src/kquery.h --- a/src/kquery.h +++ b/src/kquery.h @@ -76,7 +76,6 @@ /* List of files found using KIO */ void slotListEntries(KIO::Job *, const KIO::UDSEntryList &); void slotResult(KJob *); - void slotCanceled(KJob *); void slotreadyReadStandardOutput(); void slotreadyReadStandardError(); diff --git a/src/kquery.cpp b/src/kquery.cpp --- a/src/kquery.cpp +++ b/src/kquery.cpp @@ -56,9 +56,9 @@ , m_result(0) { processLocate = new KProcess(this); - connect(processLocate, SIGNAL(readyReadStandardOutput()), this, SLOT(slotreadyReadStandardOutput())); - connect(processLocate, SIGNAL(readyReadStandardError()), this, SLOT(slotreadyReadStandardError())); - connect(processLocate, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotendProcessLocate(int,QProcess::ExitStatus))); + connect(processLocate, &KProcess::readyReadStandardOutput, this, &KQuery::slotreadyReadStandardOutput); + connect(processLocate, &KProcess::readyReadStandardError, this, &KQuery::slotreadyReadStandardError); + connect(processLocate, QOverload::of(&KProcess::finished), this, &KQuery::slotendProcessLocate); // Files with these mime types can be ignored, even if // findFormatByFileContent() in some cases may claim that @@ -135,8 +135,7 @@ connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)), SLOT(slotListEntries(KIO::Job*,KIO::UDSEntryList))); - connect(job, SIGNAL(result(KJob*)), SLOT(slotResult(KJob*))); - connect(job, SIGNAL(canceled(KJob*)), SLOT(slotCanceled(KJob*))); + connect(job, &KIO::ListJob::result, this, &KQuery::slotResult); } } @@ -148,19 +147,9 @@ job = nullptr; m_result = _job->error(); - checkEntries(); -} - -void KQuery::slotCanceled(KJob *_job) -{ - if (job != _job) { - return; + if (m_result == KIO::ERR_USER_CANCELED) { + m_fileItems.clear(); } - job = nullptr; - - m_fileItems.clear(); - - m_result = KIO::ERR_USER_CANCELED; checkEntries(); }