[nautilus: 14/16] application: handle open
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus: 14/16] application: handle open
- Date: Wed, 22 Apr 2015 18:58:11 +0000 (UTC)
commit 9f92f73e555c733bc7c5234a29b1ee58828aa9b1
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Apr 22 14:58:47 2015 +0200
application: handle open
When some application uses gtk_uri_open, it uses GApplication
open support to call applications which handle opening files.
To be allowed to do that, it's needed to override the open vfunc
of GApplication.
Since we did the change to parse our command line options on ourselves,
it's not longer a problem to use the open vfunc, since it's only
only used when called from dbus open.
src/nautilus-application.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index a0dfde3..8c4d4f6 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -477,6 +477,12 @@ nautilus_application_open_location (NautilusApplication *application,
nautilus_profile_end (NULL);
}
+/* Note: when launched from command line we do not reach this method
+ * since we manually handle the command line parameters in order to
+ * parse --no-default-window, etc.
+ * However this method is called when open() is called via dbus, for
+ * instance when gtk_uri_open () is called from outside.
+ */
static void
nautilus_application_open (GApplication *app,
GFile **files,
@@ -1195,6 +1201,7 @@ nautilus_application_class_init (NautilusApplicationClass *class)
application_class->quit_mainloop = nautilus_application_quit_mainloop;
application_class->dbus_register = nautilus_application_dbus_register;
application_class->dbus_unregister = nautilus_application_dbus_unregister;
+ application_class->open = nautilus_application_open;
gtkapp_class = GTK_APPLICATION_CLASS (class);
gtkapp_class->window_added = nautilus_application_window_added;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]