From: Ahmad Samir Date: Mon, 14 Dec 2020 22:40:12 +0000 (+0200) Subject: Use setShowOpenOrExecuteDialog(true) with OpenUrlJob X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c03b43b4a1132ca7bc6db4a1583bc8bd1578b44f Use setShowOpenOrExecuteDialog(true) with OpenUrlJob It makes more sense for a file manager to always ask the user: - whether to execute binaries - whether to open an executable script as text or execute it The openOrExecute dialog from KIOWidgets has a "don't ask again" checkbox, and that setting is also accessible from Dolphin's settings dialog. See the discussion at https://bugs.kde.org/show_bug.cgi?id=429839#c10 --- diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index b72f2eb90..5a5319383 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -1083,7 +1083,7 @@ void DolphinMainWindow::handleUrl(const QUrl& url) } else { m_lastHandleUrlOpenJob = new KIO::OpenUrlJob(url); m_lastHandleUrlOpenJob->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); - m_lastHandleUrlOpenJob->setRunExecutables(true); + m_lastHandleUrlOpenJob->setShowOpenOrExecuteDialog(true); connect(m_lastHandleUrlOpenJob, &KIO::OpenUrlJob::mimeTypeFound, this, [this, url](const QString &mimetype) { diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 8dd309314..7053c4a6b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -638,7 +638,6 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item) } KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl()); - job->setRunExecutables(true); job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); job->setShowOpenOrExecuteDialog(true); job->start();