Location | Tool | Test ID | Function | Issue |
---|---|---|---|---|
tracker-status.c:472:25 | gcc | unused-but-set-variable | tracker_status_wait_finish | variable '_data_' set but not used |
tracker-status.c:480:2 | clang-analyzer | Value stored to '_data_' is never read | ||
tracker-status.c:758:10 | gcc | unused-variable | _dbus_tracker_status_get_progress | unused variable 'error' |
tracker-status.c:778:10 | gcc | unused-variable | _dbus_tracker_status_get_status | unused variable 'error' |
tracker-status.c:846:11 | gcc | unused-but-set-variable | tracker_status_dbus_interface_get_property | variable 'object' set but not used |
tracker-status.c:848:2 | clang-analyzer | Value stored to 'object' is never read | ||
tracker-status.c:855:11 | gcc | unused-but-set-variable | tracker_status_dbus_interface_set_property | variable 'object' set but not used |
tracker-status.c:857:2 | clang-analyzer | Value stored to 'object' is never read |
1 /* tracker-status.c generated by valac 0.18.1, the Vala compiler
2 * generated from tracker-status.vala, do not modify */
3
4 /*
5 * Copyright (C) 2008-2011, Nokia <ivan.frade@nokia.com>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 *
22 * Authors:
23 * Philip Van Hoof <philip@codeminded.be>
24 */
25
26 #include <glib.h>
27 #include <glib-object.h>
28 #include <gio/gio.h>
29 #include <float.h>
30 #include <math.h>
31 #include <stdlib.h>
32 #include <string.h>
33 #include "libtracker-data/tracker-data-update.h"
34
35
36 #define TRACKER_TYPE_STATUS (tracker_status_get_type ())
37 #define TRACKER_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_TYPE_STATUS, TrackerStatus))
38 #define TRACKER_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_TYPE_STATUS, TrackerStatusClass))
39 #define TRACKER_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_TYPE_STATUS))
40 #define TRACKER_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_TYPE_STATUS))
41 #define TRACKER_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_TYPE_STATUS, TrackerStatusClass))
42
43 typedef struct _TrackerStatus TrackerStatus;
44 typedef struct _TrackerStatusClass TrackerStatusClass;
45 typedef struct _TrackerStatusPrivate TrackerStatusPrivate;
46
47 #define TRACKER_STATUS_TYPE_WAIT_CONTEXT (tracker_status_wait_context_get_type ())
48 #define TRACKER_STATUS_WAIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TRACKER_STATUS_TYPE_WAIT_CONTEXT, TrackerStatusWaitContext))
49 #define TRACKER_STATUS_WAIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TRACKER_STATUS_TYPE_WAIT_CONTEXT, TrackerStatusWaitContextClass))
50 #define TRACKER_STATUS_IS_WAIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TRACKER_STATUS_TYPE_WAIT_CONTEXT))
51 #define TRACKER_STATUS_IS_WAIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TRACKER_STATUS_TYPE_WAIT_CONTEXT))
52 #define TRACKER_STATUS_WAIT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TRACKER_STATUS_TYPE_WAIT_CONTEXT, TrackerStatusWaitContextClass))
53
54 typedef struct _TrackerStatusWaitContext TrackerStatusWaitContext;
55 typedef struct _TrackerStatusWaitContextClass TrackerStatusWaitContextClass;
56 #define _g_free0(var) (var = (g_free (var), NULL))
57 #define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
58 typedef struct _TrackerStatusWaitContextPrivate TrackerStatusWaitContextPrivate;
59 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
60 typedef struct _TrackerStatusWaitData TrackerStatusWaitData;
61
62 struct _TrackerStatus {
63 GObject parent_instance;
64 TrackerStatusPrivate * priv;
65 };
66
67 struct _TrackerStatusClass {
68 GObjectClass parent_class;
69 };
70
71 struct _TrackerStatusPrivate {
72 gdouble _progress;
73 gchar* status;
74 guint timer_id;
75 GList* wait_list;
76 };
77
78 struct _TrackerStatusWaitContext {
79 GObject parent_instance;
80 TrackerStatusWaitContextPrivate * priv;
81 GSourceFunc callback;
82 gpointer callback_target;
83 GDestroyNotify callback_target_destroy_notify;
84 };
85
86 struct _TrackerStatusWaitContextClass {
87 GObjectClass parent_class;
88 };
89
90 struct _TrackerStatusWaitData {
91 int _state_;
92 GObject* _source_object_;
93 GAsyncResult* _res_;
94 GSimpleAsyncResult* _async_result;
95 TrackerStatus* self;
96 gdouble _tmp0_;
97 TrackerStatusWaitContext* _tmp1_;
98 TrackerStatusWaitContext* context;
99 TrackerStatusWaitContext* _tmp2_;
100 TrackerStatusWaitContext* _tmp3_;
101 TrackerStatusWaitContext* _tmp4_;
102 };
103
104
105 static gpointer tracker_status_parent_class = NULL;
106 static gboolean tracker_status_first_time;
107 static gboolean tracker_status_first_time = TRUE;
108 static gpointer tracker_status_wait_context_parent_class = NULL;
109
110 GType tracker_status_get_type (void) G_GNUC_CONST;
111 guint tracker_status_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
112 static GType tracker_status_wait_context_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
113 #define TRACKER_STATUS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_STATUS, TrackerStatusPrivate))
114 enum {
115 TRACKER_STATUS_DUMMY_PROPERTY
116 };
117 static void _g_object_unref0_ (gpointer var);
118 static void _g_list_free__g_object_unref0_ (GList* self);
119 #define TRACKER_STATUS_PATH "/org/freedesktop/Tracker1/Status"
120 #define TRACKER_STATUS_PROGRESS_TIMEOUT_S 5
121 static gboolean tracker_status_busy_notification_timeout (TrackerStatus* self);
122 static void tracker_status_callback (TrackerStatus* self, const gchar* status, gdouble progress);
123 static gboolean _tracker_status_busy_notification_timeout_gsource_func (gpointer self);
124 TrackerBusyCallback tracker_status_get_callback (TrackerStatus* self, void** result_target, GDestroyNotify* result_target_destroy_notify);
125 static void _tracker_status_callback_tracker_busy_callback (const gchar* status, gdouble progress, gpointer self);
126 gdouble tracker_status_get_progress (TrackerStatus* self);
127 gchar* tracker_status_get_status (TrackerStatus* self);
128 static void tracker_status_wait_data_free (gpointer _data);
129 void tracker_status_wait (TrackerStatus* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
130 void tracker_status_wait_finish (TrackerStatus* self, GAsyncResult* _res_, GError** error);
131 static gboolean tracker_status_wait_co (TrackerStatusWaitData* _data_);
132 static TrackerStatusWaitContext* tracker_status_wait_context_new (void);
133 static TrackerStatusWaitContext* tracker_status_wait_context_construct (GType object_type);
134 static gboolean _tracker_status_wait_co_gsource_func (gpointer self);
135 TrackerStatus* tracker_status_new (void);
136 TrackerStatus* tracker_status_construct (GType object_type);
137 static void g_cclosure_user_marshal_VOID__STRING_DOUBLE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data);
138 enum {
139 TRACKER_STATUS_WAIT_CONTEXT_DUMMY_PROPERTY
140 };
141 static void tracker_status_wait_context_finalize (GObject* obj);
142 static void tracker_status_finalize (GObject* obj);
143 static void _dbus_tracker_status_get_progress (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation);
144 static void _dbus_tracker_status_get_status (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation);
145 static void _dbus_tracker_status_wait (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation);
146 static void _dbus_tracker_status_wait_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_);
147 static void tracker_status_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data);
148 static GVariant* tracker_status_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data);
149 static gboolean tracker_status_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data);
150 static void _dbus_tracker_status_progress (GObject* _sender, const gchar* status, gdouble progres, gpointer* _data);
151 static void _tracker_status_unregister_object (gpointer user_data);
152
153 static const GDBusArgInfo _tracker_status_dbus_arg_info_get_progress_result = {-1, "result", "d"};
154 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_get_progress_in[] = {NULL};
155 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_get_progress_out[] = {&_tracker_status_dbus_arg_info_get_progress_result, NULL};
156 static const GDBusMethodInfo _tracker_status_dbus_method_info_get_progress = {-1, "GetProgress", (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_get_progress_in), (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_get_progress_out)};
157 static const GDBusArgInfo _tracker_status_dbus_arg_info_get_status_result = {-1, "result", "s"};
158 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_get_status_in[] = {NULL};
159 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_get_status_out[] = {&_tracker_status_dbus_arg_info_get_status_result, NULL};
160 static const GDBusMethodInfo _tracker_status_dbus_method_info_get_status = {-1, "GetStatus", (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_get_status_in), (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_get_status_out)};
161 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_wait_in[] = {NULL};
162 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_wait_out[] = {NULL};
163 static const GDBusMethodInfo _tracker_status_dbus_method_info_wait = {-1, "Wait", (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_wait_in), (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_wait_out)};
164 static const GDBusMethodInfo * const _tracker_status_dbus_method_info[] = {&_tracker_status_dbus_method_info_get_progress, &_tracker_status_dbus_method_info_get_status, &_tracker_status_dbus_method_info_wait, NULL};
165 static const GDBusArgInfo _tracker_status_dbus_arg_info_progress_status = {-1, "status", "s"};
166 static const GDBusArgInfo _tracker_status_dbus_arg_info_progress_progres = {-1, "progres", "d"};
167 static const GDBusArgInfo * const _tracker_status_dbus_arg_info_progress[] = {&_tracker_status_dbus_arg_info_progress_status, &_tracker_status_dbus_arg_info_progress_progres, NULL};
168 static const GDBusSignalInfo _tracker_status_dbus_signal_info_progress = {-1, "Progress", (GDBusArgInfo **) (&_tracker_status_dbus_arg_info_progress)};
169 static const GDBusSignalInfo * const _tracker_status_dbus_signal_info[] = {&_tracker_status_dbus_signal_info_progress, NULL};
170 static const GDBusPropertyInfo * const _tracker_status_dbus_property_info[] = {NULL};
171 static const GDBusInterfaceInfo _tracker_status_dbus_interface_info = {-1, "org.freedesktop.Tracker1.Status", (GDBusMethodInfo **) (&_tracker_status_dbus_method_info), (GDBusSignalInfo **) (&_tracker_status_dbus_signal_info), (GDBusPropertyInfo **) (&_tracker_status_dbus_property_info)};
172 static const GDBusInterfaceVTable _tracker_status_dbus_interface_vtable = {tracker_status_dbus_interface_method_call, tracker_status_dbus_interface_get_property, tracker_status_dbus_interface_set_property};
173
174 static void _g_object_unref0_ (gpointer var) {
175 #line 36 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
176 (var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
177 #line 178 "tracker-status.c"
178 }
179
180
181 static void _g_list_free__g_object_unref0_ (GList* self) {
182 #line 36 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
183 g_list_foreach (self, (GFunc) _g_object_unref0_, NULL);
184 #line 36 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
185 g_list_free (self);
186 #line 187 "tracker-status.c"
187 }
188
189
190 static gboolean tracker_status_busy_notification_timeout (TrackerStatus* self) {
191 gboolean result = FALSE;
192 const gchar* _tmp0_;
193 gdouble _tmp1_;
194 #line 57 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
195 g_return_val_if_fail (self != NULL, FALSE);
196 #line 59 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
197 _tmp0_ = self->priv->status;
198 #line 59 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
199 _tmp1_ = self->priv->_progress;
200 #line 59 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
201 g_signal_emit_by_name (self, "progress", _tmp0_, _tmp1_);
202 #line 61 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
203 self->priv->timer_id = (guint) 0;
204 #line 63 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
205 result = FALSE;
206 #line 63 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
207 return result;
208 #line 209 "tracker-status.c"
209 }
210
211
212 static gpointer _g_object_ref0 (gpointer self) {
213 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
214 return self ? g_object_ref (self) : NULL;
215 #line 216 "tracker-status.c"
216 }
217
218
219 static gboolean _tracker_status_busy_notification_timeout_gsource_func (gpointer self) {
220 gboolean result;
221 result = tracker_status_busy_notification_timeout (self);
222 #line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
223 return result;
224 #line 225 "tracker-status.c"
225 }
226
227
228 static void tracker_status_callback (TrackerStatus* self, const gchar* status, gdouble progress) {
229 gdouble _tmp0_;
230 gboolean _tmp1_ = FALSE;
231 gdouble _tmp2_;
232 gboolean _tmp4_;
233 const gchar* _tmp9_;
234 const gchar* _tmp10_;
235 guint _tmp13_;
236 #line 68 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
237 g_return_if_fail (self != NULL);
238 #line 68 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
239 g_return_if_fail (status != NULL);
240 #line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
241 _tmp0_ = progress;
242 #line 69 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
243 self->priv->_progress = _tmp0_;
244 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
245 _tmp2_ = progress;
246 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
247 if (_tmp2_ == ((gdouble) 1)) {
248 #line 249 "tracker-status.c"
249 GList* _tmp3_;
250 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
251 _tmp3_ = self->priv->wait_list;
252 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
253 _tmp1_ = _tmp3_ != NULL;
254 #line 255 "tracker-status.c"
255 } else {
256 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
257 _tmp1_ = FALSE;
258 #line 259 "tracker-status.c"
259 }
260 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
261 _tmp4_ = _tmp1_;
262 #line 71 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
263 if (_tmp4_) {
264 #line 265 "tracker-status.c"
265 GList* _tmp5_;
266 #line 74 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
267 self->priv->wait_list = g_list_reverse (self->priv->wait_list);
268 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
269 _tmp5_ = self->priv->wait_list;
270 #line 271 "tracker-status.c"
271 {
272 GList* context_collection = NULL;
273 GList* context_it = NULL;
274 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
275 context_collection = _tmp5_;
276 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
277 for (context_it = context_collection; context_it != NULL; context_it = context_it->next) {
278 #line 279 "tracker-status.c"
279 TrackerStatusWaitContext* _tmp6_;
280 TrackerStatusWaitContext* context = NULL;
281 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
282 _tmp6_ = _g_object_ref0 ((TrackerStatusWaitContext*) context_it->data);
283 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
284 context = _tmp6_;
285 #line 286 "tracker-status.c"
286 {
287 TrackerStatusWaitContext* _tmp7_;
288 GSourceFunc _tmp8_;
289 void* _tmp8__target;
290 #line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
291 _tmp7_ = context;
292 #line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
293 _tmp8_ = _tmp7_->callback;
294 #line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
295 _tmp8__target = _tmp7_->callback_target;
296 #line 76 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
297 _tmp8_ (_tmp8__target);
298 #line 75 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
299 _g_object_unref0 (context);
300 #line 301 "tracker-status.c"
301 }
302 }
303 }
304 #line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
305 __g_list_free__g_object_unref0_0 (self->priv->wait_list);
306 #line 79 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
307 self->priv->wait_list = NULL;
308 #line 309 "tracker-status.c"
309 }
310 #line 82 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
311 _tmp9_ = status;
312 #line 82 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
313 _tmp10_ = self->priv->status;
314 #line 82 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
315 if (g_strcmp0 (_tmp9_, _tmp10_) != 0) {
316 #line 317 "tracker-status.c"
317 const gchar* _tmp11_;
318 gchar* _tmp12_;
319 #line 83 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
320 _tmp11_ = status;
321 #line 83 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
322 _tmp12_ = g_strdup (_tmp11_);
323 #line 83 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
324 _g_free0 (self->priv->status);
325 #line 83 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
326 self->priv->status = _tmp12_;
327 #line 328 "tracker-status.c"
328 }
329 #line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
330 _tmp13_ = self->priv->timer_id;
331 #line 86 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
332 if (_tmp13_ == ((guint) 0)) {
333 #line 334 "tracker-status.c"
334 gboolean _tmp14_;
335 #line 87 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
336 _tmp14_ = tracker_status_first_time;
337 #line 87 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
338 if (_tmp14_) {
339 #line 340 "tracker-status.c"
340 guint _tmp15_ = 0U;
341 #line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
342 _tmp15_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _tracker_status_busy_notification_timeout_gsource_func, g_object_ref (self), g_object_unref);
343 #line 88 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
344 self->priv->timer_id = _tmp15_;
345 #line 89 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
346 tracker_status_first_time = FALSE;
347 #line 348 "tracker-status.c"
348 } else {
349 guint _tmp16_ = 0U;
350 #line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
351 _tmp16_ = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) TRACKER_STATUS_PROGRESS_TIMEOUT_S, _tracker_status_busy_notification_timeout_gsource_func, g_object_ref (self), g_object_unref);
352 #line 91 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
353 self->priv->timer_id = _tmp16_;
354 #line 355 "tracker-status.c"
355 }
356 }
357 #line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
358 while (TRUE) {
359 #line 360 "tracker-status.c"
360 GMainContext* _tmp17_ = NULL;
361 gboolean _tmp18_ = FALSE;
362 #line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
363 _tmp17_ = g_main_context_default ();
364 #line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
365 _tmp18_ = g_main_context_iteration (_tmp17_, FALSE);
366 #line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
367 if (!_tmp18_) {
368 #line 95 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
369 break;
370 #line 371 "tracker-status.c"
371 }
372 }
373 }
374
375
376 static void _tracker_status_callback_tracker_busy_callback (const gchar* status, gdouble progress, gpointer self) {
377 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
378 tracker_status_callback (self, status, progress);
379 #line 380 "tracker-status.c"
380 }
381
382
383 TrackerBusyCallback tracker_status_get_callback (TrackerStatus* self, void** result_target, GDestroyNotify* result_target_destroy_notify) {
384 TrackerBusyCallback result = NULL;
385 TrackerBusyCallback _tmp0_;
386 void* _tmp0__target;
387 GDestroyNotify _tmp0__target_destroy_notify;
388 #line 100 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
389 g_return_val_if_fail (self != NULL, NULL);
390 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
391 _tmp0_ = _tracker_status_callback_tracker_busy_callback;
392 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
393 _tmp0__target = g_object_ref (self);
394 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
395 _tmp0__target_destroy_notify = g_object_unref;
396 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
397 *result_target = _tmp0__target;
398 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
399 *result_target_destroy_notify = _tmp0__target_destroy_notify;
400 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
401 result = _tmp0_;
402 #line 101 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
403 return result;
404 #line 405 "tracker-status.c"
405 }
406
407
408 gdouble tracker_status_get_progress (TrackerStatus* self) {
409 gdouble result = 0.0;
410 gdouble _tmp0_;
411 #line 104 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
412 g_return_val_if_fail (self != NULL, 0.0);
413 #line 105 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
414 _tmp0_ = self->priv->_progress;
415 #line 105 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
416 result = _tmp0_;
417 #line 105 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
418 return result;
419 #line 420 "tracker-status.c"
420 }
421
422
423 gchar* tracker_status_get_status (TrackerStatus* self) {
424 gchar* result = NULL;
425 const gchar* _tmp0_;
426 gchar* _tmp1_;
427 #line 108 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
428 g_return_val_if_fail (self != NULL, NULL);
429 #line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
430 _tmp0_ = self->priv->status;
431 #line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
432 _tmp1_ = g_strdup (_tmp0_);
433 #line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
434 result = _tmp1_;
435 #line 109 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
436 return result;
437 #line 438 "tracker-status.c"
438 }
439
440
441 static void tracker_status_wait_data_free (gpointer _data) {
442 TrackerStatusWaitData* _data_;
443 _data_ = _data;
444 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
445 _g_object_unref0 (_data_->self);
446 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
447 g_slice_free (TrackerStatusWaitData, _data_);
448 #line 449 "tracker-status.c"
449 }
450
451
452 void tracker_status_wait (TrackerStatus* self, GAsyncReadyCallback _callback_, gpointer _user_data_) {
453 TrackerStatusWaitData* _data_;
454 TrackerStatus* _tmp0_;
455 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
456 _data_ = g_slice_new0 (TrackerStatusWaitData);
457 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
458 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, tracker_status_wait);
459 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
460 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, tracker_status_wait_data_free);
461 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
462 _tmp0_ = _g_object_ref0 (self);
463 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
464 _data_->self = _tmp0_;
465 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
466 tracker_status_wait_co (_data_);
467 #line 468 "tracker-status.c"
468 }
469
470
471 void tracker_status_wait_finish (TrackerStatus* self, GAsyncResult* _res_, GError** error) {
472 TrackerStatusWaitData* _data_;
(emitted by gcc) 473 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
474 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
475 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
476 return;
477 #line 478 "tracker-status.c"
478 }
479 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
480 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
481 #line 482 "tracker-status.c"
482 }
483
484
485 static gboolean _tracker_status_wait_co_gsource_func (gpointer self) {
486 gboolean result;
487 result = tracker_status_wait_co (self);
488 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
489 return result;
490 #line 491 "tracker-status.c"
491 }
492
493
494 static gboolean tracker_status_wait_co (TrackerStatusWaitData* _data_) {
495 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
496 switch (_data_->_state_) {
497 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
498 case 0:
499 #line 500 "tracker-status.c"
500 goto _state_0;
501 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
502 case 1:
503 #line 504 "tracker-status.c"
504 goto _state_1;
505 default:
506 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
507 g_assert_not_reached ();
508 #line 509 "tracker-status.c"
509 }
510 _state_0:
511 #line 113 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
512 _data_->_tmp0_ = _data_->self->priv->_progress;
513 #line 113 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
514 if (_data_->_tmp0_ == ((gdouble) 1)) {
515 #line 516 "tracker-status.c"
516 } else {
517 #line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
518 _data_->_tmp1_ = tracker_status_wait_context_new ();
519 #line 116 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
520 _data_->context = _data_->_tmp1_;
521 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
522 _data_->_tmp2_ = _data_->context;
523 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
524 (_data_->_tmp2_->callback_target_destroy_notify == NULL) ? NULL : (_data_->_tmp2_->callback_target_destroy_notify (_data_->_tmp2_->callback_target), NULL);
525 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
526 _data_->_tmp2_->callback = NULL;
527 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
528 _data_->_tmp2_->callback_target = NULL;
529 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
530 _data_->_tmp2_->callback_target_destroy_notify = NULL;
531 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
532 _data_->_tmp2_->callback = _tracker_status_wait_co_gsource_func;
533 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
534 _data_->_tmp2_->callback_target = _data_;
535 #line 117 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
536 _data_->_tmp2_->callback_target_destroy_notify = NULL;
537 #line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
538 _data_->_tmp3_ = _data_->context;
539 #line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
540 _data_->_tmp4_ = _g_object_ref0 (_data_->_tmp3_);
541 #line 118 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
542 _data_->self->priv->wait_list = g_list_prepend (_data_->self->priv->wait_list, _data_->_tmp4_);
543 #line 119 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
544 _data_->_state_ = 1;
545 #line 119 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
546 return FALSE;
547 #line 548 "tracker-status.c"
548 _state_1:
549 ;
550 #line 113 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
551 _g_object_unref0 (_data_->context);
552 #line 553 "tracker-status.c"
553 }
554 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
555 if (_data_->_state_ == 0) {
556 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
557 g_simple_async_result_complete_in_idle (_data_->_async_result);
558 #line 559 "tracker-status.c"
559 } else {
560 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
561 g_simple_async_result_complete (_data_->_async_result);
562 #line 563 "tracker-status.c"
563 }
564 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
565 g_object_unref (_data_->_async_result);
566 #line 112 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
567 return FALSE;
568 #line 569 "tracker-status.c"
569 }
570
571
572 TrackerStatus* tracker_status_construct (GType object_type) {
573 TrackerStatus * self = NULL;
574 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
575 self = (TrackerStatus*) g_object_new (object_type, NULL);
576 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
577 return self;
578 #line 579 "tracker-status.c"
579 }
580
581
582 TrackerStatus* tracker_status_new (void) {
583 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
584 return tracker_status_construct (TRACKER_TYPE_STATUS);
585 #line 586 "tracker-status.c"
586 }
587
588
589 static void g_cclosure_user_marshal_VOID__STRING_DOUBLE (GClosure * closure, GValue * return_value, guint n_param_values, const GValue * param_values, gpointer invocation_hint, gpointer marshal_data) {
590 typedef void (*GMarshalFunc_VOID__STRING_DOUBLE) (gpointer data1, const char* arg_1, gdouble arg_2, gpointer data2);
591 register GMarshalFunc_VOID__STRING_DOUBLE callback;
592 register GCClosure * cc;
593 register gpointer data1;
594 register gpointer data2;
595 cc = (GCClosure *) closure;
596 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
597 g_return_if_fail (n_param_values == 3);
598 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
599 if (G_CCLOSURE_SWAP_DATA (closure)) {
600 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
601 data1 = closure->data;
602 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
603 data2 = param_values->data[0].v_pointer;
604 #line 605 "tracker-status.c"
605 } else {
606 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
607 data1 = param_values->data[0].v_pointer;
608 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
609 data2 = closure->data;
610 #line 611 "tracker-status.c"
611 }
612 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
613 callback = (GMarshalFunc_VOID__STRING_DOUBLE) (marshal_data ? marshal_data : cc->callback);
614 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
615 callback (data1, g_value_get_string (param_values + 1), g_value_get_double (param_values + 2), data2);
616 #line 617 "tracker-status.c"
617 }
618
619
620 static TrackerStatusWaitContext* tracker_status_wait_context_construct (GType object_type) {
621 TrackerStatusWaitContext * self = NULL;
622 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
623 self = (TrackerStatusWaitContext*) g_object_new (object_type, NULL);
624 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
625 return self;
626 #line 627 "tracker-status.c"
627 }
628
629
630 static TrackerStatusWaitContext* tracker_status_wait_context_new (void) {
631 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
632 return tracker_status_wait_context_construct (TRACKER_STATUS_TYPE_WAIT_CONTEXT);
633 #line 634 "tracker-status.c"
634 }
635
636
637 static void tracker_status_wait_context_class_init (TrackerStatusWaitContextClass * klass) {
638 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
639 tracker_status_wait_context_parent_class = g_type_class_peek_parent (klass);
640 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
641 G_OBJECT_CLASS (klass)->finalize = tracker_status_wait_context_finalize;
642 #line 643 "tracker-status.c"
643 }
644
645
646 static void tracker_status_wait_context_instance_init (TrackerStatusWaitContext * self) {
647 }
648
649
650 static void tracker_status_wait_context_finalize (GObject* obj) {
651 TrackerStatusWaitContext * self;
652 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
653 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_STATUS_TYPE_WAIT_CONTEXT, TrackerStatusWaitContext);
654 #line 30 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
655 (self->callback_target_destroy_notify == NULL) ? NULL : (self->callback_target_destroy_notify (self->callback_target), NULL);
656 #line 30 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
657 self->callback = NULL;
658 #line 30 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
659 self->callback_target = NULL;
660 #line 30 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
661 self->callback_target_destroy_notify = NULL;
662 #line 29 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
663 G_OBJECT_CLASS (tracker_status_wait_context_parent_class)->finalize (obj);
664 #line 665 "tracker-status.c"
665 }
666
667
668 static GType tracker_status_wait_context_get_type (void) {
669 static volatile gsize tracker_status_wait_context_type_id__volatile = 0;
670 if (g_once_init_enter (&tracker_status_wait_context_type_id__volatile)) {
671 static const GTypeInfo g_define_type_info = { sizeof (TrackerStatusWaitContextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_status_wait_context_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerStatusWaitContext), 0, (GInstanceInitFunc) tracker_status_wait_context_instance_init, NULL };
672 GType tracker_status_wait_context_type_id;
673 tracker_status_wait_context_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerStatusWaitContext", &g_define_type_info, 0);
674 g_once_init_leave (&tracker_status_wait_context_type_id__volatile, tracker_status_wait_context_type_id);
675 }
676 return tracker_status_wait_context_type_id__volatile;
677 }
678
679
680 static void tracker_status_class_init (TrackerStatusClass * klass) {
681 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
682 tracker_status_parent_class = g_type_class_peek_parent (klass);
683 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
684 g_type_class_add_private (klass, sizeof (TrackerStatusPrivate));
685 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
686 G_OBJECT_CLASS (klass)->finalize = tracker_status_finalize;
687 #line 688 "tracker-status.c"
688 /**
689 * TrackerStatus::progress:
690 * @notifier: the TrackerStatus
691 * @status: store status
692 * @progress: a #gdouble indicating store progress, from 0 to 1.
693 *
694 * the ::progress signal will be emitted by TrackerStatus
695 * to indicate progress about the store process. @status will
696 * contain a translated string with the current status and @progress
697 * will indicate how much has been processed so far.
698 **/
699 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
700 g_signal_new ("progress", TRACKER_TYPE_STATUS, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_DOUBLE);
701 #line 702 "tracker-status.c"
702 }
703
704
705 static void tracker_status_instance_init (TrackerStatus * self) {
706 gchar* _tmp0_;
707 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
708 self->priv = TRACKER_STATUS_GET_PRIVATE (self);
709 #line 34 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
710 _tmp0_ = g_strdup ("Idle");
711 #line 34 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
712 self->priv->status = _tmp0_;
713 #line 714 "tracker-status.c"
714 }
715
716
717 static void tracker_status_finalize (GObject* obj) {
718 TrackerStatus * self;
719 guint _tmp0_;
720 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
721 self = G_TYPE_CHECK_INSTANCE_CAST (obj, TRACKER_TYPE_STATUS, TrackerStatus);
722 #line 52 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
723 _tmp0_ = self->priv->timer_id;
724 #line 52 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
725 if (_tmp0_ != ((guint) 0)) {
726 #line 727 "tracker-status.c"
727 guint _tmp1_;
728 #line 53 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
729 _tmp1_ = self->priv->timer_id;
730 #line 53 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
731 g_source_remove (_tmp1_);
732 #line 733 "tracker-status.c"
733 }
734 #line 34 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
735 _g_free0 (self->priv->status);
736 #line 36 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
737 __g_list_free__g_object_unref0_0 (self->priv->wait_list);
738 #line 24 "/home/martyn/Source/tracker/src/tracker-store/tracker-status.vala"
739 G_OBJECT_CLASS (tracker_status_parent_class)->finalize (obj);
740 #line 741 "tracker-status.c"
741 }
742
743
744 GType tracker_status_get_type (void) {
745 static volatile gsize tracker_status_type_id__volatile = 0;
746 if (g_once_init_enter (&tracker_status_type_id__volatile)) {
747 static const GTypeInfo g_define_type_info = { sizeof (TrackerStatusClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tracker_status_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TrackerStatus), 0, (GInstanceInitFunc) tracker_status_instance_init, NULL };
748 GType tracker_status_type_id;
749 tracker_status_type_id = g_type_register_static (G_TYPE_OBJECT, "TrackerStatus", &g_define_type_info, 0);
750 g_type_set_qdata (tracker_status_type_id, g_quark_from_static_string ("vala-dbus-register-object"), (void*) tracker_status_register_object);
751 g_once_init_leave (&tracker_status_type_id__volatile, tracker_status_type_id);
752 }
753 return tracker_status_type_id__volatile;
754 }
755
756
757 static void _dbus_tracker_status_get_progress (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
758 GError* error = NULL;
(emitted by gcc) 759 GVariantIter _arguments_iter;
760 GDBusMessage* _reply_message;
761 GVariant* _reply;
762 GVariantBuilder _reply_builder;
763 gdouble result;
764 g_variant_iter_init (&_arguments_iter, parameters);
765 result = tracker_status_get_progress (self);
766 _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
767 g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
768 g_variant_builder_add_value (&_reply_builder, g_variant_new_double (result));
769 _reply = g_variant_builder_end (&_reply_builder);
770 g_dbus_message_set_body (_reply_message, _reply);
771 g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
772 g_object_unref (invocation);
773 g_object_unref (_reply_message);
774 }
775
776
777 static void _dbus_tracker_status_get_status (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
778 GError* error = NULL;
(emitted by gcc) 779 GVariantIter _arguments_iter;
780 GDBusMessage* _reply_message;
781 GVariant* _reply;
782 GVariantBuilder _reply_builder;
783 gchar* result;
784 g_variant_iter_init (&_arguments_iter, parameters);
785 result = tracker_status_get_status (self);
786 _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
787 g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
788 g_variant_builder_add_value (&_reply_builder, g_variant_new_string (result));
789 _g_free0 (result);
790 _reply = g_variant_builder_end (&_reply_builder);
791 g_dbus_message_set_body (_reply_message, _reply);
792 g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
793 g_object_unref (invocation);
794 g_object_unref (_reply_message);
795 }
796
797
798 static void _dbus_tracker_status_wait (TrackerStatus* self, GVariant* parameters, GDBusMethodInvocation* invocation) {
799 GVariantIter _arguments_iter;
800 g_variant_iter_init (&_arguments_iter, parameters);
801 tracker_status_wait (self, (GAsyncReadyCallback) _dbus_tracker_status_wait_ready, invocation);
802 }
803
804
805 static void _dbus_tracker_status_wait_ready (GObject * source_object, GAsyncResult * _res_, gpointer _user_data_) {
806 GDBusMethodInvocation * invocation;
807 GError* error = NULL;
808 GDBusMessage* _reply_message;
809 GVariant* _reply;
810 GVariantBuilder _reply_builder;
811 invocation = _user_data_;
812 tracker_status_wait_finish ((TrackerStatus*) source_object, _res_, &error);
813 if (error) {
814 g_dbus_method_invocation_return_gerror (invocation, error);
815 return;
816 }
817 _reply_message = g_dbus_message_new_method_reply (g_dbus_method_invocation_get_message (invocation));
818 g_variant_builder_init (&_reply_builder, G_VARIANT_TYPE_TUPLE);
819 _reply = g_variant_builder_end (&_reply_builder);
820 g_dbus_message_set_body (_reply_message, _reply);
821 g_dbus_connection_send_message (g_dbus_method_invocation_get_connection (invocation), _reply_message, G_DBUS_SEND_MESSAGE_FLAGS_NONE, NULL, NULL);
822 g_object_unref (invocation);
823 g_object_unref (_reply_message);
824 }
825
826
827 static void tracker_status_dbus_interface_method_call (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* method_name, GVariant* parameters, GDBusMethodInvocation* invocation, gpointer user_data) {
828 gpointer* data;
829 gpointer object;
830 data = user_data;
831 object = data[0];
832 if (strcmp (method_name, "GetProgress") == 0) {
833 _dbus_tracker_status_get_progress (object, parameters, invocation);
834 } else if (strcmp (method_name, "GetStatus") == 0) {
835 _dbus_tracker_status_get_status (object, parameters, invocation);
836 } else if (strcmp (method_name, "Wait") == 0) {
837 _dbus_tracker_status_wait (object, parameters, invocation);
838 } else {
839 g_object_unref (invocation);
840 }
841 }
842
843
844 static GVariant* tracker_status_dbus_interface_get_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GError** error, gpointer user_data) {
845 gpointer* data;
846 gpointer object;
(emitted by gcc) 847 data = user_data;
848 object = data[0];
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
849 return NULL;
850 }
851
852
853 static gboolean tracker_status_dbus_interface_set_property (GDBusConnection* connection, const gchar* sender, const gchar* object_path, const gchar* interface_name, const gchar* property_name, GVariant* value, GError** error, gpointer user_data) {
854 gpointer* data;
855 gpointer object;
(emitted by gcc) 856 data = user_data;
857 object = data[0];
(emitted by clang-analyzer)TODO: a detailed trace is available in the data model (not yet rendered in this report)
858 return FALSE;
859 }
860
861
862 static void _dbus_tracker_status_progress (GObject* _sender, const gchar* status, gdouble progres, gpointer* _data) {
863 GDBusConnection * _connection;
864 const gchar * _path;
865 GVariant *_arguments;
866 GVariantBuilder _arguments_builder;
867 _connection = _data[1];
868 _path = _data[2];
869 g_variant_builder_init (&_arguments_builder, G_VARIANT_TYPE_TUPLE);
870 g_variant_builder_add_value (&_arguments_builder, g_variant_new_string (status));
871 g_variant_builder_add_value (&_arguments_builder, g_variant_new_double (progres));
872 _arguments = g_variant_builder_end (&_arguments_builder);
873 g_dbus_connection_emit_signal (_connection, NULL, _path, "org.freedesktop.Tracker1.Status", "Progress", _arguments, NULL);
874 }
875
876
877 guint tracker_status_register_object (gpointer object, GDBusConnection* connection, const gchar* path, GError** error) {
878 guint result;
879 gpointer *data;
880 data = g_new (gpointer, 3);
881 data[0] = g_object_ref (object);
882 data[1] = g_object_ref (connection);
883 data[2] = g_strdup (path);
884 result = g_dbus_connection_register_object (connection, path, (GDBusInterfaceInfo *) (&_tracker_status_dbus_interface_info), &_tracker_status_dbus_interface_vtable, data, _tracker_status_unregister_object, error);
885 if (!result) {
886 return 0;
887 }
888 g_signal_connect (object, "progress", (GCallback) _dbus_tracker_status_progress, data);
889 return result;
890 }
891
892
893 static void _tracker_status_unregister_object (gpointer user_data) {
894 gpointer* data;
895 data = user_data;
896 g_signal_handlers_disconnect_by_func (data[0], _dbus_tracker_status_progress, data);
897 g_object_unref (data[0]);
898 g_object_unref (data[1]);
899 g_free (data[2]);
900 g_free (data);
901 }