[Xfce4-commits] [xfce/thunar] 01/01: Do not register "send to" as last used app (Bug #14118)

noreply at xfce.org noreply at xfce.org
Tue Jul 16 20:41:15 CEST 2019


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       x   f   c   e   -   4   .   1   4   
   in repository xfce/thunar.

commit 06c0e3eb10dc72dcea072926d5fbbe9936cf5a3e
Author: Andre Miranda <andreldm at xfce.org>
Date:   Tue Jul 16 15:39:06 2019 -0300

    Do not register "send to" as last used app (Bug #14118)
    
    I know this code doesn't look elegant, but it was the best
    I could think of. Patches are welcome.
---
 thunar/thunar-gio-extensions.c | 7 +++++--
 thunar/thunar-launcher.c       | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c
index a3ce0da..28988b6 100644
--- a/thunar/thunar-gio-extensions.c
+++ b/thunar/thunar-gio-extensions.c
@@ -559,7 +559,7 @@ thunar_g_app_info_launch (GAppInfo          *info,
   gboolean      result = FALSE;
   gchar        *new_path = NULL;
   gchar        *old_path = NULL;
-  gboolean      update_app_info = TRUE;
+  gboolean      skip_app_info_update;
 
   _thunar_return_val_if_fail (G_IS_APP_INFO (info), FALSE);
   _thunar_return_val_if_fail (working_directory == NULL || G_IS_FILE (working_directory), FALSE);
@@ -567,6 +567,8 @@ thunar_g_app_info_launch (GAppInfo          *info,
   _thunar_return_val_if_fail (G_IS_APP_LAUNCH_CONTEXT (context), FALSE);
   _thunar_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
+  skip_app_info_update = (g_object_get_data (G_OBJECT (info), "skip-app-info-update") != NULL);
+
   /* check if we want to set the working directory of the spawned app */
   if (working_directory != NULL)
     {
@@ -590,11 +592,12 @@ thunar_g_app_info_launch (GAppInfo          *info,
     {
       for (lp = path_list; lp != NULL; lp = lp->next)
         {
+          gboolean update_app_info = !skip_app_info_update;
+
           file = thunar_file_get (lp->data, NULL);
           if (file == NULL)
             continue;
 
-          update_app_info = TRUE;
           content_type = thunar_file_get_content_type (file);
 
           /* determine default application */
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index b34b491..3f5b57a 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -1761,6 +1761,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
           /* allocate a new action for the device */
           action = gtk_action_new (name, device_name, tooltip, NULL);
           g_object_set_qdata_full (G_OBJECT (action), thunar_launcher_handler_quark, lp->data, g_object_unref);
+          g_object_set_data (G_OBJECT (lp->data), "skip-app-info-update", GUINT_TO_POINTER (1));
           g_signal_connect (G_OBJECT (action), "activate", G_CALLBACK (thunar_launcher_action_sendto_device), launcher);
           gtk_action_group_add_action (launcher->action_group, action);
           gtk_ui_manager_add_ui (launcher->ui_manager, launcher->ui_addons_merge_id,
@@ -1818,6 +1819,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
               action = gtk_action_new (name, label, tooltip, NULL);
               gtk_action_set_gicon (action, g_app_info_get_icon (lp->data));
               g_object_set_qdata_full (G_OBJECT (action), thunar_launcher_handler_quark, lp->data, g_object_unref);
+              g_object_set_data (G_OBJECT (lp->data), "skip-app-info-update", GUINT_TO_POINTER (1));
               g_signal_connect (G_OBJECT (action), "activate", G_CALLBACK (thunar_launcher_action_open), launcher);
               gtk_action_group_add_action (launcher->action_group, action);
               gtk_ui_manager_add_ui (launcher->ui_manager, launcher->ui_addons_merge_id,

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


More information about the Xfce4-commits mailing list