From 19901320428fb5c33089318fb2b1ca9e03226442 Mon Sep 17 00:00:00 2001 From: Hombre Date: Wed, 23 Oct 2013 15:30:53 +0200 Subject: [PATCH] Bug fix for the CPB command line field in Preferences, which is no more automatically and internally surrounded by double quote to let the user set command line arguments. --- rtdata/languages/Francais | 5 +++-- rtdata/languages/default | 2 +- rtgui/options.cc | 20 ++++++++++---------- rtgui/thumbnail.cc | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/rtdata/languages/Francais b/rtdata/languages/Francais index 747e80bf0..63a3f2b38 100644 --- a/rtdata/languages/Francais +++ b/rtdata/languages/Francais @@ -710,8 +710,9 @@ PREFERENCES_CIEART_LABEL;Utilise la précision float au lieu de double pour CIEC PREFERENCES_CIEART_TOOLTIP;Si activé, les calculs CIECAM sont réalisés en précision float au lieu de précision double. Cela amène un léger accroissement de vitesse, et une légère réduction de qualité PREFERENCES_CLIPPINGIND;Indication du dépassement de plage dynamique PREFERENCES_CMETRICINTENT;Intention Colorimétrique -PREFERENCES_CUSTPROFBUILDHINT;Fichier éxecutable (ou script) appelé lorsqu'un nouveau profil initial doit être généré pour une image.\nParamètres de ligne de commande pour permettre la génération d'un .pp3 basé sur des règles:\n[Chemin vers le fichier RAW/JPG] [Chemin vers le profil par défault] [ouverture f] [tps d'exposition en seconde] [longueur focale en mm] [ISO] [Objectif] [Appareil photo] -PREFERENCES_CUSTPROFBUILDPATH;Chemin de l'exécutable +PREFERENCES_CUSTPROFBUILDHINT;Fichier éxecutable (ou script) appelé lorsqu'un nouveau profil initial doit être généré pour une image.\nParamètres de ligne de commande pour permettre la génération d'un .pp3 basé sur des règles:\n[Chemin vers le fichier RAW/JPG] [Chemin vers le profil par défault] [Chemin de le répertoire Cache de RT] [ouverture f] [tps d'exposition en seconde] [longueur focale en mm] [ISO] [Objectif] [Fabricant de l'appareil photo] [Modèle de l'appareil photo]\n\nATTENTION: Il vous appartient d'utiliser ou non des guillemts double pour spécifier des chemins si ceux-ci contiennent des espaces +REFERENCES_CUSTPROFBUILDPATH;Chemin de l'exécutable +PREFERENCES_CUSTPROFBUILDPATH_TOOLTIP; PREFERENCES_CUSTPROFBUILD;Constructeur de profil d'image personnalisé PREFERENCES_CUTOVERLAYBRUSH;Masque de recadrage PREFERENCES_D50;5000K diff --git a/rtdata/languages/default b/rtdata/languages/default index d6f4fee0a..bc446c6f9 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -709,7 +709,7 @@ PREFERENCES_CIEART_LABEL;Use float precision instead of double PREFERENCES_CIEART_TOOLTIP;If enabled, CIECAM02 calculations are performed in the single-precision floating-point format instead of the double-precision one. This provides a small increase in speed at the expense of a negligible loss of quality PREFERENCES_CLIPPINGIND;Clipping Indication PREFERENCES_CMETRICINTENT;Colorimetric intent -PREFERENCES_CUSTPROFBUILDHINT;Executable (or script) file called when a new initial processing profile should be generated for an image.\nReceives command line parameters to allow a rules-based processing profile generation:\n[raw/JPG path] [default processing profile path] [f-number] [exposure in secs] [focal length in mm] [ISO] [lens] [camera] +PREFERENCES_CUSTPROFBUILDHINT;Executable (or script) file called when a new initial processing profile should be generated for an image.\nReceives command line parameters to allow a rules-based processing profile generation:\n[raw/JPG path] [default processing profile path] [RT's cache folder path] [f-number] [exposure in secs] [focal length in mm] [ISO] [lens] [camera make] [camera model]\n\nWARNING: You are responsible of using double quotes where necessary if you're using paths containing spaces. PREFERENCES_CUSTPROFBUILDPATH;Executable path PREFERENCES_CUSTPROFBUILD;Custom Processing Profile Builder PREFERENCES_CUTOVERLAYBRUSH;Crop mask color/transparency diff --git a/rtgui/options.cc b/rtgui/options.cc index ca9f352ec..df53b7ed7 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -1083,34 +1083,34 @@ void Options::load () { if (SHGetSpecialFolderPathW(NULL,pathW,CSIDL_LOCAL_APPDATA,false)) { WideCharToMultiByte(CP_UTF8,0,pathW,-1,pathA,MAX_PATH,0,0); - rtdir = Glib::ustring(pathA) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); + rtdir = Glib::build_filename(Glib::ustring(pathA), Glib::ustring(CACHEFOLDERNAME)); } } #else - rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME); + rtdir = Glib::build_filename(Glib::ustring(g_get_user_config_dir ()), Glib::ustring(CACHEFOLDERNAME)); #endif // Set the cache folder in RT's base folder - cacheBaseDir = argv0 + "/cache"; + cacheBaseDir = Glib::build_filename(argv0, "cache"); // Read the global option file (the one located in the application's base folder) - options.readFromFile (argv0+"/options"); + options.readFromFile (Glib::build_filename(argv0, "options")); // Check if RT is installed in Multi-User mode if (options.multiUser) { // Read the user option file (the one located somewhere in the user's home folder) // Those values supersets those of the global option file - int r = options.readFromFile (rtdir + "/options"); + int r = options.readFromFile (Glib::build_filename(rtdir, "options")); // If the local option file does not exist or is broken, and the local cache folder does not exist, recreate it if (r && !safe_g_mkdir_with_parents (rtdir, 511)) { // Save the option file - options.saveToFile (rtdir + "/options"); + options.saveToFile (Glib::build_filename(rtdir, "options")); } // Modify the path of the cache folder to the user's personal folder #ifdef WIN32 - cacheBaseDir = rtdir + "/cache"; + cacheBaseDir = Glib::build_filename(rtdir, "cache"); #else - cacheBaseDir = Glib::ustring(g_get_user_cache_dir()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME); + cacheBaseDir = Glib::build_filename(Glib::ustring(g_get_user_cache_dir()), Glib::ustring(CACHEFOLDERNAME)); #endif } @@ -1185,10 +1185,10 @@ void Options::load () { void Options::save () { if (options.multiUser==false) { - options.saveToFile (argv0+"/options"); + options.saveToFile (Glib::build_filename(argv0, "options")); } else { - options.saveToFile (rtdir + "/options"); + options.saveToFile (Glib::build_filename(rtdir, "options")); } } diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 5d6e0bd6e..0544aea2f 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -205,7 +205,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu Glib::ustring defaultPparamsPath = options.findProfilePath(defProf); if (!options.customProfileBuilder.empty() && !defaultPparamsPath.empty() && (!hasProcParams() || forceCPB) && cfs && cfs->exifValid) { // For the filename etc. do NOT use streams, since they are not UTF8 safe - Glib::ustring cmdLine=Glib::ustring("\"") + options.customProfileBuilder + Glib::ustring("\" \"") + fname + Glib::ustring("\" \"") + Glib::ustring cmdLine = options.customProfileBuilder + Glib::ustring(" \"") + fname + Glib::ustring("\" \"") + (defaultPparamsPath == DEFPROFILE_INTERNAL ? "Neutral" : Glib::build_filename(defaultPparamsPath, Glib::path_get_basename(defProf) + paramFileExtension)) + Glib::ustring("\" "); // ustring doesn't know int etc formatting, so take these via (unsafe) stream