Listen to changed dirs when browsing recursively
Remove images in removed directories and rescan when new directories are added.
This commit is contained in:
parent
eef54f0f2d
commit
051bbaf322
@ -1783,7 +1783,7 @@ void FileCatalog::reparseDirectory ()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if a thumbnailed file has been deleted
|
// check if a thumbnailed file has been deleted or is not in a directory of interest
|
||||||
const std::vector<ThumbBrowserEntryBase*>& t = fileBrowser->getEntries();
|
const std::vector<ThumbBrowserEntryBase*>& t = fileBrowser->getEntries();
|
||||||
std::vector<Glib::ustring> fileNamesToDel;
|
std::vector<Glib::ustring> fileNamesToDel;
|
||||||
std::vector<Glib::ustring> fileNamesToRemove;
|
std::vector<Glib::ustring> fileNamesToRemove;
|
||||||
@ -1832,8 +1832,10 @@ void FileCatalog::reparseDirectory ()
|
|||||||
void FileCatalog::on_dir_changed (const Glib::RefPtr<Gio::File>& file, const Glib::RefPtr<Gio::File>& other_file, Gio::FileMonitorEvent event_type, bool internal)
|
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 (options.has_retained_extention(file->get_parse_name())
|
if ((options.has_retained_extention(file->get_parse_name())
|
||||||
&& (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED)) {
|
&& (event_type == Gio::FILE_MONITOR_EVENT_CREATED || event_type == Gio::FILE_MONITOR_EVENT_DELETED || event_type == Gio::FILE_MONITOR_EVENT_CHANGED))
|
||||||
|
|| (event_type == Gio::FILE_MONITOR_EVENT_CREATED && Glib::file_test(file->get_path(), Glib::FileTest::FILE_TEST_IS_DIR))
|
||||||
|
|| (event_type == Gio::FILE_MONITOR_EVENT_DELETED && std::find_if(dirMonitors.cbegin(), dirMonitors.cend(), [&file](const FileMonitorInfo &monitor) { return monitor.filePath == file->get_path(); }) != dirMonitors.cend())) {
|
||||||
if (!internal) {
|
if (!internal) {
|
||||||
GThreadLock lock;
|
GThreadLock lock;
|
||||||
reparseDirectory ();
|
reparseDirectory ();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user