From 3b4676b3871cad5cd0e4695b211581f8db8accd0 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Fri, 4 Feb 2022 00:18:00 +0100 Subject: [PATCH] Fix opening FTP files in their preferred app When passing an URL like ftp://foo/bar.txt OpenUrlJob opens it in the default handler for ftp urls, not the one for txt files, which would be more appropriate here By passing along the mimetype we can change that behavior to what we want BUG: 443253 --- src/dolphinviewcontainer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 5520bf794..70e473601 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -649,7 +649,7 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item) return; } - KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl()); + KIO::OpenUrlJob *job = new KIO::OpenUrlJob(item.targetUrl(), item.mimetype()); job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this)); job->setShowOpenOrExecuteDialog(true); job->start();