diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index f10dfdcb5..61713d845 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -204,7 +204,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady (rtengine::IImage16* img) { err = img->saveAsJPEG (fname, saveFormat.jpegQuality); img->free (); if (!err && saveFormat.saveParams) - processing->params.save (removeExtension(fname) + ".pp2"); + processing->params.save (removeExtension(fname) + paramFileExtension); if (processing->thumbnail) { processing->thumbnail->imageDeveloped (); processing->thumbnail->imageRemovedFromQueue (); diff --git a/rtgui/cachemanager.cc b/rtgui/cachemanager.cc index 81746034b..17ac566ba 100644 --- a/rtgui/cachemanager.cc +++ b/rtgui/cachemanager.cc @@ -103,7 +103,7 @@ void CacheManager::deleteEntry (const Glib::ustring& fname) { r = openEntries.find (fname); if (r==openEntries.end() && md5!="") { ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); - ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); + ::g_remove ((getCacheFileName ("profiles", fname, md5) + paramFileExtension).c_str()); ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); @@ -114,7 +114,7 @@ void CacheManager::deleteEntry (const Glib::ustring& fname) { std::string md5 = getMD5 (fname); if (md5!="") { ::g_remove ((getCacheFileName ("data", fname, md5) + ".txt").c_str()); - ::g_remove ((getCacheFileName ("profiles", fname, md5) + ".pp2").c_str()); + ::g_remove ((getCacheFileName ("profiles", fname, md5) + paramFileExtension).c_str()); ::g_remove ((getCacheFileName ("images", fname, md5) + ".cust").c_str()); ::g_remove ((getCacheFileName ("images", fname, md5) + ".jpg").c_str()); ::g_remove ((getCacheFileName ("aehistograms", fname, md5)).c_str()); @@ -128,7 +128,7 @@ void CacheManager::renameEntry (const std::string& oldfilename, const std::strin std::string newmd5 = getMD5 (newfilename); - ::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + ".pp2").c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + ".pp2").c_str()); + ::g_rename ((getCacheFileName ("profiles", oldfilename, oldmd5) + paramFileExtension).c_str(), (getCacheFileName ("profiles", newfilename, newmd5) + paramFileExtension).c_str()); ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".cust").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".cust").c_str()); ::g_rename ((getCacheFileName ("images", oldfilename, oldmd5) + ".jpg").c_str(), (getCacheFileName ("images", newfilename, newmd5) + ".jpg").c_str()); ::g_rename ((getCacheFileName ("aehistograms", oldfilename, oldmd5)).c_str(), (getCacheFileName ("aehistograms", newfilename, newmd5)).c_str()); @@ -245,7 +245,7 @@ void CacheManager::applyCacheSizeLimitation () { ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "images"), flist.front().fname) + ".jpg").c_str()); ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "aehistograms"), flist.front().fname)).c_str()); ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "embprofiles"), flist.front().fname) + ".icc").c_str()); -// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + ".pp2").c_str()); +// ::g_remove ((Glib::build_filename (Glib::build_filename (baseDir, "profiles"), flist.front().fname) + paramFileExtension).c_str()); flist.erase (flist.begin()); } } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index a3915b297..431801589 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -275,7 +275,7 @@ void EditorPanel::open (Thumbnail* tmb, rtengine::InitialImage* isrc) { navigator->previewWindow->setPreviewHandler (previewHandler); navigator->previewWindow->setImageArea (iarea->imageArea); - // try to load the last saved parameters from the cache or from the pp2 file + // try to load the last saved parameters from the cache or from the paramfile file ProcParams* ldprof = NULL; if (openThm->hasProcParams()) { ldprof = new ProcParams (); @@ -315,7 +315,7 @@ void EditorPanel::saveProfile () { ipc->getParams (¶ms); if (options.saveParamsFile) - params.save (openThm->getFileName() + ".pp2"); + params.save (openThm->getFileName() + paramFileExtension); if (openThm && options.saveParamsCache) openThm->setProcParams (params, EDITOR); } @@ -570,7 +570,7 @@ bool EditorPanel::idle_imageSaved(ProgressConnector *pc,rtengine::IImage16* if (sf.saveParams) { rtengine::procparams::ProcParams pparams; ipc->getParams (&pparams); - pparams.save (removeExtension (fname) + ".out.pp2"); + pparams.save (removeExtension (fname) + ".out" + paramFileExtension); } }else{ Glib::ustring msg_ = Glib::ustring("") + fname + ": Error during image saving\n"; diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index efc8f3c46..c29f0c436 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -468,9 +468,9 @@ void FileCatalog::deleteRequested (std::vector tbe) { cacheMgr.deleteEntry (fname); // delete from file system ::g_remove (fname.c_str()); - // delete .pp2 if found - ::g_remove (Glib::ustring(fname+".pp2").c_str()); - ::g_remove (Glib::ustring(removeExtension(fname)+".pp2").c_str()); + // delete paramfile if found + ::g_remove (Glib::ustring(fname+paramFileExtension).c_str()); + ::g_remove (Glib::ustring(removeExtension(fname)+paramFileExtension).c_str()); // delete .thm file ::g_remove (Glib::ustring(removeExtension(fname)+".thm").c_str()); ::g_remove (Glib::ustring(removeExtension(fname)+".THM").c_str()); diff --git a/rtgui/options.cc b/rtgui/options.cc index 5f25b88b6..f0a396f92 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -26,7 +26,8 @@ #include Options options; -Glib::ustring versionString = "v3.0 alpha 1"; +Glib::ustring versionString = "v3.0 alpha 1"; +Glib::ustring paramFileExtension = ".pp2"; Options::Options () { diff --git a/rtgui/options.h b/rtgui/options.h index 1d96eb1ba..e7d05e78c 100644 --- a/rtgui/options.h +++ b/rtgui/options.h @@ -140,5 +140,6 @@ extern Options options; extern Glib::ustring argv0; extern Glib::ustring argv1; extern Glib::ustring versionString; +extern Glib::ustring paramFileExtension; #endif diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 77f20e594..3db415ec8 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -293,8 +293,8 @@ Gtk::Widget* Preferences::getProcParamsPanel () { std::vector pnames; if (options.multiUser) - parseDir (Options::rtdir + "/" + options.profilePath, pnames, ".pp2"); - parseDir (argv0 + "/" + options.profilePath, pnames, ".pp2"); + parseDir (Options::rtdir + "/" + options.profilePath, pnames, paramFileExtension); + parseDir (argv0 + "/" + options.profilePath, pnames, paramFileExtension); for (int i=0; iappend_text (pnames[i]); iprofiles->append_text (pnames[i]); diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 6c7e10d58..e684f98de 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -126,7 +126,7 @@ void ProfilePanel::save_clicked () { Gtk::FileFilter filter_pp; filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); - filter_pp.add_pattern("*.pp2"); + filter_pp.add_pattern("*"+paramFileExtension); dialog.add_filter(filter_pp); Gtk::FileFilter filter_any; @@ -156,7 +156,7 @@ void ProfilePanel::save_clicked () { hasext = false; if (!hasext) - fname = fname + ".pp2"; + fname = fname + paramFileExtension; if (Glib::file_test (fname, Glib::FILE_TEST_EXISTS)) { Glib::ustring msg_ = Glib::ustring("") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + ""; @@ -215,7 +215,7 @@ void ProfilePanel::load_clicked () { Gtk::FileFilter filter_pp; filter_pp.set_name(M("PROFILEPANEL_FILEDLGFILTERPP")); - filter_pp.add_pattern("*.pp2"); + filter_pp.add_pattern("*"+paramFileExtension); dialog.add_filter(filter_pp); Gtk::FileFilter filter_any; diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index 95e632ffb..3dfdeed85 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -63,7 +63,7 @@ void ProfileStore::parseDir (const Glib::ustring& pdir) { // ignore directories if (!Glib::file_test (fname, Glib::FILE_TEST_IS_DIR)) { int lastdot = sname.find_last_of ('.'); - if (lastdot!=Glib::ustring::npos && lastdot<=sname.size()-4 && !sname.casefold().compare (lastdot, 4, ".pp2")) { + if (lastdot!=Glib::ustring::npos && lastdot<=sname.size()-4 && !sname.casefold().compare (lastdot, 4, paramFileExtension)) { printf ("Processing file %s...\n", fname.c_str()); Glib::ustring name = sname.substr(0,lastdot); if (pparams.find(name)!=pparams.end()) { diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 0e796f4c5..93a8d76f5 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -145,18 +145,18 @@ void Thumbnail::loadProcParams () { pparamsValid = false; if (options.paramsLoadLocation==PLL_Input) { - // try to load it from pp2 file next to the image file - int ppres = pparams.load (fname + ".pp2"); + // try to load it from params file next to the image file + int ppres = pparams.load (fname + paramFileExtension); pparamsValid = !ppres && pparams.version>=220; if (!pparamsValid) - pparamsValid = !pparams.load (getCacheFileName ("profiles")+".pp2"); + pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); } else { // try to load it from cache - pparamsValid = !pparams.load (getCacheFileName ("profiles")+".pp2"); - // if no success, load it from pp2 file next to the image file + pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension); + // if no success, load it from params file next to the image file if (!pparamsValid) { - int ppres = pparams.load (fname + ".pp2"); + int ppres = pparams.load (fname + paramFileExtension); pparamsValid = !ppres && pparams.version>=220; } } @@ -167,16 +167,16 @@ void Thumbnail::clearProcParams (int whoClearedIt) { cfs.recentlySaved = false; pparamsValid = false; needsReProcessing = true; - // remove pp2 file from cache - Glib::ustring fname_ = getCacheFileName ("profiles")+".pp2"; + // remove param file from cache + Glib::ustring fname_ = getCacheFileName ("profiles")+paramFileExtension; if (Glib::file_test (fname_, Glib::FILE_TEST_EXISTS)) ::g_remove (fname_.c_str()); - // remove pp2 file located next to the file -// fname_ = removeExtension(fname) + ".pp2"; - fname_ = fname + ".pp2"; + // remove param file located next to the file +// fname_ = removeExtension(fname) + paramFileExtension; + fname_ = fname + paramFileExtension; if (Glib::file_test (fname_, Glib::FILE_TEST_EXISTS)) ::g_remove (fname_.c_str()); - fname_ = removeExtension(fname) + ".pp2"; + fname_ = removeExtension(fname) + paramFileExtension; if (Glib::file_test (fname_, Glib::FILE_TEST_EXISTS)) ::g_remove (fname_.c_str()); @@ -213,7 +213,7 @@ void Thumbnail::imageDeveloped () { cfs.recentlySaved = true; cfs.save (getCacheFileName ("data")+".txt"); - pparams.save (getCacheFileName ("profiles")+".pp2"); + pparams.save (getCacheFileName ("profiles")+paramFileExtension); } void Thumbnail::imageEnqueued () { @@ -410,10 +410,10 @@ void Thumbnail::updateCache () { if (pparamsValid) { if (options.saveParamsCache) - pparams.save (getCacheFileName ("profiles")+".pp2"); + pparams.save (getCacheFileName ("profiles")+paramFileExtension); if (options.saveParamsFile) -// pparams.save (removeExtension(fname) + ".pp2"); - pparams.save (fname + ".pp2"); +// pparams.save (removeExtension(fname) + paramFileExtension); + pparams.save (fname + paramFileExtension); } cfs.save (getCacheFileName ("data")+".txt"); }