From 67f52893177748a5158bab013b9dd1b61c5744e0 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Thu, 29 Dec 2016 12:57:34 -0500 Subject: Add a new function to the XDGDesktop class: QString generateExec(QStringList inputfiles, QString ActionID); This will automatically evaluate the input file's syntax and adjust as needed for the application to recognize/run the file. Similarly it will perform all the substitutions and such as necessary to end up with a fully-formatted executable command which can easily be launched with QProcess as necessary. --- src-qt5/core/libLumina/LuminaXDG.cpp | 40 ++++++++++++++++++++++++++++++++++++ src-qt5/core/libLumina/LuminaXDG.h | 4 +++- 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'src-qt5') diff --git a/src-qt5/core/libLumina/LuminaXDG.cpp b/src-qt5/core/libLumina/LuminaXDG.cpp index c46b943a..cb16830d 100644 --- a/src-qt5/core/libLumina/LuminaXDG.cpp +++ b/src-qt5/core/libLumina/LuminaXDG.cpp @@ -230,6 +230,46 @@ QString XDGDesktop::getDesktopExec(QString ActionID){ return out; } +QString XDGDesktop::generateExec(QStringList inputfiles, QString ActionID){ + QString exec = getDesktopExec(ActionID); + //Does the app need the input files in URL or File syntax? + bool URLsyntax = (exec.contains("%u") || exec.contains("%U")); + //Adjust the input file formats as needed + for(int i=0; i