[Xfce4-commits] [xfce/thunar] 03/05: Remember chosen application in the chooser dialog as last used

noreply at xfce.org noreply at xfce.org
Tue May 12 20:52:19 CEST 2015


This is an automated email from the git hooks/post-receive script.

hjudt pushed a commit to branch master
in repository xfce/thunar.

commit 4fb5e8b12be02390e2c01e691c73a30a16e77ad6
Author: Harald Judt <h.judt at gmx.at>
Date:   Tue May 12 16:30:27 2015 +0200

    Remember chosen application in the chooser dialog as last used
    
    If the user does not set the application as default, do remember it as last
    used, making it appear first in the list of recommended applications.
---
 thunar/thunar-chooser-dialog.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/thunar/thunar-chooser-dialog.c b/thunar/thunar-chooser-dialog.c
index dd9914d..04e0316 100644
--- a/thunar/thunar-chooser-dialog.c
+++ b/thunar/thunar-chooser-dialog.c
@@ -456,12 +456,12 @@ thunar_chooser_dialog_response (GtkDialog *widget,
       /* remember the application as default for these kind of file */
       succeed = g_app_info_set_as_default_for_type (app_info, content_type, &error);
 
-      /* verify that we were successfull */
+      /* verify that we were successful */
       if (G_UNLIKELY (!succeed))
         {
           /* display an error to the user */
-          thunar_dialogs_show_error (GTK_WIDGET (dialog), 
-                                     error, 
+          thunar_dialogs_show_error (GTK_WIDGET (dialog),
+                                     error,
                                      _("Failed to set default application for \"%s\""),
                                      thunar_file_get_display_name (dialog->file));
 
@@ -473,6 +473,15 @@ thunar_chooser_dialog_response (GtkDialog *widget,
       if (G_LIKELY (succeed))
         thunar_file_changed (dialog->file);
     }
+  else
+    {
+      /* simply try to set the app as last used for this type (we do not show any errors here) */
+      if (g_app_info_set_as_last_used_for_type (app_info, content_type, NULL))
+        {
+          /* emit "changed" on the file if we successfully changed the default application */
+          thunar_file_changed (dialog->file);
+        }
+    }
 
   /* check if we should also execute the application */
   if (G_LIKELY (succeed && dialog->open))

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


More information about the Xfce4-commits mailing list