[Xfce4-commits] [xfce/thunar] 01/01: Keep "Open with" menu items updated (Bug #15530)

noreply at xfce.org noreply at xfce.org
Sat Jul 20 00:10:33 CEST 2019


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

a   l   e   x       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 0335f8942ecd33cfa118f5a88d9d995dbfb2d5e7
Author: Theo Linkspfeifer <lastonestanding at tutanota.com>
Date:   Wed Jun 12 23:11:26 2019 +0200

    Keep "Open with" menu items updated (Bug #15530)
---
 thunar/thunar-launcher.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index 3f5b57a..20789fe 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -33,6 +33,7 @@
 #include <thunar/thunar-browser.h>
 #include <thunar/thunar-chooser-dialog.h>
 #include <thunar/thunar-dialogs.h>
+#include <thunar/thunar-file-monitor.h>
 #include <thunar/thunar-gio-extensions.h>
 #include <thunar/thunar-gobject-extensions.h>
 #include <thunar/thunar-gtk-extensions.h>
@@ -154,6 +155,8 @@ struct _ThunarLauncher
   ThunarDeviceMonitor    *device_monitor;
   ThunarSendtoModel      *sendto_model;
   guint                   sendto_idle_id;
+
+  ThunarFileMonitor      *file_monitor;
 };
 
 struct _ThunarLauncherMountData
@@ -290,6 +293,10 @@ G_GNUC_END_IGNORE_DEPRECATIONS
   launcher->device_monitor = thunar_device_monitor_get ();
   g_signal_connect_swapped (launcher->device_monitor, "device-added", G_CALLBACK (thunar_launcher_update), launcher);
   g_signal_connect_swapped (launcher->device_monitor, "device-removed", G_CALLBACK (thunar_launcher_update), launcher);
+
+  /* update launcher actions when any monitored file changes */
+  launcher->file_monitor = thunar_file_monitor_get_default ();
+  g_signal_connect_swapped (launcher->file_monitor, "file-changed", G_CALLBACK (thunar_launcher_update), launcher);
 }
 
 
@@ -336,6 +343,10 @@ thunar_launcher_finalize (GObject *object)
   /* release the reference on the sendto model */
   g_object_unref (launcher->sendto_model);
 
+  /* disconnect from the file monitor */
+  g_signal_handlers_disconnect_by_func (launcher->file_monitor, thunar_launcher_update, launcher);
+  g_object_unref (launcher->file_monitor);
+
   (*G_OBJECT_CLASS (thunar_launcher_parent_class)->finalize) (object);
 }
 

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


More information about the Xfce4-commits mailing list