PP3 file version is now manually specified in a header file (ppversion.h) for easier version tracking through Mercurial. It has been set to 300 instead of {latestagdistance} which was a bad idea. This could chnage if the Mercurial team manage to create a reliable absolute version numbering of the remote repos before the 3.0 release.

This commit is contained in:
Hombre
2011-02-19 22:42:44 +01:00
parent f6d23d95e2
commit 5c25bc14bf
10 changed files with 70 additions and 29 deletions

View File

@@ -100,7 +100,7 @@ int CacheImageData::save (const Glib::ustring& fname) {
if (safe_file_test(fname,Glib::FILE_TEST_EXISTS)) keyFile.load_from_file (fname);
keyFile.set_string ("General", "MD5", md5);
keyFile.set_integer ("General", "Version", options.version);
keyFile.set_string ("General", "Version", options.version);
keyFile.set_boolean ("General", "Supported", supported);
keyFile.set_integer ("General", "Format", format);
keyFile.set_integer ("General", "Rank", rank);

View File

@@ -76,7 +76,7 @@ void Options::setDefaults () {
fbShowHidden = false;
fbArrangement = 0;
multiUser = false;
version = TAGDISTANCE;
version = VERSION;
thumbSize = 80;
thumbSizeTab = 80;
showHistory = true;
@@ -186,7 +186,7 @@ if (keyFile.has_group ("General")) {
if (keyFile.has_key ("General", "StoreLastProfile")) savesParamsAtExit = keyFile.get_boolean ("General", "StoreLastProfile");
if (keyFile.has_key ("General", "DualProcSupport")) rtSettings.dualThreadEnabled = keyFile.get_boolean ("General", "DualProcSupport");
if (keyFile.has_key ("General", "MultiUser")) multiUser = keyFile.get_boolean ("General", "MultiUser");
// if (keyFile.has_key ("General", "Version")) version = keyFile.get_integer ("General", "Version");
if (keyFile.has_key ("General", "Version")) version = keyFile.get_string ("General", "Version");
if (keyFile.has_key ("General", "Language")) language = keyFile.get_string ("General", "Language");
if (keyFile.has_key ("General", "Theme")) theme = keyFile.get_string ("General", "Theme");
if (keyFile.has_key ("General", "UseSystemTheme")) useSystemTheme = keyFile.get_boolean ("General", "UseSystemTheme");
@@ -337,7 +337,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_string ("General", "Language", language);
keyFile.set_string ("General", "Theme", theme);
keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme);
keyFile.set_integer ("General", "Version", TAGDISTANCE);
keyFile.set_string ("General", "Version", VERSION);
keyFile.set_boolean ("General", "FirstRun", firstRun);
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
keyFile.set_string ("General", "FlatFieldsPath", rtSettings.flatFieldsPath);

View File

@@ -84,7 +84,7 @@ class Options {
int fbArrangement;
bool multiUser;
static Glib::ustring rtdir;
int version;
Glib::ustring version;
int thumbSize,thumbSizeTab;
bool showHistory;
int showFilePanelState; // 0: normal, 1: maximized, 2: normal, 3: hidden

7
rtgui/ppversion.h Normal file
View File

@@ -0,0 +1,7 @@
#ifndef _PPVERSION_
#define _PPVERSION_
// This number have to be incremented whenever the PP3 file format is modified
#define PPVERSION 300
#endif

View File

@@ -74,7 +74,7 @@ void ProfileStore::parseDir (const Glib::ustring& pdir) {
}
ProcParams* pp = new ProcParams ();
int res = pp->load (fname);
if (!res && pp->version>=220)
if (!res && pp->ppVersion>=220)
pparams[name] = pp;
else
delete pp;

View File

@@ -159,7 +159,7 @@ void Thumbnail::loadProcParams () {
if (options.paramsLoadLocation==PLL_Input) {
// try to load it from params file next to the image file
int ppres = pparams.load (fname + paramFileExtension);
pparamsValid = !ppres && pparams.version>=220;
pparamsValid = !ppres && pparams.ppVersion>=220;
if (!pparamsValid)
pparamsValid = !pparams.load (getCacheFileName ("profiles")+paramFileExtension);
}
@@ -169,7 +169,7 @@ void Thumbnail::loadProcParams () {
// if no success, load it from params file next to the image file
if (!pparamsValid) {
int ppres = pparams.load (fname + paramFileExtension);
pparamsValid = !ppres && pparams.version>=220;
pparamsValid = !ppres && pparams.ppVersion>=220;
}
}
}
@@ -571,4 +571,4 @@ bool Thumbnail::openDefaultViewer(int destination) {
return false;
#endif
}
}