diff src/preferences.c @ 2770:2e819f4a7a41

Read metadata in the idle loop Selecting sort-by DateOriginal, DateDigitized or Rating caused Geeqie to freeze while the metadata was read for the whole folder contents. This commit reads those data in the idle loop and thus prevents the freeze. There is an option in Preferences/Metadata to autmatically read the metadata in the idle loop whenever a new folder is selected.
author Colin Clark <colin.clark@cclark.uk>
date Mon, 18 Jun 2018 18:53:46 +0100
parents ed8cc78cb9dd
children 813be27b1cd5
line wrap: on
line diff
--- a/src/preferences.c	Thu Jun 07 14:13:43 2018 +0100
+++ b/src/preferences.c	Mon Jun 18 18:53:46 2018 +0100
@@ -412,6 +412,7 @@
 	options->with_rename = c_options->with_rename;
 	config_entry_to_option(help_search_engine_entry, &options->help_search_engine, NULL);
 
+	options->read_metadata_in_idle = c_options->read_metadata_in_idle;
 #ifdef DEBUG
 	set_debug_level(debug_c);
 #endif
@@ -2220,6 +2221,12 @@
 
 	pref_checkbox_new_int(group, _("Write metadata on directory change"),
 			      options->metadata.confirm_on_dir_change, &c_options->metadata.confirm_on_dir_change);
+
+	group = pref_group_new(vbox, FALSE, _("Pre-load metadata"), GTK_ORIENTATION_VERTICAL);
+
+	ct_button = pref_checkbox_new_int(group, _("Read metadata in background"),
+					  options->read_metadata_in_idle, &c_options->read_metadata_in_idle);
+	gtk_widget_set_tooltip_text(ct_button,"On folder change, read DateTimeOriginal, DateTimeDigitized and Star Rating in the idle loop.\nIf this is not selected, initial loading of the folder will be faster but sorting on these items will be slower");
 }
 
 /* metadata tab */