~ubuntu-desktop/unity-lens-files/ubuntu

« back to all changes in this revision

Viewing changes to src/main.c

  • Committer: Didier Roche
  • Date: 2011-08-11 08:52:55 UTC
  • mfrom: (14.4.24 upstream)
  • Revision ID: didier.roche@canonical.com-20110811085255-jiqd2j7uf549mj24
* New upstream release.
* Fix some conflicts in src/config.vala and src/daemon.vala after
  merge-upstream. Get it back to sane values (no home dir)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* main.c generated by valac 0.11.7, the Vala compiler
 
1
/* main.c generated by valac 0.12.1, the Vala compiler
2
2
 * generated from main.vala, do not modify */
3
3
 
4
4
/*
30
30
#include <gio/gdesktopappinfo.h>
31
31
 
32
32
 
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))
39
39
 
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)))
46
46
 
47
47
 
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;
52
 
 
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);
60
 
 
61
 
 
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;
 
52
 
 
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);
 
60
 
 
61
 
 
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;
77
77
        bus = _tmp0_;
78
78
        if (_inner_error_ != NULL) {
79
79
                if (_inner_error_->domain == G_IO_ERROR) {
80
 
                        goto __catch12_g_io_error;
 
80
                        goto __catch8_g_io_error;
81
81
                }
82
82
                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
83
83
                g_clear_error (&_inner_error_);
95
95
        if (_inner_error_ != NULL) {
96
96
                _g_object_unref0 (bus);
97
97
                if (_inner_error_->domain == G_IO_ERROR) {
98
 
                        goto __catch12_g_io_error;
 
98
                        goto __catch8_g_io_error;
99
99
                }
100
 
                goto __finally12;
 
100
                goto __finally8;
101
101
        }
102
102
        g_variant_get (_result_, "(b)", &has_owner, NULL);
103
103
        result = has_owner;
106
106
        return result;
107
107
        _g_variant_unref0 (_result_);
108
108
        _g_object_unref0 (bus);
109
 
        goto __finally12;
110
 
        __catch12_g_io_error:
 
109
        goto __finally8;
 
110
        __catch8_g_io_error:
111
111
        {
112
112
                GError * e;
113
113
                e = _inner_error_;
115
115
                g_warning ("main.vala:46: Unable to decide whether '%s' is running: %s", name, e->message);
116
116
                _g_error_free0 (e);
117
117
        }
118
 
        __finally12:
 
118
        __finally8:
119
119
        if (_inner_error_ != NULL) {
120
120
                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);
121
121
                g_clear_error (&_inner_error_);
126
126
}
127
127
 
128
128
 
129
 
gint unity_files_place_main (gchar** args, int args_length1) {
 
129
gint unity_files_lens_main (gchar** args, int args_length1) {
130
130
        gint result = 0;
131
131
        gboolean _tmp0_;
132
 
        UnityFilesPlaceDaemon* _tmp1_ = NULL;
 
132
        UnityFilesLensDaemon* _tmp1_ = NULL;
133
133
        GApplication* _tmp2_ = NULL;
134
134
        gboolean _tmp3_;
135
135
        gint _tmp4_;
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");
143
143
        if (_tmp0_) {
144
144
                g_print ("%s", "Another instance of the Unity Files Daemon " "already appears to be running.\nBailing out.\n");
145
145
                result = 2;
146
146
                return result;
147
147
        }
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;
157
157
        }
158
 
        goto __finally13;
159
 
        __catch13_g_error:
 
158
        goto __finally9;
 
159
        __catch9_g_error:
160
160
        {
161
161
                GError * e;
162
162
                e = _inner_error_;
166
166
                _g_error_free0 (e);
167
167
                return result;
168
168
        }
169
 
        __finally13:
 
169
        __finally9:
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_);
173
173
                return 0;
174
174
        }
175
 
        _tmp3_ = g_application_get_is_remote (unity_files_place_app);
 
175
        _tmp3_ = g_application_get_is_remote (unity_files_lens_app);
176
176
        if (_tmp3_) {
177
177
                g_print ("%s", "Another instance of the Unity Files Daemon " "already appears to be running.\nBailing out.\n");
178
178
                result = 2;
179
179
                return result;
180
180
        }
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);
183
183
        result = _tmp4_;
184
184
        return result;
185
185
}
187
187
 
188
188
int main (int argc, char ** argv) {
189
189
        g_type_init ();
190
 
        return unity_files_place_main (argv, argc);
 
190
        return unity_files_lens_main (argv, argc);
191
191
}
192
192
 
193
193