Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gthumb for openSUSE:Factory checked in at 2026-11-17 17:21:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gthumb (Old) and /work/SRC/openSUSE:Factory/.gthumb.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gthumb" Tue Nov 17 17:21:07 2026 rev:136 rq:1398124 version:4.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/gthumb/gthumb.changes 2026-11-11 16:30:28.977843090 +0100 +++ /work/SRC/openSUSE:Factory/.gthumb.new.1251/gthumb.changes 2026-11-17 17:23:48.116242144 +0100 @@ -1,0 +2,10 @@ +Sun Nov 15 09:39:48 UTC 2026 - Bjørn Lie <[email protected]> + +- Update to version 4.0.3: + * Features: Browser and Viewer: show the selections the file belongs to + * Bugfixes: + + Compare by basename when the values are equal + + When changing image keep the previous zoom if a custom zoom was used + + Allow to rename files when the location is writable + +------------------------------------------------------------------- Old: ---- gthumb-4.0.2.tar.xz New: ---- gthumb-4.0.3.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gthumb.spec ++++++ --- /var/tmp/diff_new_pack.nSJDOr/_old 2026-11-17 17:23:49.097283908 +0100 +++ /var/tmp/diff_new_pack.nSJDOr/_new 2026-11-17 17:23:49.099283993 +0100 @@ -17,7 +17,7 @@ Name: gthumb -Version: 4.0.2 +Version: 4.0.3 Release: 0 Summary: An Image Viewer and Browser for GNOME License: GPL-2.0-or-later ++++++ _scmsync.obsinfo ++++++ --- /var/tmp/diff_new_pack.nSJDOr/_old 2026-11-17 17:23:49.132285398 +0100 +++ /var/tmp/diff_new_pack.nSJDOr/_new 2026-11-17 17:23:49.135285526 +0100 @@ -1,7 +1,7 @@ -mtime: 1794144782 -commit: 42a56061a2a63844b18503c69a52fa8cdc17849cdddaf8886b312a4ccd4ae8f7 +mtime: 1794735653 +commit: 83f31b5cfa958b20ef87176f42d270c7533095a77afcd5547ad7d5191debf17b url: https://src.opensuse.org/GNOME/gthumb -revision: 42a56061a2a63844b18503c69a52fa8cdc17849cdddaf8886b312a4ccd4ae8f7 +revision: 83f31b5cfa958b20ef87176f42d270c7533095a77afcd5547ad7d5191debf17b trackingbranch: factory projectscmsync: https://src.opensuse.org/GNOME/_ObsPrj ++++++ _service ++++++ --- /var/tmp/diff_new_pack.nSJDOr/_old 2026-11-17 17:23:49.152286250 +0100 +++ /var/tmp/diff_new_pack.nSJDOr/_new 2026-11-17 17:23:49.155286377 +0100 @@ -3,7 +3,7 @@ <service name="obs_scm" mode="manual"> <param name="scm">git</param> <param name="url">https://gitlab.gnome.org/GNOME/gthumb.git</param> - <param name="revision">4.0.2</param> + <param name="revision">4.0.3</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">v?(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ build.specials.obscpio ++++++ ++++++ build.specials.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.gitignore new/.gitignore --- old/.gitignore 1970-01-01 01:00:00.000000000 +0100 +++ new/.gitignore 2026-11-15 10:40:53.000000000 +0100 @@ -0,0 +1,5 @@ +*.obscpio +*.osc +_build.* +.pbuild +osc-collab.* ++++++ gthumb-4.0.2.tar.xz -> gthumb-4.0.3.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/NEWS new/gthumb-4.0.3/NEWS --- old/gthumb-4.0.2/NEWS 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/NEWS 2026-11-15 09:35:40.000000000 +0100 @@ -1,3 +1,15 @@ +Version 4.0.3 +~~~~~~~~~~~~~ +Released: 2026-11-15 + +Features: + * Browser and Viewer: show the selections the file belongs to + +Bugfixes: + * Compare by basename when the values are equal + * When changing image keep the previous zoom if a custom zoom was used + * Allow to rename files when the location is writable + Version 4.0.2 ~~~~~~~~~~~~~ Released: 2026-11-08 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/data/appdata/org.gnome.gthumb.metainfo.xml.in new/gthumb-4.0.3/data/appdata/org.gnome.gthumb.metainfo.xml.in --- old/gthumb-4.0.2/data/appdata/org.gnome.gthumb.metainfo.xml.in 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/data/appdata/org.gnome.gthumb.metainfo.xml.in 2026-11-15 09:35:40.000000000 +0100 @@ -69,6 +69,20 @@ </screenshot> </screenshots> <releases> + <release version="4.0.3" date="2026-11-15" type="stable"> + <description> + <p>This release adds the following features:</p> + <ul> + <li>Browser and Viewer: show the selections the file belongs to</li> + </ul> + <p>This release fixes the following bugs:</p> + <ul> + <li>Compare by basename when the values are equal</li> + <li>When changing image keep the previous zoom if a custom zoom was used</li> + <li>Allow to rename files when the location is writable</li> + </ul> + </description> + </release> <release version="4.0.2" date="2026-11-08" type="stable"> <description> <p>This release fixes the following bugs:</p> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/data/ui/viewer.ui new/gthumb-4.0.3/data/ui/viewer.ui --- old/gthumb-4.0.2/data/ui/viewer.ui 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/data/ui/viewer.ui 2026-11-15 09:35:40.000000000 +0100 @@ -21,6 +21,15 @@ </style> </object> </child> + <child> + <object class="GtkBox" id="header_emblems"> + <property name="orientation">horizontal</property> + <property name="spacing">6</property> + <style> + <class name="accent"/> + </style> + </object> + </child> </object> </property> <child type="start"> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/meson.build new/gthumb-4.0.3/meson.build --- old/gthumb-4.0.2/meson.build 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/meson.build 2026-11-15 09:35:40.000000000 +0100 @@ -1,6 +1,6 @@ project('gthumb', [ 'vala', 'c', 'cpp' ], - version: '4.0.2', + version: '4.0.3', license: 'GPL2+', meson_version: '>=1.1.0' ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/po/POTFILES.in new/gthumb-4.0.3/po/POTFILES.in --- old/gthumb-4.0.2/po/POTFILES.in 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/po/POTFILES.in 2026-11-15 09:35:40.000000000 +0100 @@ -266,8 +266,10 @@ src/Ext/Search/UpdateSearch.vala src/Ext/Selections/FileSourceSelections.vala src/Ext/Selections/Selection.vala +src/Ext/Selections/SelectionMetadataProvider.vala src/Ext/Selections/Selections.vala src/Ext/Selections/SelectionsStatus.vala +src/Ext/Selections/UintList.vala src/Ext/Shortcuts/Shortcut.vala src/Ext/Shortcuts/ShortcutDialog.vala src/Ext/Shortcuts/ShortcutRow.vala diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Application.vala new/gthumb-4.0.3/src/Application.vala --- old/gthumb-4.0.2/src/Application.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Application.vala 2026-11-15 09:35:40.000000000 +0100 @@ -136,6 +136,7 @@ MetadataInfo.register ("Private::File::DisplayChanged", N_("File Changed"), "File", METADATA_ALLOW_EVERYWHERE); MetadataInfo.register ("Private::File::Location", N_("Folder"), "File", MetadataFlags.ALLOW_IN_PRINT | MetadataFlags.ALLOW_IN_FILE_LIST | MetadataFlags.ALLOW_IN_PROPERTIES_VIEW); MetadataInfo.register (PrivateAttribute.LOADED_IMAGE_IS_MODIFIED, null, "File", MetadataFlags.HIDDEN); + MetadataInfo.register (PrivateAttribute.SELECTIONS, null, "File", MetadataFlags.HIDDEN); // Translators: width and height of images or videos. MetadataInfo.register ("Frame::Pixels", N_("Pixels"), "File", METADATA_ALLOW_EVERYWHERE); @@ -179,6 +180,7 @@ register_metadata_provider (typeof (ExivMetadataProvider)); register_metadata_provider (typeof (ImageMetadataProvider)); register_metadata_provider (typeof (VideoMetadataProvider)); + register_metadata_provider (typeof (SelectionMetadataProvider)); // Always the last one, in order to give priority to the embedded // metadata if the file is newer than the comment file. register_metadata_provider (typeof (CommentMetadataProvider)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Browser.vala new/gthumb-4.0.3/src/Browser.vala --- old/gthumb-4.0.2/src/Browser.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Browser.vala 2026-11-15 09:35:40.000000000 +0100 @@ -340,7 +340,6 @@ } var is_selection = file_data.file.has_uri_scheme ("selection"); var can_write = file_data.info.get_attribute_boolean (FileAttribute.ACCESS_CAN_WRITE); - var can_rename = file_data.info.get_attribute_boolean (FileAttribute.ACCESS_CAN_RENAME); var is_vfs_folder = (source_type == typeof (FileSourceVfs)); edit_catalog_button.visible = is_catalog || is_search; @@ -354,7 +353,7 @@ Util.enable_action (window.action_group, "cut-files", can_write); Util.enable_action (window.action_group, "move-files-to", can_write); - Util.enable_action (window.action_group, "rename-files", can_rename); + Util.enable_action (window.action_group, "rename-files", can_write); Util.enable_action (window.action_group, "duplicate-files", can_write); Util.enable_action (window.action_group, "trash-files", can_write); Util.enable_action (window.action_group, "delete-files-from-disk", can_write); @@ -405,9 +404,9 @@ file_grid.thumbnail_attributes_v = {}; } - // Other attributes. TODO - //attributes.append (","); - //attributes.append (GTH_ATTRIBUTE_EMBLEMS); + // Attribute for selection state. + attributes.append (","); + attributes.append (PrivateAttribute.SELECTIONS); // Save in a variable to avoid recalculation. list_attributes = attributes.str; @@ -1066,12 +1065,6 @@ }); action_group.add_action (action); - action = new SimpleAction ("open-selection", VariantType.INT32); - action.activate.connect ((_action, _params) => { - open_selection ((uint) _params.get_int32 ()); - }); - action_group.add_action (action); - action = new SimpleAction ("open-container", null); action.activate.connect ((_action, _params) => { var selected_file = file_grid.get_selected_file (); @@ -2039,6 +2032,19 @@ file_sorter.set_order ("Private::Unsorted", false); } + public void emblems_changed (GenericList<File> files) { + foreach (var file in files) { + var iter = folder_tree.current_children.iterator (); + var file_data = iter.find_first_item ((file_data) => file_data.file.equal (file)); + if (file_data != null) { + if (app.selections.update_private_attribute (file_data.file, file_data.info)) { + file_data.emblems_changed (); + } + window.viewer.emblems_changed (file_data.file); + } + } + } + async void new_folder () { var local_job = window.new_job ("New Folder"); try { @@ -2336,19 +2342,19 @@ }); } - WindowState state = null; + WindowState before_open_selection_state = null; - void open_selection (uint number) { + public void open_selection (uint number, File? file_to_select = null) { var uri = "selection:///%u".printf (number); var location = File.new_for_uri (uri); if (folder_tree.current_folder.file.equal (location)) { - if (state != null) { - window.restore_state.begin (state); + if (before_open_selection_state != null) { + window.restore_state.begin (before_open_selection_state); return; } } - state = new WindowState (window); - open_location (location); + before_open_selection_state = new WindowState (window); + open_location (location, LoadAction.OPEN, file_to_select); } void open_terminal (File file) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/DefaultSorters.vala new/gthumb-4.0.3/src/DefaultSorters.vala --- old/gthumb-4.0.2/src/DefaultSorters.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/DefaultSorters.vala 2026-11-15 09:35:40.000000000 +0100 @@ -21,25 +21,29 @@ public static int cmp_size (Gth.FileData a, Gth.FileData b) { var size_a = a.info.get_size (); var size_b = b.info.get_size (); - return (size_a < size_b) ? -1 : (size_a > size_b) ? 1 : 0; + var result = (size_a < size_b) ? -1 : (size_a > size_b) ? 1 : 0; + return (result != 0) ? result : Sorters.cmp_basename (a, b); } public static int cmp_modified_time (Gth.FileData a, Gth.FileData b) { var time_a = a.get_modification_time (); var time_b = b.get_modification_time (); - return time_a.compare (time_b); + var result = time_a.compare (time_b); + return (result != 0) ? result : Sorters.cmp_basename (a, b); } public static int cmp_changed_time (Gth.FileData a, Gth.FileData b) { var time_a = a.get_file_changed_time (); var time_b = b.get_file_changed_time (); - return time_a.compare (time_b); + var result = time_a.compare (time_b); + return (result != 0) ? result : Sorters.cmp_basename (a, b); } public static int cmp_created_time (Gth.FileData a, Gth.FileData b) { var time_a = a.get_creation_time (); var time_b = b.get_creation_time (); - return time_a.compare (time_b); + var result = time_a.compare (time_b); + return (result != 0) ? result : Sorters.cmp_basename (a, b); } public static int cmp_position (Gth.FileData a, Gth.FileData b) { @@ -63,7 +67,8 @@ var height = b.info.get_attribute_int32 ("Frame::Height"); b_pixels = width * height; } - return Util.int_cmp (a_pixels, b_pixels); + var result = Util.int_cmp (a_pixels, b_pixels); + return (result != 0) ? result : Sorters.cmp_basename (a, b); } public static int cmp_aspect_ratio (Gth.FileData a, Gth.FileData b) { @@ -87,6 +92,7 @@ b_ratio = (float) width / height; } } - return (a_ratio < b_ratio) ? -1 : (a_ratio > b_ratio) ? 1 : 0; + var result = (a_ratio < b_ratio) ? -1 : (a_ratio > b_ratio) ? 1 : 0; + return (result != 0) ? result : Sorters.cmp_basename (a, b); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Events.vala new/gthumb-4.0.3/src/Events.vala --- old/gthumb-4.0.2/src/Events.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Events.vala 2026-11-15 09:35:40.000000000 +0100 @@ -46,6 +46,12 @@ }); } + public signal void emblems_changed (GenericList<File> files) { + app.foreach_main_window ((win) => { + win.browser.emblems_changed (files); + }); + } + public signal void files_renamed (GenericList<RenamedFile> files) { app.foreach_main_window ((win) => { win.browser.files_renamed (files); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Image/ImageView.vala new/gthumb-4.0.3/src/Ext/Image/ImageView.vala --- old/gthumb-4.0.2/src/Ext/Image/ImageView.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Image/ImageView.vala 2026-11-15 09:35:40.000000000 +0100 @@ -9,7 +9,6 @@ if (value == _image) { return; } - before_changing_image (); if (_default_zoom_type == ZoomType.KEEP_PREVIOUS) { if (_image == null) { _zoom_type = ZoomType.MAXIMIZE_IF_LARGER; @@ -18,6 +17,7 @@ else { _zoom_type = _default_zoom_type; } + before_changing_image (); _image = value; switch (_zoom_type) { case ZoomType.NATURAL_SIZE: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Selections/Selection.vala new/gthumb-4.0.3/src/Ext/Selections/Selection.vala --- old/gthumb-4.0.2/src/Ext/Selections/Selection.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Selections/Selection.vala 2026-11-15 09:35:40.000000000 +0100 @@ -5,7 +5,6 @@ public string sort_type; public bool inverse_order; public GenericArray<File> files; - public GenericSet<File> file_set; public Selection (uint _number) { number = _number; @@ -20,6 +19,10 @@ file_set.remove_all (); } + public bool contains (File file) { + return file_set.contains (file); + } + public bool add_file (File file) { if (file_set.contains (file)) { return false; @@ -48,6 +51,7 @@ var location = File.new_for_uri ("selection:///%u".printf (number)); app.events.files_added (location, files); app.events.selection_changed (number); + app.events.emblems_changed (files); } public void remove_files (GenericList<File> files) { @@ -57,6 +61,7 @@ var location = File.new_for_uri ("selection:///%u".printf (number)); app.events.files_removed_from_catalog (location, files); app.events.selection_changed (number); + app.events.emblems_changed (files); } public void set_files (GenericList<File> files) { @@ -136,18 +141,15 @@ return new FileData (file, info); } - const string[] ICONS = { - "gth-flag-symbolic", - "gth-flag-1-symbolic", - "gth-flag-2-symbolic", - "gth-flag-3-symbolic", - }; + public static Icon get_symbolic_icon (uint number) { + return new ThemedIcon (ICONS[number]); + } public static void update_file_info (File file, FileInfo info) { var number = Selection.get_number (file); info.set_file_type (FileType.DIRECTORY); - info.set_symbolic_icon (new ThemedIcon (ICONS[number])); + info.set_symbolic_icon (Selection.get_symbolic_icon (number)); info.set_sort_order ((int) number); info.set_attribute_boolean (FileAttribute.ACCESS_CAN_READ, true); if (number > 0) { @@ -213,5 +215,13 @@ } } + GenericSet<File> file_set; + const string ROOT = "selection:///"; + const string[] ICONS = { + "gth-flag-symbolic", + "gth-flag-1-symbolic", + "gth-flag-2-symbolic", + "gth-flag-3-symbolic", + }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Selections/SelectionMetadataProvider.vala new/gthumb-4.0.3/src/Ext/Selections/SelectionMetadataProvider.vala --- old/gthumb-4.0.2/src/Ext/Selections/SelectionMetadataProvider.vala 1970-01-01 01:00:00.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Selections/SelectionMetadataProvider.vala 2026-11-15 09:35:40.000000000 +0100 @@ -0,0 +1,22 @@ +public class Gth.SelectionMetadataProvider : Gth.MetadataProvider { + public override bool can_read (File? file, FileInfo info, string[]? attribute_v = null) { + return (info.get_file_type () == FileType.REGULAR) + && Util.attributes_match_any_pattern_v (supported_attributes, attribute_v); + } + + public override bool read (File? file, Bytes? buffer, FileInfo file_info, Cancellable cancellable) throws Error { + if (file == null) { + return false; + } + app.selections.update_private_attribute (file, file_info); + return true; + } + + construct { + id = "Selection"; + supported_attributes = { + PrivateAttribute.SELECTIONS, + }; + cachable = false; + } +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Selections/Selections.vala new/gthumb-4.0.3/src/Ext/Selections/Selections.vala --- old/gthumb-4.0.2/src/Ext/Selections/Selections.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Selections/Selections.vala 2026-11-15 09:35:40.000000000 +0100 @@ -7,8 +7,12 @@ } } - public Selection? get_selection (uint number) { - return ((number > 0) && (number <= Selection.MAX_SELECTIONS)) ? entries[number - 1] : null; + public int get_size () { + return entries.length; + } + + public unowned Selection? get_selection (uint number) { + return ((number > 0) && (number <= entries.length)) ? entries[number - 1] : null; } public Selection? get_selection_from_file (File file) { @@ -16,6 +20,30 @@ return get_selection (number); } + public bool update_private_attribute (File file, FileInfo file_info) { + var changed = false; + uint[] selections = null; + for (var i = 0; i < entries.length; i++) { + unowned var selection = entries[i]; + if ((selection != null) && selection.contains (file)) { + if (selections == null) { + selections = new uint[0]; + } + selections += selection.number; + } + } + + if (selections != null) { + file_info.set_attribute_object (PrivateAttribute.SELECTIONS, new UintList.from_uintv (selections)); + changed = true; + } + else if (file_info.has_attribute (PrivateAttribute.SELECTIONS)) { + file_info.remove_attribute (PrivateAttribute.SELECTIONS); + changed = true; + } + return changed; + } + public void save_to_file () { try { var doc = new Dom.Document (); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Selections/UintList.vala new/gthumb-4.0.3/src/Ext/Selections/UintList.vala --- old/gthumb-4.0.2/src/Ext/Selections/UintList.vala 1970-01-01 01:00:00.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Selections/UintList.vala 2026-11-15 09:35:40.000000000 +0100 @@ -0,0 +1,11 @@ +public class Gth.UintList : Object { + public UintList.from_uintv (uint[] _uintv) { + uintv = _uintv; + } + + public unowned uint[] get_uintv() { + return uintv; + } + + uint[] uintv; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Ext/Selections/meson.build new/gthumb-4.0.3/src/Ext/Selections/meson.build --- old/gthumb-4.0.2/src/Ext/Selections/meson.build 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Ext/Selections/meson.build 2026-11-15 09:35:40.000000000 +0100 @@ -1,6 +1,8 @@ selections_files = files( 'FileSourceSelections.vala', 'Selection.vala', + 'SelectionMetadataProvider.vala', 'Selections.vala', 'SelectionsStatus.vala', + 'UintList.vala', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/FileData.vala new/gthumb-4.0.3/src/FileData.vala --- old/gthumb-4.0.2/src/FileData.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/FileData.vala 2026-11-15 09:35:40.000000000 +0100 @@ -88,6 +88,8 @@ public signal void children_changed (); + public signal void emblems_changed (); + public virtual signal void info_changed () { // Invalidate cached data. mtime = null; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/FileGridItem.vala new/gthumb-4.0.3/src/FileGridItem.vala --- old/gthumb-4.0.2/src/FileGridItem.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/FileGridItem.vala 2026-11-15 09:35:40.000000000 +0100 @@ -39,6 +39,11 @@ first_label.visible = attributes_v.length > 0; second_label.visible = attributes_v.length > 1; third_label.visible = attributes_v.length > 2; + + emblems = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12); + emblems.visible = false; + emblems.add_css_class ("accent"); + append (emblems); } public void set_size (uint _size) { @@ -57,21 +62,25 @@ if (size != file_grid.thumbnail_size) { set_size (file_grid.thumbnail_size); } - update_attributes (); - file_renamed_id = file_data.info_changed.connect_after (() => { + info_changed_id = file_data.info_changed.connect_after (() => { update_attributes (); }); + update_emblems (); + emblems_changed_id = file_data.emblems_changed.connect_after (() => { + update_emblems (); + }); thumbnail.bind (file_data); } public void unbind () { thumbnail.unbind (); - file_data.disconnect (file_renamed_id); + file_data.disconnect (info_changed_id); first_label.set_text (""); second_label.set_text (""); third_label.set_text (""); tooltip_text = null; + Util.remove_all_children (emblems); } void update_attributes () { @@ -89,12 +98,29 @@ } } + void update_emblems () { + Util.remove_all_children (emblems); + var n_emblems = 0; + if (file_data.info.has_attribute (PrivateAttribute.SELECTIONS)) { + var active_selections = file_data.info.get_attribute_object (PrivateAttribute.SELECTIONS) as Gth.UintList; + unowned var numbers = active_selections.get_uintv (); + foreach (var number in numbers) { + var icon = Selection.get_symbolic_icon (number); + emblems.append (new Gtk.Image.from_gicon (icon)); + n_emblems++; + } + } + emblems.visible = n_emblems > 0; + } + Gth.Thumbnail thumbnail; Gtk.Inscription first_label; Gtk.Inscription second_label; Gtk.Inscription third_label; + Gtk.Box emblems; uint size; - ulong file_renamed_id; + ulong info_changed_id; + ulong emblems_changed_id; unowned string[] attributes_v; const int V_SPACING = 6; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/MainWindow.vala new/gthumb-4.0.3/src/MainWindow.vala --- old/gthumb-4.0.2/src/MainWindow.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/MainWindow.vala 2026-11-15 09:35:40.000000000 +0100 @@ -1164,6 +1164,12 @@ } }); action_group.add_action (action); + + action = new SimpleAction ("open-selection", VariantType.INT32); + action.activate.connect ((_action, _params) => { + browser.open_selection ((uint) _params.get_int32 ()); + }); + action_group.add_action (action); } async void exec_file_operation (string name, FileOperation operation, GenericList<File> files, Gth.Job? external_job = null) { @@ -1281,6 +1287,11 @@ else if (state.page == Page.VIEWER) { try { yield viewer.open_file_async (state.file, ViewFlags.FOCUS, local_job); + if ((browser.folder_tree.current_folder == null) + || !state.location.equal (browser.folder_tree.current_folder.file)) + { + yield browser.load_folder (state.location, LoadAction.OPEN, local_job); + } } catch (Error error) { show_error (error); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Migration.vala new/gthumb-4.0.3/src/Migration.vala --- old/gthumb-4.0.2/src/Migration.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Migration.vala 2026-11-15 09:35:40.000000000 +0100 @@ -34,7 +34,7 @@ metadata.add ("comment::time", "Metadata::DateTime"); metadata.add ("comment::categories", "Metadata::Tags"); metadata.add ("comment::rating", "Metadata::Rating"); - metadata.add ("gth::file::emblems", "Private::File::Emblems"); + metadata.add ("gth::file::emblems", PrivateAttribute.SELECTIONS); metadata.add ("gth::standard::secondary-sort-order", "Private::SecondarySortOrder"); metadata.add ("image::width", "Frame::Width"); metadata.add ("image::height", "Frame::Height"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Types.vala new/gthumb-4.0.3/src/Types.vala --- old/gthumb-4.0.2/src/Types.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Types.vala 2026-11-15 09:35:40.000000000 +0100 @@ -208,7 +208,7 @@ const string LOADED_IMAGE_COLOR_PROFILE = "Loaded::Image::ColorProfile"; const string ASK_FILENAME_WHEN_SAVING = "Loaded::Image::AskFilename"; const string ASKED_FILENAME_BEFORE_SAVING = "Loaded::Image::AskedFilename"; - const string EMBLEMS = "Private::File::Emblems"; + const string SELECTIONS = "Private::File::Selections"; const string VOLUME = "Private::Volume"; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/Viewer.vala new/gthumb-4.0.3/src/Viewer.vala --- old/gthumb-4.0.2/src/Viewer.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/Viewer.vala 2026-11-15 09:35:40.000000000 +0100 @@ -212,6 +212,13 @@ } } + public void emblems_changed (File file) { + if ((current_file != null) && current_file.file.equal (file)) { + app.selections.update_private_attribute (current_file.file, current_file.info); + update_title (); + } + } + public void list_changed () { update_current_file_position (); } @@ -518,19 +525,48 @@ } public void update_title () { - var title = new StringBuilder (); + // Title + if (window.current_page == MainWindow.Page.VIEWER) { + if (current_file != null) { + window.title = current_file.info.get_display_name (); + } + else { + window.title = ""; + } + } + + // State string state = null; if (current_file != null) { - title.append (current_file.info.get_display_name ()); if (current_file.get_is_modified ()) { // Translators: text added to the window title when the image is modified and unsaved. state = _("modified"); } } - if (window.current_page == MainWindow.Page.VIEWER) { - window.title = title.str; + if (state != null) { + header_state.label = state; + header_state.visible = true; } - set_header_state (state); + else { + header_state.visible = false; + } + + // Emblems + var with_emblems = false; + if ((current_file != null) && current_file.info.has_attribute (PrivateAttribute.SELECTIONS)) { + var active_selections = current_file.info.get_attribute_object (PrivateAttribute.SELECTIONS) as Gth.UintList; + if (active_selections != null) { + foreach (unowned var button in emblem_buttons) { + button.visible = false; + } + unowned var numbers = active_selections.get_uintv (); + foreach (var number in numbers) { + emblem_buttons[((int) number) - 1].visible = true; + with_emblems = true; + } + } + } + header_emblems.visible = with_emblems; } public void update_list_info (uint files) { @@ -637,16 +673,6 @@ } } - public void set_header_state (string? state) { - if (state != null) { - header_state.label = state; - header_state.visible = true; - } - else { - header_state.visible = false; - } - } - public void release_resources () { viewer_signals.disconnect_all (); fixed_signals.disconnect_all (); @@ -811,6 +837,19 @@ action_group.add_action (action); } + Gtk.Button new_emblem_button (uint number) { + var button = new Gtk.Button (); + var icon = Selection.get_symbolic_icon (number); + button.child = new Gtk.Image.from_gicon (icon); + button.clicked.connect (() => { + window.browser.open_selection (number, current_file?.file); + }); + // Translators: %u is replaced with a number + button.tooltip_text = _("Selection %u").printf (number); + button.visible = false; + return button; + } + construct { fullscreen_state = new FullscreenState (this); viewer_signals = new RegisteredSignals (); @@ -839,6 +878,14 @@ can_change = window.viewer.position > 0; } }); + + header_emblems.visible = false; + emblem_buttons = new Gtk.Button[app.selections.get_size ()]; + for (var i = 0; i < app.selections.get_size (); i++) { + var button = new_emblem_button ((uint) (i + 1)); + emblem_buttons[i] = button; + header_emblems.append (button); + } } [GtkChild] public unowned Adw.OverlaySplitView main_view; @@ -861,6 +908,7 @@ [GtkChild] unowned Gtk.PopoverMenu context_menu; [GtkChild] unowned Adw.WindowTitle header_title; [GtkChild] unowned Gtk.Label header_state; + [GtkChild] unowned Gtk.Box header_emblems; [GtkChild] public unowned Gth.ActionPopover tools_popover; [GtkChild] public unowned Gtk.Stack sidebar_stack; [GtkChild] public unowned Adw.OverlaySplitView content_view; @@ -877,6 +925,7 @@ RegisteredSignals fixed_signals; FullscreenState fullscreen_state; bool scrollable; + Gtk.Button[] emblem_buttons; const double MOTION_THRESHOLD = 10; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gthumb-4.0.2/src/WindowState.vala new/gthumb-4.0.3/src/WindowState.vala --- old/gthumb-4.0.2/src/WindowState.vala 2026-11-08 12:13:20.000000000 +0100 +++ new/gthumb-4.0.3/src/WindowState.vala 2026-11-15 09:35:40.000000000 +0100 @@ -13,7 +13,7 @@ if (window.viewer.current_file != null) { file = window.viewer.current_file.file; } - selected = window.browser.file_grid.get_selected_files (); + selected = window.get_selected_files (); vscroll = window.browser.file_grid.view.vadjustment.value; } } ++++++ gthumb.obsinfo ++++++ --- /var/tmp/diff_new_pack.nSJDOr/_old 2026-11-17 17:23:49.704309750 +0100 +++ /var/tmp/diff_new_pack.nSJDOr/_new 2026-11-17 17:23:49.707309878 +0100 @@ -1,5 +1,5 @@ name: gthumb -version: 4.0.2 -mtime: 1794136400 -commit: ae594c2d36bb733df32cc7c4b715eae89b6879c8 +version: 4.0.3 +mtime: 1794731740 +commit: 6cb0cb9e0186f5c5f30801440344b95f343df60f
