[nautilus/wip/csoriano/desktop-split: 1/53] application: add common startup code
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/csoriano/desktop-split: 1/53] application: add common startup code
- Date: Wed, 6 Apr 2016 09:04:40 +0000 (UTC)
commit e2cbade9a25863db34d7fda81f41486dae3d16be
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Mar 16 16:17:32 2016 +0100
application: add common startup code
So children of nautilus application can chain up to it.
We leave out the parts that children won't be interested in, like
the bus manager which only nautilus is owner.
So far is only used for the opened locations, so it's fine.
src/nautilus-application.c | 36 +++++++++++++++++++++++++++---------
src/nautilus-application.h | 1 +
2 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index f73b2a7..b313175 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1208,30 +1208,25 @@ on_application_shutdown (GApplication *application,
g_list_free (notification_ids);
}
-static void
-nautilus_application_startup (GApplication *app)
+void
+nautilus_application_startup_common (NautilusApplication *self)
{
- NautilusApplication *self = NAUTILUS_APPLICATION (app);
NautilusApplicationPrivate *priv;
nautilus_profile_start (NULL);
-
priv = nautilus_application_get_instance_private (self);
- g_application_set_resource_base_path (app, "/org/gnome/nautilus");
+ g_application_set_resource_base_path (G_APPLICATION (self), "/org/gnome/nautilus");
/* chain up to the GTK+ implementation early, so gtk_init()
* is called for us.
*/
- G_APPLICATION_CLASS (nautilus_application_parent_class)->startup (app);
+ G_APPLICATION_CLASS (nautilus_application_parent_class)->startup (G_APPLICATION (self));
gtk_window_set_default_icon_name ("system-file-manager");
setup_theme_extensions ();
- /* create DBus manager */
- priv->fdb_manager = nautilus_freedesktop_dbus_new ();
-
/* initialize preferences and create the global GSettings objects */
nautilus_global_preferences_init ();
@@ -1260,6 +1255,23 @@ nautilus_application_startup (GApplication *app)
nautilus_profile_end (NULL);
g_signal_connect (self, "shutdown", G_CALLBACK (on_application_shutdown), NULL);
+
+}
+
+static void
+nautilus_application_startup (GApplication *app)
+{
+ NautilusApplication *self = NAUTILUS_APPLICATION (app);
+ NautilusApplicationPrivate *priv;
+
+ nautilus_profile_start (NULL);
+ priv = nautilus_application_get_instance_private (self);
+
+ /* create DBus manager */
+ priv->fdb_manager = nautilus_freedesktop_dbus_new ();
+ nautilus_application_startup_common (self);
+
+ nautilus_profile_end (NULL);
}
static gboolean
@@ -1328,6 +1340,12 @@ update_dbus_opened_locations (NautilusApplication *self)
g_return_if_fail (NAUTILUS_IS_APPLICATION (self));
priv = nautilus_application_get_instance_private (self);
+
+ /* Children of nautilus application could not handle the dbus, so don't
+ * do anything in that case */
+ if (!priv->fdb_manager)
+ return;
+
for (l = priv->windows; l != NULL; l = l->next) {
window = l->data;
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 66c875d..43fb3c8 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -84,6 +84,7 @@ GtkWidget * nautilus_application_connect_server (NautilusApplication *applicatio
void nautilus_application_search (NautilusApplication *application,
const gchar *uri,
const gchar *text);
+void nautilus_application_startup_common (NautilusApplication *application);
G_END_DECLS
#endif /* __NAUTILUS_APPLICATION_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]