diff options
author | Ken Moore <ken@pcbsd.org> | 2015-04-23 10:34:05 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-04-23 10:34:05 -0400 |
commit | 542945d3bd3b6e7ec91b2c2ef63bbeaa0827cce0 (patch) | |
tree | 47e0eaeb06617cb3b2a5904d645dbcce22de9df4 /lumina-open/main.cpp | |
parent | Merge branch 'master' of github.com:pcbsd/lumina (diff) | |
download | lumina-542945d3bd3b6e7ec91b2c2ef63bbeaa0827cce0.tar.gz lumina-542945d3bd3b6e7ec91b2c2ef63bbeaa0827cce0.tar.bz2 lumina-542945d3bd3b6e7ec91b2c2ef63bbeaa0827cce0.zip |
A couple updates for lumina-open:
1) Apply the "%20" <--> " " conversion on the input file/path depending on the URL/File input specified by the application about to be launched.
2) Ensure that "binaries" passed in with the "-select" flag properly get passed to the app selection dialog.
Diffstat (limited to 'lumina-open/main.cpp')
-rw-r--r-- | lumina-open/main.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lumina-open/main.cpp b/lumina-open/main.cpp index d0d2ced1..70e5b2f7 100644 --- a/lumina-open/main.cpp +++ b/lumina-open/main.cpp @@ -258,7 +258,7 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat } } if(cmd.isEmpty()){ - if(extension=="binary"){ cmd = inFile; } + if(extension=="binary" && !showDLG){ cmd = inFile; } else{ //Find out the proper application to use this file/directory useInputFile=true; @@ -272,14 +272,21 @@ void getCMD(int argc, char ** argv, QString& binary, QString& args, QString& pat // NOTE: lumina-open is only designed for a single input file, // so no need to distinguish between the list codes (uppercase) // and the single-file codes (lowercase) - if(isFile && (cmd.contains("%f") || cmd.contains("%F") ) ){ + //Special "inFile" format replacements for input codes + if( (cmd.contains("%f") || cmd.contains("%F") ) ){ + //Apply any special field replacements for the desired format + inFile.replace("%20"," "); + //Now replace the field codes cmd.replace("%f","\""+inFile+"\""); cmd.replace("%F","\""+inFile+"\""); - }else if(isUrl && (cmd.contains("%U") || cmd.contains("%u")) ){ + }else if( (cmd.contains("%U") || cmd.contains("%u")) ){ + //Apply any special field replacements for the desired format + inFile.replace(" ", "%20"); + //Now replace the field codes cmd.replace("%u","\""+inFile+"\""); cmd.replace("%U","\""+inFile+"\""); }else{ - //No field codes (or improper field codes given - which is quite common) + //No field codes (or improper field codes given in the file - which is quite common) // - Just tack the input file on the end and let the app handle it as necessary cmd.append(" \""+inFile+"\""); } |