30
30
#include <gio/gdesktopappinfo.h>
33
#define UNITY_FILES_PLACE_TYPE_DAEMON (unity_files_place_daemon_get_type ())
34
#define UNITY_FILES_PLACE_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_FILES_PLACE_TYPE_DAEMON, UnityFilesPlaceDaemon))
35
#define UNITY_FILES_PLACE_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_FILES_PLACE_TYPE_DAEMON, UnityFilesPlaceDaemonClass))
36
#define UNITY_FILES_PLACE_IS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_FILES_PLACE_TYPE_DAEMON))
37
#define UNITY_FILES_PLACE_IS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_FILES_PLACE_TYPE_DAEMON))
38
#define UNITY_FILES_PLACE_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_FILES_PLACE_TYPE_DAEMON, UnityFilesPlaceDaemonClass))
33
#define UNITY_FILES_LENS_TYPE_DAEMON (unity_files_lens_daemon_get_type ())
34
#define UNITY_FILES_LENS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_FILES_LENS_TYPE_DAEMON, UnityFilesLensDaemon))
35
#define UNITY_FILES_LENS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_FILES_LENS_TYPE_DAEMON, UnityFilesLensDaemonClass))
36
#define UNITY_FILES_LENS_IS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_FILES_LENS_TYPE_DAEMON))
37
#define UNITY_FILES_LENS_IS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_FILES_LENS_TYPE_DAEMON))
38
#define UNITY_FILES_LENS_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_FILES_LENS_TYPE_DAEMON, UnityFilesLensDaemonClass))
40
typedef struct _UnityFilesPlaceDaemon UnityFilesPlaceDaemon;
41
typedef struct _UnityFilesPlaceDaemonClass UnityFilesPlaceDaemonClass;
40
typedef struct _UnityFilesLensDaemon UnityFilesLensDaemon;
41
typedef struct _UnityFilesLensDaemonClass UnityFilesLensDaemonClass;
42
42
#define _g_variant_type_free0(var) ((var == NULL) ? NULL : (var = (g_variant_type_free (var), NULL)))
43
43
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
44
44
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
45
45
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
48
extern GApplication* unity_files_place_app;
49
GApplication* unity_files_place_app = NULL;
50
extern UnityFilesPlaceDaemon* unity_files_place_daemon;
51
UnityFilesPlaceDaemon* unity_files_place_daemon = NULL;
53
GType unity_files_place_daemon_get_type (void) G_GNUC_CONST;
54
gboolean unity_files_place_dbus_name_has_owner (const gchar* name);
55
gint unity_files_place_main (gchar** args, int args_length1);
56
#define CONFIG_PACKAGE "unity-place-files"
57
#define CONFIG_LOCALEDIR "/usr/share/locale"
58
UnityFilesPlaceDaemon* unity_files_place_daemon_new (void);
59
UnityFilesPlaceDaemon* unity_files_place_daemon_construct (GType object_type);
62
gboolean unity_files_place_dbus_name_has_owner (const gchar* name) {
48
extern GApplication* unity_files_lens_app;
49
GApplication* unity_files_lens_app = NULL;
50
extern UnityFilesLensDaemon* unity_files_lens_daemon;
51
UnityFilesLensDaemon* unity_files_lens_daemon = NULL;
53
GType unity_files_lens_daemon_get_type (void) G_GNUC_CONST;
54
gboolean unity_files_lens_dbus_name_has_owner (const gchar* name);
55
gint unity_files_lens_main (gchar** args, int args_length1);
56
#define CONFIG_PACKAGE "unity-lens-files"
57
#define CONFIG_LOCALEDIR "/home/njpatel/build/share/locale"
58
UnityFilesLensDaemon* unity_files_lens_daemon_new (void);
59
UnityFilesLensDaemon* unity_files_lens_daemon_construct (GType object_type);
62
gboolean unity_files_lens_dbus_name_has_owner (const gchar* name) {
63
63
gboolean result = FALSE;
64
64
gboolean has_owner = FALSE;
65
65
GDBusConnection* _tmp0_ = NULL;
139
139
bind_textdomain_codeset (CONFIG_PACKAGE, "UTF-8");
140
140
setlocale (LC_ALL, "");
141
141
g_desktop_app_info_set_desktop_env ("GNOME");
142
_tmp0_ = unity_files_place_dbus_name_has_owner ("com.canonical.Unity.FilesPlace");
142
_tmp0_ = unity_files_lens_dbus_name_has_owner ("com.canonical.Unity.Lens.Files");
144
144
g_print ("%s", "Another instance of the Unity Files Daemon " "already appears to be running.\nBailing out.\n");
148
_tmp1_ = unity_files_place_daemon_new ();
149
_g_object_unref0 (unity_files_place_daemon);
150
unity_files_place_daemon = _tmp1_;
151
_tmp2_ = g_application_new ("com.canonical.Unity.FilesPlace", G_APPLICATION_IS_SERVICE);
152
_g_object_unref0 (unity_files_place_app);
153
unity_files_place_app = _tmp2_;
154
g_application_register (unity_files_place_app, NULL, &_inner_error_);
148
_tmp1_ = unity_files_lens_daemon_new ();
149
_g_object_unref0 (unity_files_lens_daemon);
150
unity_files_lens_daemon = _tmp1_;
151
_tmp2_ = g_application_new ("com.canonical.Unity.Lens.Files", G_APPLICATION_IS_SERVICE);
152
_g_object_unref0 (unity_files_lens_app);
153
unity_files_lens_app = _tmp2_;
154
g_application_register (unity_files_lens_app, NULL, &_inner_error_);
155
155
if (_inner_error_ != NULL) {
156
goto __catch13_g_error;
156
goto __catch9_g_error;
162
162
e = _inner_error_;
166
166
_g_error_free0 (e);
170
170
if (_inner_error_ != NULL) {
171
171
g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
172
172
g_clear_error (&_inner_error_);
175
_tmp3_ = g_application_get_is_remote (unity_files_place_app);
175
_tmp3_ = g_application_get_is_remote (unity_files_lens_app);
177
177
g_print ("%s", "Another instance of the Unity Files Daemon " "already appears to be running.\nBailing out.\n");
181
g_application_hold (unity_files_place_app);
182
_tmp4_ = g_application_run (unity_files_place_app, 0, NULL);
181
g_application_hold (unity_files_lens_app);
182
_tmp4_ = g_application_run (unity_files_lens_app, 0, NULL);