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
This commit is contained in:
Nicolas Fella 2022-02-04 00:18:00 +01:00
parent 43e915213e
commit 3b4676b387

View 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();