[Xfce4-commits] [xfce/thunar] 01/02: Silence gdk_threads_* deprecations
noreply at xfce.org
noreply at xfce.org
Sat Jun 2 17:37:04 CEST 2018
This is an automated email from the git hooks/post-receive script.
a n d r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/thunar.
commit c5d6c68555699322a5c8fb040e7fd50274ad3849
Author: Andre Miranda <andreldm at xfce.org>
Date: Sat Jun 2 11:56:51 2018 -0300
Silence gdk_threads_* deprecations
---
thunar/thunar-icon-factory.c | 5 +++--
thunar/thunar-launcher.c | 9 +++++----
thunar/thunar-path-entry.c | 4 ++--
thunar/thunar-renamer-model.c | 4 ++--
thunar/thunar-renamer-progress.c | 5 +++--
thunar/thunar-shortcuts-model.c | 8 ++++----
thunar/thunar-standard-view.c | 12 ++++++------
thunar/thunar-tree-model.c | 9 +++++----
thunar/thunar-tree-view.c | 13 +++++++------
thunar/thunar-user.c | 5 +++--
thunar/thunar-util.h | 10 ++++++++++
thunar/thunar-window.c | 12 ++++++------
thunarx/thunarx-private.h | 10 ++++++++++
thunarx/thunarx-provider-factory.c | 4 ++--
14 files changed, 68 insertions(+), 42 deletions(-)
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index 4ec16c9..6bc0847 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -35,6 +35,7 @@
#include <thunar/thunar-preferences.h>
#include <thunar/thunar-private.h>
#include <thunar/thunar-thumbnail-frame.h>
+#include <thunar/thunar-util.h>
@@ -332,12 +333,12 @@ thunar_icon_factory_sweep_timer (gpointer user_data)
_thunar_return_val_if_fail (THUNAR_IS_ICON_FACTORY (factory), FALSE);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* ditch all icons whose ref_count is 1 */
g_hash_table_foreach_remove (factory->icon_cache, (GHRFunc) thunar_icon_check_sweep, factory);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index f6d434e..8fed3ed 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -42,6 +42,7 @@
#include <thunar/thunar-sendto-model.h>
#include <thunar/thunar-stock.h>
#include <thunar/thunar-device-monitor.h>
+#include <thunar/thunar-util.h>
#include <thunar/thunar-window.h>
@@ -783,7 +784,7 @@ thunar_launcher_update_idle (gpointer data)
if (G_UNLIKELY (launcher->ui_manager == NULL))
return FALSE;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* drop the previous addons ui controls from the UI manager */
if (G_LIKELY (launcher->ui_addons_merge_id != 0))
@@ -1095,7 +1096,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
launcher, thunar_launcher_sendto_idle_destroy);
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
@@ -1739,7 +1740,7 @@ thunar_launcher_sendto_idle (gpointer user_data)
if (launcher->ui_manager == NULL)
return FALSE;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* determine the number of selected files and check whether atleast one of these
* files is located in the trash (to en-/disable the "sendto-desktop" action).
@@ -1877,7 +1878,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-path-entry.c b/thunar/thunar-path-entry.c
index 0d5d959..ca73234 100644
--- a/thunar/thunar-path-entry.c
+++ b/thunar/thunar-path-entry.c
@@ -1092,7 +1092,7 @@ thunar_path_entry_check_completion_idle (gpointer user_data)
ThunarPathEntry *path_entry = THUNAR_PATH_ENTRY (user_data);
const gchar *text;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* check if the user entered at least part of a filename */
text = gtk_entry_get_text (GTK_ENTRY (path_entry));
@@ -1102,7 +1102,7 @@ thunar_path_entry_check_completion_idle (gpointer user_data)
thunar_path_entry_common_prefix_append (path_entry, TRUE);
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-renamer-model.c b/thunar/thunar-renamer-model.c
index e8fd4cf..82f12a4 100644
--- a/thunar/thunar-renamer-model.c
+++ b/thunar/thunar-renamer-model.c
@@ -899,7 +899,7 @@ thunar_renamer_model_update_idle (gpointer user_data)
gchar *name;
GList *lp;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* don't do anything if the model is frozen */
if (G_LIKELY (!renamer_model->frozen))
@@ -961,7 +961,7 @@ thunar_renamer_model_update_idle (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
/* keep the idle source as long as any item changed */
return changed;
diff --git a/thunar/thunar-renamer-progress.c b/thunar/thunar-renamer-progress.c
index 4bcdac2..ef628b3 100644
--- a/thunar/thunar-renamer-progress.c
+++ b/thunar/thunar-renamer-progress.c
@@ -23,6 +23,7 @@
#include <thunar/thunar-private.h>
#include <thunar/thunar-renamer-progress.h>
+#include <thunar/thunar-util.h>
@@ -143,7 +144,7 @@ thunar_renamer_progress_next_idle (gpointer user_data)
guint n_total;
GList *first;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* check if we have still pairs to go */
if (G_LIKELY (renamer_progress->pairs_todo != NULL))
@@ -266,7 +267,7 @@ thunar_renamer_progress_next_idle (gpointer user_data)
if (G_UNLIKELY (renamer_progress->pairs_todo == NULL))
g_main_loop_quit (renamer_progress->next_idle_loop);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
/* keep the idle source alive as long as we have anything to do */
return (renamer_progress->pairs_todo != NULL);
diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c
index 07c25c4..514d15e 100644
--- a/thunar/thunar-shortcuts-model.c
+++ b/thunar/thunar-shortcuts-model.c
@@ -1296,7 +1296,7 @@ thunar_shortcuts_model_load (gpointer data)
_thunar_return_val_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model), FALSE);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* parse the bookmarks */
thunar_util_load_bookmarks (model->bookmarks_file,
@@ -1306,7 +1306,7 @@ thunar_shortcuts_model_load (gpointer data)
/* update the visibility */
thunar_shortcuts_model_header_visibility (model);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
model->bookmarks_idle_id = 0;
@@ -1326,7 +1326,7 @@ thunar_shortcuts_model_reload (gpointer data)
_thunar_return_val_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model), FALSE);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* drop all existing user-defined shortcuts from the model */
for (idx = 0, lp = model->shortcuts; lp != NULL; )
@@ -1357,7 +1357,7 @@ thunar_shortcuts_model_reload (gpointer data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
/* load new bookmarks */
return thunar_shortcuts_model_load (data);
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index 49fd163..3a9c5fa 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -2133,7 +2133,7 @@ thunar_standard_view_update_statusbar_text_idle (gpointer data)
_thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* clear the current status text (will be recalculated on-demand) */
g_free (standard_view->priv->statusbar_text);
@@ -2144,7 +2144,7 @@ thunar_standard_view_update_statusbar_text_idle (gpointer data)
/* tell everybody that the statusbar text may have changed */
g_object_notify_by_pspec (G_OBJECT (standard_view), standard_view_props[PROP_STATUSBAR_TEXT]);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
@@ -3957,7 +3957,7 @@ thunar_standard_view_drag_scroll_timer (gpointer user_data)
gint y, x;
gint w, h;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* verify that we are realized */
if (G_LIKELY (gtk_widget_get_realized (GTK_WIDGET (standard_view))))
@@ -4007,7 +4007,7 @@ thunar_standard_view_drag_scroll_timer (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return TRUE;
}
@@ -4028,9 +4028,9 @@ thunar_standard_view_drag_timer (gpointer user_data)
ThunarStandardView *standard_view = THUNAR_STANDARD_VIEW (user_data);
/* fire up the context menu */
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
thunar_standard_view_context_menu (standard_view);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-tree-model.c b/thunar/thunar-tree-model.c
index fc4a5c1..52f4fe8 100644
--- a/thunar/thunar-tree-model.c
+++ b/thunar/thunar-tree-model.c
@@ -37,6 +37,7 @@
#include <thunar/thunar-private.h>
#include <thunar/thunar-tree-model.h>
#include <thunar/thunar-device-monitor.h>
+#include <thunar/thunar-util.h>
@@ -918,13 +919,13 @@ thunar_tree_model_cleanup_idle (gpointer user_data)
{
ThunarTreeModel *model = THUNAR_TREE_MODEL (user_data);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* walk through the tree and release all the nodes with a ref count of 0 */
g_node_traverse (model->root, G_PRE_ORDER, G_TRAVERSE_ALL, -1,
thunar_tree_model_node_traverse_cleanup, model);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
@@ -1434,7 +1435,7 @@ thunar_tree_model_item_load_idle (gpointer user_data)
_thunar_return_val_if_fail (node->children == NULL || G_NODE_HAS_DUMMY (node), FALSE);
#endif
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* check if we don't have a file yet and this is a mounted volume */
if (item->file == NULL && item->device != NULL && thunar_device_is_mounted (item->device))
@@ -1471,7 +1472,7 @@ thunar_tree_model_item_load_idle (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index b11f4a8..2abcb7d 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -44,6 +44,7 @@
#include <thunar/thunar-simple-job.h>
#include <thunar/thunar-tree-model.h>
#include <thunar/thunar-tree-view.h>
+#include <thunar/thunar-util.h>
@@ -2535,7 +2536,7 @@ thunar_tree_view_cursor_idle (gpointer user_data)
ThunarFile *file;
gboolean done = TRUE;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* for easier navigation, we sometimes want to force/keep selection of a certain path */
if (view->select_path != NULL)
@@ -2610,7 +2611,7 @@ thunar_tree_view_cursor_idle (gpointer user_data)
gtk_tree_path_free (path);
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return !done;
}
@@ -2640,7 +2641,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
gint offset;
gint y, h;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* verify that we are realized */
if (gtk_widget_get_realized (GTK_WIDGET (view)))
@@ -2711,7 +2712,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return TRUE;
}
@@ -2732,7 +2733,7 @@ thunar_tree_view_expand_timer (gpointer user_data)
ThunarTreeView *view = THUNAR_TREE_VIEW (user_data);
GtkTreePath *path;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* cancel the drag autoscroll timer when expanding a row */
if (G_UNLIKELY (view->drag_scroll_timer_id != 0))
@@ -2747,7 +2748,7 @@ thunar_tree_view_expand_timer (gpointer user_data)
gtk_tree_path_free (path);
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunar/thunar-user.c b/thunar/thunar-user.c
index 78add29..ceba7b0 100644
--- a/thunar/thunar-user.c
+++ b/thunar/thunar-user.c
@@ -51,6 +51,7 @@
#include <exo/exo.h>
#include <thunar/thunar-user.h>
+#include <thunar/thunar-util.h>
@@ -558,7 +559,7 @@ thunar_user_manager_flush_timer (gpointer user_data)
ThunarUserManager *manager = THUNAR_USER_MANAGER (user_data);
guint size = 0;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* drop all cached groups */
size += g_hash_table_foreach_remove (manager->groups, (GHRFunc) gtk_true, NULL);
@@ -581,7 +582,7 @@ thunar_user_manager_flush_timer (gpointer user_data)
#endif
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return TRUE;
}
diff --git a/thunar/thunar-util.h b/thunar/thunar-util.h
index 5449f0c..d0f277c 100644
--- a/thunar/thunar-util.h
+++ b/thunar/thunar-util.h
@@ -24,6 +24,16 @@
#include <thunar/thunar-enum-types.h>
+#define THUNAR_THREADS_ENTER \
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ gdk_threads_enter(); \
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+#define THUNAR_THREADS_LEAVE \
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ gdk_threads_leave (); \
+G_GNUC_END_IGNORE_DEPRECATIONS
+
G_BEGIN_DECLS;
typedef void (*ThunarBookmarksFunc) (GFile *file,
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index e0d0cf9..153c114 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -2185,7 +2185,7 @@ thunar_window_bookmark_merge (gpointer user_data)
_thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE);
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* remove old actions */
if (window->bookmark_items_actions_merge_id != 0)
@@ -2233,7 +2233,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
window->bookmark_reload_idle_id = 0;
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
@@ -3627,10 +3627,10 @@ thunar_window_merge_idle (gpointer user_data)
ThunarWindow *window = THUNAR_WINDOW (user_data);
/* merge custom preferences from the providers */
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
thunar_window_merge_custom_preferences (window);
thunar_window_merge_go_actions (window);
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
thunar_window_bookmark_merge (window);
@@ -3670,7 +3670,7 @@ thunar_window_save_geometry_timer (gpointer user_data)
gint width;
gint height;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* check if we should remember the window geometry */
g_object_get (G_OBJECT (window->preferences), "misc-remember-geometry", &remember_geometry, NULL);
@@ -3700,7 +3700,7 @@ thunar_window_save_geometry_timer (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return FALSE;
}
diff --git a/thunarx/thunarx-private.h b/thunarx/thunarx-private.h
index 1f9d714..d0658cc 100644
--- a/thunarx/thunarx-private.h
+++ b/thunarx/thunarx-private.h
@@ -27,6 +27,16 @@
#include <glib-object.h>
+#define THUNAR_THREADS_ENTER \
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ gdk_threads_enter(); \
+G_GNUC_END_IGNORE_DEPRECATIONS
+
+#define THUNAR_THREADS_LEAVE \
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
+ gdk_threads_leave (); \
+G_GNUC_END_IGNORE_DEPRECATIONS
+
G_BEGIN_DECLS
#define I_(string) (g_intern_static_string ((string)))
diff --git a/thunarx/thunarx-provider-factory.c b/thunarx/thunarx-provider-factory.c
index 7764b55..94b1154 100644
--- a/thunarx/thunarx-provider-factory.c
+++ b/thunarx/thunarx-provider-factory.c
@@ -214,7 +214,7 @@ thunarx_provider_factory_timer (gpointer user_data)
ThunarxProviderInfo *info;
gint n;
- GDK_THREADS_ENTER ();
+THUNAR_THREADS_ENTER
/* drop all providers for which only we keep a reference */
for (n = factory->n_infos; --n >= 0; )
@@ -227,7 +227,7 @@ thunarx_provider_factory_timer (gpointer user_data)
}
}
- GDK_THREADS_LEAVE ();
+THUNAR_THREADS_LEAVE
return TRUE;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list