]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix opening FTP files in their preferred app
authorNicolas Fella <nicolas.fella@gmx.de>
Thu, 3 Feb 2022 23:18:00 +0000 (00:18 +0100)
committerNicolas Fella <nicolas.fella@gmx.de>
Thu, 3 Feb 2022 23:18:00 +0000 (00:18 +0100)
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

index 5520bf794ab5f3272eebacce89090788531a409e..70e473601fb9543e976f712f1d4bfb9d53a6e4f9 100644 (file)
@@ -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();