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:
@@ -464,7 +464,7 @@ std::vector<Glib::ustring> FileCatalog::getFileList () {
|
||||
|
||||
std::vector<Glib::ustring> names;
|
||||
Glib::RefPtr<Gio::File> dir = Gio::File::create_for_path (selectedDirectory);
|
||||
safe_build_file_list (dir, names, selectedDirectory);
|
||||
safe_build_file_list (dir, names, selectedDirectory, &(options.parsedExtensions));
|
||||
return names;
|
||||
}
|
||||
|
||||
@@ -666,9 +666,10 @@ void FileCatalog::_openImage (std::vector<Thumbnail*> tmb) {
|
||||
bool continueToLoad=true;
|
||||
for (size_t i=0; i< tmb.size() && continueToLoad; i++) {
|
||||
if (editedFiles.find (tmb[i]->getFileName())==editedFiles.end()){
|
||||
listener->fileSelected (tmb[i]);
|
||||
if( !options.tabbedUI )
|
||||
continueToLoad = false;
|
||||
// Open the image here, and stop if in Single Editor mode, or if an image couldn't
|
||||
// be opened, would it be because the file doesn't exist or because of lack of RAM
|
||||
if( !(listener->fileSelected (tmb[i])) && !options.tabbedUI )
|
||||
continueToLoad = false;
|
||||
}
|
||||
tmb[i]->decreaseRef ();
|
||||
}
|
||||
@@ -1276,20 +1277,25 @@ int winDirChangedUITread (void* cat) {
|
||||
void FileCatalog::winDirChanged () {
|
||||
g_idle_add(winDirChangedUITread, this);
|
||||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
void FileCatalog::on_dir_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, bool internal) {
|
||||
|
||||
if (!internal)
|
||||
gdk_threads_enter();
|
||||
if (options.has_retained_extention(file->get_parse_name())) {
|
||||
if (!internal)
|
||||
gdk_threads_enter();
|
||||
|
||||
if (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED)
|
||||
reparseDirectory ();
|
||||
if (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED)
|
||||
reparseDirectory ();
|
||||
|
||||
if (!internal)
|
||||
gdk_threads_leave();
|
||||
if (!internal)
|
||||
gdk_threads_leave();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void FileCatalog::checkAndAddFile (Glib::RefPtr<Gio::File> file) {
|
||||
|
||||
if (!file )
|
||||
|
Reference in New Issue
Block a user