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>
This commit is contained in:
Ernestas Kulik 2018-07-21 11:03:48 +03:00 committed by António Fernandes
parent b17c3f61a8
commit 684650c8ae
4 changed files with 7 additions and 25 deletions

View file

@ -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,16 +1505,12 @@ 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 = g_timeout_add (timeout, hover_timer, container);
dnd_info->hover_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, container);
}
}

View file

@ -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"

View file

@ -290,25 +290,18 @@ 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 = g_timeout_add (timeout, hover_timer, dest);
dest->details->hover_id = g_timeout_add (HOVER_TIMEOUT, hover_timer, dest);
}
}

View file

@ -122,19 +122,12 @@ 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 = g_timeout_add (timeout,
drag_info->switch_location_timer = g_timeout_add (HOVER_TIMEOUT,
slot_proxy_switch_location_timer,
drag_info);
}