[connections/collection-view-child-papercuts: 2/3] collection-view-child: Properly reset source id for thumbnailer




commit a1973e8951cc6cfb1f5916593eccbe62eab5edbf
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Aug 17 14:57:22 2021 +0200

    collection-view-child: Properly reset source id for thumbnailer

 src/collection-view-child.vala | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/collection-view-child.vala b/src/collection-view-child.vala
index 597b820..5101382 100644
--- a/src/collection-view-child.vala
+++ b/src/collection-view-child.vala
@@ -47,8 +47,9 @@ namespace Connections {
 
         private void update_thumbnail () {
             thumbnail_id = Timeout.add_seconds (3, () => {
+                thumbnail_id = 0;
+
                 if (!connection.connected) {
-                    thumbnail_id = 0;
                     thumbnail.set_from_icon_name ("org.gnome.Connections-symbolic",
                                                   Gtk.IconSize.LARGE_TOOLBAR);
                     return false;
@@ -69,6 +70,7 @@ namespace Connections {
         ~CollectionViewChild () {
             if (thumbnail_id != 0)
                 Source.remove (thumbnail_id);
+                thumbnail_id = 0;
         }
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]