Commit c5d6c685 authored by Andre Miranda's avatar Andre Miranda

Silence gdk_threads_* deprecations

parent a80821b2
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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;
}
......
......@@ -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)))
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment