Commit 27af7275 authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port KRun to OpenUrlJob

Bump min. required KF5 version to 5.71, as that's where OpenUrl job first
appeared; also bump min. required Qt version to 5.12 (as that's what KF
require currently).

Drive-by change: use range-for.
parent f623c72c
......@@ -9,11 +9,11 @@ set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_
project(keditbookmarks VERSION ${RELEASE_SERVICE_VERSION})
# ECM setup
set(KF5_MIN_VERSION "5.28.0")
set(KF5_MIN_VERSION "5.71.0")
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(QT_MIN_VERSION "5.6.0")
set(QT_MIN_VERSION "5.12.0")
include(KDEInstallDirs)
include(KDECMakeSettings)
......
......@@ -41,12 +41,13 @@
#include "keditbookmarks_debug.h"
#include <KActionCollection>
#include <KIO/JobUiDelegate>
#include <KIO/OpenUrlJob>
#include <QIcon>
#include <KIconDialog>
#include <KIconLoader>
#include <KLocalizedString>
#include <KStandardAction>
#include <KRun>
#include <QInputDialog>
......@@ -531,13 +532,15 @@ void ActionsImpl::slotDelete() {
void ActionsImpl::slotOpenLink()
{
KEBApp::self()->bkInfo()->commitChanges();
QList<KBookmark> bookmarks = KEBApp::self()->selectedBookmarksExpanded();
QList<KBookmark>::const_iterator it, end;
end = bookmarks.constEnd();
for (it = bookmarks.constBegin(); it != end; ++it) {
if ((*it).isGroup() || (*it).isSeparator())
const QList<KBookmark> bookmarks = KEBApp::self()->selectedBookmarksExpanded();
for (auto &bm : bookmarks) {
if (bm.isGroup() || bm.isSeparator()) {
continue;
(void)new KRun((*it).url(), KEBApp::self());
}
auto *job = new KIO::OpenUrlJob(bm.url());
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, KEBApp::self()));
job->start();
}
}
......
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