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

Port away from deprecated KUrlRequester::returnPressed signal overload

Because QPushButton::click takes a single argument, we have to pass in a lambda
which discards the string parameter from KUrlRequester::returnPressed.
parent 084362d1
......@@ -6,8 +6,9 @@
#include "scanforlostfileswidget.h"
#include "scanforlostfilesplugin.h"
#include <KIO/DeleteJob>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <KMessageBox>
#include <KRun>
#include <QClipboard>
#include <QMenu>
......@@ -50,7 +51,9 @@ ScanForLostFilesWidget::ScanForLostFilesWidget(ScanForLostFilesPlugin *plugin, Q
connect(actionOpen_file, &QAction::triggered, [=]() {
QModelIndex index = treeView->currentIndex();
new KRun(QUrl::fromLocalFile(m_model->filePath(m_proxy->mapToSource(index))), nullptr, true);
auto job = new KIO::OpenUrlJob(QUrl::fromLocalFile(m_model->filePath(m_proxy->mapToSource(index))));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, nullptr));
job->start();
});
treeView->setSortingEnabled(true);
......@@ -66,7 +69,9 @@ ScanForLostFilesWidget::ScanForLostFilesWidget(ScanForLostFilesPlugin *plugin, Q
reqFolder->setMode(KFile::Directory | KFile::ExistingOnly);
connect(reqFolder, &KUrlRequester::urlSelected, btnScanFolder, &QPushButton::click);
connect(reqFolder, QOverload<>::of(&KUrlRequester::returnPressed), btnScanFolder, &QPushButton::click);
connect(reqFolder, &KUrlRequester::returnPressed, btnScanFolder, [this]() {
btnScanFolder->click();
});
if (CoreInterface *c = m_plugin->getCore()) {
if (GroupManager *gm = c->getGroupManager()) {
if (Group *all = gm->allGroup()) {
......
Supports Markdown
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