[Xfce4-commits] [xfce/thunar] 01/01: Handle a few deprecations

noreply at xfce.org noreply at xfce.org
Sat Sep 2 20:43:42 CEST 2017


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 aafb30d694dd5e36c3dce4dc05be7c3e1926376b
Author: Andre Miranda <andreldm at xfce.org>
Date:   Sat Sep 2 15:43:22 2017 -0300

    Handle a few deprecations
---
 plugins/thunar-tpa/thunar-tpa.c         | 24 +++++++++++++++---------
 thunar/thunar-application.c             |  2 +-
 thunar/thunar-chooser-dialog.c          |  6 ++++--
 thunar/thunar-emblem-chooser.c          |  2 +-
 thunar/thunar-file.c                    |  2 +-
 thunar/thunar-icon-factory.c            |  4 ++--
 thunar/thunar-launcher.c                |  2 +-
 thunar/thunar-preferences-dialog.c      |  2 +-
 thunar/thunar-session-client.c          | 13 +------------
 thunar/thunar-shortcuts-icon-renderer.c |  2 +-
 thunar/thunar-standard-view.c           |  2 +-
 thunar/thunar-tree-view.c               |  2 +-
 thunar/thunar-window.c                  |  4 ++--
 13 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/plugins/thunar-tpa/thunar-tpa.c b/plugins/thunar-tpa/thunar-tpa.c
index 184237c..6044b43 100644
--- a/plugins/thunar-tpa/thunar-tpa.c
+++ b/plugins/thunar-tpa/thunar-tpa.c
@@ -493,8 +493,9 @@ thunar_tpa_trash_changed (DBusGProxy *proxy,
 static void
 thunar_tpa_display_trash (ThunarTpa *plugin)
 {
-  gchar *display_name;
-  gchar *startup_id;
+  gchar     *display_name;
+  gchar     *startup_id;
+  GdkScreen *screen;
 
   g_return_if_fail (THUNAR_IS_TPA (plugin));
 
@@ -506,7 +507,8 @@ thunar_tpa_display_trash (ThunarTpa *plugin)
         dbus_g_proxy_cancel_call (plugin->proxy, plugin->display_trash_call);
 
       /* schedule a new call */
-      display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
+      screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
+      display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
       startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
       plugin->display_trash_call = org_xfce_Trash_display_trash_async (plugin->proxy, display_name, startup_id, thunar_tpa_display_trash_reply, plugin);
       g_free (startup_id);
@@ -519,8 +521,9 @@ thunar_tpa_display_trash (ThunarTpa *plugin)
 static void
 thunar_tpa_empty_trash (ThunarTpa *plugin)
 {
-  gchar *display_name;
-  gchar *startup_id;
+  gchar     *display_name;
+  gchar     *startup_id;
+  GdkScreen *screen;
 
   g_return_if_fail (THUNAR_IS_TPA (plugin));
 
@@ -532,7 +535,8 @@ thunar_tpa_empty_trash (ThunarTpa *plugin)
         dbus_g_proxy_cancel_call (plugin->proxy, plugin->empty_trash_call);
 
       /* schedule a new call */
-      display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
+      screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
+      display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
       startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
       plugin->empty_trash_call = org_xfce_Trash_empty_trash_async (plugin->proxy, display_name, startup_id, thunar_tpa_empty_trash_reply, plugin);
       g_free (startup_id);
@@ -546,8 +550,9 @@ static gboolean
 thunar_tpa_move_to_trash (ThunarTpa    *plugin,
                           const gchar **uri_list)
 {
-  gchar *display_name;
-  gchar *startup_id;
+  gchar     *display_name;
+  gchar     *startup_id;
+  GdkScreen *screen;
 
   g_return_val_if_fail (THUNAR_IS_TPA (plugin), FALSE);
   g_return_val_if_fail (uri_list != NULL, FALSE);
@@ -561,7 +566,8 @@ thunar_tpa_move_to_trash (ThunarTpa    *plugin,
     dbus_g_proxy_cancel_call (plugin->proxy, plugin->move_to_trash_call);
 
   /* schedule a new call */
-  display_name = gdk_screen_make_display_name (gtk_widget_get_screen (GTK_WIDGET (plugin)));
+  screen = gtk_widget_get_screen (GTK_WIDGET (plugin));
+  display_name = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
   startup_id = g_strdup_printf ("_TIME%d", gtk_get_current_event_time ());
   plugin->move_to_trash_call = org_xfce_Trash_move_to_trash_async (plugin->proxy, uri_list, display_name, startup_id, thunar_tpa_move_to_trash_reply, plugin);
   g_free (startup_id);
diff --git a/thunar/thunar-application.c b/thunar/thunar-application.c
index 7781884..28457c8 100644
--- a/thunar/thunar-application.c
+++ b/thunar/thunar-application.c
@@ -939,7 +939,7 @@ thunar_application_volman_idle (gpointer user_data)
           screen = xfce_gdk_screen_get_active (NULL);
 
           if (screen != NULL)
-            display = gdk_screen_make_display_name (screen);
+            display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
 
           /* try to spawn the volman on the active screen */
           if (g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD | G_SPAWN_SEARCH_PATH, thunar_setup_display_cb, display, &pid, &err))
diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index ea489ba..7fd6154 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -399,6 +399,7 @@ thunar_chooser_dialog_response (GtkDialog *widget,
   gchar               *name;
   gchar               *s;
   GList                list;
+  GdkScreen           *screen;
 
   /* no special processing for non-accept responses */
   if (G_UNLIKELY (response != GTK_RESPONSE_ACCEPT))
@@ -487,8 +488,9 @@ thunar_chooser_dialog_response (GtkDialog *widget,
   if (G_LIKELY (succeed && dialog->open))
     {
       /* create launch context */
-      context = gdk_app_launch_context_new ();
-      gdk_app_launch_context_set_screen (context, gtk_widget_get_screen (GTK_WIDGET (dialog)));
+      screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
+      context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
+      gdk_app_launch_context_set_screen (context, screen);
       gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
 
       /* create fake file list */
diff --git a/thunar/thunar-emblem-chooser.c b/thunar/thunar-emblem-chooser.c
index be61f09..4332c58 100644
--- a/thunar/thunar-emblem-chooser.c
+++ b/thunar/thunar-emblem-chooser.c
@@ -469,7 +469,7 @@ thunar_emblem_chooser_create_button (ThunarEmblemChooser *chooser,
 
   g_object_unref (G_OBJECT (icon));
 done:
-  gtk_icon_info_free (info);
+  g_object_unref (info);
   return button;
 }
 
diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c
index 530bd1a..1c6ec21 100644
--- a/thunar/thunar-file.c
+++ b/thunar/thunar-file.c
@@ -1830,7 +1830,7 @@ thunar_file_launch (ThunarFile  *file,
   path_list.next = path_list.prev = NULL;
 
   /* create a launch context */
-  context = gdk_app_launch_context_new ();
+  context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
   gdk_app_launch_context_set_screen (context, screen);
   gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
 
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index 28a3398..fd6bdc3 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -506,7 +506,7 @@ thunar_icon_factory_lookup_icon (ThunarIconFactory *factory,
               pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
 
               /* cleanup */
-              gtk_icon_info_free (icon_info);
+              g_object_unref (icon_info);
             }
         }
 
@@ -848,7 +848,7 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory  *factory,
                 {
                   /* try to load the pixbuf from the icon info */
                   icon = gtk_icon_info_load_icon (icon_info, NULL);
-                  gtk_icon_info_free (icon_info);
+                  g_object_unref (icon_info);
                 }
             }
           else if (G_IS_LOADABLE_ICON (gicon))
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index 8ad88d4..34928e0 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -655,7 +655,7 @@ thunar_launcher_open_paths (GAppInfo       *app_info,
   screen = (launcher->widget != NULL) ? gtk_widget_get_screen (launcher->widget) : NULL;
 
   /* create launch context */
-  context = gdk_app_launch_context_new ();
+  context = gdk_display_get_app_launch_context (gdk_screen_get_display (screen));
   gdk_app_launch_context_set_screen (context, screen);
   gdk_app_launch_context_set_timestamp (context, gtk_get_current_event_time ());
   gdk_app_launch_context_set_icon (context, g_app_info_get_icon (app_info));
diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c
index 0c5485e..9feb381 100644
--- a/thunar/thunar-preferences-dialog.c
+++ b/thunar/thunar-preferences-dialog.c
@@ -708,7 +708,7 @@ thunar_preferences_dialog_configure (ThunarPreferencesDialog *dialog)
   screen = gtk_widget_get_screen (GTK_WIDGET (dialog));
 
   if (screen != NULL)
-    display = gdk_screen_make_display_name (screen);
+    display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
 
   /* invoke the configuration interface of thunar-volman */
   if (!g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, thunar_setup_display_cb, display, NULL, &err))
diff --git a/thunar/thunar-session-client.c b/thunar/thunar-session-client.c
index 26d8d05..ff49b66 100644
--- a/thunar/thunar-session-client.c
+++ b/thunar/thunar-session-client.c
@@ -173,18 +173,7 @@ thunar_session_client_connect (ThunarSessionClient *session_client,
   /* tell GDK about our new session id */
   gdk_x11_set_sm_client_id (id);
 
-  /* remember the returned client id */
-  if (g_mem_is_system_malloc ())
-    {
-      /* just use the memory */
-      session_client->id = id;
-    }
-  else
-    {
-      /* use GLib memory management */
-      session_client->id = g_strdup (id);
-      free (id);
-    }
+  session_client->id = id;
 
   /* determine the session file path */
   spec = g_strconcat ("sessions/Thunar-", session_client->id, NULL);
diff --git a/thunar/thunar-shortcuts-icon-renderer.c b/thunar/thunar-shortcuts-icon-renderer.c
index 0b7b451..2fd839f 100644
--- a/thunar/thunar-shortcuts-icon-renderer.c
+++ b/thunar/thunar-shortcuts-icon-renderer.c
@@ -245,7 +245,7 @@ thunar_shortcuts_icon_renderer_render (GtkCellRenderer     *renderer,
       if (G_LIKELY (icon_info != NULL))
         {
           icon = gtk_icon_info_load_icon (icon_info, NULL);
-          gtk_icon_info_free (icon_info);
+          g_object_unref (icon_info);
         }
 
       /* render the icon (if any) */
diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c
index ca7086b..04e2a3d 100644
--- a/thunar/thunar-standard-view.c
+++ b/thunar/thunar-standard-view.c
@@ -3392,7 +3392,7 @@ thunar_standard_view_drag_data_received (GtkWidget          *view,
                       screen = gtk_widget_get_screen (GTK_WIDGET (view));
 
                       if (screen != NULL)
-                        display = gdk_screen_make_display_name (screen);
+                        display = g_strdup (gdk_display_get_name (gdk_screen_get_display (screen)));
 
                       /* try to run exo-desktop-item-edit */
                       succeed = g_spawn_async (working_directory, argv, NULL,
diff --git a/thunar/thunar-tree-view.c b/thunar/thunar-tree-view.c
index d666f56..694c028 100644
--- a/thunar/thunar-tree-view.c
+++ b/thunar/thunar-tree-view.c
@@ -2665,7 +2665,7 @@ thunar_tree_view_drag_scroll_timer (gpointer user_data)
       if (G_UNLIKELY (offset != 0))
         {
           /* determine the vertical adjustment */
-          vadjustment = gtk_tree_view_get_vadjustment (GTK_TREE_VIEW (view));
+          vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (view));
 
           /* determine the new value */
           value = CLAMP (gtk_adjustment_get_value (vadjustment) + 2 * offset, gtk_adjustment_get_lower (vadjustment), gtk_adjustment_get_upper (vadjustment) - gtk_adjustment_get_page_size (vadjustment));
diff --git a/thunar/thunar-window.c b/thunar/thunar-window.c
index f1950b4..8db402f 100644
--- a/thunar/thunar-window.c
+++ b/thunar/thunar-window.c
@@ -3456,9 +3456,9 @@ thunar_window_notify_loading (ThunarView   *view,
       /* setup the proper cursor */
       if (thunar_view_get_loading (view))
         {
-          cursor = gdk_cursor_new (GDK_WATCH);
+          cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (view)), GDK_WATCH);
           gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (window)), cursor);
-          gdk_cursor_unref (cursor);
+          g_object_unref (cursor);
         }
       else
         {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list