[seahorse/gkr/hide-details-when-empty] gkr: Don't show "Details" if no attributes are shown
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/gkr/hide-details-when-empty] gkr: Don't show "Details" if no attributes are shown
- Date: Wed, 4 Aug 2021 17:23:36 +0000 (UTC)
commit bc85435c51742c363eaa7e1af04be13c775a1e25
Author: Niels De Graef <nielsdegraef gmail com>
Date: Wed Aug 4 19:21:20 2021 +0200
gkr: Don't show "Details" if no attributes are shown
Don't do this by checking if `attrs.size() > 0`, since there still a
possibility that it contains elements, but that we skip them (for
example: any "gkr:" strings).
This fixes an issue where stored notes would still show a "Details"
title, but no content.
gkr/gkr-item-properties.vala | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gkr/gkr-item-properties.vala b/gkr/gkr-item-properties.vala
index e7edb713..08578270 100644
--- a/gkr/gkr-item-properties.vala
+++ b/gkr/gkr-item-properties.vala
@@ -181,12 +181,14 @@ public class Seahorse.Gkr.ItemProperties : Gtk.Dialog {
var attrs = this.item.attributes;
var iter = GLib.HashTableIter<string, string>(attrs);
- this.details_group.visible = (attrs.size() > 0);
+ bool any_details = false;
string key, value;
while (iter.next(out key, out value)) {
if (key.has_prefix("gkr:") || key.has_prefix("xdg:"))
continue;
+ any_details = true;
+
var row = new Hdy.ActionRow();
row.title = key;
row.can_focus = false;
@@ -203,6 +205,7 @@ public class Seahorse.Gkr.ItemProperties : Gtk.Dialog {
this.details_box.insert(row, -1);
}
+ this.details_group.visible = any_details;
}
private async void save_password() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]