[gnome-builder/wip/open-file] application: fix dbus service activate and opening files in remote instance
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/open-file] application: fix dbus service activate and opening files in remote instance
- Date: Wed, 24 Sep 2014 00:25:55 +0000 (UTC)
commit e473678c1e9e7f02aa2d0d8e104a5b5cf95b41ef
Author: Christian Hergert <christian hergert me>
Date: Tue Sep 23 17:25:46 2014 -0700
application: fix dbus service activate and opening files in remote instance
configure.ac | 7 ++++++-
data/.gitignore | 1 +
data/data.mk | 6 ++++++
data/org.gnome.Builder.desktop | 2 +-
data/org.gnome.Builder.service.in | 3 +++
src/app/gb-application.c | 6 ------
src/main.c | 11 +++++++----
7 files changed, 24 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f9cdb22..3baa5a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -31,7 +31,12 @@ GTK_DOC_CHECK
])
# Define our known config files.
-AC_CONFIG_FILES([Makefile data/icons/Makefile tests/Makefile])
+AC_CONFIG_FILES([
+ Makefile
+ data/icons/Makefile
+ data/org.gnome.Builder.service
+ tests/Makefile
+])
# Last change to configure things and write configuration files.
m4_include([build/autotools/autoconf.d/pre-output.m4])
diff --git a/data/.gitignore b/data/.gitignore
new file mode 100644
index 0000000..6636915
--- /dev/null
+++ b/data/.gitignore
@@ -0,0 +1 @@
+org.gnome.Builder.service
diff --git a/data/data.mk b/data/data.mk
index 8542ed2..9f0848b 100644
--- a/data/data.mk
+++ b/data/data.mk
@@ -4,3 +4,9 @@ data_desktopdir = $(datadir)/applications
data_desktop_DATA = data/org.gnome.Builder.desktop
EXTRA_DIST += $(data_desktop_DATA)
+# D-Bus service file.
+servicedir = $(datadir)/dbus-1/services
+service_in_files = data/org.gnome.Builder.service.in
+service_DATA = $(service_in_files:.service.in=.service)
+EXTRA_DIST += $(service_in_files)
+CLEANFILES += $(service_DATA)
diff --git a/data/org.gnome.Builder.desktop b/data/org.gnome.Builder.desktop
index a4627f6..4b33954 100644
--- a/data/org.gnome.Builder.desktop
+++ b/data/org.gnome.Builder.desktop
@@ -3,7 +3,7 @@ Name=Builder
Comment=Build software for GNOME
Exec=gnome-builder
Icon=builder
-DBusActivatable=false
+DBusActivatable=true
StartupNotify=true
Terminal=false
Type=Application
diff --git a/data/org.gnome.Builder.service.in b/data/org.gnome.Builder.service.in
new file mode 100644
index 0000000..a55bed4
--- /dev/null
+++ b/data/org.gnome.Builder.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.gnome.Builder
+Exec= bindir@/gnome-builder --gapplication-service
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 876738c..1fe21f8 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -370,11 +370,5 @@ static void
gb_application_init (GbApplication *application)
{
ENTRY;
-
- g_application_set_application_id (G_APPLICATION (application),
- "org.gnome.Builder");
- g_application_set_flags (G_APPLICATION (application),
- G_APPLICATION_HANDLES_OPEN);
-
EXIT;
}
diff --git a/src/main.c b/src/main.c
index b2d1d14..3a43423 100644
--- a/src/main.c
+++ b/src/main.c
@@ -27,7 +27,7 @@ int
main (int argc,
char *argv[])
{
- GbApplication *app;
+ GApplication *app;
int ret;
g_set_prgname ("gnome-builder");
@@ -35,9 +35,12 @@ main (int argc,
gb_log_init (TRUE, NULL);
- app = gb_application_new ();
- g_application_set_default (G_APPLICATION (app));
- ret = g_application_run (G_APPLICATION (app), argc, argv);
+ app = g_object_new (GB_TYPE_APPLICATION,
+ "application-id", "org.gnome.Builder",
+ "flags", G_APPLICATION_HANDLES_OPEN,
+ NULL);
+ g_application_set_default (app);
+ ret = g_application_run (app, argc, argv);
g_clear_object (&app);
gb_log_shutdown ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]