Commit 71ebe037 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Utilize KIO::OpenUrlJob for opening urls

This way we consistently use the KIO jobs for launching urls.
parent dde0f20b
Pipeline #139119 passed with stage
in 11 minutes and 12 seconds
......@@ -29,6 +29,7 @@ add_library(krunner_bookmarks_common STATIC ${krunner_bookmarks_common_SRCS})
target_link_libraries(krunner_bookmarks_common
Qt::Sql
KF5::KIOCore
KF5::KIOGui
KF5::I18n
KF5::Runner
KF5::Bookmarks
......
......@@ -9,13 +9,13 @@
#include "browsers/browser.h"
#include <QDebug>
#include <QDesktopServices>
#include <QDir>
#include <QList>
#include <QStack>
#include <QUrl>
#include <KApplicationTrader>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <KSharedConfig>
......@@ -108,7 +108,8 @@ void BookmarksRunner::run(const Plasma::RunnerContext &context, const Plasma::Qu
url.setScheme(QStringLiteral("http"));
}
QDesktopServices::openUrl(url);
auto job = new KIO::OpenUrlJob(url);
job->start();
}
#include "bookmarksrunner.moc"
......@@ -8,6 +8,7 @@
#include <KApplicationTrader>
#include <KIO/CommandLauncherJob>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KShell>
......@@ -15,7 +16,6 @@
#include <KUriFilter>
#include <QAction>
#include <QDBusConnection>
#include <QDesktopServices>
WebshortcutRunner::WebshortcutRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args)
: Plasma::AbstractRunner(parent, metaData, args)
......@@ -177,7 +177,8 @@ void WebshortcutRunner::run(const Plasma::RunnerContext &context, const Plasma::
auto *job = new KIO::CommandLauncherJob(command);
job->start();
} else {
QDesktopServices::openUrl(location);
auto job = new KIO::OpenUrlJob(location);
job->start();
}
}
}
......
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