[nautilus/wip/antoniof/gtk4-preparation-step-properties-cleanup: 8/9] general: Drop uses of gtk-timeout-expand setting




commit 4f21fbcb2fc8a4d79a4e9126f61f26172110da1b
Author: Ernestas Kulik <ernestask gnome org>
Date:   Sat Jul 21 11:03:48 2018 +0300

    general: Drop uses of gtk-timeout-expand setting
    
    It's deprecated.
    
    Add a hardcoded value equal to the default of gtk-timeout-expand.
    
    Rebased and ammended by António Fernandes <antoniof gnome org>

 src/nautilus-canvas-dnd.c          | 10 ++--------
 src/nautilus-dnd.h                 |  2 ++
 src/nautilus-tree-view-drag-dest.c | 11 ++---------
 src/nautilus-window-slot-dnd.c     |  8 +-------
 4 files changed, 7 insertions(+), 24 deletions(-)
---
diff --git a/src/nautilus-canvas-dnd.c b/src/nautilus-canvas-dnd.c
index 1f86039c2..95b8f8d34 100644
--- a/src/nautilus-canvas-dnd.c
+++ b/src/nautilus-canvas-dnd.c
@@ -1495,8 +1495,6 @@ check_hover_timer (NautilusCanvasContainer *container,
                    const char              *uri)
 {
     NautilusCanvasDndInfo *dnd_info;
-    GtkSettings *settings;
-    guint timeout;
 
     dnd_info = container->details->dnd_info;
 
@@ -1507,17 +1505,13 @@ check_hover_timer (NautilusCanvasContainer *container,
 
     remove_hover_timer (dnd_info);
 
-    settings = gtk_widget_get_settings (GTK_WIDGET (container));
-    g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-
-    g_free (dnd_info->target_uri);
-    dnd_info->target_uri = NULL;
+    g_clear_pointer (&dnd_info->target_uri, g_free);
 
     if (uri != NULL)
     {
         dnd_info->target_uri = g_strdup (uri);
         dnd_info->hover_id =
-            gdk_threads_add_timeout (timeout,
+            gdk_threads_add_timeout (HOVER_TIMEOUT,
                                      hover_timer,
                                      container);
     }
diff --git a/src/nautilus-dnd.h b/src/nautilus-dnd.h
index 6e101b529..0bb5e732f 100644
--- a/src/nautilus-dnd.h
+++ b/src/nautilus-dnd.h
@@ -27,6 +27,8 @@
 #include <gtk/gtk.h>
 #include "nautilus-file.h"
 
+#define HOVER_TIMEOUT 500
+
 /* Drag & Drop target names. */
 #define NAUTILUS_ICON_DND_GNOME_ICON_LIST_TYPE "x-special/gnome-icon-list"
 #define NAUTILUS_ICON_DND_URI_LIST_TYPE                "text/uri-list"
diff --git a/src/nautilus-tree-view-drag-dest.c b/src/nautilus-tree-view-drag-dest.c
index 379693ffd..147c63b59 100644
--- a/src/nautilus-tree-view-drag-dest.c
+++ b/src/nautilus-tree-view-drag-dest.c
@@ -344,26 +344,19 @@ static void
 check_hover_timer (NautilusTreeViewDragDest *dest,
                    const char               *uri)
 {
-    GtkSettings *settings;
-    guint timeout;
-
     if (g_strcmp0 (uri, dest->details->target_uri) == 0)
     {
         return;
     }
     remove_hover_timer (dest);
 
-    settings = gtk_widget_get_settings (GTK_WIDGET (dest->details->tree_view));
-    g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-
-    g_free (dest->details->target_uri);
-    dest->details->target_uri = NULL;
+    g_clear_pointer (&dest->details->target_uri, g_free);
 
     if (uri != NULL)
     {
         dest->details->target_uri = g_strdup (uri);
         dest->details->hover_id =
-            gdk_threads_add_timeout (timeout,
+            gdk_threads_add_timeout (HOVER_TIMEOUT,
                                      hover_timer,
                                      dest);
     }
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 96c5d9cc8..513409dd1 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -122,19 +122,13 @@ static void
 slot_proxy_check_switch_location_timer (NautilusDragSlotProxyInfo *drag_info,
                                         GtkWidget                 *widget)
 {
-    GtkSettings *settings;
-    guint timeout;
-
     if (drag_info->switch_location_timer)
     {
         return;
     }
 
-    settings = gtk_widget_get_settings (widget);
-    g_object_get (settings, "gtk-timeout-expand", &timeout, NULL);
-
     drag_info->switch_location_timer =
-        gdk_threads_add_timeout (timeout,
+        gdk_threads_add_timeout (HOVER_TIMEOUT,
                                  slot_proxy_switch_location_timer,
                                  drag_info);
 }


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