Summary: | Open with... ignores parameters of Exec line in Desktop Entry | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Milan Knížek <knizek> |
Component: | Usability-OpenWith | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles, faure, kdelibs-bugs, metzpinguin |
Priority: | NOR | ||
Version: | 5.0.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/digikam/d63328539b0b949031b42eb3046d54ff80bc26c9 | Version Fixed In: | 5.1.0 |
Description
Milan Knížek
2016-07-11 17:42:57 UTC
open with is delegate to KDE API... Gilles Caulier Git commit d63328539b0b949031b42eb3046d54ff80bc26c9 by Maik Qualmann. Committed on 11/07/2016 at 20:30. Pushed by mqualmann into branch 'master'. fix string parsing from KService.exec() entry FIXED-IN: 5.1.0 M +41 -6 utilities/imageeditor/core/fileoperation.cpp M +2 -1 utilities/imageeditor/core/fileoperation.h http://commits.kde.org/digikam/d63328539b0b949031b42eb3046d54ff80bc26c9 This patch looks awful to me ;) (it duplicates what KRun does much better, it breaks on files with a double-quote in the name, and for non-local files, it breaks on any other special command from the desktop entry spec like %d since it will keep it instead of providing its value, etc.) Why not just use KRun::runService() or (since KF 5.24) KRun::runApplication() ? For the other overload (without a kservice), there's KRun::run(). Because KRun do not work on Windows. We need a multiplatform solution Because we want to reduce KDE dependencies to provide a pure Qt5 application Because we want to reduce the puzlle provided by KDE dependencies. Gilles Caulier The (admitted quite new) KRun::runApplication does exactly what you want : it computes the process arguments and then passes them to QProcess. No runtime dependency on anything else. It should work just fine on Windows. I'm surprised that running desktop files with %f/%u/etc. in them is a required feature on Windows though ? Git commit fc79b21fd529314eda2bc62328cddec380ae9196 by Maik Qualmann. Committed on 14/07/2016 at 19:17. Pushed by mqualmann into branch 'master'. optimization FileOperation::runFiles() M +36 -36 utilities/imageeditor/core/fileoperation.cpp http://commits.kde.org/digikam/fc79b21fd529314eda2bc62328cddec380ae9196 You could at least use KIO::DesktopExecParser which does the parsing and escaping correctly (unlike this QRegExp, when given a complex sh Exec line), and fully supports the desktop entry spec (you added %d, but not %k...). KIO::DesktopExecParser parser(service, QList <QUrl>() << QUrl::fromLocalFile(dest)); process.setArguments(parser.resultingArguments()); |