PP3 sidecar files were triggering unwanted monitoring event (there was still some remaining even with Oduis' fix from issue #597). They are now filtered out : only files that have one of the retained (and then displayed) extensions are taken into account.

Works for both Windows and Linux (i don't know if MacOS version's is listening the directories).

Note that contrary to the Branch3 version of the patch, the pp3 files are updated too when ranking the thumbs because this information is now part of the pp3 file.
This commit is contained in:
natureh
2011-07-13 16:41:01 +02:00
parent db0130b4cd
commit b9b5e37ef2
16 changed files with 243 additions and 56 deletions

View File

@@ -23,6 +23,7 @@
#include <multilangmgr.h>
#include <safekeyfile.h>
#include <addsetids.h>
#include <guiutils.h>
#include <safegtk.h>
#include "version.h"
@@ -121,6 +122,7 @@ void Options::setDefaults () {
//crvOpen.clear ();
parseExtensions.clear ();
parseExtensionsEnabled.clear ();
parsedExtensions.clear ();
renameUseTemplates = false;
renameTemplates.clear ();
thumbnailZoomRatios.clear ();
@@ -227,6 +229,12 @@ Options* Options::copyFrom (Options* other) {
return this;
}
void Options::filterOutParsedExtensions () {
parsedExtensions.clear();
for (unsigned int i=0; i<parseExtensions.size(); i++)
if (parseExtensionsEnabled[i]) parsedExtensions.push_back(parseExtensions[i].lowercase());
}
int Options::readFromFile (Glib::ustring fname) {
rtengine::SafeKeyFile keyFile;
@@ -400,6 +408,8 @@ if (keyFile.has_group ("Sounds")) {
if (keyFile.has_key ("Sounds", "LngEditProcDoneSecs")) sndLngEditProcDoneSecs = keyFile.get_double ("Sounds", "LngEditProcDoneSecs");
}
filterOutParsedExtensions ();
return 0;
}
@@ -676,6 +686,29 @@ void Options::save () {
}
}
/*
* return true if fname ends with one of the retained image file extensions
*/
bool Options::has_retained_extention (Glib::ustring fname) {
Glib::ustring ext = getExtension(fname).lowercase();
if (ext.length()) {
// there is an extension to the filename
// look out if it has one of the retained extensions
for (unsigned int i=0; i<parsedExtensions.size(); i++) {
if (ext == parsedExtensions[i]) {
return true;
}
}
}
return false;
}
/*
* return true if ext is an enabled extension
*/
bool Options::is_extention_enabled (Glib::ustring ext) {
for (int j=0; j<(int)parseExtensions.size(); j++)
if (parseExtensions[j].casefold() == ext.casefold())