Remove hard-wired ".pp2" strings to make transition to ".pp3" easier
This commit is contained in:
parent
c5a72d2d84
commit
c427279ce3
@ -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 ();
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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<int> *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("<b>") + fname + ": Error during image saving\n</b>";
|
||||
|
@ -468,9 +468,9 @@ void FileCatalog::deleteRequested (std::vector<FileBrowserEntry*> 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());
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
Options options;
|
||||
Glib::ustring versionString = "v3.0 alpha 1";
|
||||
Glib::ustring paramFileExtension = ".pp2";
|
||||
|
||||
Options::Options () {
|
||||
|
||||
|
@ -140,5 +140,6 @@ extern Options options;
|
||||
extern Glib::ustring argv0;
|
||||
extern Glib::ustring argv1;
|
||||
extern Glib::ustring versionString;
|
||||
extern Glib::ustring paramFileExtension;
|
||||
|
||||
#endif
|
||||
|
@ -293,8 +293,8 @@ Gtk::Widget* Preferences::getProcParamsPanel () {
|
||||
|
||||
std::vector<Glib::ustring> 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; i<pnames.size(); i++) {
|
||||
rprofiles->append_text (pnames[i]);
|
||||
iprofiles->append_text (pnames[i]);
|
||||
|
@ -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("<b>") + fname + ": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE") + "</b>";
|
||||
@ -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;
|
||||
|
@ -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()) {
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user