1 /* unity-lens-private.c generated by valac 0.14.2, the Vala compiler
2 * generated from unity-lens-private.vala, do not modify */
3
4 /*
5 * Copyright (C) 2011 Canonical, Ltd.
6 *
7 * This library is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License
9 * version 3.0 as published by the Free Software Foundation.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License version 3.0 for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
19 *
20 * Authored by Neil Jagdish Patel <neil.patel@canonical.com>
21 *
22 */
23
24 #include <glib.h>
25 #include <glib-object.h>
26 #include <gio/gio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include "unity.h"
30 #include <dee.h>
31 #include <time.h>
32 #include <gee.h>
33 #include <unity-trace.h>
34
35
36 #define UNITY_TYPE_LENS_SERVICE (unity_lens_service_get_type ())
37 #define UNITY_LENS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_LENS_SERVICE, UnityLensService))
38 #define UNITY_IS_LENS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_LENS_SERVICE))
39 #define UNITY_LENS_SERVICE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UNITY_TYPE_LENS_SERVICE, UnityLensServiceIface))
40
41 typedef struct _UnityLensService UnityLensService;
42 typedef struct _UnityLensServiceIface UnityLensServiceIface;
43
44 #define UNITY_TYPE_LENS_SERVICE_PROXY (unity_lens_service_proxy_get_type ())
45
46 #define UNITY_TYPE_ACTIVATION_REPLY_RAW (unity_activation_reply_raw_get_type ())
47 typedef struct _UnityActivationReplyRaw UnityActivationReplyRaw;
48
49 #define UNITY_TYPE_PREVIEW_REPLY_RAW (unity_preview_reply_raw_get_type ())
50 typedef struct _UnityPreviewReplyRaw UnityPreviewReplyRaw;
51
52 #define UNITY_TYPE_LENS_IMPL (unity_lens_impl_get_type ())
53 #define UNITY_LENS_IMPL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_LENS_IMPL, UnityLensImpl))
54 #define UNITY_LENS_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_LENS_IMPL, UnityLensImplClass))
55 #define UNITY_IS_LENS_IMPL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_LENS_IMPL))
56 #define UNITY_IS_LENS_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_LENS_IMPL))
57 #define UNITY_LENS_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_LENS_IMPL, UnityLensImplClass))
58
59 typedef struct _UnityLensImpl UnityLensImpl;
60 typedef struct _UnityLensImplClass UnityLensImplClass;
61 typedef struct _UnityLensImplPrivate UnityLensImplPrivate;
62
63 #define UNITY_TYPE_SCOPE_FACTORY (unity_scope_factory_get_type ())
64 #define UNITY_SCOPE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCOPE_FACTORY, UnityScopeFactory))
65 #define UNITY_SCOPE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SCOPE_FACTORY, UnityScopeFactoryClass))
66 #define UNITY_IS_SCOPE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCOPE_FACTORY))
67 #define UNITY_IS_SCOPE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SCOPE_FACTORY))
68 #define UNITY_SCOPE_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SCOPE_FACTORY, UnityScopeFactoryClass))
69
70 typedef struct _UnityScopeFactory UnityScopeFactory;
71 typedef struct _UnityScopeFactoryClass UnityScopeFactoryClass;
72
73 #define UNITY_TYPE_FILTERS_SYNCHRONIZER (unity_filters_synchronizer_get_type ())
74 #define UNITY_FILTERS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_FILTERS_SYNCHRONIZER, UnityFiltersSynchronizer))
75 #define UNITY_FILTERS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_FILTERS_SYNCHRONIZER, UnityFiltersSynchronizerClass))
76 #define UNITY_IS_FILTERS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_FILTERS_SYNCHRONIZER))
77 #define UNITY_IS_FILTERS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_FILTERS_SYNCHRONIZER))
78 #define UNITY_FILTERS_SYNCHRONIZER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_FILTERS_SYNCHRONIZER, UnityFiltersSynchronizerClass))
79
80 typedef struct _UnityFiltersSynchronizer UnityFiltersSynchronizer;
81 typedef struct _UnityFiltersSynchronizerClass UnityFiltersSynchronizerClass;
82
83 #define UNITY_TYPE_RESULTS_SYNCHRONIZER (unity_results_synchronizer_get_type ())
84 #define UNITY_RESULTS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizer))
85 #define UNITY_RESULTS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizerClass))
86 #define UNITY_IS_RESULTS_SYNCHRONIZER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER))
87 #define UNITY_IS_RESULTS_SYNCHRONIZER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_RESULTS_SYNCHRONIZER))
88 #define UNITY_RESULTS_SYNCHRONIZER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_RESULTS_SYNCHRONIZER, UnityResultsSynchronizerClass))
89
90 typedef struct _UnityResultsSynchronizer UnityResultsSynchronizer;
91 typedef struct _UnityResultsSynchronizerClass UnityResultsSynchronizerClass;
92 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
93 #define _g_free0(var) (var = (g_free (var), NULL))
94
95 #define UNITY_TYPE_SCOPE_PROXY (unity_scope_proxy_get_type ())
96 #define UNITY_SCOPE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCOPE_PROXY, UnityScopeProxy))
97 #define UNITY_IS_SCOPE_PROXY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCOPE_PROXY))
98 #define UNITY_SCOPE_PROXY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), UNITY_TYPE_SCOPE_PROXY, UnityScopeProxyIface))
99
100 typedef struct _UnityScopeProxy UnityScopeProxy;
101 typedef struct _UnityScopeProxyIface UnityScopeProxyIface;
102
103 #define UNITY_TYPE_VIEW_TYPE (unity_view_type_get_type ())
104 #define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))
105 #define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
106 #define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
107
108 #define UNITY_TYPE_LENS_INFO (unity_lens_info_get_type ())
109 typedef struct _UnityLensInfo UnityLensInfo;
110 typedef struct _Block1Data Block1Data;
111
112 #define UNITY_TYPE_SCOPE_PROXY_REMOTE (unity_scope_proxy_remote_get_type ())
113 #define UNITY_SCOPE_PROXY_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCOPE_PROXY_REMOTE, UnityScopeProxyRemote))
114 #define UNITY_SCOPE_PROXY_REMOTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SCOPE_PROXY_REMOTE, UnityScopeProxyRemoteClass))
115 #define UNITY_IS_SCOPE_PROXY_REMOTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCOPE_PROXY_REMOTE))
116 #define UNITY_IS_SCOPE_PROXY_REMOTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SCOPE_PROXY_REMOTE))
117 #define UNITY_SCOPE_PROXY_REMOTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SCOPE_PROXY_REMOTE, UnityScopeProxyRemoteClass))
118
119 typedef struct _UnityScopeProxyRemote UnityScopeProxyRemote;
120 typedef struct _UnityScopeProxyRemoteClass UnityScopeProxyRemoteClass;
121
122 #define UNITY_TYPE_FILTER_COLUMN (unity_filter_column_get_type ())
123 typedef struct _UnityLensImplInfoRequestData UnityLensImplInfoRequestData;
124 typedef struct _UnityLensImplActivateData UnityLensImplActivateData;
125 typedef struct _Block2Data Block2Data;
126 typedef struct _Block3Data Block3Data;
127 typedef struct _Block4Data Block4Data;
128 typedef struct _UnityScopeFactoryPrivate UnityScopeFactoryPrivate;
129 typedef struct _UnityLensImplSearchData UnityLensImplSearchData;
130 typedef struct _Block5Data Block5Data;
131 typedef struct _Block6Data Block6Data;
132 typedef struct _Block7Data Block7Data;
133 typedef struct _UnityLensImplGlobalSearchData UnityLensImplGlobalSearchData;
134 typedef struct _UnityLensImplPreviewData UnityLensImplPreviewData;
135 typedef struct _UnityLensImplUpdateFilterData UnityLensImplUpdateFilterData;
136 typedef struct _UnityLensImplUpdateActiveSourcesData UnityLensImplUpdateActiveSourcesData;
137 typedef struct _UnityLensImplSetViewTypeData UnityLensImplSetViewTypeData;
138
139 struct _UnityActivationReplyRaw {
140 gchar* uri;
141 guint handled;
142 GHashTable* hints;
143 };
144
145 struct _UnityPreviewReplyRaw {
146 gchar* uri;
147 gchar* renderer_name;
148 GHashTable* properties;
149 };
150
151 struct _UnityLensServiceIface {
152 GTypeInterface parent_iface;
153 void (*info_request) (UnityLensService* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
154 void (*info_request_finish) (UnityLensService* self, GAsyncResult* _res_, GError** error);
155 void (*activate) (UnityLensService* self, const gchar* uri, guint action_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
156 void (*activate_finish) (UnityLensService* self, GAsyncResult* _res_, UnityActivationReplyRaw* result, GError** error);
157 void (*search) (UnityLensService* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
158 GHashTable* (*search_finish) (UnityLensService* self, GAsyncResult* _res_, GError** error);
159 void (*global_search) (UnityLensService* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
160 GHashTable* (*global_search_finish) (UnityLensService* self, GAsyncResult* _res_, GError** error);
161 void (*preview) (UnityLensService* self, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
162 void (*preview_finish) (UnityLensService* self, GAsyncResult* _res_, UnityPreviewReplyRaw* result, GError** error);
163 void (*update_filter) (UnityLensService* self, const gchar* filter_name, GHashTable* properties, GAsyncReadyCallback _callback_, gpointer _user_data_);
164 void (*update_filter_finish) (UnityLensService* self, GAsyncResult* _res_, GError** error);
165 void (*set_view_type) (UnityLensService* self, guint view_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
166 void (*set_view_type_finish) (UnityLensService* self, GAsyncResult* _res_, GError** error);
167 };
168
169 struct _UnityLensImpl {
170 GObject parent_instance;
171 UnityLensImplPrivate * priv;
172 };
173
174 struct _UnityLensImplClass {
175 GObjectClass parent_class;
176 };
177
178 struct _UnityLensImplPrivate {
179 UnityLens* _owner;
180 guint _dbus_id;
181 guint _info_changed_id;
182 guint _sources_update_id;
183 DeeSharedModel* _results_model;
184 DeeSharedModel* _global_results_model;
185 DeeSharedModel* _categories_model;
186 DeeSharedModel* _filters_model;
187 UnityOptionsFilter* _sources;
188 UnityScopeFactory* _scope_factory;
189 UnityFiltersSynchronizer* _filters_sync;
190 UnityResultsSynchronizer* _results_sync;
191 UnityResultsSynchronizer* _global_results_sync;
192 };
193
194 typedef enum {
195 UNITY_VIEW_TYPE_HIDDEN,
196 UNITY_VIEW_TYPE_HOME_VIEW,
197 UNITY_VIEW_TYPE_LENS_VIEW
198 } UnityViewType;
199
200 struct _UnityScopeProxyIface {
201 GTypeInterface parent_iface;
202 void (*activate) (UnityScopeProxy* self, const gchar* uri, guint action_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
203 void (*activate_finish) (UnityScopeProxy* self, GAsyncResult* _res_, UnityActivationReplyRaw* result);
204 void (*search) (UnityScopeProxy* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
205 GHashTable* (*search_finish) (UnityScopeProxy* self, GAsyncResult* _res_);
206 void (*global_search) (UnityScopeProxy* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
207 GHashTable* (*global_search_finish) (UnityScopeProxy* self, GAsyncResult* _res_);
208 void (*preview) (UnityScopeProxy* self, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
209 void (*preview_finish) (UnityScopeProxy* self, GAsyncResult* _res_, UnityPreviewReplyRaw* result);
210 void (*set_active_sources) (UnityScopeProxy* self, gchar** sources, int sources_length1, GAsyncReadyCallback _callback_, gpointer _user_data_);
211 void (*set_active_sources_finish) (UnityScopeProxy* self, GAsyncResult* _res_);
212 UnityOptionsFilter* (*get_sources) (UnityScopeProxy* self);
213 void (*set_sources) (UnityScopeProxy* self, UnityOptionsFilter* value);
214 gboolean (*get_search_in_global) (UnityScopeProxy* self);
215 void (*set_search_in_global) (UnityScopeProxy* self, gboolean value);
216 UnityViewType (*get_view_type) (UnityScopeProxy* self);
217 void (*set_view_type) (UnityScopeProxy* self, UnityViewType value);
218 DeeSerializableModel* (*get_results_model) (UnityScopeProxy* self);
219 void (*set_results_model) (UnityScopeProxy* self, DeeSerializableModel* value);
220 DeeSerializableModel* (*get_global_results_model) (UnityScopeProxy* self);
221 void (*set_global_results_model) (UnityScopeProxy* self, DeeSerializableModel* value);
222 DeeSerializableModel* (*get_filters_model) (UnityScopeProxy* self);
223 void (*set_filters_model) (UnityScopeProxy* self, DeeSerializableModel* value);
224 };
225
226 struct _UnityLensInfo {
227 gchar* dbus_path;
228 gboolean search_in_global;
229 gboolean visible;
230 gchar* search_hint;
231 gchar* private_connection_name;
232 gchar* results_model_name;
233 gchar* global_results_model_name;
234 gchar* categories_model_name;
235 gchar* filters_model_name;
236 GHashTable* hints;
237 };
238
239 struct _Block1Data {
240 int _ref_count_;
241 UnityLensImpl * self;
242 UnityScopeProxy* scope;
243 };
244
245 typedef enum {
246 UNITY_FILTER_COLUMN_ID = 0,
247 UNITY_FILTER_COLUMN_NAME,
248 UNITY_FILTER_COLUMN_ICON_HINT,
249 UNITY_FILTER_COLUMN_RENDERER_NAME,
250 UNITY_FILTER_COLUMN_RENDERER_STATE,
251 UNITY_FILTER_COLUMN_VISIBLE,
252 UNITY_FILTER_COLUMN_COLLAPSED,
253 UNITY_FILTER_COLUMN_FILTERING
254 } UnityFilterColumn;
255
256 struct _UnityLensImplInfoRequestData {
257 int _state_;
258 GObject* _source_object_;
259 GAsyncResult* _res_;
260 GSimpleAsyncResult* _async_result;
261 UnityLensImpl* self;
262 };
263
264 struct _UnityLensImplActivateData {
265 int _state_;
266 GObject* _source_object_;
267 GAsyncResult* _res_;
268 GSimpleAsyncResult* _async_result;
269 UnityLensImpl* self;
270 gchar* uri;
271 guint action_type;
272 UnityActivationReplyRaw result;
273 const gchar* _tmp0_;
274 gchar** _tmp1_;
275 gchar** _tmp2_;
276 gchar** tokens;
277 gint tokens_length1;
278 gint _tokens_size_;
279 gchar** _tmp3_;
280 gint _tmp3__length1;
281 const gchar* _tmp4_;
282 UnityScopeProxy* _tmp5_;
283 UnityScopeProxy* scope;
284 UnityActivationReplyRaw raw;
285 GHashTable* _tmp6_;
286 UnityScopeProxy* _tmp7_;
287 UnityScopeProxy* _tmp8_;
288 gchar** _tmp9_;
289 gint _tmp9__length1;
290 const gchar* _tmp10_;
291 guint _tmp11_;
292 UnityActivationReplyRaw _tmp12_;
293 const gchar* _tmp13_;
294 gchar* _tmp14_;
295 };
296
297 struct _Block2Data {
298 int _ref_count_;
299 UnityLensImpl * self;
300 GHashTable* _result_;
301 gint num_scopes;
302 gpointer _async_data_;
303 };
304
305 struct _Block3Data {
306 int _ref_count_;
307 Block2Data * _data2_;
308 guint64 seqnum;
309 };
310
311 struct _Block4Data {
312 int _ref_count_;
313 Block3Data * _data3_;
314 gulong update_sig_id;
315 };
316
317 struct _UnityScopeFactory {
318 GObject parent_instance;
319 UnityScopeFactoryPrivate * priv;
320 GeeArrayList* scopes;
321 };
322
323 struct _UnityScopeFactoryClass {
324 GObjectClass parent_class;
325 };
326
327 struct _UnityLensImplSearchData {
328 int _state_;
329 GObject* _source_object_;
330 GAsyncResult* _res_;
331 GSimpleAsyncResult* _async_result;
332 UnityLensImpl* self;
333 gchar* search_string;
334 GHashTable* hints;
335 GHashTable* result;
336 Block2Data* _data2_;
337 GHashFunc _tmp0_;
338 GEqualFunc _tmp1_;
339 GHashTable* _tmp2_;
340 GAsyncReadyCallback cb;
341 void* cb_target;
342 GDestroyNotify cb_target_destroy_notify;
343 UnityScopeFactory* _tmp3_;
344 GeeArrayList* _tmp4_;
345 GeeArrayList* _tmp5_;
346 GeeArrayList* _scope_list;
347 GeeArrayList* _tmp6_;
348 gint _tmp7_;
349 gint _tmp8_;
350 gint _scope_size;
351 gint _scope_index;
352 gint _tmp9_;
353 gint _tmp10_;
354 gint _tmp11_;
355 GeeArrayList* _tmp12_;
356 gint _tmp13_;
357 gpointer _tmp14_;
358 UnityScopeProxy* scope;
359 gint _tmp15_;
360 UnityScopeProxy* _tmp16_;
361 const gchar* _tmp17_;
362 GHashTable* _tmp18_;
363 GAsyncReadyCallback _tmp19_;
364 void* _tmp19__target;
365 gint _tmp20_;
366 GHashTable* _tmp21_;
367 gchar* _tmp22_;
368 DeeSharedModel* _tmp23_;
369 guint64 _tmp24_;
370 GVariant* _tmp25_;
371 GVariant* _tmp26_;
372 GHashTable* _tmp27_;
373 GHashTable* _tmp28_;
374 };
375
376 struct _Block5Data {
377 int _ref_count_;
378 UnityLensImpl * self;
379 gint num_scopes;
380 gpointer _async_data_;
381 };
382
383 struct _Block6Data {
384 int _ref_count_;
385 Block5Data * _data5_;
386 guint64 seqnum;
387 };
388
389 struct _Block7Data {
390 int _ref_count_;
391 Block6Data * _data6_;
392 gulong update_sig_id;
393 };
394
395 struct _UnityLensImplGlobalSearchData {
396 int _state_;
397 GObject* _source_object_;
398 GAsyncResult* _res_;
399 GSimpleAsyncResult* _async_result;
400 UnityLensImpl* self;
401 gchar* search_string;
402 GHashTable* hints;
403 GHashTable* result;
404 Block5Data* _data5_;
405 GAsyncReadyCallback cb;
406 void* cb_target;
407 GDestroyNotify cb_target_destroy_notify;
408 UnityScopeFactory* _tmp0_;
409 GeeArrayList* _tmp1_;
410 GeeArrayList* _tmp2_;
411 GeeArrayList* _scope_list;
412 GeeArrayList* _tmp3_;
413 gint _tmp4_;
414 gint _tmp5_;
415 gint _scope_size;
416 gint _scope_index;
417 gint _tmp6_;
418 gint _tmp7_;
419 gint _tmp8_;
420 GeeArrayList* _tmp9_;
421 gint _tmp10_;
422 gpointer _tmp11_;
423 UnityScopeProxy* scope;
424 UnityScopeProxy* _tmp12_;
425 gboolean _tmp13_;
426 gboolean _tmp14_;
427 gint _tmp15_;
428 UnityScopeProxy* _tmp16_;
429 const gchar* _tmp17_;
430 GHashTable* _tmp18_;
431 GAsyncReadyCallback _tmp19_;
432 void* _tmp19__target;
433 gint _tmp20_;
434 GHashFunc _tmp21_;
435 GEqualFunc _tmp22_;
436 GHashTable* _tmp23_;
437 GHashTable* _result_;
438 gchar* _tmp24_;
439 DeeSharedModel* _tmp25_;
440 guint64 _tmp26_;
441 GVariant* _tmp27_;
442 GVariant* _tmp28_;
443 };
444
445 struct _UnityLensImplPreviewData {
446 int _state_;
447 GObject* _source_object_;
448 GAsyncResult* _res_;
449 GSimpleAsyncResult* _async_result;
450 UnityLensImpl* self;
451 gchar* uri;
452 UnityPreviewReplyRaw result;
453 const gchar* _tmp0_;
454 gchar** _tmp1_;
455 gchar** _tmp2_;
456 gchar** tokens;
457 gint tokens_length1;
458 gint _tokens_size_;
459 gchar** _tmp3_;
460 gint _tmp3__length1;
461 const gchar* _tmp4_;
462 UnityScopeProxy* _tmp5_;
463 UnityScopeProxy* scope;
464 UnityPreviewReplyRaw raw;
465 gchar* _tmp6_;
466 GHashTable* _tmp7_;
467 UnityScopeProxy* _tmp8_;
468 UnityScopeProxy* _tmp9_;
469 gchar** _tmp10_;
470 gint _tmp10__length1;
471 const gchar* _tmp11_;
472 UnityPreviewReplyRaw _tmp12_;
473 const gchar* _tmp13_;
474 gchar* _tmp14_;
475 };
476
477 struct _UnityLensImplUpdateFilterData {
478 int _state_;
479 GObject* _source_object_;
480 GAsyncResult* _res_;
481 GSimpleAsyncResult* _async_result;
482 UnityLensImpl* self;
483 gchar* filter_name;
484 GHashTable* properties;
485 const gchar* _tmp0_;
486 };
487
488 struct _UnityLensImplUpdateActiveSourcesData {
489 int _state_;
490 GObject* _source_object_;
491 GAsyncResult* _res_;
492 GSimpleAsyncResult* _async_result;
493 UnityLensImpl* self;
494 GeeSet* updated_scope_uids;
495 GeeSet* _tmp0_;
496 GeeIterator* _tmp1_;
497 GeeIterator* _scope_uid_it;
498 GeeIterator* _tmp2_;
499 gboolean _tmp3_;
500 GeeIterator* _tmp4_;
501 gpointer _tmp5_;
502 gchar* scope_uid;
503 const gchar* _tmp6_;
504 UnityScopeProxy* _tmp7_;
505 UnityScopeProxy* scope;
506 UnityScopeProxy* _tmp8_;
507 gchar** _tmp9_;
508 gchar** active_sources;
509 gint active_sources_length1;
510 gint _active_sources_size_;
511 UnityOptionsFilter* _tmp10_;
512 GList* _tmp11_;
513 GList* filter_option_collection;
514 GList* filter_option_it;
515 UnityFilterOption* _tmp12_;
516 UnityFilterOption* filter_option;
517 gboolean _tmp13_;
518 UnityFilterOption* _tmp14_;
519 const gchar* _tmp15_;
520 const gchar* _tmp16_;
521 const gchar* _tmp17_;
522 gboolean _tmp18_;
523 UnityFilterOption* _tmp19_;
524 gboolean _tmp20_;
525 gboolean _tmp21_;
526 gboolean _tmp22_;
527 gchar** _tmp23_;
528 gint _tmp23__length1;
529 UnityFilterOption* _tmp24_;
530 const gchar* _tmp25_;
531 const gchar* _tmp26_;
532 const gchar* _tmp27_;
533 gint _tmp28_;
534 gint _tmp29_;
535 gchar* _tmp30_;
536 UnityScopeProxy* _tmp31_;
537 gchar** _tmp32_;
538 gint _tmp32__length1;
539 };
540
541 struct _UnityLensImplSetViewTypeData {
542 int _state_;
543 GObject* _source_object_;
544 GAsyncResult* _res_;
545 GSimpleAsyncResult* _async_result;
546 UnityLensImpl* self;
547 guint view_type;
548 UnityScopeFactory* _tmp0_;
549 GeeArrayList* _tmp1_;
550 GeeArrayList* _tmp2_;
551 GeeArrayList* _scope_list;
552 GeeArrayList* _tmp3_;
553 gint _tmp4_;
554 gint _tmp5_;
555 gint _scope_size;
556 gint _scope_index;
557 gint _tmp6_;
558 gint _tmp7_;
559 gint _tmp8_;
560 GeeArrayList* _tmp9_;
561 gint _tmp10_;
562 gpointer _tmp11_;
563 UnityScopeProxy* scope;
564 UnityScopeProxy* _tmp12_;
565 guint _tmp13_;
566 UnityLens* _tmp14_;
567 guint _tmp15_;
568 };
569
570
571 static gpointer unity_lens_impl_parent_class = NULL;
572 static const gchar* unity_lens_impl_LENS_DIRECTORY;
573 static const gchar* unity_lens_impl_LENS_DIRECTORY = NULL;
574 static UnityLensServiceIface* unity_lens_impl_unity_lens_service_parent_iface = NULL;
575
576 GType unity_lens_service_proxy_get_type (void) G_GNUC_CONST;
577 guint unity_lens_service_register_object (void* object, GDBusConnection* connection, const gchar* path, GError** error);
578 GType unity_activation_reply_raw_get_type (void) G_GNUC_CONST;
579 UnityActivationReplyRaw* unity_activation_reply_raw_dup (const UnityActivationReplyRaw* self);
580 void unity_activation_reply_raw_free (UnityActivationReplyRaw* self);
581 void unity_activation_reply_raw_copy (const UnityActivationReplyRaw* self, UnityActivationReplyRaw* dest);
582 void unity_activation_reply_raw_destroy (UnityActivationReplyRaw* self);
583 GType unity_preview_reply_raw_get_type (void) G_GNUC_CONST;
584 UnityPreviewReplyRaw* unity_preview_reply_raw_dup (const UnityPreviewReplyRaw* self);
585 void unity_preview_reply_raw_free (UnityPreviewReplyRaw* self);
586 void unity_preview_reply_raw_copy (const UnityPreviewReplyRaw* self, UnityPreviewReplyRaw* dest);
587 void unity_preview_reply_raw_destroy (UnityPreviewReplyRaw* self);
588 GType unity_lens_service_get_type (void) G_GNUC_CONST;
589 GType unity_lens_impl_get_type (void) G_GNUC_CONST;
590 GType unity_scope_factory_get_type (void) G_GNUC_CONST;
591 GType unity_filters_synchronizer_get_type (void) G_GNUC_CONST;
592 GType unity_results_synchronizer_get_type (void) G_GNUC_CONST;
593 #define UNITY_LENS_IMPL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_TYPE_LENS_IMPL, UnityLensImplPrivate))
594 enum {
595 UNITY_LENS_IMPL_DUMMY_PROPERTY,
596 UNITY_LENS_IMPL_RESULTS_SYNC,
597 UNITY_LENS_IMPL_GLOBAL_RESULTS_SYNC
598 };
599 UnityLensImpl* unity_lens_impl_new (UnityLens* owner);
600 UnityLensImpl* unity_lens_impl_construct (GType object_type, UnityLens* owner);
601 static void unity_lens_impl_queue_info_changed (UnityLensImpl* self);
602 static void _unity_lens_impl_queue_info_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
603 static void unity_lens_impl_sources_display_name_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec);
604 static void _unity_lens_impl_sources_display_name_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
605 #define UNITY_LENS_SOURCES_FILTER_ID "unity-sources"
606 static void unity_lens_impl_create_models (UnityLensImpl* self, const gchar* dbus_name);
607 static gchar* unity_lens_impl_create_dbus_name (UnityLensImpl* self);
608 static void unity_lens_impl_create_synchronizers (UnityLensImpl* self);
609 UnityScopeFactory* unity_scope_factory_new (const gchar* lens_id_, const gchar* lenses_directory_);
610 UnityScopeFactory* unity_scope_factory_construct (GType object_type, const gchar* lens_id_, const gchar* lenses_directory_);
611 GType unity_view_type_get_type (void) G_GNUC_CONST;
612 GType unity_scope_proxy_get_type (void) G_GNUC_CONST;
613 static void unity_lens_impl_on_scope_added (UnityLensImpl* self, UnityScopeFactory* factory, UnityScopeProxy* scope);
614 static void _unity_lens_impl_on_scope_added_unity_scope_factory_scope_added (UnityScopeFactory* _sender, UnityScopeProxy* scope, gpointer self);
615 UnityResultsSynchronizer* unity_results_synchronizer_new (DeeModel* receiver);
616 UnityResultsSynchronizer* unity_results_synchronizer_construct (GType object_type, DeeModel* receiver);
617 UnityFiltersSynchronizer* unity_filters_synchronizer_new (DeeModel* provider);
618 UnityFiltersSynchronizer* unity_filters_synchronizer_construct (GType object_type, DeeModel* provider);
619 static void __lambda10_ (UnityLensImpl* self, DeeModel* model, DeeModelIter* iter);
620 static void unity_lens_impl_sources_filter_changed (UnityLensImpl* self, DeeModel* model, DeeModelIter* iter);
621 static void ___lambda10__dee_model_row_changed (DeeModel* _sender, DeeModelIter* iter, gpointer self);
622 void unity_lens_impl_export (UnityLensImpl* self, GError** error);
623 void unity_lens_impl_load_categories (UnityLensImpl* self, GList* categories);
624 const gchar* unity_category_get_renderer (UnityCategory* self);
625 GVariant* unity_tools_hash_table_to_asv (GHashTable* hash);
626 GHashTable* unity_category_get_hints (UnityCategory* self);
627 void unity_lens_impl_load_filters (UnityLensImpl* self, GList* filters);
628 static void unity_lens_impl_on_filter_changed (UnityLensImpl* self, UnityFilter* filter);
629 static void _unity_lens_impl_on_filter_changed_unity_filter_changed (UnityFilter* _sender, gpointer self);
630 const gchar* unity_filter_get_renderer_name (UnityFilterRenderer renderer);
631 GHashTable* unity_filter_get_hints (UnityFilter* self);
632 static gboolean unity_lens_impl_emit_info_changed (UnityLensImpl* self);
633 static gboolean _unity_lens_impl_emit_info_changed_gsource_func (gpointer self);
634 GType unity_lens_info_get_type (void) G_GNUC_CONST;
635 UnityLensInfo* unity_lens_info_dup (const UnityLensInfo* self);
636 void unity_lens_info_free (UnityLensInfo* self);
637 void unity_lens_info_copy (const UnityLensInfo* self, UnityLensInfo* dest);
638 void unity_lens_info_destroy (UnityLensInfo* self);
639 static void _g_free0_ (gpointer var);
640 static void _g_variant_unref0_ (gpointer var);
641 DeeSerializableModel* unity_scope_proxy_get_results_model (UnityScopeProxy* self);
642 static void unity_lens_impl_on_scope_results_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec);
643 DeeSerializableModel* unity_scope_proxy_get_global_results_model (UnityScopeProxy* self);
644 static void unity_lens_impl_on_scope_global_results_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec);
645 DeeSerializableModel* unity_scope_proxy_get_filters_model (UnityScopeProxy* self);
646 static void unity_lens_impl_on_scope_filters_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec);
647 static void _unity_lens_impl_on_scope_results_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
648 static void _unity_lens_impl_on_scope_global_results_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
649 static void _unity_lens_impl_on_scope_filters_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
650 static void unity_lens_impl_on_scope_sources_updated (UnityLensImpl* self, GObject* obj, GParamSpec* pspec);
651 static void _unity_lens_impl_on_scope_sources_updated_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
652 void unity_results_synchronizer_add_provider (UnityResultsSynchronizer* self, DeeModel* provider, const gchar* uid);
653 static gchar* unity_lens_impl_uid_for_scope (UnityLensImpl* self, UnityScopeProxy* scope);
654 static Block1Data* block1_data_ref (Block1Data* _data1_);
655 static void block1_data_unref (Block1Data* _data1_);
656 GType unity_scope_proxy_remote_get_type (void) G_GNUC_CONST;
657 static void ___lambda11_ (Block1Data* _data1_);
658 void unity_filters_synchronizer_add_receiver (UnityFiltersSynchronizer* self, DeeModel* receiver);
659 static void ____lambda11__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
660 UnityOptionsFilter* unity_scope_proxy_get_sources (UnityScopeProxy* self);
661 void unity_filter_option_set_active (UnityFilterOption* self, gboolean value);
662 static void unity_lens_impl_queue_sources_update (UnityLensImpl* self);
663 GType unity_filter_column_get_type (void) G_GNUC_CONST;
664 void unity_filter_set_display_name (UnityFilter* self, const gchar* value);
665 static gboolean ___lambda9_ (UnityLensImpl* self);
666 static gboolean ____lambda9__gsource_func (gpointer self);
667 void unity_filter_update (UnityFilter* self, GVariant* properties);
668 void unity_lens_impl_update_active_sources (UnityLensImpl* self, GeeSet* updated_scope_uids, GAsyncReadyCallback _callback_, gpointer _user_data_);
669 void unity_lens_impl_update_active_sources_finish (UnityLensImpl* self, GAsyncResult* _res_);
670 void unity_lens_impl_add_local_scope (UnityLensImpl* self, UnityScope* scope);
671 void unity_scope_factory_add_local_scope (UnityScopeFactory* self, UnityScope* scope);
672 UnityOptionsFilter* unity_lens_impl_get_sources (UnityLensImpl* self);
673 DeeModel* unity_lens_impl_get_model (UnityLensImpl* self, gint index);
674 static void unity_lens_impl_real_info_request_data_free (gpointer _data);
675 static void unity_lens_impl_real_info_request (UnityLensService* base, GAsyncReadyCallback _callback_, gpointer _user_data_);
676 static gboolean unity_lens_impl_real_info_request_co (UnityLensImplInfoRequestData* _data_);
677 static void unity_lens_impl_real_activate_data_free (gpointer _data);
678 static void unity_lens_impl_real_activate (UnityLensService* base, const gchar* uri, guint action_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
679 static gboolean unity_lens_impl_real_activate_co (UnityLensImplActivateData* _data_);
680 static UnityScopeProxy* unity_lens_impl_get_scope_for_uid (UnityLensImpl* self, const gchar* uid);
681 void unity_scope_proxy_activate (UnityScopeProxy* self, const gchar* uri, guint action_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
682 void unity_scope_proxy_activate_finish (UnityScopeProxy* self, GAsyncResult* _res_, UnityActivationReplyRaw* result);
683 static void unity_lens_impl_activate_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
684 static void unity_lens_impl_real_search_data_free (gpointer _data);
685 static void unity_lens_impl_real_search (UnityLensService* base, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
686 static gboolean unity_lens_impl_real_search_co (UnityLensImplSearchData* _data_);
687 static Block2Data* block2_data_ref (Block2Data* _data2_);
688 static void block2_data_unref (Block2Data* _data2_);
689 static void __lambda12_ (Block2Data* _data2_, GObject* obj, GAsyncResult* res);
690 void unity_scope_proxy_search (UnityScopeProxy* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
691 GHashTable* unity_scope_proxy_search_finish (UnityScopeProxy* self, GAsyncResult* _res_);
692 static Block3Data* block3_data_ref (Block3Data* _data3_);
693 static void block3_data_unref (Block3Data* _data3_);
694 static Block4Data* block4_data_ref (Block4Data* _data4_);
695 static void block4_data_unref (Block4Data* _data4_);
696 static void _____lambda13_ (Block4Data* _data4_, DeeSharedModel* m, guint64 begin_seqnum, guint64 end_seqnum);
697 void unity_lens_service_search (UnityLensService* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
698 GHashTable* unity_lens_service_search_finish (UnityLensService* self, GAsyncResult* _res_, GError** error);
699 static void ______lambda13__dee_shared_model_end_transaction (DeeSharedModel* _sender, guint64 begin_seqnum, guint64 end_seqnum, gpointer self);
700 static void ___lambda12__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
701 static void unity_lens_impl_real_global_search_data_free (gpointer _data);
702 static void unity_lens_impl_real_global_search (UnityLensService* base, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
703 static gboolean unity_lens_impl_real_global_search_co (UnityLensImplGlobalSearchData* _data_);
704 static Block5Data* block5_data_ref (Block5Data* _data5_);
705 static void block5_data_unref (Block5Data* _data5_);
706 static void __lambda14_ (Block5Data* _data5_, GObject* obj, GAsyncResult* _result_);
707 void unity_scope_proxy_global_search (UnityScopeProxy* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
708 GHashTable* unity_scope_proxy_global_search_finish (UnityScopeProxy* self, GAsyncResult* _res_);
709 static Block6Data* block6_data_ref (Block6Data* _data6_);
710 static void block6_data_unref (Block6Data* _data6_);
711 static Block7Data* block7_data_ref (Block7Data* _data7_);
712 static void block7_data_unref (Block7Data* _data7_);
713 static void ____lambda15_ (Block7Data* _data7_, DeeSharedModel* m, guint64 begin_seqnum, guint64 end_seqnum);
714 void unity_lens_service_global_search (UnityLensService* self, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_);
715 GHashTable* unity_lens_service_global_search_finish (UnityLensService* self, GAsyncResult* _res_, GError** error);
716 static void _____lambda15__dee_shared_model_end_transaction (DeeSharedModel* _sender, guint64 begin_seqnum, guint64 end_seqnum, gpointer self);
717 static void ___lambda14__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
718 gboolean unity_scope_proxy_get_search_in_global (UnityScopeProxy* self);
719 static void unity_lens_impl_real_preview_data_free (gpointer _data);
720 static void unity_lens_impl_real_preview (UnityLensService* base, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
721 static gboolean unity_lens_impl_real_preview_co (UnityLensImplPreviewData* _data_);
722 void unity_scope_proxy_preview (UnityScopeProxy* self, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
723 void unity_scope_proxy_preview_finish (UnityScopeProxy* self, GAsyncResult* _res_, UnityPreviewReplyRaw* result);
724 static void unity_lens_impl_preview_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
725 static void unity_lens_impl_real_update_filter_data_free (gpointer _data);
726 static void unity_lens_impl_real_update_filter (UnityLensService* base, const gchar* filter_name, GHashTable* properties, GAsyncReadyCallback _callback_, gpointer _user_data_);
727 static gboolean unity_lens_impl_real_update_filter_co (UnityLensImplUpdateFilterData* _data_);
728 static void unity_lens_impl_update_active_sources_data_free (gpointer _data);
729 static gboolean unity_lens_impl_update_active_sources_co (UnityLensImplUpdateActiveSourcesData* _data_);
730 static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value);
731 void unity_scope_proxy_set_active_sources (UnityScopeProxy* self, gchar** sources, int sources_length1, GAsyncReadyCallback _callback_, gpointer _user_data_);
732 void unity_scope_proxy_set_active_sources_finish (UnityScopeProxy* self, GAsyncResult* _res_);
733 static void unity_lens_impl_real_set_view_type_data_free (gpointer _data);
734 static void unity_lens_impl_real_set_view_type (UnityLensService* base, guint view_type, GAsyncReadyCallback _callback_, gpointer _user_data_);
735 static gboolean unity_lens_impl_real_set_view_type_co (UnityLensImplSetViewTypeData* _data_);
736 void unity_scope_proxy_set_view_type (UnityScopeProxy* self, UnityViewType value);
737 void unity_lens_set_active_internal (UnityLens* self, gboolean is_active);
738 UnityResultsSynchronizer* unity_lens_impl_get_results_sync (UnityLensImpl* self);
739 UnityResultsSynchronizer* unity_lens_impl_get_global_results_sync (UnityLensImpl* self);
740 static void unity_lens_impl_finalize (GObject* obj);
741 static void _vala_unity_lens_impl_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
742 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
743 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
744 static gint _vala_array_length (gpointer array);
745
746
747 static void _unity_lens_impl_queue_info_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
748 unity_lens_impl_queue_info_changed (self);
749 }
750
751
752 static void _unity_lens_impl_sources_display_name_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
753 unity_lens_impl_sources_display_name_changed (self, _sender, pspec);
754 }
755
756
757 static void _unity_lens_impl_on_scope_added_unity_scope_factory_scope_added (UnityScopeFactory* _sender, UnityScopeProxy* scope, gpointer self) {
758 unity_lens_impl_on_scope_added (self, _sender, scope);
759 }
760
761
762 UnityLensImpl* unity_lens_impl_construct (GType object_type, UnityLens* owner) {
763 UnityLensImpl * self = NULL;
764 UnityLens* _tmp0_;
765 UnityLens* _tmp1_;
766 UnityLens* _tmp2_;
767 UnityLens* _tmp3_;
768 UnityLens* _tmp4_;
769 UnityLens* _tmp5_;
770 const gchar* _tmp6_;
771 const gchar* _tmp7_;
772 UnityCheckOptionFilter* _tmp8_;
773 gchar* _tmp9_ = NULL;
774 gchar* _tmp10_;
775 UnityLens* _tmp11_;
776 const gchar* _tmp12_;
777 const gchar* _tmp13_;
778 const gchar* _tmp14_;
779 UnityScopeFactory* _tmp15_;
780 UnityScopeFactory* _tmp16_;
781 g_return_val_if_fail (owner != NULL, NULL);
782 self = (UnityLensImpl*) g_object_new (object_type, NULL);
783 _tmp0_ = owner;
784 self->priv->_owner = _tmp0_;
785 _tmp1_ = self->priv->_owner;
786 g_signal_connect_object ((GObject*) _tmp1_, "notify::search-in-global", (GCallback) _unity_lens_impl_queue_info_changed_g_object_notify, self, 0);
787 _tmp2_ = self->priv->_owner;
788 g_signal_connect_object ((GObject*) _tmp2_, "notify::visible", (GCallback) _unity_lens_impl_queue_info_changed_g_object_notify, self, 0);
789 _tmp3_ = self->priv->_owner;
790 g_signal_connect_object ((GObject*) _tmp3_, "notify::search-hint", (GCallback) _unity_lens_impl_queue_info_changed_g_object_notify, self, 0);
791 _tmp4_ = self->priv->_owner;
792 g_signal_connect_object ((GObject*) _tmp4_, "notify::sources-display-name", (GCallback) _unity_lens_impl_sources_display_name_changed_g_object_notify, self, 0);
793 _tmp5_ = self->priv->_owner;
794 _tmp6_ = unity_lens_get_sources_display_name (_tmp5_);
795 _tmp7_ = _tmp6_;
796 _tmp8_ = unity_check_option_filter_new (UNITY_LENS_SOURCES_FILTER_ID, _tmp7_, NULL, TRUE);
797 _g_object_unref0 (self->priv->_sources);
798 self->priv->_sources = (UnityOptionsFilter*) _tmp8_;
799 _tmp9_ = unity_lens_impl_create_dbus_name (self);
800 _tmp10_ = _tmp9_;
801 unity_lens_impl_create_models (self, _tmp10_);
802 _g_free0 (_tmp10_);
803 unity_lens_impl_create_synchronizers (self);
804 _tmp11_ = self->priv->_owner;
805 _tmp12_ = unity_lens_get_id (_tmp11_);
806 _tmp13_ = _tmp12_;
807 _tmp14_ = unity_lens_impl_LENS_DIRECTORY;
808 _tmp15_ = unity_scope_factory_new (_tmp13_, _tmp14_);
809 _g_object_unref0 (self->priv->_scope_factory);
810 self->priv->_scope_factory = _tmp15_;
811 _tmp16_ = self->priv->_scope_factory;
812 g_signal_connect_object (_tmp16_, "scope-added", (GCallback) _unity_lens_impl_on_scope_added_unity_scope_factory_scope_added, self, 0);
813 return self;
814 }
815
816
817 UnityLensImpl* unity_lens_impl_new (UnityLens* owner) {
818 return unity_lens_impl_construct (UNITY_TYPE_LENS_IMPL, owner);
819 }
820
821
822 static gchar* unity_lens_impl_create_dbus_name (UnityLensImpl* self) {
823 gchar* result = NULL;
824 time_t _tmp0_;
825 guint t;
826 UnityLens* _tmp1_;
827 const gchar* _tmp2_;
828 const gchar* _tmp3_;
829 gchar* _tmp4_;
830 gchar* _tmp5_;
831 gchar* _tmp6_ = NULL;
832 gchar* _tmp7_;
833 gchar* _tmp8_;
834 gchar* _tmp9_;
835 g_return_val_if_fail (self != NULL, NULL);
836 _tmp0_ = time (NULL);
837 t = (guint) _tmp0_;
838 _tmp1_ = self->priv->_owner;
839 _tmp2_ = unity_lens_get_id (_tmp1_);
840 _tmp3_ = _tmp2_;
841 _tmp4_ = g_strconcat ("com.canonical.Unity.Lens" ".", _tmp3_, NULL);
842 _tmp5_ = _tmp4_;
843 _tmp6_ = g_strdup_printf (".T%u", t);
844 _tmp7_ = _tmp6_;
845 _tmp8_ = g_strconcat (_tmp5_, _tmp7_, NULL);
846 _tmp9_ = _tmp8_;
847 _g_free0 (_tmp7_);
848 _g_free0 (_tmp5_);
849 result = _tmp9_;
850 return result;
851 }
852
853
854 static void unity_lens_impl_create_models (UnityLensImpl* self, const gchar* dbus_name) {
855 const gchar* _tmp0_;
856 gchar* _tmp1_;
857 gchar* _tmp2_;
858 DeeSharedModel* _tmp3_;
859 DeeSharedModel* _tmp4_;
860 const gchar* _tmp5_;
861 gchar* _tmp6_;
862 gchar* _tmp7_;
863 DeeSharedModel* _tmp8_;
864 DeeSharedModel* _tmp9_;
865 const gchar* _tmp10_;
866 gchar* _tmp11_;
867 gchar* _tmp12_;
868 DeeSharedModel* _tmp13_;
869 DeeSharedModel* _tmp14_;
870 const gchar* _tmp15_;
871 gchar* _tmp16_;
872 gchar* _tmp17_;
873 DeeSharedModel* _tmp18_;
874 DeeSharedModel* _tmp19_;
875 g_return_if_fail (self != NULL);
876 g_return_if_fail (dbus_name != NULL);
877 _tmp0_ = dbus_name;
878 _tmp1_ = g_strconcat (_tmp0_, ".Results", NULL);
879 _tmp2_ = _tmp1_;
880 _tmp3_ = (DeeSharedModel*) dee_shared_model_new (_tmp2_);
881 _g_object_unref0 (self->priv->_results_model);
882 self->priv->_results_model = _tmp3_;
883 _g_free0 (_tmp2_);
884 _tmp4_ = self->priv->_results_model;
885 dee_model_set_schema ((DeeModel*) _tmp4_, "s", "s", "u", "s", "s", "s", "s", NULL);
886 _tmp5_ = dbus_name;
887 _tmp6_ = g_strconcat (_tmp5_, ".GlobalResults", NULL);
888 _tmp7_ = _tmp6_;
889 _tmp8_ = (DeeSharedModel*) dee_shared_model_new (_tmp7_);
890 _g_object_unref0 (self->priv->_global_results_model);
891 self->priv->_global_results_model = _tmp8_;
892 _g_free0 (_tmp7_);
893 _tmp9_ = self->priv->_global_results_model;
894 dee_model_set_schema ((DeeModel*) _tmp9_, "s", "s", "u", "s", "s", "s", "s", NULL);
895 _tmp10_ = dbus_name;
896 _tmp11_ = g_strconcat (_tmp10_, ".Categories", NULL);
897 _tmp12_ = _tmp11_;
898 _tmp13_ = (DeeSharedModel*) dee_shared_model_new (_tmp12_);
899 _g_object_unref0 (self->priv->_categories_model);
900 self->priv->_categories_model = _tmp13_;
901 _g_free0 (_tmp12_);
902 _tmp14_ = self->priv->_categories_model;
903 dee_model_set_schema ((DeeModel*) _tmp14_, "s", "s", "s", "a{sv}", NULL);
904 _tmp15_ = dbus_name;
905 _tmp16_ = g_strconcat (_tmp15_, ".Filters", NULL);
906 _tmp17_ = _tmp16_;
907 _tmp18_ = (DeeSharedModel*) dee_shared_model_new (_tmp17_);
908 _g_object_unref0 (self->priv->_filters_model);
909 self->priv->_filters_model = _tmp18_;
910 _g_free0 (_tmp17_);
911 _tmp19_ = self->priv->_filters_model;
912 dee_model_set_schema ((DeeModel*) _tmp19_, "s", "s", "s", "s", "a{sv}", "b", "b", "b", NULL);
913 }
914
915
916 static void __lambda10_ (UnityLensImpl* self, DeeModel* model, DeeModelIter* iter) {
917 DeeModel* _tmp0_;
918 DeeModelIter* _tmp1_;
919 const gchar* _tmp2_ = NULL;
920 DeeModel* _tmp3_;
921 DeeModelIter* _tmp4_;
922 g_return_if_fail (model != NULL);
923 g_return_if_fail (iter != NULL);
924 _tmp0_ = model;
925 _tmp1_ = iter;
926 _tmp2_ = dee_model_get_string (_tmp0_, _tmp1_, (guint) 0);
927 if (g_strcmp0 (_tmp2_, UNITY_LENS_SOURCES_FILTER_ID) != 0) {
928 return;
929 }
930 _tmp3_ = model;
931 _tmp4_ = iter;
932 unity_lens_impl_sources_filter_changed (self, _tmp3_, _tmp4_);
933 }
934
935
936 static void ___lambda10__dee_model_row_changed (DeeModel* _sender, DeeModelIter* iter, gpointer self) {
937 __lambda10_ (self, _sender, iter);
938 }
939
940
941 static void unity_lens_impl_create_synchronizers (UnityLensImpl* self) {
942 DeeSharedModel* _tmp0_;
943 UnityResultsSynchronizer* _tmp1_;
944 DeeSharedModel* _tmp2_;
945 UnityResultsSynchronizer* _tmp3_;
946 DeeSharedModel* _tmp4_;
947 UnityFiltersSynchronizer* _tmp5_;
948 DeeSharedModel* _tmp6_;
949 g_return_if_fail (self != NULL);
950 _tmp0_ = self->priv->_results_model;
951 _tmp1_ = unity_results_synchronizer_new ((DeeModel*) _tmp0_);
952 _g_object_unref0 (self->priv->_results_sync);
953 self->priv->_results_sync = _tmp1_;
954 _tmp2_ = self->priv->_global_results_model;
955 _tmp3_ = unity_results_synchronizer_new ((DeeModel*) _tmp2_);
956 _g_object_unref0 (self->priv->_global_results_sync);
957 self->priv->_global_results_sync = _tmp3_;
958 _tmp4_ = self->priv->_filters_model;
959 _tmp5_ = unity_filters_synchronizer_new ((DeeModel*) _tmp4_);
960 _g_object_unref0 (self->priv->_filters_sync);
961 self->priv->_filters_sync = _tmp5_;
962 _tmp6_ = self->priv->_filters_model;
963 g_signal_connect_object ((DeeModel*) _tmp6_, "row-changed", (GCallback) ___lambda10__dee_model_row_changed, self, 0);
964 }
965
966
967 void unity_lens_impl_export (UnityLensImpl* self, GError** error) {
968 GDBusConnection* _tmp0_ = NULL;
969 GDBusConnection* conn;
970 GDBusConnection* _tmp1_;
971 UnityLens* _tmp2_;
972 const gchar* _tmp3_;
973 const gchar* _tmp4_;
974 guint _tmp5_ = 0U;
975 guint _tmp6_;
976 GError * _inner_error_ = NULL;
977 g_return_if_fail (self != NULL);
978 _tmp0_ = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &_inner_error_);
979 conn = _tmp0_;
980 if (_inner_error_ != NULL) {
981 if (_inner_error_->domain == G_IO_ERROR) {
982 g_propagate_error (error, _inner_error_);
983 return;
984 } else {
985 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);
986 g_clear_error (&_inner_error_);
987 return;
988 }
989 }
990 _tmp1_ = conn;
991 _tmp2_ = self->priv->_owner;
992 _tmp3_ = unity_lens_get_dbus_path (_tmp2_);
993 _tmp4_ = _tmp3_;
994 _tmp5_ = unity_lens_service_register_object (UNITY_IS_LENS_SERVICE (self) ? ((UnityLensService*) self) : NULL, _tmp1_, _tmp4_, &_inner_error_);
995 _tmp6_ = _tmp5_;
996 if (_inner_error_ != NULL) {
997 if (_inner_error_->domain == G_IO_ERROR) {
998 g_propagate_error (error, _inner_error_);
999 _g_object_unref0 (conn);
1000 return;
1001 } else {
1002 _g_object_unref0 (conn);
1003 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);
1004 g_clear_error (&_inner_error_);
1005 return;
1006 }
1007 }
1008 self->priv->_dbus_id = _tmp6_;
1009 unity_lens_impl_queue_info_changed (self);
1010 _g_object_unref0 (conn);
1011 }
1012
1013
1014 static gpointer _g_object_ref0 (gpointer self) {
1015 return self ? g_object_ref (self) : NULL;
1016 }
1017
1018
1019 void unity_lens_impl_load_categories (UnityLensImpl* self, GList* categories) {
1020 GList* _tmp0_;
1021 g_return_if_fail (self != NULL);
1022 _tmp0_ = categories;
1023 {
1024 GList* category_collection = NULL;
1025 GList* category_it = NULL;
1026 category_collection = _tmp0_;
1027 for (category_it = category_collection; category_it != NULL; category_it = category_it->next) {
1028 UnityCategory* _tmp1_;
1029 UnityCategory* category = NULL;
1030 _tmp1_ = _g_object_ref0 ((UnityCategory*) category_it->data);
1031 category = _tmp1_;
1032 {
1033 gchar* _tmp2_ = NULL;
1034 UnityCategory* _tmp3_;
1035 GIcon* _tmp4_;
1036 GIcon* _tmp5_;
1037 const gchar* _tmp11_;
1038 gchar* _tmp12_;
1039 gchar* icon_hint_s;
1040 DeeSharedModel* _tmp13_;
1041 UnityCategory* _tmp14_;
1042 const gchar* _tmp15_;
1043 const gchar* _tmp16_;
1044 const gchar* _tmp17_;
1045 UnityCategory* _tmp18_;
1046 const gchar* _tmp19_;
1047 const gchar* _tmp20_;
1048 UnityCategory* _tmp21_;
1049 GHashTable* _tmp22_;
1050 GHashTable* _tmp23_;
1051 GVariant* _tmp24_ = NULL;
1052 GVariant* _tmp25_;
1053 _tmp3_ = category;
1054 _tmp4_ = unity_category_get_icon_hint (_tmp3_);
1055 _tmp5_ = _tmp4_;
1056 if (_tmp5_ != NULL) {
1057 UnityCategory* _tmp6_;
1058 GIcon* _tmp7_;
1059 GIcon* _tmp8_;
1060 gchar* _tmp9_ = NULL;
1061 _tmp6_ = category;
1062 _tmp7_ = unity_category_get_icon_hint (_tmp6_);
1063 _tmp8_ = _tmp7_;
1064 _tmp9_ = g_icon_to_string (_tmp8_);
1065 _g_free0 (_tmp2_);
1066 _tmp2_ = _tmp9_;
1067 } else {
1068 gchar* _tmp10_;
1069 _tmp10_ = g_strdup ("");
1070 _g_free0 (_tmp2_);
1071 _tmp2_ = _tmp10_;
1072 }
1073 _tmp11_ = _tmp2_;
1074 _tmp12_ = g_strdup (_tmp11_);
1075 icon_hint_s = _tmp12_;
1076 _tmp13_ = self->priv->_categories_model;
1077 _tmp14_ = category;
1078 _tmp15_ = unity_category_get_name (_tmp14_);
1079 _tmp16_ = _tmp15_;
1080 _tmp17_ = icon_hint_s;
1081 _tmp18_ = category;
1082 _tmp19_ = unity_category_get_renderer (_tmp18_);
1083 _tmp20_ = _tmp19_;
1084 _tmp21_ = category;
1085 _tmp22_ = unity_category_get_hints (_tmp21_);
1086 _tmp23_ = _tmp22_;
1087 _tmp24_ = unity_tools_hash_table_to_asv (_tmp23_);
1088 _tmp25_ = _tmp24_;
1089 dee_model_append ((DeeModel*) _tmp13_, _tmp16_, _tmp17_, _tmp20_, _tmp25_, NULL);
1090 _g_variant_unref0 (_tmp25_);
1091 _g_free0 (icon_hint_s);
1092 _g_free0 (_tmp2_);
1093 _g_object_unref0 (category);
1094 }
1095 }
1096 }
1097 }
1098
1099
1100 static void _unity_lens_impl_on_filter_changed_unity_filter_changed (UnityFilter* _sender, gpointer self) {
1101 unity_lens_impl_on_filter_changed (self, _sender);
1102 }
1103
1104
1105 void unity_lens_impl_load_filters (UnityLensImpl* self, GList* filters) {
1106 DeeSharedModel* _tmp0_;
1107 GList* _tmp1_;
1108 GList* _tmp3_;
1109 GList* _tmp4_ = NULL;
1110 GList* filters_and_sources;
1111 UnityOptionsFilter* _tmp5_;
1112 GList* _tmp6_;
1113 guint _tmp7_ = 0U;
1114 GList* _tmp9_;
1115 g_return_if_fail (self != NULL);
1116 _tmp0_ = self->priv->_filters_model;
1117 dee_model_clear ((DeeModel*) _tmp0_);
1118 _tmp1_ = filters;
1119 {
1120 GList* filter_collection = NULL;
1121 GList* filter_it = NULL;
1122 filter_collection = _tmp1_;
1123 for (filter_it = filter_collection; filter_it != NULL; filter_it = filter_it->next) {
1124 UnityFilter* filter = NULL;
1125 filter = (UnityFilter*) filter_it->data;
1126 {
1127 UnityFilter* _tmp2_;
1128 _tmp2_ = filter;
1129 g_signal_connect_object (_tmp2_, "changed", (GCallback) _unity_lens_impl_on_filter_changed_unity_filter_changed, self, 0);
1130 }
1131 }
1132 }
1133 _tmp3_ = filters;
1134 _tmp4_ = g_list_copy (_tmp3_);
1135 filters_and_sources = _tmp4_;
1136 _tmp5_ = self->priv->_sources;
1137 _tmp6_ = _tmp5_->options;
1138 _tmp7_ = g_list_length (_tmp6_);
1139 if (_tmp7_ > ((guint) 0)) {
1140 UnityOptionsFilter* _tmp8_;
1141 _tmp8_ = self->priv->_sources;
1142 filters_and_sources = g_list_append (filters_and_sources, (UnityFilter*) _tmp8_);
1143 }
1144 _tmp9_ = filters_and_sources;
1145 {
1146 GList* filter_collection = NULL;
1147 GList* filter_it = NULL;
1148 filter_collection = _tmp9_;
1149 for (filter_it = filter_collection; filter_it != NULL; filter_it = filter_it->next) {
1150 UnityFilter* filter = NULL;
1151 filter = (UnityFilter*) filter_it->data;
1152 {
1153 gchar* _tmp10_ = NULL;
1154 UnityFilter* _tmp11_;
1155 GIcon* _tmp12_;
1156 GIcon* _tmp13_;
1157 const gchar* _tmp19_;
1158 gchar* _tmp20_;
1159 gchar* icon_hint_s;
1160 DeeSharedModel* _tmp21_;
1161 UnityFilter* _tmp22_;
1162 const gchar* _tmp23_;
1163 const gchar* _tmp24_;
1164 UnityFilter* _tmp25_;
1165 const gchar* _tmp26_;
1166 const gchar* _tmp27_;
1167 const gchar* _tmp28_;
1168 UnityFilter* _tmp29_;
1169 UnityFilterRenderer _tmp30_;
1170 UnityFilterRenderer _tmp31_;
1171 const gchar* _tmp32_ = NULL;
1172 UnityFilter* _tmp33_;
1173 GHashTable* _tmp34_ = NULL;
1174 GHashTable* _tmp35_;
1175 GVariant* _tmp36_ = NULL;
1176 GVariant* _tmp37_;
1177 UnityFilter* _tmp38_;
1178 gboolean _tmp39_;
1179 gboolean _tmp40_;
1180 UnityFilter* _tmp41_;
1181 gboolean _tmp42_;
1182 gboolean _tmp43_;
1183 UnityFilter* _tmp44_;
1184 gboolean _tmp45_;
1185 gboolean _tmp46_;
1186 _tmp11_ = filter;
1187 _tmp12_ = unity_filter_get_icon_hint (_tmp11_);
1188 _tmp13_ = _tmp12_;
1189 if (_tmp13_ != NULL) {
1190 UnityFilter* _tmp14_;
1191 GIcon* _tmp15_;
1192 GIcon* _tmp16_;
1193 gchar* _tmp17_ = NULL;
1194 _tmp14_ = filter;
1195 _tmp15_ = unity_filter_get_icon_hint (_tmp14_);
1196 _tmp16_ = _tmp15_;
1197 _tmp17_ = g_icon_to_string (_tmp16_);
1198 _g_free0 (_tmp10_);
1199 _tmp10_ = _tmp17_;
1200 } else {
1201 gchar* _tmp18_;
1202 _tmp18_ = g_strdup ("");
1203 _g_free0 (_tmp10_);
1204 _tmp10_ = _tmp18_;
1205 }
1206 _tmp19_ = _tmp10_;
1207 _tmp20_ = g_strdup (_tmp19_);
1208 icon_hint_s = _tmp20_;
1209 _tmp21_ = self->priv->_filters_model;
1210 _tmp22_ = filter;
1211 _tmp23_ = unity_filter_get_id (_tmp22_);
1212 _tmp24_ = _tmp23_;
1213 _tmp25_ = filter;
1214 _tmp26_ = unity_filter_get_display_name (_tmp25_);
1215 _tmp27_ = _tmp26_;
1216 _tmp28_ = icon_hint_s;
1217 _tmp29_ = filter;
1218 _tmp30_ = unity_filter_get_renderer (_tmp29_);
1219 _tmp31_ = _tmp30_;
1220 _tmp32_ = unity_filter_get_renderer_name (_tmp31_);
1221 _tmp33_ = filter;
1222 _tmp34_ = unity_filter_get_hints (_tmp33_);
1223 _tmp35_ = _tmp34_;
1224 _tmp36_ = unity_tools_hash_table_to_asv (_tmp35_);
1225 _tmp37_ = _tmp36_;
1226 _tmp38_ = filter;
1227 _tmp39_ = unity_filter_get_visible (_tmp38_);
1228 _tmp40_ = _tmp39_;
1229 _tmp41_ = filter;
1230 _tmp42_ = unity_filter_get_collapsed (_tmp41_);
1231 _tmp43_ = _tmp42_;
1232 _tmp44_ = filter;
1233 _tmp45_ = unity_filter_get_filtering (_tmp44_);
1234 _tmp46_ = _tmp45_;
1235 dee_model_append ((DeeModel*) _tmp21_, _tmp24_, _tmp27_, _tmp28_, _tmp32_, _tmp37_, _tmp40_, _tmp43_, _tmp46_, NULL);
1236 _g_variant_unref0 (_tmp37_);
1237 _g_hash_table_unref0 (_tmp35_);
1238 _g_free0 (icon_hint_s);
1239 _g_free0 (_tmp10_);
1240 }
1241 }
1242 }
1243 _g_list_free0 (filters_and_sources);
1244 }
1245
1246
1247 static gboolean _unity_lens_impl_emit_info_changed_gsource_func (gpointer self) {
1248 gboolean result;
1249 result = unity_lens_impl_emit_info_changed (self);
1250 return result;
1251 }
1252
1253
1254 static void unity_lens_impl_queue_info_changed (UnityLensImpl* self) {
1255 guint _tmp0_;
1256 g_return_if_fail (self != NULL);
1257 _tmp0_ = self->priv->_info_changed_id;
1258 if (_tmp0_ == ((guint) 0)) {
1259 guint _tmp1_ = 0U;
1260 _tmp1_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, _unity_lens_impl_emit_info_changed_gsource_func, g_object_ref (self), g_object_unref);
1261 self->priv->_info_changed_id = _tmp1_;
1262 }
1263 }
1264
1265
1266 static void _g_free0_ (gpointer var) {
1267 var = (g_free (var), NULL);
1268 }
1269
1270
1271 static void _g_variant_unref0_ (gpointer var) {
1272 (var == NULL) ? NULL : (var = (g_variant_unref (var), NULL));
1273 }
1274
1275
1276 static gboolean unity_lens_impl_emit_info_changed (UnityLensImpl* self) {
1277 gboolean result = FALSE;
1278 UnityLensInfo info = {0};
1279 UnityLens* _tmp0_;
1280 const gchar* _tmp1_;
1281 const gchar* _tmp2_;
1282 gchar* _tmp3_;
1283 UnityLens* _tmp4_;
1284 gboolean _tmp5_;
1285 gboolean _tmp6_;
1286 UnityLens* _tmp7_;
1287 const gchar* _tmp8_;
1288 const gchar* _tmp9_;
1289 gchar* _tmp10_;
1290 UnityLens* _tmp11_;
1291 gboolean _tmp12_;
1292 gboolean _tmp13_;
1293 gchar* _tmp14_;
1294 DeeSharedModel* _tmp15_;
1295 const gchar* _tmp16_ = NULL;
1296 gchar* _tmp17_;
1297 DeeSharedModel* _tmp18_;
1298 const gchar* _tmp19_ = NULL;
1299 gchar* _tmp20_;
1300 DeeSharedModel* _tmp21_;
1301 const gchar* _tmp22_ = NULL;
1302 gchar* _tmp23_;
1303 DeeSharedModel* _tmp24_;
1304 const gchar* _tmp25_ = NULL;
1305 gchar* _tmp26_;
1306 GHashTable* _tmp27_;
1307 UnityLensInfo _tmp28_;
1308 g_return_val_if_fail (self != NULL, FALSE);
1309 memset (&info, 0, sizeof (UnityLensInfo));
1310 _tmp0_ = self->priv->_owner;
1311 _tmp1_ = unity_lens_get_dbus_path (_tmp0_);
1312 _tmp2_ = _tmp1_;
1313 _tmp3_ = g_strdup (_tmp2_);
1314 _g_free0 (info.dbus_path);
1315 info.dbus_path = _tmp3_;
1316 _tmp4_ = self->priv->_owner;
1317 _tmp5_ = unity_lens_get_search_in_global (_tmp4_);
1318 _tmp6_ = _tmp5_;
1319 info.search_in_global = _tmp6_;
1320 _tmp7_ = self->priv->_owner;
1321 _tmp8_ = unity_lens_get_search_hint (_tmp7_);
1322 _tmp9_ = _tmp8_;
1323 _tmp10_ = g_strdup (_tmp9_);
1324 _g_free0 (info.search_hint);
1325 info.search_hint = _tmp10_;
1326 _tmp11_ = self->priv->_owner;
1327 _tmp12_ = unity_lens_get_visible (_tmp11_);
1328 _tmp13_ = _tmp12_;
1329 info.visible = _tmp13_;
1330 _tmp14_ = g_strdup ("<not implemented>");
1331 _g_free0 (info.private_connection_name);
1332 info.private_connection_name = _tmp14_;
1333 _tmp15_ = self->priv->_results_model;
1334 _tmp16_ = dee_shared_model_get_swarm_name (_tmp15_);
1335 _tmp17_ = g_strdup (_tmp16_);
1336 _g_free0 (info.results_model_name);
1337 info.results_model_name = _tmp17_;
1338 _tmp18_ = self->priv->_global_results_model;
1339 _tmp19_ = dee_shared_model_get_swarm_name (_tmp18_);
1340 _tmp20_ = g_strdup (_tmp19_);
1341 _g_free0 (info.global_results_model_name);
1342 info.global_results_model_name = _tmp20_;
1343 _tmp21_ = self->priv->_categories_model;
1344 _tmp22_ = dee_shared_model_get_swarm_name (_tmp21_);
1345 _tmp23_ = g_strdup (_tmp22_);
1346 _g_free0 (info.categories_model_name);
1347 info.categories_model_name = _tmp23_;
1348 _tmp24_ = self->priv->_filters_model;
1349 _tmp25_ = dee_shared_model_get_swarm_name (_tmp24_);
1350 _tmp26_ = g_strdup (_tmp25_);
1351 _g_free0 (info.filters_model_name);
1352 info.filters_model_name = _tmp26_;
1353 _tmp27_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
1354 _g_hash_table_unref0 (info.hints);
1355 info.hints = _tmp27_;
1356 _tmp28_ = info;
1357 g_signal_emit_by_name ((UnityLensService*) self, "changed", &_tmp28_);
1358 self->priv->_info_changed_id = (guint) 0;
1359 result = FALSE;
1360 unity_lens_info_destroy (&info);
1361 return result;
1362 }
1363
1364
1365 static void _unity_lens_impl_on_scope_results_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1366 unity_lens_impl_on_scope_results_model_changed (self, _sender, pspec);
1367 }
1368
1369
1370 static void _unity_lens_impl_on_scope_global_results_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1371 unity_lens_impl_on_scope_global_results_model_changed (self, _sender, pspec);
1372 }
1373
1374
1375 static void _unity_lens_impl_on_scope_filters_model_changed_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1376 unity_lens_impl_on_scope_filters_model_changed (self, _sender, pspec);
1377 }
1378
1379
1380 static void _unity_lens_impl_on_scope_sources_updated_g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1381 unity_lens_impl_on_scope_sources_updated (self, _sender, pspec);
1382 }
1383
1384
1385 static void unity_lens_impl_on_scope_added (UnityLensImpl* self, UnityScopeFactory* factory, UnityScopeProxy* scope) {
1386 UnityScopeProxy* _tmp0_;
1387 DeeSerializableModel* _tmp1_;
1388 DeeSerializableModel* _tmp2_;
1389 UnityScopeProxy* _tmp4_;
1390 DeeSerializableModel* _tmp5_;
1391 DeeSerializableModel* _tmp6_;
1392 UnityScopeProxy* _tmp8_;
1393 DeeSerializableModel* _tmp9_;
1394 DeeSerializableModel* _tmp10_;
1395 UnityScopeProxy* _tmp12_;
1396 UnityScopeProxy* _tmp13_;
1397 UnityScopeProxy* _tmp14_;
1398 UnityScopeProxy* _tmp15_;
1399 g_return_if_fail (self != NULL);
1400 g_return_if_fail (factory != NULL);
1401 g_return_if_fail (scope != NULL);
1402 _tmp0_ = scope;
1403 _tmp1_ = unity_scope_proxy_get_results_model (_tmp0_);
1404 _tmp2_ = _tmp1_;
1405 if (DEE_IS_MODEL (_tmp2_)) {
1406 UnityScopeProxy* _tmp3_;
1407 _tmp3_ = scope;
1408 unity_lens_impl_on_scope_results_model_changed (self, (GObject*) _tmp3_, NULL);
1409 }
1410 _tmp4_ = scope;
1411 _tmp5_ = unity_scope_proxy_get_global_results_model (_tmp4_);
1412 _tmp6_ = _tmp5_;
1413 if (DEE_IS_MODEL (_tmp6_)) {
1414 UnityScopeProxy* _tmp7_;
1415 _tmp7_ = scope;
1416 unity_lens_impl_on_scope_global_results_model_changed (self, (GObject*) _tmp7_, NULL);
1417 }
1418 _tmp8_ = scope;
1419 _tmp9_ = unity_scope_proxy_get_filters_model (_tmp8_);
1420 _tmp10_ = _tmp9_;
1421 if (DEE_IS_MODEL (_tmp10_)) {
1422 UnityScopeProxy* _tmp11_;
1423 _tmp11_ = scope;
1424 unity_lens_impl_on_scope_filters_model_changed (self, (GObject*) _tmp11_, NULL);
1425 }
1426 _tmp12_ = scope;
1427 g_signal_connect_object ((GObject*) _tmp12_, "notify::results-model", (GCallback) _unity_lens_impl_on_scope_results_model_changed_g_object_notify, self, 0);
1428 _tmp13_ = scope;
1429 g_signal_connect_object ((GObject*) _tmp13_, "notify::global-results-model", (GCallback) _unity_lens_impl_on_scope_global_results_model_changed_g_object_notify, self, 0);
1430 _tmp14_ = scope;
1431 g_signal_connect_object ((GObject*) _tmp14_, "notify::filters-model", (GCallback) _unity_lens_impl_on_scope_filters_model_changed_g_object_notify, self, 0);
1432 _tmp15_ = scope;
1433 g_signal_connect_object ((GObject*) _tmp15_, "notify::sources", (GCallback) _unity_lens_impl_on_scope_sources_updated_g_object_notify, self, 0);
1434 }
1435
1436
1437 static void unity_lens_impl_on_scope_results_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec) {
1438 GObject* _tmp0_;
1439 UnityScopeProxy* _tmp1_;
1440 UnityScopeProxy* scope;
1441 UnityResultsSynchronizer* _tmp2_;
1442 DeeSerializableModel* _tmp3_;
1443 DeeSerializableModel* _tmp4_;
1444 gchar* _tmp5_ = NULL;
1445 gchar* _tmp6_;
1446 g_return_if_fail (self != NULL);
1447 g_return_if_fail (obj != NULL);
1448 _tmp0_ = obj;
1449 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
1450 scope = _tmp1_;
1451 _tmp2_ = self->priv->_results_sync;
1452 _tmp3_ = unity_scope_proxy_get_results_model (scope);
1453 _tmp4_ = _tmp3_;
1454 _tmp5_ = unity_lens_impl_uid_for_scope (self, scope);
1455 _tmp6_ = _tmp5_;
1456 unity_results_synchronizer_add_provider (_tmp2_, (DeeModel*) _tmp4_, _tmp6_);
1457 _g_free0 (_tmp6_);
1458 _g_object_unref0 (scope);
1459 }
1460
1461
1462 static void unity_lens_impl_on_scope_global_results_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec) {
1463 GObject* _tmp0_;
1464 UnityScopeProxy* _tmp1_;
1465 UnityScopeProxy* scope;
1466 UnityResultsSynchronizer* _tmp2_;
1467 DeeSerializableModel* _tmp3_;
1468 DeeSerializableModel* _tmp4_;
1469 gchar* _tmp5_ = NULL;
1470 gchar* _tmp6_;
1471 g_return_if_fail (self != NULL);
1472 g_return_if_fail (obj != NULL);
1473 _tmp0_ = obj;
1474 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
1475 scope = _tmp1_;
1476 _tmp2_ = self->priv->_global_results_sync;
1477 _tmp3_ = unity_scope_proxy_get_global_results_model (scope);
1478 _tmp4_ = _tmp3_;
1479 _tmp5_ = g_strdup_printf ("%p", scope);
1480 _tmp6_ = _tmp5_;
1481 unity_results_synchronizer_add_provider (_tmp2_, (DeeModel*) _tmp4_, _tmp6_);
1482 _g_free0 (_tmp6_);
1483 _g_object_unref0 (scope);
1484 }
1485
1486
1487 static Block1Data* block1_data_ref (Block1Data* _data1_) {
1488 g_atomic_int_inc (&_data1_->_ref_count_);
1489 return _data1_;
1490 }
1491
1492
1493 static void block1_data_unref (Block1Data* _data1_) {
1494 if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
1495 _g_object_unref0 (_data1_->self);
1496 _g_object_unref0 (_data1_->scope);
1497 g_slice_free (Block1Data, _data1_);
1498 }
1499 }
1500
1501
1502 static void ___lambda11_ (Block1Data* _data1_) {
1503 UnityLensImpl * self;
1504 UnityFiltersSynchronizer* _tmp0_;
1505 UnityScopeProxy* _tmp1_;
1506 DeeSerializableModel* _tmp2_;
1507 DeeSerializableModel* _tmp3_;
1508 self = _data1_->self;
1509 _tmp0_ = self->priv->_filters_sync;
1510 _tmp1_ = _data1_->scope;
1511 _tmp2_ = unity_scope_proxy_get_filters_model (_tmp1_);
1512 _tmp3_ = _tmp2_;
1513 unity_filters_synchronizer_add_receiver (_tmp0_, (DeeModel*) _tmp3_);
1514 }
1515
1516
1517 static void ____lambda11__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1518 ___lambda11_ (self);
1519 }
1520
1521
1522 static void unity_lens_impl_on_scope_filters_model_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec) {
1523 Block1Data* _data1_;
1524 GObject* _tmp0_;
1525 UnityScopeProxy* _tmp1_;
1526 gboolean _tmp2_ = FALSE;
1527 UnityScopeProxy* _tmp3_;
1528 gboolean _tmp9_;
1529 g_return_if_fail (self != NULL);
1530 g_return_if_fail (obj != NULL);
1531 _data1_ = g_slice_new0 (Block1Data);
1532 _data1_->_ref_count_ = 1;
1533 _data1_->self = g_object_ref (self);
1534 _tmp0_ = obj;
1535 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
1536 _data1_->scope = _tmp1_;
1537 _tmp3_ = _data1_->scope;
1538 if (UNITY_IS_SCOPE_PROXY_REMOTE (_tmp3_)) {
1539 UnityScopeProxy* _tmp4_;
1540 DeeSerializableModel* _tmp5_;
1541 DeeSerializableModel* _tmp6_;
1542 gboolean _tmp7_ = FALSE;
1543 gboolean _tmp8_;
1544 _tmp4_ = _data1_->scope;
1545 _tmp5_ = unity_scope_proxy_get_filters_model (_tmp4_);
1546 _tmp6_ = _tmp5_;
1547 g_object_get (DEE_IS_SHARED_MODEL (_tmp6_) ? ((DeeSharedModel*) _tmp6_) : NULL, "synchronized", &_tmp7_, NULL);
1548 _tmp8_ = _tmp7_;
1549 _tmp2_ = _tmp8_ == FALSE;
1550 } else {
1551 _tmp2_ = FALSE;
1552 }
1553 _tmp9_ = _tmp2_;
1554 if (_tmp9_) {
1555 UnityScopeProxy* _tmp10_;
1556 DeeSerializableModel* _tmp11_;
1557 DeeSerializableModel* _tmp12_;
1558 _tmp10_ = _data1_->scope;
1559 _tmp11_ = unity_scope_proxy_get_filters_model (_tmp10_);
1560 _tmp12_ = _tmp11_;
1561 g_signal_connect_data ((GObject*) _tmp12_, "notify::synchronized", (GCallback) ____lambda11__g_object_notify, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0);
1562 } else {
1563 UnityFiltersSynchronizer* _tmp13_;
1564 UnityScopeProxy* _tmp14_;
1565 DeeSerializableModel* _tmp15_;
1566 DeeSerializableModel* _tmp16_;
1567 _tmp13_ = self->priv->_filters_sync;
1568 _tmp14_ = _data1_->scope;
1569 _tmp15_ = unity_scope_proxy_get_filters_model (_tmp14_);
1570 _tmp16_ = _tmp15_;
1571 unity_filters_synchronizer_add_receiver (_tmp13_, (DeeModel*) _tmp16_);
1572 }
1573 block1_data_unref (_data1_);
1574 _data1_ = NULL;
1575 }
1576
1577
1578 static void unity_lens_impl_on_scope_sources_updated (UnityLensImpl* self, GObject* obj, GParamSpec* pspec) {
1579 GObject* _tmp0_;
1580 UnityScopeProxy* _tmp1_;
1581 UnityScopeProxy* scope;
1582 GeeHashSet* _tmp2_;
1583 GeeHashSet* touched_filters;
1584 UnityScopeProxy* _tmp3_;
1585 UnityOptionsFilter* _tmp4_;
1586 UnityOptionsFilter* _tmp5_;
1587 GList* _tmp6_;
1588 UnityScopeProxy* _tmp41_;
1589 gchar* _tmp42_ = NULL;
1590 gchar* _tmp43_;
1591 gchar* _tmp44_ = NULL;
1592 gchar* _tmp45_;
1593 gchar* prefix;
1594 GeeHashSet* _tmp46_;
1595 GeeHashSet* removed_ids;
1596 UnityOptionsFilter* _tmp47_;
1597 GList* _tmp48_;
1598 g_return_if_fail (self != NULL);
1599 g_return_if_fail (obj != NULL);
1600 g_return_if_fail (pspec != NULL);
1601 _tmp0_ = obj;
1602 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
1603 scope = _tmp1_;
1604 _tmp2_ = gee_hash_set_new (UNITY_TYPE_FILTER_OPTION, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
1605 touched_filters = _tmp2_;
1606 _tmp3_ = scope;
1607 _tmp4_ = unity_scope_proxy_get_sources (_tmp3_);
1608 _tmp5_ = _tmp4_;
1609 _tmp6_ = _tmp5_->options;
1610 {
1611 GList* filter_collection = NULL;
1612 GList* filter_it = NULL;
1613 filter_collection = _tmp6_;
1614 for (filter_it = filter_collection; filter_it != NULL; filter_it = filter_it->next) {
1615 UnityFilterOption* _tmp7_;
1616 UnityFilterOption* filter = NULL;
1617 _tmp7_ = _g_object_ref0 ((UnityFilterOption*) filter_it->data);
1618 filter = _tmp7_;
1619 {
1620 UnityScopeProxy* _tmp8_;
1621 gchar* _tmp9_ = NULL;
1622 gchar* _tmp10_;
1623 UnityFilterOption* _tmp11_;
1624 const gchar* _tmp12_;
1625 const gchar* _tmp13_;
1626 gchar* _tmp14_ = NULL;
1627 gchar* _tmp15_;
1628 gchar* mangled_id;
1629 UnityOptionsFilter* _tmp16_;
1630 const gchar* _tmp17_;
1631 UnityFilterOption* _tmp18_ = NULL;
1632 UnityFilterOption* option;
1633 UnityFilterOption* _tmp19_;
1634 _tmp8_ = scope;
1635 _tmp9_ = unity_lens_impl_uid_for_scope (self, _tmp8_);
1636 _tmp10_ = _tmp9_;
1637 _tmp11_ = filter;
1638 _tmp12_ = unity_filter_option_get_id (_tmp11_);
1639 _tmp13_ = _tmp12_;
1640 _tmp14_ = g_strdup_printf ("%s:%s", _tmp10_, _tmp13_);
1641 _tmp15_ = _tmp14_;
1642 _g_free0 (_tmp10_);
1643 mangled_id = _tmp15_;
1644 _tmp16_ = self->priv->_sources;
1645 _tmp17_ = mangled_id;
1646 _tmp18_ = unity_options_filter_get_option (_tmp16_, _tmp17_);
1647 option = _tmp18_;
1648 _tmp19_ = option;
1649 if (_tmp19_ == NULL) {
1650 UnityOptionsFilter* _tmp20_;
1651 const gchar* _tmp21_;
1652 UnityFilterOption* _tmp22_;
1653 const gchar* _tmp23_;
1654 const gchar* _tmp24_;
1655 UnityFilterOption* _tmp25_;
1656 GIcon* _tmp26_;
1657 GIcon* _tmp27_;
1658 UnityFilterOption* _tmp28_ = NULL;
1659 UnityFilterOption* new_option;
1660 UnityFilterOption* _tmp29_;
1661 UnityFilterOption* _tmp30_;
1662 gboolean _tmp31_;
1663 gboolean _tmp32_;
1664 GeeHashSet* _tmp33_;
1665 UnityFilterOption* _tmp34_;
1666 _tmp20_ = self->priv->_sources;
1667 _tmp21_ = mangled_id;
1668 _tmp22_ = filter;
1669 _tmp23_ = unity_filter_option_get_display_name (_tmp22_);
1670 _tmp24_ = _tmp23_;
1671 _tmp25_ = filter;
1672 _tmp26_ = unity_filter_option_get_icon_hint (_tmp25_);
1673 _tmp27_ = _tmp26_;
1674 _tmp28_ = unity_options_filter_add_option (_tmp20_, _tmp21_, _tmp24_, _tmp27_);
1675 new_option = _tmp28_;
1676 _tmp29_ = new_option;
1677 _tmp30_ = filter;
1678 _tmp31_ = unity_filter_option_get_active (_tmp30_);
1679 _tmp32_ = _tmp31_;
1680 unity_filter_option_set_active (_tmp29_, _tmp32_);
1681 _tmp33_ = touched_filters;
1682 _tmp34_ = new_option;
1683 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp33_, _tmp34_);
1684 _g_object_unref0 (new_option);
1685 } else {
1686 UnityFilterOption* _tmp35_;
1687 UnityFilterOption* _tmp36_;
1688 gboolean _tmp37_;
1689 gboolean _tmp38_;
1690 GeeHashSet* _tmp39_;
1691 UnityFilterOption* _tmp40_;
1692 _tmp35_ = option;
1693 _tmp36_ = filter;
1694 _tmp37_ = unity_filter_option_get_active (_tmp36_);
1695 _tmp38_ = _tmp37_;
1696 unity_filter_option_set_active (_tmp35_, _tmp38_);
1697 _tmp39_ = touched_filters;
1698 _tmp40_ = option;
1699 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
1700 }
1701 _g_object_unref0 (option);
1702 _g_free0 (mangled_id);
1703 _g_object_unref0 (filter);
1704 }
1705 }
1706 }
1707 _tmp41_ = scope;
1708 _tmp42_ = unity_lens_impl_uid_for_scope (self, _tmp41_);
1709 _tmp43_ = _tmp42_;
1710 _tmp44_ = g_strdup_printf ("%s:", _tmp43_);
1711 _tmp45_ = _tmp44_;
1712 _g_free0 (_tmp43_);
1713 prefix = _tmp45_;
1714 _tmp46_ = gee_hash_set_new (G_TYPE_STRING, NULL, NULL, NULL, NULL);
1715 removed_ids = _tmp46_;
1716 _tmp47_ = self->priv->_sources;
1717 _tmp48_ = _tmp47_->options;
1718 {
1719 GList* filter_option_collection = NULL;
1720 GList* filter_option_it = NULL;
1721 filter_option_collection = _tmp48_;
1722 for (filter_option_it = filter_option_collection; filter_option_it != NULL; filter_option_it = filter_option_it->next) {
1723 UnityFilterOption* _tmp49_;
1724 UnityFilterOption* filter_option = NULL;
1725 _tmp49_ = _g_object_ref0 ((UnityFilterOption*) filter_option_it->data);
1726 filter_option = _tmp49_;
1727 {
1728 gboolean _tmp50_ = FALSE;
1729 UnityFilterOption* _tmp51_;
1730 const gchar* _tmp52_;
1731 const gchar* _tmp53_;
1732 const gchar* _tmp54_;
1733 gboolean _tmp55_ = FALSE;
1734 gboolean _tmp59_;
1735 _tmp51_ = filter_option;
1736 _tmp52_ = unity_filter_option_get_id (_tmp51_);
1737 _tmp53_ = _tmp52_;
1738 _tmp54_ = prefix;
1739 _tmp55_ = g_str_has_prefix (_tmp53_, _tmp54_);
1740 if (_tmp55_) {
1741 GeeHashSet* _tmp56_;
1742 UnityFilterOption* _tmp57_;
1743 gboolean _tmp58_ = FALSE;
1744 _tmp56_ = touched_filters;
1745 _tmp57_ = filter_option;
1746 _tmp58_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp56_, _tmp57_);
1747 _tmp50_ = !_tmp58_;
1748 } else {
1749 _tmp50_ = FALSE;
1750 }
1751 _tmp59_ = _tmp50_;
1752 if (_tmp59_) {
1753 GeeHashSet* _tmp60_;
1754 UnityFilterOption* _tmp61_;
1755 const gchar* _tmp62_;
1756 const gchar* _tmp63_;
1757 _tmp60_ = removed_ids;
1758 _tmp61_ = filter_option;
1759 _tmp62_ = unity_filter_option_get_id (_tmp61_);
1760 _tmp63_ = _tmp62_;
1761 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp60_, _tmp63_);
1762 }
1763 _g_object_unref0 (filter_option);
1764 }
1765 }
1766 }
1767 {
1768 GeeHashSet* _tmp64_;
1769 GeeIterator* _tmp65_ = NULL;
1770 GeeIterator* _id_it;
1771 _tmp64_ = removed_ids;
1772 _tmp65_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp64_);
1773 _id_it = _tmp65_;
1774 while (TRUE) {
1775 GeeIterator* _tmp66_;
1776 gboolean _tmp67_ = FALSE;
1777 GeeIterator* _tmp68_;
1778 gpointer _tmp69_ = NULL;
1779 const gchar* id;
1780 UnityOptionsFilter* _tmp70_;
1781 const gchar* _tmp71_;
1782 _tmp66_ = _id_it;
1783 _tmp67_ = gee_iterator_next (_tmp66_);
1784 if (!_tmp67_) {
1785 break;
1786 }
1787 _tmp68_ = _id_it;
1788 _tmp69_ = gee_iterator_get (_tmp68_);
1789 id = (const gchar*) _tmp69_;
1790 _tmp70_ = self->priv->_sources;
1791 _tmp71_ = id;
1792 unity_options_filter_remove_option (_tmp70_, _tmp71_);
1793 }
1794 _g_object_unref0 (_id_it);
1795 }
1796 unity_lens_impl_queue_sources_update (self);
1797 _g_object_unref0 (removed_ids);
1798 _g_free0 (prefix);
1799 _g_object_unref0 (touched_filters);
1800 _g_object_unref0 (scope);
1801 }
1802
1803
1804 static void unity_lens_impl_on_filter_changed (UnityLensImpl* self, UnityFilter* filter) {
1805 DeeSharedModel* _tmp0_;
1806 DeeModelIter* _tmp1_ = NULL;
1807 DeeModelIter* iter;
1808 g_return_if_fail (self != NULL);
1809 g_return_if_fail (filter != NULL);
1810 _tmp0_ = self->priv->_filters_model;
1811 _tmp1_ = dee_model_get_first_iter ((DeeModel*) _tmp0_);
1812 iter = _tmp1_;
1813 while (TRUE) {
1814 DeeModelIter* _tmp2_;
1815 DeeSharedModel* _tmp3_;
1816 DeeModelIter* _tmp4_ = NULL;
1817 DeeSharedModel* _tmp5_;
1818 DeeModelIter* _tmp6_;
1819 const gchar* _tmp7_ = NULL;
1820 UnityFilter* _tmp8_;
1821 const gchar* _tmp9_;
1822 const gchar* _tmp10_;
1823 _tmp2_ = iter;
1824 _tmp3_ = self->priv->_filters_model;
1825 _tmp4_ = dee_model_get_last_iter ((DeeModel*) _tmp3_);
1826 if (!(_tmp2_ != _tmp4_)) {
1827 break;
1828 }
1829 _tmp5_ = self->priv->_filters_model;
1830 _tmp6_ = iter;
1831 _tmp7_ = dee_model_get_string ((DeeModel*) _tmp5_, _tmp6_, (guint) UNITY_FILTER_COLUMN_ID);
1832 _tmp8_ = filter;
1833 _tmp9_ = unity_filter_get_id (_tmp8_);
1834 _tmp10_ = _tmp9_;
1835 if (g_strcmp0 (_tmp7_, _tmp10_) == 0) {
1836 gchar* _tmp11_ = NULL;
1837 UnityFilter* _tmp12_;
1838 GIcon* _tmp13_;
1839 GIcon* _tmp14_;
1840 const gchar* _tmp20_;
1841 gchar* _tmp21_;
1842 gchar* icon_hint_s;
1843 DeeSharedModel* _tmp22_;
1844 DeeModelIter* _tmp23_;
1845 UnityFilter* _tmp24_;
1846 const gchar* _tmp25_;
1847 const gchar* _tmp26_;
1848 UnityFilter* _tmp27_;
1849 const gchar* _tmp28_;
1850 const gchar* _tmp29_;
1851 const gchar* _tmp30_;
1852 UnityFilter* _tmp31_;
1853 UnityFilterRenderer _tmp32_;
1854 UnityFilterRenderer _tmp33_;
1855 const gchar* _tmp34_ = NULL;
1856 UnityFilter* _tmp35_;
1857 GHashTable* _tmp36_ = NULL;
1858 GHashTable* _tmp37_;
1859 GVariant* _tmp38_ = NULL;
1860 GVariant* _tmp39_;
1861 UnityFilter* _tmp40_;
1862 gboolean _tmp41_;
1863 gboolean _tmp42_;
1864 UnityFilter* _tmp43_;
1865 gboolean _tmp44_;
1866 gboolean _tmp45_;
1867 UnityFilter* _tmp46_;
1868 gboolean _tmp47_;
1869 gboolean _tmp48_;
1870 _tmp12_ = filter;
1871 _tmp13_ = unity_filter_get_icon_hint (_tmp12_);
1872 _tmp14_ = _tmp13_;
1873 if (_tmp14_ != NULL) {
1874 UnityFilter* _tmp15_;
1875 GIcon* _tmp16_;
1876 GIcon* _tmp17_;
1877 gchar* _tmp18_ = NULL;
1878 _tmp15_ = filter;
1879 _tmp16_ = unity_filter_get_icon_hint (_tmp15_);
1880 _tmp17_ = _tmp16_;
1881 _tmp18_ = g_icon_to_string (_tmp17_);
1882 _g_free0 (_tmp11_);
1883 _tmp11_ = _tmp18_;
1884 } else {
1885 gchar* _tmp19_;
1886 _tmp19_ = g_strdup ("");
1887 _g_free0 (_tmp11_);
1888 _tmp11_ = _tmp19_;
1889 }
1890 _tmp20_ = _tmp11_;
1891 _tmp21_ = g_strdup (_tmp20_);
1892 icon_hint_s = _tmp21_;
1893 _tmp22_ = self->priv->_filters_model;
1894 _tmp23_ = iter;
1895 _tmp24_ = filter;
1896 _tmp25_ = unity_filter_get_id (_tmp24_);
1897 _tmp26_ = _tmp25_;
1898 _tmp27_ = filter;
1899 _tmp28_ = unity_filter_get_display_name (_tmp27_);
1900 _tmp29_ = _tmp28_;
1901 _tmp30_ = icon_hint_s;
1902 _tmp31_ = filter;
1903 _tmp32_ = unity_filter_get_renderer (_tmp31_);
1904 _tmp33_ = _tmp32_;
1905 _tmp34_ = unity_filter_get_renderer_name (_tmp33_);
1906 _tmp35_ = filter;
1907 _tmp36_ = unity_filter_get_hints (_tmp35_);
1908 _tmp37_ = _tmp36_;
1909 _tmp38_ = unity_tools_hash_table_to_asv (_tmp37_);
1910 _tmp39_ = _tmp38_;
1911 _tmp40_ = filter;
1912 _tmp41_ = unity_filter_get_visible (_tmp40_);
1913 _tmp42_ = _tmp41_;
1914 _tmp43_ = filter;
1915 _tmp44_ = unity_filter_get_collapsed (_tmp43_);
1916 _tmp45_ = _tmp44_;
1917 _tmp46_ = filter;
1918 _tmp47_ = unity_filter_get_filtering (_tmp46_);
1919 _tmp48_ = _tmp47_;
1920 dee_model_set ((DeeModel*) _tmp22_, _tmp23_, _tmp26_, _tmp29_, _tmp30_, _tmp34_, _tmp39_, _tmp42_, _tmp45_, _tmp48_, NULL);
1921 _g_variant_unref0 (_tmp39_);
1922 _g_hash_table_unref0 (_tmp37_);
1923 _g_free0 (icon_hint_s);
1924 _g_free0 (_tmp11_);
1925 break;
1926 }
1927 }
1928 }
1929
1930
1931 static void unity_lens_impl_sources_display_name_changed (UnityLensImpl* self, GObject* obj, GParamSpec* pspec) {
1932 UnityOptionsFilter* _tmp0_;
1933 UnityLens* _tmp1_;
1934 const gchar* _tmp2_;
1935 const gchar* _tmp3_;
1936 g_return_if_fail (self != NULL);
1937 g_return_if_fail (obj != NULL);
1938 g_return_if_fail (pspec != NULL);
1939 _tmp0_ = self->priv->_sources;
1940 _tmp1_ = self->priv->_owner;
1941 _tmp2_ = unity_lens_get_sources_display_name (_tmp1_);
1942 _tmp3_ = _tmp2_;
1943 unity_filter_set_display_name ((UnityFilter*) _tmp0_, _tmp3_);
1944 unity_lens_impl_queue_sources_update (self);
1945 }
1946
1947
1948 static gboolean ___lambda9_ (UnityLensImpl* self) {
1949 gboolean result = FALSE;
1950 DeeSharedModel* _tmp0_;
1951 DeeModelIter* _tmp1_ = NULL;
1952 DeeSharedModel* _tmp2_;
1953 DeeModelIter* _tmp3_ = NULL;
1954 gboolean empty_model;
1955 gboolean _tmp4_;
1956 UnityOptionsFilter* _tmp15_;
1957 GList* _tmp16_;
1958 guint _tmp17_ = 0U;
1959 _tmp0_ = self->priv->_filters_model;
1960 _tmp1_ = dee_model_get_first_iter ((DeeModel*) _tmp0_);
1961 _tmp2_ = self->priv->_filters_model;
1962 _tmp3_ = dee_model_get_last_iter ((DeeModel*) _tmp2_);
1963 empty_model = _tmp1_ == _tmp3_;
1964 _tmp4_ = empty_model;
1965 if (!_tmp4_) {
1966 DeeSharedModel* _tmp5_;
1967 DeeModelIter* _tmp6_ = NULL;
1968 DeeModelIter* iter;
1969 DeeSharedModel* _tmp7_;
1970 DeeModelIter* _tmp8_;
1971 DeeModelIter* _tmp9_ = NULL;
1972 DeeSharedModel* _tmp10_;
1973 DeeModelIter* _tmp11_;
1974 const gchar* _tmp12_ = NULL;
1975 _tmp5_ = self->priv->_filters_model;
1976 _tmp6_ = dee_model_get_last_iter ((DeeModel*) _tmp5_);
1977 iter = _tmp6_;
1978 _tmp7_ = self->priv->_filters_model;
1979 _tmp8_ = iter;
1980 _tmp9_ = dee_model_prev ((DeeModel*) _tmp7_, _tmp8_);
1981 iter = _tmp9_;
1982 _tmp10_ = self->priv->_filters_model;
1983 _tmp11_ = iter;
1984 _tmp12_ = dee_model_get_string ((DeeModel*) _tmp10_, _tmp11_, (guint) UNITY_FILTER_COLUMN_ID);
1985 if (g_strcmp0 (_tmp12_, UNITY_LENS_SOURCES_FILTER_ID) == 0) {
1986 DeeSharedModel* _tmp13_;
1987 DeeModelIter* _tmp14_;
1988 _tmp13_ = self->priv->_filters_model;
1989 _tmp14_ = iter;
1990 dee_model_remove ((DeeModel*) _tmp13_, _tmp14_);
1991 }
1992 }
1993 _tmp15_ = self->priv->_sources;
1994 _tmp16_ = _tmp15_->options;
1995 _tmp17_ = g_list_length (_tmp16_);
1996 if (_tmp17_ > ((guint) 0)) {
1997 UnityOptionsFilter* _tmp18_;
1998 UnityOptionsFilter* _tmp19_;
1999 UnityOptionsFilter* filter;
2000 gchar* _tmp20_ = NULL;
2001 UnityOptionsFilter* _tmp21_;
2002 GIcon* _tmp22_;
2003 GIcon* _tmp23_;
2004 const gchar* _tmp29_;
2005 gchar* _tmp30_;
2006 gchar* icon_hint_s;
2007 DeeSharedModel* _tmp31_;
2008 UnityOptionsFilter* _tmp32_;
2009 const gchar* _tmp33_;
2010 const gchar* _tmp34_;
2011 UnityOptionsFilter* _tmp35_;
2012 const gchar* _tmp36_;
2013 const gchar* _tmp37_;
2014 const gchar* _tmp38_;
2015 UnityOptionsFilter* _tmp39_;
2016 UnityFilterRenderer _tmp40_;
2017 UnityFilterRenderer _tmp41_;
2018 const gchar* _tmp42_ = NULL;
2019 UnityOptionsFilter* _tmp43_;
2020 GHashTable* _tmp44_ = NULL;
2021 GHashTable* _tmp45_;
2022 GVariant* _tmp46_ = NULL;
2023 GVariant* _tmp47_;
2024 UnityOptionsFilter* _tmp48_;
2025 gboolean _tmp49_;
2026 gboolean _tmp50_;
2027 UnityOptionsFilter* _tmp51_;
2028 gboolean _tmp52_;
2029 gboolean _tmp53_;
2030 UnityOptionsFilter* _tmp54_;
2031 gboolean _tmp55_;
2032 gboolean _tmp56_;
2033 _tmp18_ = self->priv->_sources;
2034 _tmp19_ = _g_object_ref0 (_tmp18_);
2035 filter = _tmp19_;
2036 _tmp21_ = filter;
2037 _tmp22_ = unity_filter_get_icon_hint ((UnityFilter*) _tmp21_);
2038 _tmp23_ = _tmp22_;
2039 if (_tmp23_ != NULL) {
2040 UnityOptionsFilter* _tmp24_;
2041 GIcon* _tmp25_;
2042 GIcon* _tmp26_;
2043 gchar* _tmp27_ = NULL;
2044 _tmp24_ = filter;
2045 _tmp25_ = unity_filter_get_icon_hint ((UnityFilter*) _tmp24_);
2046 _tmp26_ = _tmp25_;
2047 _tmp27_ = g_icon_to_string (_tmp26_);
2048 _g_free0 (_tmp20_);
2049 _tmp20_ = _tmp27_;
2050 } else {
2051 gchar* _tmp28_;
2052 _tmp28_ = g_strdup ("");
2053 _g_free0 (_tmp20_);
2054 _tmp20_ = _tmp28_;
2055 }
2056 _tmp29_ = _tmp20_;
2057 _tmp30_ = g_strdup (_tmp29_);
2058 icon_hint_s = _tmp30_;
2059 _tmp31_ = self->priv->_filters_model;
2060 _tmp32_ = filter;
2061 _tmp33_ = unity_filter_get_id ((UnityFilter*) _tmp32_);
2062 _tmp34_ = _tmp33_;
2063 _tmp35_ = filter;
2064 _tmp36_ = unity_filter_get_display_name ((UnityFilter*) _tmp35_);
2065 _tmp37_ = _tmp36_;
2066 _tmp38_ = icon_hint_s;
2067 _tmp39_ = filter;
2068 _tmp40_ = unity_filter_get_renderer ((UnityFilter*) _tmp39_);
2069 _tmp41_ = _tmp40_;
2070 _tmp42_ = unity_filter_get_renderer_name (_tmp41_);
2071 _tmp43_ = filter;
2072 _tmp44_ = unity_filter_get_hints ((UnityFilter*) _tmp43_);
2073 _tmp45_ = _tmp44_;
2074 _tmp46_ = unity_tools_hash_table_to_asv (_tmp45_);
2075 _tmp47_ = _tmp46_;
2076 _tmp48_ = filter;
2077 _tmp49_ = unity_filter_get_visible ((UnityFilter*) _tmp48_);
2078 _tmp50_ = _tmp49_;
2079 _tmp51_ = filter;
2080 _tmp52_ = unity_filter_get_collapsed ((UnityFilter*) _tmp51_);
2081 _tmp53_ = _tmp52_;
2082 _tmp54_ = filter;
2083 _tmp55_ = unity_filter_get_filtering ((UnityFilter*) _tmp54_);
2084 _tmp56_ = _tmp55_;
2085 dee_model_append ((DeeModel*) _tmp31_, _tmp34_, _tmp37_, _tmp38_, _tmp42_, _tmp47_, _tmp50_, _tmp53_, _tmp56_, NULL);
2086 _g_variant_unref0 (_tmp47_);
2087 _g_hash_table_unref0 (_tmp45_);
2088 _g_free0 (icon_hint_s);
2089 _g_free0 (_tmp20_);
2090 _g_object_unref0 (filter);
2091 }
2092 self->priv->_sources_update_id = (guint) 0;
2093 result = FALSE;
2094 return result;
2095 }
2096
2097
2098 static gboolean ____lambda9__gsource_func (gpointer self) {
2099 gboolean result;
2100 result = ___lambda9_ (self);
2101 return result;
2102 }
2103
2104
2105 static void unity_lens_impl_queue_sources_update (UnityLensImpl* self) {
2106 guint _tmp0_;
2107 g_return_if_fail (self != NULL);
2108 _tmp0_ = self->priv->_sources_update_id;
2109 if (_tmp0_ == ((guint) 0)) {
2110 guint _tmp1_ = 0U;
2111 _tmp1_ = g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, ____lambda9__gsource_func, g_object_ref (self), g_object_unref);
2112 self->priv->_sources_update_id = _tmp1_;
2113 }
2114 }
2115
2116
2117 static void unity_lens_impl_sources_filter_changed (UnityLensImpl* self, DeeModel* model, DeeModelIter* iter) {
2118 UnityOptionsFilter* _tmp0_;
2119 const gchar* _tmp1_;
2120 const gchar* _tmp2_;
2121 UnityOptionsFilter* _tmp3_;
2122 const gchar* _tmp4_;
2123 const gchar* _tmp5_;
2124 UnityOptionsFilter* _tmp6_;
2125 GIcon* _tmp7_;
2126 GIcon* _tmp8_;
2127 UnityOptionsFilter* _tmp9_;
2128 gboolean _tmp10_;
2129 gboolean _tmp11_;
2130 UnityCheckOptionFilter* _tmp12_;
2131 UnityCheckOptionFilter* temp;
2132 DeeModel* _tmp13_;
2133 DeeModelIter* _tmp14_;
2134 GVariant* _tmp15_ = NULL;
2135 GVariant* properties;
2136 UnityCheckOptionFilter* _tmp16_;
2137 GVariant* _tmp17_;
2138 GeeHashSet* _tmp18_;
2139 GeeHashSet* updated_scopes;
2140 UnityCheckOptionFilter* _tmp19_;
2141 GList* _tmp20_;
2142 UnityCheckOptionFilter* _tmp42_;
2143 UnityOptionsFilter* _tmp43_;
2144 GeeHashSet* _tmp44_;
2145 g_return_if_fail (self != NULL);
2146 g_return_if_fail (model != NULL);
2147 g_return_if_fail (iter != NULL);
2148 _tmp0_ = self->priv->_sources;
2149 _tmp1_ = unity_filter_get_id ((UnityFilter*) _tmp0_);
2150 _tmp2_ = _tmp1_;
2151 _tmp3_ = self->priv->_sources;
2152 _tmp4_ = unity_filter_get_display_name ((UnityFilter*) _tmp3_);
2153 _tmp5_ = _tmp4_;
2154 _tmp6_ = self->priv->_sources;
2155 _tmp7_ = unity_filter_get_icon_hint ((UnityFilter*) _tmp6_);
2156 _tmp8_ = _tmp7_;
2157 _tmp9_ = self->priv->_sources;
2158 _tmp10_ = unity_filter_get_collapsed ((UnityFilter*) _tmp9_);
2159 _tmp11_ = _tmp10_;
2160 _tmp12_ = unity_check_option_filter_new (_tmp2_, _tmp5_, _tmp8_, _tmp11_);
2161 temp = _tmp12_;
2162 _tmp13_ = model;
2163 _tmp14_ = iter;
2164 _tmp15_ = dee_model_get_value (_tmp13_, _tmp14_, (guint) UNITY_FILTER_COLUMN_RENDERER_STATE);
2165 properties = _tmp15_;
2166 _tmp16_ = temp;
2167 _tmp17_ = properties;
2168 unity_filter_update ((UnityFilter*) _tmp16_, _tmp17_);
2169 _tmp18_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
2170 updated_scopes = _tmp18_;
2171 _tmp19_ = temp;
2172 _tmp20_ = ((UnityOptionsFilter*) _tmp19_)->options;
2173 {
2174 GList* filter_option_collection = NULL;
2175 GList* filter_option_it = NULL;
2176 filter_option_collection = _tmp20_;
2177 for (filter_option_it = filter_option_collection; filter_option_it != NULL; filter_option_it = filter_option_it->next) {
2178 UnityFilterOption* _tmp21_;
2179 UnityFilterOption* filter_option = NULL;
2180 _tmp21_ = _g_object_ref0 ((UnityFilterOption*) filter_option_it->data);
2181 filter_option = _tmp21_;
2182 {
2183 UnityOptionsFilter* _tmp22_;
2184 UnityFilterOption* _tmp23_;
2185 const gchar* _tmp24_;
2186 const gchar* _tmp25_;
2187 UnityFilterOption* _tmp26_ = NULL;
2188 UnityFilterOption* current_value;
2189 UnityFilterOption* _tmp27_;
2190 UnityFilterOption* _tmp28_;
2191 gboolean _tmp29_;
2192 gboolean _tmp30_;
2193 UnityFilterOption* _tmp31_;
2194 gboolean _tmp32_;
2195 gboolean _tmp33_;
2196 _tmp22_ = self->priv->_sources;
2197 _tmp23_ = filter_option;
2198 _tmp24_ = unity_filter_option_get_id (_tmp23_);
2199 _tmp25_ = _tmp24_;
2200 _tmp26_ = unity_options_filter_get_option (_tmp22_, _tmp25_);
2201 current_value = _tmp26_;
2202 _tmp27_ = current_value;
2203 if (_tmp27_ == NULL) {
2204 _g_object_unref0 (current_value);
2205 _g_object_unref0 (filter_option);
2206 continue;
2207 }
2208 _tmp28_ = current_value;
2209 _tmp29_ = unity_filter_option_get_active (_tmp28_);
2210 _tmp30_ = _tmp29_;
2211 _tmp31_ = filter_option;
2212 _tmp32_ = unity_filter_option_get_active (_tmp31_);
2213 _tmp33_ = _tmp32_;
2214 if (_tmp30_ != _tmp33_) {
2215 UnityFilterOption* _tmp34_;
2216 const gchar* _tmp35_;
2217 const gchar* _tmp36_;
2218 gchar** _tmp37_;
2219 gchar** _tmp38_ = NULL;
2220 gchar** tokens;
2221 gint tokens_length1;
2222 gint _tokens_size_;
2223 GeeHashSet* _tmp39_;
2224 gchar** _tmp40_;
2225 gint _tmp40__length1;
2226 const gchar* _tmp41_;
2227 _tmp34_ = filter_option;
2228 _tmp35_ = unity_filter_option_get_id (_tmp34_);
2229 _tmp36_ = _tmp35_;
2230 _tmp38_ = _tmp37_ = g_strsplit (_tmp36_, ":", 2);
2231 tokens = _tmp38_;
2232 tokens_length1 = _vala_array_length (_tmp37_);
2233 _tokens_size_ = tokens_length1;
2234 _tmp39_ = updated_scopes;
2235 _tmp40_ = tokens;
2236 _tmp40__length1 = tokens_length1;
2237 _tmp41_ = _tmp40_[0];
2238 gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp41_);
2239 tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
2240 }
2241 _g_object_unref0 (current_value);
2242 _g_object_unref0 (filter_option);
2243 }
2244 }
2245 }
2246 _tmp42_ = temp;
2247 _tmp43_ = _g_object_ref0 ((UnityOptionsFilter*) _tmp42_);
2248 _g_object_unref0 (self->priv->_sources);
2249 self->priv->_sources = _tmp43_;
2250 _tmp44_ = updated_scopes;
2251 unity_lens_impl_update_active_sources (self, (GeeSet*) _tmp44_, NULL, NULL);
2252 _g_object_unref0 (updated_scopes);
2253 _g_variant_unref0 (properties);
2254 _g_object_unref0 (temp);
2255 }
2256
2257
2258 void unity_lens_impl_add_local_scope (UnityLensImpl* self, UnityScope* scope) {
2259 UnityScopeFactory* _tmp0_;
2260 UnityScope* _tmp1_;
2261 g_return_if_fail (self != NULL);
2262 g_return_if_fail (scope != NULL);
2263 _tmp0_ = self->priv->_scope_factory;
2264 _tmp1_ = scope;
2265 unity_scope_factory_add_local_scope (_tmp0_, _tmp1_);
2266 }
2267
2268
2269 UnityOptionsFilter* unity_lens_impl_get_sources (UnityLensImpl* self) {
2270 UnityOptionsFilter* result = NULL;
2271 UnityOptionsFilter* _tmp0_;
2272 g_return_val_if_fail (self != NULL, NULL);
2273 _tmp0_ = self->priv->_sources;
2274 result = _tmp0_;
2275 return result;
2276 }
2277
2278
2279 DeeModel* unity_lens_impl_get_model (UnityLensImpl* self, gint index) {
2280 DeeModel* result = NULL;
2281 gint _tmp0_;
2282 gint _tmp1_;
2283 gint _tmp2_;
2284 g_return_val_if_fail (self != NULL, NULL);
2285 _tmp0_ = index;
2286 _tmp1_ = index;
2287 g_return_val_if_fail ((_tmp0_ >= 0) && (_tmp1_ <= 3), NULL);
2288 _tmp2_ = index;
2289 switch (_tmp2_) {
2290 case 0:
2291 {
2292 DeeSharedModel* _tmp3_;
2293 _tmp3_ = self->priv->_results_model;
2294 result = (DeeModel*) _tmp3_;
2295 return result;
2296 }
2297 case 1:
2298 {
2299 DeeSharedModel* _tmp4_;
2300 _tmp4_ = self->priv->_global_results_model;
2301 result = (DeeModel*) _tmp4_;
2302 return result;
2303 }
2304 case 2:
2305 {
2306 DeeSharedModel* _tmp5_;
2307 _tmp5_ = self->priv->_filters_model;
2308 result = (DeeModel*) _tmp5_;
2309 return result;
2310 }
2311 case 3:
2312 {
2313 DeeSharedModel* _tmp6_;
2314 _tmp6_ = self->priv->_categories_model;
2315 result = (DeeModel*) _tmp6_;
2316 return result;
2317 }
2318 default:
2319 break;
2320 }
2321 result = NULL;
2322 return result;
2323 }
2324
2325
2326 static void unity_lens_impl_real_info_request_data_free (gpointer _data) {
2327 UnityLensImplInfoRequestData* _data_;
2328 _data_ = _data;
2329 _g_object_unref0 (_data_->self);
2330 g_slice_free (UnityLensImplInfoRequestData, _data_);
2331 }
2332
2333
2334 static void unity_lens_impl_real_info_request (UnityLensService* base, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2335 UnityLensImpl * self;
2336 UnityLensImplInfoRequestData* _data_;
2337 UnityLensImpl* _tmp0_;
2338 self = (UnityLensImpl*) base;
2339 _data_ = g_slice_new0 (UnityLensImplInfoRequestData);
2340 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_info_request);
2341 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_info_request_data_free);
2342 _tmp0_ = _g_object_ref0 (self);
2343 _data_->self = _tmp0_;
2344 unity_lens_impl_real_info_request_co (_data_);
2345 }
2346
2347
2348 static void unity_lens_impl_real_info_request_finish (UnityLensService* base, GAsyncResult* _res_, GError** error) {
2349 UnityLensImplInfoRequestData* _data_;
2350 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2351 }
2352
2353
2354 static gboolean unity_lens_impl_real_info_request_co (UnityLensImplInfoRequestData* _data_) {
2355 switch (_data_->_state_) {
2356 case 0:
2357 goto _state_0;
2358 default:
2359 g_assert_not_reached ();
2360 }
2361 _state_0:
2362 unity_lens_impl_queue_info_changed (_data_->self);
2363 if (_data_->_state_ == 0) {
2364 g_simple_async_result_complete_in_idle (_data_->_async_result);
2365 } else {
2366 g_simple_async_result_complete (_data_->_async_result);
2367 }
2368 g_object_unref (_data_->_async_result);
2369 return FALSE;
2370 }
2371
2372
2373 static void unity_lens_impl_real_activate_data_free (gpointer _data) {
2374 UnityLensImplActivateData* _data_;
2375 _data_ = _data;
2376 _g_free0 (_data_->uri);
2377 unity_activation_reply_raw_destroy (&_data_->result);
2378 _g_object_unref0 (_data_->self);
2379 g_slice_free (UnityLensImplActivateData, _data_);
2380 }
2381
2382
2383 static void unity_lens_impl_real_activate (UnityLensService* base, const gchar* uri, guint action_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2384 UnityLensImpl * self;
2385 UnityLensImplActivateData* _data_;
2386 UnityLensImpl* _tmp0_;
2387 const gchar* _tmp1_;
2388 gchar* _tmp2_;
2389 guint _tmp3_;
2390 self = (UnityLensImpl*) base;
2391 _data_ = g_slice_new0 (UnityLensImplActivateData);
2392 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_activate);
2393 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_activate_data_free);
2394 _tmp0_ = _g_object_ref0 (self);
2395 _data_->self = _tmp0_;
2396 _tmp1_ = uri;
2397 _tmp2_ = g_strdup (_tmp1_);
2398 _data_->uri = _tmp2_;
2399 _tmp3_ = action_type;
2400 _data_->action_type = _tmp3_;
2401 unity_lens_impl_real_activate_co (_data_);
2402 }
2403
2404
2405 static void unity_lens_impl_real_activate_finish (UnityLensService* base, GAsyncResult* _res_, UnityActivationReplyRaw* result, GError** error) {
2406 UnityLensImplActivateData* _data_;
2407 UnityActivationReplyRaw _tmp0_ = {0};
2408 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
2409 return;
2410 }
2411 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2412 unity_activation_reply_raw_copy (&_data_->result, &_tmp0_);
2413 *result = _tmp0_;
2414 }
2415
2416
2417 static void unity_lens_impl_activate_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
2418 UnityLensImplActivateData* _data_;
2419 _data_ = _user_data_;
2420 _data_->_source_object_ = source_object;
2421 _data_->_res_ = _res_;
2422 unity_lens_impl_real_activate_co (_data_);
2423 }
2424
2425
2426 static gboolean unity_lens_impl_real_activate_co (UnityLensImplActivateData* _data_) {
2427 switch (_data_->_state_) {
2428 case 0:
2429 goto _state_0;
2430 case 1:
2431 goto _state_1;
2432 default:
2433 g_assert_not_reached ();
2434 }
2435 _state_0:
2436 _data_->_tmp0_ = _data_->uri;
2437 _data_->_tmp2_ = NULL;
2438 _data_->_tmp2_ = _data_->_tmp1_ = g_strsplit (_data_->_tmp0_, ":", 2);
2439 _data_->tokens = _data_->_tmp2_;
2440 _data_->tokens_length1 = _vala_array_length (_data_->_tmp1_);
2441 _data_->_tokens_size_ = _data_->tokens_length1;
2442 _data_->_tmp3_ = _data_->tokens;
2443 _data_->_tmp3__length1 = _data_->tokens_length1;
2444 _data_->_tmp4_ = _data_->_tmp3_[0];
2445 _data_->_tmp5_ = NULL;
2446 _data_->_tmp5_ = unity_lens_impl_get_scope_for_uid (_data_->self, _data_->_tmp4_);
2447 _data_->scope = _data_->_tmp5_;
2448 memset (&_data_->raw, 0, sizeof (UnityActivationReplyRaw));
2449 _data_->raw.handled = (guint) UNITY_HANDLED_TYPE_NOT_HANDLED;
2450 _data_->_tmp6_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
2451 _g_hash_table_unref0 (_data_->raw.hints);
2452 _data_->raw.hints = _data_->_tmp6_;
2453 _data_->_tmp7_ = _data_->scope;
2454 if (UNITY_IS_SCOPE_PROXY (_data_->_tmp7_)) {
2455 _data_->_tmp8_ = _data_->scope;
2456 _data_->_tmp9_ = _data_->tokens;
2457 _data_->_tmp9__length1 = _data_->tokens_length1;
2458 _data_->_tmp10_ = _data_->_tmp9_[1];
2459 _data_->_tmp11_ = _data_->action_type;
2460 memset (&_data_->_tmp12_, 0, sizeof (UnityActivationReplyRaw));
2461 _data_->_state_ = 1;
2462 unity_scope_proxy_activate (_data_->_tmp8_, _data_->_tmp10_, _data_->_tmp11_, unity_lens_impl_activate_ready, _data_);
2463 return FALSE;
2464 _state_1:
2465 unity_scope_proxy_activate_finish (_data_->_tmp8_, _data_->_res_, &_data_->_tmp12_);
2466 unity_activation_reply_raw_destroy (&_data_->raw);
2467 _data_->raw = _data_->_tmp12_;
2468 }
2469 _data_->_tmp13_ = _data_->uri;
2470 _data_->_tmp14_ = g_strdup (_data_->_tmp13_);
2471 _g_free0 (_data_->raw.uri);
2472 _data_->raw.uri = _data_->_tmp14_;
2473 _data_->result = _data_->raw;
2474 _g_object_unref0 (_data_->scope);
2475 _data_->tokens = (_vala_array_free (_data_->tokens, _data_->tokens_length1, (GDestroyNotify) g_free), NULL);
2476 if (_data_->_state_ == 0) {
2477 g_simple_async_result_complete_in_idle (_data_->_async_result);
2478 } else {
2479 g_simple_async_result_complete (_data_->_async_result);
2480 }
2481 g_object_unref (_data_->_async_result);
2482 return FALSE;
2483 unity_activation_reply_raw_destroy (&_data_->raw);
2484 _g_object_unref0 (_data_->scope);
2485 _data_->tokens = (_vala_array_free (_data_->tokens, _data_->tokens_length1, (GDestroyNotify) g_free), NULL);
2486 if (_data_->_state_ == 0) {
2487 g_simple_async_result_complete_in_idle (_data_->_async_result);
2488 } else {
2489 g_simple_async_result_complete (_data_->_async_result);
2490 }
2491 g_object_unref (_data_->_async_result);
2492 return FALSE;
2493 }
2494
2495
2496 static void unity_lens_impl_real_search_data_free (gpointer _data) {
2497 UnityLensImplSearchData* _data_;
2498 _data_ = _data;
2499 _g_free0 (_data_->search_string);
2500 _g_hash_table_unref0 (_data_->hints);
2501 _g_hash_table_unref0 (_data_->result);
2502 _g_object_unref0 (_data_->self);
2503 g_slice_free (UnityLensImplSearchData, _data_);
2504 }
2505
2506
2507 static gpointer _g_hash_table_ref0 (gpointer self) {
2508 return self ? g_hash_table_ref (self) : NULL;
2509 }
2510
2511
2512 static void unity_lens_impl_real_search (UnityLensService* base, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2513 UnityLensImpl * self;
2514 UnityLensImplSearchData* _data_;
2515 UnityLensImpl* _tmp0_;
2516 const gchar* _tmp1_;
2517 gchar* _tmp2_;
2518 GHashTable* _tmp3_;
2519 GHashTable* _tmp4_;
2520 self = (UnityLensImpl*) base;
2521 _data_ = g_slice_new0 (UnityLensImplSearchData);
2522 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_search);
2523 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_search_data_free);
2524 _tmp0_ = _g_object_ref0 (self);
2525 _data_->self = _tmp0_;
2526 _tmp1_ = search_string;
2527 _tmp2_ = g_strdup (_tmp1_);
2528 _data_->search_string = _tmp2_;
2529 _tmp3_ = hints;
2530 _tmp4_ = _g_hash_table_ref0 (_tmp3_);
2531 _data_->hints = _tmp4_;
2532 unity_lens_impl_real_search_co (_data_);
2533 }
2534
2535
2536 static GHashTable* unity_lens_impl_real_search_finish (UnityLensService* base, GAsyncResult* _res_, GError** error) {
2537 GHashTable* result;
2538 UnityLensImplSearchData* _data_;
2539 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
2540 return NULL;
2541 }
2542 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2543 result = _data_->result;
2544 _data_->result = NULL;
2545 return result;
2546 }
2547
2548
2549 static Block2Data* block2_data_ref (Block2Data* _data2_) {
2550 g_atomic_int_inc (&_data2_->_ref_count_);
2551 return _data2_;
2552 }
2553
2554
2555 static void block2_data_unref (Block2Data* _data2_) {
2556 if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
2557 _g_object_unref0 (_data2_->self);
2558 _g_hash_table_unref0 (_data2_->_result_);
2559 g_slice_free (Block2Data, _data2_);
2560 }
2561 }
2562
2563
2564 static Block3Data* block3_data_ref (Block3Data* _data3_) {
2565 g_atomic_int_inc (&_data3_->_ref_count_);
2566 return _data3_;
2567 }
2568
2569
2570 static void block3_data_unref (Block3Data* _data3_) {
2571 if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
2572 block2_data_unref (_data3_->_data2_);
2573 _data3_->_data2_ = NULL;
2574 g_slice_free (Block3Data, _data3_);
2575 }
2576 }
2577
2578
2579 static Block4Data* block4_data_ref (Block4Data* _data4_) {
2580 g_atomic_int_inc (&_data4_->_ref_count_);
2581 return _data4_;
2582 }
2583
2584
2585 static void block4_data_unref (Block4Data* _data4_) {
2586 if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
2587 block3_data_unref (_data4_->_data3_);
2588 _data4_->_data3_ = NULL;
2589 g_slice_free (Block4Data, _data4_);
2590 }
2591 }
2592
2593
2594 static void _____lambda13_ (Block4Data* _data4_, DeeSharedModel* m, guint64 begin_seqnum, guint64 end_seqnum) {
2595 Block3Data* _data3_;
2596 Block2Data* _data2_;
2597 UnityLensImpl * self;
2598 guint64 _tmp0_;
2599 guint64 _tmp1_;
2600 DeeSharedModel* _tmp2_;
2601 gulong _tmp3_;
2602 gint _tmp4_;
2603 gint _tmp5_;
2604 _data3_ = _data4_->_data3_;
2605 _data2_ = _data3_->_data2_;
2606 self = _data2_->self;
2607 g_return_if_fail (m != NULL);
2608 _tmp0_ = end_seqnum;
2609 _tmp1_ = _data3_->seqnum;
2610 if (_tmp0_ < _tmp1_) {
2611 return;
2612 }
2613 _tmp2_ = m;
2614 _tmp3_ = _data4_->update_sig_id;
2615 g_signal_handler_disconnect (_tmp2_, _tmp3_);
2616 _tmp4_ = _data2_->num_scopes;
2617 _data2_->num_scopes = _tmp4_ - 1;
2618 _tmp5_ = _data2_->num_scopes;
2619 if (_tmp5_ == 0) {
2620 unity_lens_impl_real_search_co (_data2_->_async_data_);
2621 }
2622 }
2623
2624
2625 static void ______lambda13__dee_shared_model_end_transaction (DeeSharedModel* _sender, guint64 begin_seqnum, guint64 end_seqnum, gpointer self) {
2626 _____lambda13_ (self, _sender, begin_seqnum, end_seqnum);
2627 }
2628
2629
2630 static gpointer _g_variant_ref0 (gpointer self) {
2631 return self ? g_variant_ref (self) : NULL;
2632 }
2633
2634
2635 static void __lambda12_ (Block2Data* _data2_, GObject* obj, GAsyncResult* res) {
2636 UnityLensImpl * self;
2637 GObject* _tmp0_;
2638 UnityScopeProxy* _tmp1_;
2639 UnityScopeProxy* scope;
2640 UnityScopeProxy* _tmp2_;
2641 GAsyncResult* _tmp3_;
2642 GHashTable* _tmp4_ = NULL;
2643 GHashTable* results;
2644 GHashTableIter iter = {0};
2645 GHashTable* _tmp5_;
2646 GHashTableIter _tmp6_ = {0};
2647 const gchar* key = NULL;
2648 GVariant* variant = NULL;
2649 gboolean models_updated;
2650 gboolean _tmp27_;
2651 gint _tmp28_;
2652 gint _tmp29_;
2653 self = _data2_->self;
2654 g_return_if_fail (res != NULL);
2655 _tmp0_ = obj;
2656 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
2657 scope = _tmp1_;
2658 _tmp2_ = scope;
2659 _tmp3_ = res;
2660 _tmp4_ = unity_scope_proxy_search_finish (_tmp2_, _tmp3_);
2661 results = _tmp4_;
2662 _tmp5_ = results;
2663 g_hash_table_iter_init (&_tmp6_, _tmp5_);
2664 iter = _tmp6_;
2665 models_updated = TRUE;
2666 while (TRUE) {
2667 gconstpointer _tmp7_ = NULL;
2668 gconstpointer _tmp8_ = NULL;
2669 gboolean _tmp9_ = FALSE;
2670 const gchar* _tmp10_;
2671 _tmp9_ = g_hash_table_iter_next (&iter, &_tmp7_, &_tmp8_);
2672 key = _tmp7_;
2673 variant = _tmp8_;
2674 if (!_tmp9_) {
2675 break;
2676 }
2677 _tmp10_ = key;
2678 if (g_strcmp0 (_tmp10_, "model-seqnum") == 0) {
2679 Block3Data* _data3_;
2680 GVariant* _tmp11_;
2681 guint64 _tmp12_ = 0ULL;
2682 UnityScopeProxy* _tmp13_;
2683 DeeSerializableModel* _tmp14_;
2684 DeeSerializableModel* _tmp15_;
2685 DeeSerializableModel* model;
2686 DeeSerializableModel* _tmp16_;
2687 guint64 _tmp17_ = 0ULL;
2688 guint64 _tmp18_;
2689 _data3_ = g_slice_new0 (Block3Data);
2690 _data3_->_ref_count_ = 1;
2691 _data3_->_data2_ = block2_data_ref (_data2_);
2692 _tmp11_ = variant;
2693 _tmp12_ = g_variant_get_uint64 (_tmp11_);
2694 _data3_->seqnum = _tmp12_;
2695 _tmp13_ = scope;
2696 _tmp14_ = unity_scope_proxy_get_results_model (_tmp13_);
2697 _tmp15_ = _tmp14_;
2698 model = _tmp15_;
2699 _tmp16_ = model;
2700 _tmp17_ = dee_serializable_model_get_seqnum (_tmp16_);
2701 _tmp18_ = _data3_->seqnum;
2702 if (_tmp17_ < _tmp18_) {
2703 Block4Data* _data4_;
2704 DeeSerializableModel* _tmp19_;
2705 gulong _tmp20_ = 0UL;
2706 gulong _tmp21_;
2707 _data4_ = g_slice_new0 (Block4Data);
2708 _data4_->_ref_count_ = 1;
2709 _data4_->_data3_ = block3_data_ref (_data3_);
2710 _data4_->update_sig_id = (gulong) 0;
2711 _tmp19_ = model;
2712 _tmp20_ = g_signal_connect_data (DEE_IS_SHARED_MODEL (_tmp19_) ? ((DeeSharedModel*) _tmp19_) : NULL, "end-transaction", (GCallback) ______lambda13__dee_shared_model_end_transaction, block4_data_ref (_data4_), (GClosureNotify) block4_data_unref, 0);
2713 _data4_->update_sig_id = _tmp20_;
2714 _tmp21_ = _data4_->update_sig_id;
2715 models_updated = _tmp21_ == ((gulong) 0);
2716 block4_data_unref (_data4_);
2717 _data4_ = NULL;
2718 }
2719 block3_data_unref (_data3_);
2720 _data3_ = NULL;
2721 } else {
2722 GHashTable* _tmp22_;
2723 const gchar* _tmp23_;
2724 gchar* _tmp24_;
2725 GVariant* _tmp25_;
2726 GVariant* _tmp26_;
2727 _tmp22_ = _data2_->_result_;
2728 _tmp23_ = key;
2729 _tmp24_ = g_strdup (_tmp23_);
2730 _tmp25_ = variant;
2731 _tmp26_ = _g_variant_ref0 (_tmp25_);
2732 g_hash_table_insert (_tmp22_, _tmp24_, _tmp26_);
2733 }
2734 }
2735 _tmp27_ = models_updated;
2736 if (!_tmp27_) {
2737 _g_hash_table_unref0 (results);
2738 _g_object_unref0 (scope);
2739 return;
2740 }
2741 _tmp28_ = _data2_->num_scopes;
2742 _data2_->num_scopes = _tmp28_ - 1;
2743 _tmp29_ = _data2_->num_scopes;
2744 if (_tmp29_ == 0) {
2745 unity_lens_impl_real_search_co (_data2_->_async_data_);
2746 }
2747 _g_hash_table_unref0 (results);
2748 _g_object_unref0 (scope);
2749 }
2750
2751
2752 static void ___lambda12__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
2753 __lambda12_ (self, source_object, res);
2754 }
2755
2756
2757 static gboolean unity_lens_impl_real_search_co (UnityLensImplSearchData* _data_) {
2758 switch (_data_->_state_) {
2759 case 0:
2760 goto _state_0;
2761 case 1:
2762 goto _state_1;
2763 default:
2764 g_assert_not_reached ();
2765 }
2766 _state_0:
2767 _data_->_data2_ = g_slice_new0 (Block2Data);
2768 _data_->_data2_->_ref_count_ = 1;
2769 _data_->_data2_->self = g_object_ref (_data_->self);
2770 _data_->_data2_->_async_data_ = _data_;
2771 _data_->_tmp0_ = g_str_hash;
2772 _data_->_tmp1_ = g_str_equal;
2773 _data_->_tmp2_ = g_hash_table_new_full (_data_->_tmp0_, _data_->_tmp1_, _g_free0_, _g_variant_unref0_);
2774 _data_->_data2_->_result_ = _data_->_tmp2_;
2775 _data_->_data2_->num_scopes = 0;
2776 _data_->cb = ___lambda12__gasync_ready_callback;
2777 _data_->cb_target = block2_data_ref (_data_->_data2_);
2778 _data_->cb_target_destroy_notify = block2_data_unref;
2779 {
2780 _data_->_tmp3_ = _data_->self->priv->_scope_factory;
2781 _data_->_tmp4_ = _data_->_tmp3_->scopes;
2782 _data_->_tmp5_ = _g_object_ref0 (_data_->_tmp4_);
2783 _data_->_scope_list = _data_->_tmp5_;
2784 _data_->_tmp6_ = _data_->_scope_list;
2785 _data_->_tmp7_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp6_);
2786 _data_->_tmp8_ = _data_->_tmp7_;
2787 _data_->_scope_size = _data_->_tmp8_;
2788 _data_->_scope_index = -1;
2789 while (TRUE) {
2790 _data_->_tmp9_ = _data_->_scope_index;
2791 _data_->_scope_index = _data_->_tmp9_ + 1;
2792 _data_->_tmp10_ = _data_->_scope_index;
2793 _data_->_tmp11_ = _data_->_scope_size;
2794 if (!(_data_->_tmp10_ < _data_->_tmp11_)) {
2795 break;
2796 }
2797 _data_->_tmp12_ = _data_->_scope_list;
2798 _data_->_tmp13_ = _data_->_scope_index;
2799 _data_->_tmp14_ = NULL;
2800 _data_->_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp12_, _data_->_tmp13_);
2801 _data_->scope = (UnityScopeProxy*) _data_->_tmp14_;
2802 _data_->_tmp15_ = _data_->_data2_->num_scopes;
2803 _data_->_data2_->num_scopes = _data_->_tmp15_ + 1;
2804 _data_->_tmp16_ = _data_->scope;
2805 _data_->_tmp17_ = _data_->search_string;
2806 _data_->_tmp18_ = _data_->hints;
2807 _data_->_tmp19_ = _data_->cb;
2808 _data_->_tmp19__target = _data_->cb_target;
2809 unity_scope_proxy_search (_data_->_tmp16_, _data_->_tmp17_, _data_->_tmp18_, _data_->_tmp19_, _data_->_tmp19__target);
2810 _g_object_unref0 (_data_->scope);
2811 }
2812 _g_object_unref0 (_data_->_scope_list);
2813 }
2814 _data_->_tmp20_ = _data_->_data2_->num_scopes;
2815 if (_data_->_tmp20_ > 0) {
2816 _data_->_state_ = 1;
2817 return FALSE;
2818 _state_1:
2819 ;
2820 }
2821 _data_->_tmp21_ = _data_->_data2_->_result_;
2822 _data_->_tmp22_ = g_strdup ("model-seqnum");
2823 _data_->_tmp23_ = _data_->self->priv->_results_model;
2824 _data_->_tmp24_ = 0ULL;
2825 _data_->_tmp24_ = dee_serializable_model_get_seqnum ((DeeSerializableModel*) _data_->_tmp23_);
2826 _data_->_tmp25_ = g_variant_new_uint64 (_data_->_tmp24_);
2827 _data_->_tmp26_ = g_variant_ref_sink (_data_->_tmp25_);
2828 g_hash_table_insert (_data_->_tmp21_, _data_->_tmp22_, _data_->_tmp26_);
2829 _data_->_tmp27_ = _data_->_data2_->_result_;
2830 _data_->_tmp28_ = _g_hash_table_ref0 (_data_->_tmp27_);
2831 _data_->result = _data_->_tmp28_;
2832 (_data_->cb_target_destroy_notify == NULL) ? NULL : (_data_->cb_target_destroy_notify (_data_->cb_target), NULL);
2833 _data_->cb = NULL;
2834 _data_->cb_target = NULL;
2835 _data_->cb_target_destroy_notify = NULL;
2836 block2_data_unref (_data_->_data2_);
2837 _data_->_data2_ = NULL;
2838 if (_data_->_state_ == 0) {
2839 g_simple_async_result_complete_in_idle (_data_->_async_result);
2840 } else {
2841 g_simple_async_result_complete (_data_->_async_result);
2842 }
2843 g_object_unref (_data_->_async_result);
2844 return FALSE;
CID 10576 - UNREACHABLE
This code cannot be reached: "(_data_->cb_target_destroy_...".
2845 (_data_->cb_target_destroy_notify == NULL) ? NULL : (_data_->cb_target_destroy_notify (_data_->cb_target), NULL);
2846 _data_->cb = NULL;
2847 _data_->cb_target = NULL;
2848 _data_->cb_target_destroy_notify = NULL;
2849 block2_data_unref (_data_->_data2_);
2850 _data_->_data2_ = NULL;
2851 if (_data_->_state_ == 0) {
2852 g_simple_async_result_complete_in_idle (_data_->_async_result);
2853 } else {
2854 g_simple_async_result_complete (_data_->_async_result);
2855 }
2856 g_object_unref (_data_->_async_result);
2857 return FALSE;
2858 }
2859
2860
2861 static void unity_lens_impl_real_global_search_data_free (gpointer _data) {
2862 UnityLensImplGlobalSearchData* _data_;
2863 _data_ = _data;
2864 _g_free0 (_data_->search_string);
2865 _g_hash_table_unref0 (_data_->hints);
2866 _g_hash_table_unref0 (_data_->result);
2867 _g_object_unref0 (_data_->self);
2868 g_slice_free (UnityLensImplGlobalSearchData, _data_);
2869 }
2870
2871
2872 static void unity_lens_impl_real_global_search (UnityLensService* base, const gchar* search_string, GHashTable* hints, GAsyncReadyCallback _callback_, gpointer _user_data_) {
2873 UnityLensImpl * self;
2874 UnityLensImplGlobalSearchData* _data_;
2875 UnityLensImpl* _tmp0_;
2876 const gchar* _tmp1_;
2877 gchar* _tmp2_;
2878 GHashTable* _tmp3_;
2879 GHashTable* _tmp4_;
2880 self = (UnityLensImpl*) base;
2881 _data_ = g_slice_new0 (UnityLensImplGlobalSearchData);
2882 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_global_search);
2883 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_global_search_data_free);
2884 _tmp0_ = _g_object_ref0 (self);
2885 _data_->self = _tmp0_;
2886 _tmp1_ = search_string;
2887 _tmp2_ = g_strdup (_tmp1_);
2888 _data_->search_string = _tmp2_;
2889 _tmp3_ = hints;
2890 _tmp4_ = _g_hash_table_ref0 (_tmp3_);
2891 _data_->hints = _tmp4_;
2892 unity_lens_impl_real_global_search_co (_data_);
2893 }
2894
2895
2896 static GHashTable* unity_lens_impl_real_global_search_finish (UnityLensService* base, GAsyncResult* _res_, GError** error) {
2897 GHashTable* result;
2898 UnityLensImplGlobalSearchData* _data_;
2899 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
2900 return NULL;
2901 }
2902 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
2903 result = _data_->result;
2904 _data_->result = NULL;
2905 return result;
2906 }
2907
2908
2909 static Block5Data* block5_data_ref (Block5Data* _data5_) {
2910 g_atomic_int_inc (&_data5_->_ref_count_);
2911 return _data5_;
2912 }
2913
2914
2915 static void block5_data_unref (Block5Data* _data5_) {
2916 if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
2917 _g_object_unref0 (_data5_->self);
2918 g_slice_free (Block5Data, _data5_);
2919 }
2920 }
2921
2922
2923 static Block6Data* block6_data_ref (Block6Data* _data6_) {
2924 g_atomic_int_inc (&_data6_->_ref_count_);
2925 return _data6_;
2926 }
2927
2928
2929 static void block6_data_unref (Block6Data* _data6_) {
2930 if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
2931 block5_data_unref (_data6_->_data5_);
2932 _data6_->_data5_ = NULL;
2933 g_slice_free (Block6Data, _data6_);
2934 }
2935 }
2936
2937
2938 static Block7Data* block7_data_ref (Block7Data* _data7_) {
2939 g_atomic_int_inc (&_data7_->_ref_count_);
2940 return _data7_;
2941 }
2942
2943
2944 static void block7_data_unref (Block7Data* _data7_) {
2945 if (g_atomic_int_dec_and_test (&_data7_->_ref_count_)) {
2946 block6_data_unref (_data7_->_data6_);
2947 _data7_->_data6_ = NULL;
2948 g_slice_free (Block7Data, _data7_);
2949 }
2950 }
2951
2952
2953 static void ____lambda15_ (Block7Data* _data7_, DeeSharedModel* m, guint64 begin_seqnum, guint64 end_seqnum) {
2954 Block6Data* _data6_;
2955 Block5Data* _data5_;
2956 UnityLensImpl * self;
2957 guint64 _tmp0_;
2958 guint64 _tmp1_;
2959 DeeSharedModel* _tmp2_;
2960 gulong _tmp3_;
2961 gint _tmp4_;
2962 gint _tmp5_;
2963 _data6_ = _data7_->_data6_;
2964 _data5_ = _data6_->_data5_;
2965 self = _data5_->self;
2966 g_return_if_fail (m != NULL);
2967 _tmp0_ = end_seqnum;
2968 _tmp1_ = _data6_->seqnum;
2969 if (_tmp0_ < _tmp1_) {
2970 return;
2971 }
2972 _tmp2_ = m;
2973 _tmp3_ = _data7_->update_sig_id;
2974 g_signal_handler_disconnect (_tmp2_, _tmp3_);
2975 _tmp4_ = _data5_->num_scopes;
2976 _data5_->num_scopes = _tmp4_ - 1;
2977 _tmp5_ = _data5_->num_scopes;
2978 if (_tmp5_ == 0) {
2979 unity_lens_impl_real_global_search_co (_data5_->_async_data_);
2980 }
2981 }
2982
2983
2984 static void _____lambda15__dee_shared_model_end_transaction (DeeSharedModel* _sender, guint64 begin_seqnum, guint64 end_seqnum, gpointer self) {
2985 ____lambda15_ (self, _sender, begin_seqnum, end_seqnum);
2986 }
2987
2988
2989 static void __lambda14_ (Block5Data* _data5_, GObject* obj, GAsyncResult* _result_) {
2990 UnityLensImpl * self;
2991 GObject* _tmp0_;
2992 UnityScopeProxy* _tmp1_;
2993 UnityScopeProxy* scope;
2994 UnityScopeProxy* _tmp2_;
2995 GAsyncResult* _tmp3_;
2996 GHashTable* _tmp4_ = NULL;
2997 GHashTable* results;
2998 gboolean models_updated;
2999 GHashTable* _tmp5_;
3000 gconstpointer _tmp6_ = NULL;
3001 GVariant* seqnum_v;
3002 GVariant* _tmp7_;
3003 gboolean _tmp19_;
3004 gint _tmp20_;
3005 gint _tmp21_;
3006 self = _data5_->self;
3007 g_return_if_fail (_result_ != NULL);
3008 _tmp0_ = obj;
3009 _tmp1_ = _g_object_ref0 (UNITY_IS_SCOPE_PROXY (_tmp0_) ? ((UnityScopeProxy*) _tmp0_) : NULL);
3010 scope = _tmp1_;
3011 _tmp2_ = scope;
3012 _tmp3_ = _result_;
3013 _tmp4_ = unity_scope_proxy_global_search_finish (_tmp2_, _tmp3_);
3014 results = _tmp4_;
3015 models_updated = TRUE;
3016 _tmp5_ = results;
3017 _tmp6_ = g_hash_table_lookup (_tmp5_, "model-seqnum");
3018 seqnum_v = (GVariant*) _tmp6_;
3019 _tmp7_ = seqnum_v;
3020 if (_tmp7_ != NULL) {
3021 Block6Data* _data6_;
3022 GVariant* _tmp8_;
3023 guint64 _tmp9_ = 0ULL;
3024 UnityScopeProxy* _tmp10_;
3025 DeeSerializableModel* _tmp11_;
3026 DeeSerializableModel* _tmp12_;
3027 DeeSerializableModel* model;
3028 DeeSerializableModel* _tmp13_;
3029 guint64 _tmp14_ = 0ULL;
3030 guint64 _tmp15_;
3031 _data6_ = g_slice_new0 (Block6Data);
3032 _data6_->_ref_count_ = 1;
3033 _data6_->_data5_ = block5_data_ref (_data5_);
3034 _tmp8_ = seqnum_v;
3035 _tmp9_ = g_variant_get_uint64 (_tmp8_);
3036 _data6_->seqnum = _tmp9_;
3037 _tmp10_ = scope;
3038 _tmp11_ = unity_scope_proxy_get_global_results_model (_tmp10_);
3039 _tmp12_ = _tmp11_;
3040 model = _tmp12_;
3041 _tmp13_ = model;
3042 _tmp14_ = dee_serializable_model_get_seqnum (_tmp13_);
3043 _tmp15_ = _data6_->seqnum;
3044 if (_tmp14_ < _tmp15_) {
3045 Block7Data* _data7_;
3046 DeeSerializableModel* _tmp16_;
3047 gulong _tmp17_ = 0UL;
3048 gulong _tmp18_;
3049 _data7_ = g_slice_new0 (Block7Data);
3050 _data7_->_ref_count_ = 1;
3051 _data7_->_data6_ = block6_data_ref (_data6_);
3052 _data7_->update_sig_id = (gulong) 0;
3053 _tmp16_ = model;
3054 _tmp17_ = g_signal_connect_data (DEE_IS_SHARED_MODEL (_tmp16_) ? ((DeeSharedModel*) _tmp16_) : NULL, "end-transaction", (GCallback) _____lambda15__dee_shared_model_end_transaction, block7_data_ref (_data7_), (GClosureNotify) block7_data_unref, 0);
3055 _data7_->update_sig_id = _tmp17_;
3056 _tmp18_ = _data7_->update_sig_id;
3057 models_updated = _tmp18_ == ((gulong) 0);
3058 block7_data_unref (_data7_);
3059 _data7_ = NULL;
3060 }
3061 block6_data_unref (_data6_);
3062 _data6_ = NULL;
3063 }
3064 _tmp19_ = models_updated;
3065 if (!_tmp19_) {
3066 _g_hash_table_unref0 (results);
3067 _g_object_unref0 (scope);
3068 return;
3069 }
3070 _tmp20_ = _data5_->num_scopes;
3071 _data5_->num_scopes = _tmp20_ - 1;
3072 _tmp21_ = _data5_->num_scopes;
3073 if (_tmp21_ == 0) {
3074 unity_lens_impl_real_global_search_co (_data5_->_async_data_);
3075 }
3076 _g_hash_table_unref0 (results);
3077 _g_object_unref0 (scope);
3078 }
3079
3080
3081 static void ___lambda14__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
3082 __lambda14_ (self, source_object, res);
3083 }
3084
3085
3086 static gboolean unity_lens_impl_real_global_search_co (UnityLensImplGlobalSearchData* _data_) {
3087 switch (_data_->_state_) {
3088 case 0:
3089 goto _state_0;
3090 case 1:
3091 goto _state_1;
3092 default:
3093 g_assert_not_reached ();
3094 }
3095 _state_0:
3096 _data_->_data5_ = g_slice_new0 (Block5Data);
3097 _data_->_data5_->_ref_count_ = 1;
3098 _data_->_data5_->self = g_object_ref (_data_->self);
3099 _data_->_data5_->_async_data_ = _data_;
3100 _data_->_data5_->num_scopes = 0;
3101 _data_->cb = ___lambda14__gasync_ready_callback;
3102 _data_->cb_target = block5_data_ref (_data_->_data5_);
3103 _data_->cb_target_destroy_notify = block5_data_unref;
3104 {
3105 _data_->_tmp0_ = _data_->self->priv->_scope_factory;
3106 _data_->_tmp1_ = _data_->_tmp0_->scopes;
3107 _data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
3108 _data_->_scope_list = _data_->_tmp2_;
3109 _data_->_tmp3_ = _data_->_scope_list;
3110 _data_->_tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp3_);
3111 _data_->_tmp5_ = _data_->_tmp4_;
3112 _data_->_scope_size = _data_->_tmp5_;
3113 _data_->_scope_index = -1;
3114 while (TRUE) {
3115 _data_->_tmp6_ = _data_->_scope_index;
3116 _data_->_scope_index = _data_->_tmp6_ + 1;
3117 _data_->_tmp7_ = _data_->_scope_index;
3118 _data_->_tmp8_ = _data_->_scope_size;
3119 if (!(_data_->_tmp7_ < _data_->_tmp8_)) {
3120 break;
3121 }
3122 _data_->_tmp9_ = _data_->_scope_list;
3123 _data_->_tmp10_ = _data_->_scope_index;
3124 _data_->_tmp11_ = NULL;
3125 _data_->_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp9_, _data_->_tmp10_);
3126 _data_->scope = (UnityScopeProxy*) _data_->_tmp11_;
3127 _data_->_tmp12_ = _data_->scope;
3128 _data_->_tmp13_ = unity_scope_proxy_get_search_in_global (_data_->_tmp12_);
3129 _data_->_tmp14_ = _data_->_tmp13_;
3130 if (_data_->_tmp14_) {
3131 _data_->_tmp15_ = _data_->_data5_->num_scopes;
3132 _data_->_data5_->num_scopes = _data_->_tmp15_ + 1;
3133 _data_->_tmp16_ = _data_->scope;
3134 _data_->_tmp17_ = _data_->search_string;
3135 _data_->_tmp18_ = _data_->hints;
3136 _data_->_tmp19_ = _data_->cb;
3137 _data_->_tmp19__target = _data_->cb_target;
3138 unity_scope_proxy_global_search (_data_->_tmp16_, _data_->_tmp17_, _data_->_tmp18_, _data_->_tmp19_, _data_->_tmp19__target);
3139 }
3140 _g_object_unref0 (_data_->scope);
3141 }
3142 _g_object_unref0 (_data_->_scope_list);
3143 }
3144 _data_->_tmp20_ = _data_->_data5_->num_scopes;
3145 if (_data_->_tmp20_ > 0) {
3146 _data_->_state_ = 1;
3147 return FALSE;
3148 _state_1:
3149 ;
3150 }
3151 _data_->_tmp21_ = g_str_hash;
3152 _data_->_tmp22_ = g_str_equal;
3153 _data_->_tmp23_ = g_hash_table_new_full (_data_->_tmp21_, _data_->_tmp22_, _g_free0_, _g_variant_unref0_);
3154 _data_->_result_ = _data_->_tmp23_;
3155 _data_->_tmp24_ = g_strdup ("model-seqnum");
3156 _data_->_tmp25_ = _data_->self->priv->_global_results_model;
3157 _data_->_tmp26_ = 0ULL;
3158 _data_->_tmp26_ = dee_serializable_model_get_seqnum ((DeeSerializableModel*) _data_->_tmp25_);
3159 _data_->_tmp27_ = g_variant_new_uint64 (_data_->_tmp26_);
3160 _data_->_tmp28_ = g_variant_ref_sink (_data_->_tmp27_);
3161 g_hash_table_insert (_data_->_result_, _data_->_tmp24_, _data_->_tmp28_);
3162 _data_->result = _data_->_result_;
3163 (_data_->cb_target_destroy_notify == NULL) ? NULL : (_data_->cb_target_destroy_notify (_data_->cb_target), NULL);
3164 _data_->cb = NULL;
3165 _data_->cb_target = NULL;
3166 _data_->cb_target_destroy_notify = NULL;
3167 block5_data_unref (_data_->_data5_);
3168 _data_->_data5_ = NULL;
3169 if (_data_->_state_ == 0) {
3170 g_simple_async_result_complete_in_idle (_data_->_async_result);
3171 } else {
3172 g_simple_async_result_complete (_data_->_async_result);
3173 }
3174 g_object_unref (_data_->_async_result);
3175 return FALSE;
3176 _g_hash_table_unref0 (_data_->_result_);
3177 (_data_->cb_target_destroy_notify == NULL) ? NULL : (_data_->cb_target_destroy_notify (_data_->cb_target), NULL);
3178 _data_->cb = NULL;
3179 _data_->cb_target = NULL;
3180 _data_->cb_target_destroy_notify = NULL;
3181 block5_data_unref (_data_->_data5_);
3182 _data_->_data5_ = NULL;
3183 if (_data_->_state_ == 0) {
3184 g_simple_async_result_complete_in_idle (_data_->_async_result);
3185 } else {
3186 g_simple_async_result_complete (_data_->_async_result);
3187 }
3188 g_object_unref (_data_->_async_result);
3189 return FALSE;
3190 }
3191
3192
3193 static void unity_lens_impl_real_preview_data_free (gpointer _data) {
3194 UnityLensImplPreviewData* _data_;
3195 _data_ = _data;
3196 _g_free0 (_data_->uri);
3197 unity_preview_reply_raw_destroy (&_data_->result);
3198 _g_object_unref0 (_data_->self);
3199 g_slice_free (UnityLensImplPreviewData, _data_);
3200 }
3201
3202
3203 static void unity_lens_impl_real_preview (UnityLensService* base, const gchar* uri, GAsyncReadyCallback _callback_, gpointer _user_data_) {
3204 UnityLensImpl * self;
3205 UnityLensImplPreviewData* _data_;
3206 UnityLensImpl* _tmp0_;
3207 const gchar* _tmp1_;
3208 gchar* _tmp2_;
3209 self = (UnityLensImpl*) base;
3210 _data_ = g_slice_new0 (UnityLensImplPreviewData);
3211 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_preview);
3212 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_preview_data_free);
3213 _tmp0_ = _g_object_ref0 (self);
3214 _data_->self = _tmp0_;
3215 _tmp1_ = uri;
3216 _tmp2_ = g_strdup (_tmp1_);
3217 _data_->uri = _tmp2_;
3218 unity_lens_impl_real_preview_co (_data_);
3219 }
3220
3221
3222 static void unity_lens_impl_real_preview_finish (UnityLensService* base, GAsyncResult* _res_, UnityPreviewReplyRaw* result, GError** error) {
3223 UnityLensImplPreviewData* _data_;
3224 UnityPreviewReplyRaw _tmp0_ = {0};
3225 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
3226 return;
3227 }
3228 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
3229 unity_preview_reply_raw_copy (&_data_->result, &_tmp0_);
3230 *result = _tmp0_;
3231 }
3232
3233
3234 static void unity_lens_impl_preview_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
3235 UnityLensImplPreviewData* _data_;
3236 _data_ = _user_data_;
3237 _data_->_source_object_ = source_object;
3238 _data_->_res_ = _res_;
3239 unity_lens_impl_real_preview_co (_data_);
3240 }
3241
3242
3243 static gboolean unity_lens_impl_real_preview_co (UnityLensImplPreviewData* _data_) {
3244 switch (_data_->_state_) {
3245 case 0:
3246 goto _state_0;
3247 case 1:
3248 goto _state_1;
3249 default:
3250 g_assert_not_reached ();
3251 }
3252 _state_0:
3253 _data_->_tmp0_ = _data_->uri;
3254 _data_->_tmp2_ = NULL;
3255 _data_->_tmp2_ = _data_->_tmp1_ = g_strsplit (_data_->_tmp0_, ":", 2);
3256 _data_->tokens = _data_->_tmp2_;
3257 _data_->tokens_length1 = _vala_array_length (_data_->_tmp1_);
3258 _data_->_tokens_size_ = _data_->tokens_length1;
3259 _data_->_tmp3_ = _data_->tokens;
3260 _data_->_tmp3__length1 = _data_->tokens_length1;
3261 _data_->_tmp4_ = _data_->_tmp3_[0];
3262 _data_->_tmp5_ = NULL;
3263 _data_->_tmp5_ = unity_lens_impl_get_scope_for_uid (_data_->self, _data_->_tmp4_);
3264 _data_->scope = _data_->_tmp5_;
3265 memset (&_data_->raw, 0, sizeof (UnityPreviewReplyRaw));
3266 _data_->_tmp6_ = g_strdup ("preview-none");
3267 _g_free0 (_data_->raw.renderer_name);
3268 _data_->raw.renderer_name = _data_->_tmp6_;
3269 _data_->_tmp7_ = g_hash_table_new_full (NULL, NULL, _g_free0_, _g_variant_unref0_);
3270 _g_hash_table_unref0 (_data_->raw.properties);
3271 _data_->raw.properties = _data_->_tmp7_;
3272 _data_->_tmp8_ = _data_->scope;
3273 if (UNITY_IS_SCOPE_PROXY (_data_->_tmp8_)) {
3274 _data_->_tmp9_ = _data_->scope;
3275 _data_->_tmp10_ = _data_->tokens;
3276 _data_->_tmp10__length1 = _data_->tokens_length1;
3277 _data_->_tmp11_ = _data_->_tmp10_[1];
3278 memset (&_data_->_tmp12_, 0, sizeof (UnityPreviewReplyRaw));
3279 _data_->_state_ = 1;
3280 unity_scope_proxy_preview (_data_->_tmp9_, _data_->_tmp11_, unity_lens_impl_preview_ready, _data_);
3281 return FALSE;
3282 _state_1:
3283 unity_scope_proxy_preview_finish (_data_->_tmp9_, _data_->_res_, &_data_->_tmp12_);
3284 unity_preview_reply_raw_destroy (&_data_->raw);
3285 _data_->raw = _data_->_tmp12_;
3286 }
3287 _data_->_tmp13_ = _data_->uri;
3288 _data_->_tmp14_ = g_strdup (_data_->_tmp13_);
3289 _g_free0 (_data_->raw.uri);
3290 _data_->raw.uri = _data_->_tmp14_;
3291 _data_->result = _data_->raw;
3292 _g_object_unref0 (_data_->scope);
3293 _data_->tokens = (_vala_array_free (_data_->tokens, _data_->tokens_length1, (GDestroyNotify) g_free), NULL);
3294 if (_data_->_state_ == 0) {
3295 g_simple_async_result_complete_in_idle (_data_->_async_result);
3296 } else {
3297 g_simple_async_result_complete (_data_->_async_result);
3298 }
3299 g_object_unref (_data_->_async_result);
3300 return FALSE;
3301 unity_preview_reply_raw_destroy (&_data_->raw);
3302 _g_object_unref0 (_data_->scope);
3303 _data_->tokens = (_vala_array_free (_data_->tokens, _data_->tokens_length1, (GDestroyNotify) g_free), NULL);
3304 if (_data_->_state_ == 0) {
3305 g_simple_async_result_complete_in_idle (_data_->_async_result);
3306 } else {
3307 g_simple_async_result_complete (_data_->_async_result);
3308 }
3309 g_object_unref (_data_->_async_result);
3310 return FALSE;
3311 }
3312
3313
3314 static void unity_lens_impl_real_update_filter_data_free (gpointer _data) {
3315 UnityLensImplUpdateFilterData* _data_;
3316 _data_ = _data;
3317 _g_free0 (_data_->filter_name);
3318 _g_hash_table_unref0 (_data_->properties);
3319 _g_object_unref0 (_data_->self);
3320 g_slice_free (UnityLensImplUpdateFilterData, _data_);
3321 }
3322
3323
3324 static void unity_lens_impl_real_update_filter (UnityLensService* base, const gchar* filter_name, GHashTable* properties, GAsyncReadyCallback _callback_, gpointer _user_data_) {
3325 UnityLensImpl * self;
3326 UnityLensImplUpdateFilterData* _data_;
3327 UnityLensImpl* _tmp0_;
3328 const gchar* _tmp1_;
3329 gchar* _tmp2_;
3330 GHashTable* _tmp3_;
3331 GHashTable* _tmp4_;
3332 self = (UnityLensImpl*) base;
3333 _data_ = g_slice_new0 (UnityLensImplUpdateFilterData);
3334 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_update_filter);
3335 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_update_filter_data_free);
3336 _tmp0_ = _g_object_ref0 (self);
3337 _data_->self = _tmp0_;
3338 _tmp1_ = filter_name;
3339 _tmp2_ = g_strdup (_tmp1_);
3340 _data_->filter_name = _tmp2_;
3341 _tmp3_ = properties;
3342 _tmp4_ = _g_hash_table_ref0 (_tmp3_);
3343 _data_->properties = _tmp4_;
3344 unity_lens_impl_real_update_filter_co (_data_);
3345 }
3346
3347
3348 static void unity_lens_impl_real_update_filter_finish (UnityLensService* base, GAsyncResult* _res_, GError** error) {
3349 UnityLensImplUpdateFilterData* _data_;
3350 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
3351 return;
3352 }
3353 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
3354 }
3355
3356
3357 static gboolean unity_lens_impl_real_update_filter_co (UnityLensImplUpdateFilterData* _data_) {
3358 switch (_data_->_state_) {
3359 case 0:
3360 goto _state_0;
3361 default:
3362 g_assert_not_reached ();
3363 }
3364 _state_0:
3365 _data_->_tmp0_ = _data_->filter_name;
3366 unity_trace_log_object ((GObject*) _data_->self, "Update file '%s'", _data_->_tmp0_);
3367 if (_data_->_state_ == 0) {
3368 g_simple_async_result_complete_in_idle (_data_->_async_result);
3369 } else {
3370 g_simple_async_result_complete (_data_->_async_result);
3371 }
3372 g_object_unref (_data_->_async_result);
3373 return FALSE;
3374 }
3375
3376
3377 static void unity_lens_impl_update_active_sources_data_free (gpointer _data) {
3378 UnityLensImplUpdateActiveSourcesData* _data_;
3379 _data_ = _data;
3380 _g_object_unref0 (_data_->updated_scope_uids);
3381 _g_object_unref0 (_data_->self);
3382 g_slice_free (UnityLensImplUpdateActiveSourcesData, _data_);
3383 }
3384
3385
3386 void unity_lens_impl_update_active_sources (UnityLensImpl* self, GeeSet* updated_scope_uids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
3387 UnityLensImplUpdateActiveSourcesData* _data_;
3388 UnityLensImpl* _tmp0_;
3389 GeeSet* _tmp1_;
3390 GeeSet* _tmp2_;
3391 _data_ = g_slice_new0 (UnityLensImplUpdateActiveSourcesData);
3392 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_update_active_sources);
3393 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_update_active_sources_data_free);
3394 _tmp0_ = _g_object_ref0 (self);
3395 _data_->self = _tmp0_;
3396 _tmp1_ = updated_scope_uids;
3397 _tmp2_ = _g_object_ref0 (_tmp1_);
3398 _data_->updated_scope_uids = _tmp2_;
3399 unity_lens_impl_update_active_sources_co (_data_);
3400 }
3401
3402
3403 void unity_lens_impl_update_active_sources_finish (UnityLensImpl* self, GAsyncResult* _res_) {
3404 UnityLensImplUpdateActiveSourcesData* _data_;
3405 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
3406 }
3407
3408
3409 static glong string_strnlen (gchar* str, glong maxlen) {
3410 glong result = 0L;
3411 gchar* _tmp0_;
3412 glong _tmp1_;
3413 gchar* _tmp2_ = NULL;
3414 gchar* end;
3415 gchar* _tmp3_;
3416 _tmp0_ = str;
3417 _tmp1_ = maxlen;
3418 _tmp2_ = memchr (_tmp0_, 0, (gsize) _tmp1_);
3419 end = _tmp2_;
3420 _tmp3_ = end;
3421 if (_tmp3_ == NULL) {
3422 glong _tmp4_;
3423 _tmp4_ = maxlen;
3424 result = _tmp4_;
3425 return result;
3426 } else {
3427 gchar* _tmp5_;
3428 gchar* _tmp6_;
3429 _tmp5_ = end;
3430 _tmp6_ = str;
3431 result = (glong) (_tmp5_ - _tmp6_);
3432 return result;
3433 }
3434 }
3435
3436
3437 static gchar* string_substring (const gchar* self, glong offset, glong len) {
3438 gchar* result = NULL;
3439 glong string_length = 0L;
3440 gboolean _tmp0_ = FALSE;
3441 glong _tmp1_;
3442 gboolean _tmp3_;
3443 glong _tmp9_;
3444 glong _tmp15_;
3445 glong _tmp18_;
3446 glong _tmp19_;
3447 glong _tmp20_;
3448 glong _tmp21_;
3449 glong _tmp22_;
3450 gchar* _tmp23_ = NULL;
3451 g_return_val_if_fail (self != NULL, NULL);
3452 _tmp1_ = offset;
3453 if (_tmp1_ >= ((glong) 0)) {
3454 glong _tmp2_;
3455 _tmp2_ = len;
3456 _tmp0_ = _tmp2_ >= ((glong) 0);
3457 } else {
3458 _tmp0_ = FALSE;
3459 }
3460 _tmp3_ = _tmp0_;
3461 if (_tmp3_) {
3462 glong _tmp4_;
3463 glong _tmp5_;
3464 glong _tmp6_ = 0L;
3465 _tmp4_ = offset;
3466 _tmp5_ = len;
3467 _tmp6_ = string_strnlen ((gchar*) self, _tmp4_ + _tmp5_);
3468 string_length = _tmp6_;
3469 } else {
3470 gint _tmp7_;
3471 gint _tmp8_;
3472 _tmp7_ = strlen (self);
3473 _tmp8_ = _tmp7_;
3474 string_length = (glong) _tmp8_;
3475 }
3476 _tmp9_ = offset;
3477 if (_tmp9_ < ((glong) 0)) {
3478 glong _tmp10_;
3479 glong _tmp11_;
3480 glong _tmp12_;
3481 _tmp10_ = string_length;
3482 _tmp11_ = offset;
3483 offset = _tmp10_ + _tmp11_;
3484 _tmp12_ = offset;
3485 g_return_val_if_fail (_tmp12_ >= ((glong) 0), NULL);
3486 } else {
3487 glong _tmp13_;
3488 glong _tmp14_;
3489 _tmp13_ = offset;
3490 _tmp14_ = string_length;
3491 g_return_val_if_fail (_tmp13_ <= _tmp14_, NULL);
3492 }
3493 _tmp15_ = len;
3494 if (_tmp15_ < ((glong) 0)) {
3495 glong _tmp16_;
3496 glong _tmp17_;
3497 _tmp16_ = string_length;
3498 _tmp17_ = offset;
3499 len = _tmp16_ - _tmp17_;
3500 }
3501 _tmp18_ = offset;
3502 _tmp19_ = len;
3503 _tmp20_ = string_length;
3504 g_return_val_if_fail ((_tmp18_ + _tmp19_) <= _tmp20_, NULL);
3505 _tmp21_ = offset;
3506 _tmp22_ = len;
3507 _tmp23_ = g_strndup (((gchar*) self) + _tmp21_, (gsize) _tmp22_);
3508 result = _tmp23_;
3509 return result;
3510 }
3511
3512
3513 static void _vala_array_add3 (gchar*** array, int* length, int* size, gchar* value) {
3514 if ((*length) == (*size)) {
3515 *size = (*size) ? (2 * (*size)) : 4;
3516 *array = g_renew (gchar*, *array, (*size) + 1);
3517 }
3518 (*array)[(*length)++] = value;
3519 (*array)[*length] = NULL;
3520 }
3521
3522
3523 static gboolean unity_lens_impl_update_active_sources_co (UnityLensImplUpdateActiveSourcesData* _data_) {
3524 switch (_data_->_state_) {
3525 case 0:
3526 goto _state_0;
3527 default:
3528 g_assert_not_reached ();
3529 }
3530 _state_0:
3531 {
3532 _data_->_tmp0_ = _data_->updated_scope_uids;
3533 _data_->_tmp1_ = NULL;
3534 _data_->_tmp1_ = gee_iterable_iterator ((GeeIterable*) _data_->_tmp0_);
3535 _data_->_scope_uid_it = _data_->_tmp1_;
3536 while (TRUE) {
3537 _data_->_tmp2_ = _data_->_scope_uid_it;
3538 _data_->_tmp3_ = FALSE;
3539 _data_->_tmp3_ = gee_iterator_next (_data_->_tmp2_);
3540 if (!_data_->_tmp3_) {
3541 break;
3542 }
3543 _data_->_tmp4_ = _data_->_scope_uid_it;
3544 _data_->_tmp5_ = NULL;
3545 _data_->_tmp5_ = gee_iterator_get (_data_->_tmp4_);
3546 _data_->scope_uid = (gchar*) _data_->_tmp5_;
3547 _data_->_tmp6_ = _data_->scope_uid;
3548 _data_->_tmp7_ = NULL;
3549 _data_->_tmp7_ = unity_lens_impl_get_scope_for_uid (_data_->self, _data_->_tmp6_);
3550 _data_->scope = _data_->_tmp7_;
3551 _data_->_tmp8_ = _data_->scope;
3552 if (_data_->_tmp8_ == NULL) {
3553 _g_object_unref0 (_data_->scope);
3554 _g_free0 (_data_->scope_uid);
3555 continue;
3556 }
3557 _data_->_tmp9_ = NULL;
3558 _data_->_tmp9_ = g_new0 (gchar*, 0 + 1);
3559 _data_->active_sources = _data_->_tmp9_;
3560 _data_->active_sources_length1 = 0;
3561 _data_->_active_sources_size_ = _data_->active_sources_length1;
3562 _data_->_tmp10_ = _data_->self->priv->_sources;
3563 _data_->_tmp11_ = _data_->_tmp10_->options;
3564 {
3565 _data_->filter_option_collection = _data_->_tmp11_;
3566 _data_->filter_option_it = NULL;
3567 for (_data_->filter_option_it = _data_->filter_option_collection; _data_->filter_option_it != NULL; _data_->filter_option_it = _data_->filter_option_it->next) {
3568 _data_->_tmp12_ = _g_object_ref0 ((UnityFilterOption*) _data_->filter_option_it->data);
3569 _data_->filter_option = _data_->_tmp12_;
3570 {
3571 _data_->_tmp14_ = _data_->filter_option;
3572 _data_->_tmp15_ = unity_filter_option_get_id (_data_->_tmp14_);
3573 _data_->_tmp16_ = _data_->_tmp15_;
3574 _data_->_tmp17_ = _data_->scope_uid;
3575 _data_->_tmp18_ = FALSE;
3576 _data_->_tmp18_ = g_str_has_prefix (_data_->_tmp16_, _data_->_tmp17_);
3577 if (_data_->_tmp18_) {
3578 _data_->_tmp19_ = _data_->filter_option;
3579 _data_->_tmp20_ = unity_filter_option_get_active (_data_->_tmp19_);
3580 _data_->_tmp21_ = _data_->_tmp20_;
3581 _data_->_tmp13_ = _data_->_tmp21_;
3582 } else {
3583 _data_->_tmp13_ = FALSE;
3584 }
3585 _data_->_tmp22_ = _data_->_tmp13_;
3586 if (_data_->_tmp22_) {
3587 _data_->_tmp23_ = _data_->active_sources;
3588 _data_->_tmp23__length1 = _data_->active_sources_length1;
3589 _data_->_tmp24_ = _data_->filter_option;
3590 _data_->_tmp25_ = unity_filter_option_get_id (_data_->_tmp24_);
3591 _data_->_tmp26_ = _data_->_tmp25_;
3592 _data_->_tmp27_ = _data_->scope_uid;
3593 _data_->_tmp28_ = strlen (_data_->_tmp27_);
3594 _data_->_tmp29_ = _data_->_tmp28_;
3595 _data_->_tmp30_ = NULL;
3596 _data_->_tmp30_ = string_substring (_data_->_tmp26_, (glong) (_data_->_tmp29_ + 1), (glong) (-1));
3597 _vala_array_add3 (&_data_->active_sources, &_data_->active_sources_length1, &_data_->_active_sources_size_, _data_->_tmp30_);
3598 }
3599 _g_object_unref0 (_data_->filter_option);
3600 }
3601 }
3602 }
3603 _data_->_tmp31_ = _data_->scope;
3604 _data_->_tmp32_ = _data_->active_sources;
3605 _data_->_tmp32__length1 = _data_->active_sources_length1;
3606 unity_scope_proxy_set_active_sources (_data_->_tmp31_, _data_->_tmp32_, _data_->_tmp32__length1, NULL, NULL);
3607 _data_->active_sources = (_vala_array_free (_data_->active_sources, _data_->active_sources_length1, (GDestroyNotify) g_free), NULL);
3608 _g_object_unref0 (_data_->scope);
3609 _g_free0 (_data_->scope_uid);
3610 }
3611 _g_object_unref0 (_data_->_scope_uid_it);
3612 }
3613 if (_data_->_state_ == 0) {
3614 g_simple_async_result_complete_in_idle (_data_->_async_result);
3615 } else {
3616 g_simple_async_result_complete (_data_->_async_result);
3617 }
3618 g_object_unref (_data_->_async_result);
3619 return FALSE;
3620 }
3621
3622
3623 static void unity_lens_impl_real_set_view_type_data_free (gpointer _data) {
3624 UnityLensImplSetViewTypeData* _data_;
3625 _data_ = _data;
3626 _g_object_unref0 (_data_->self);
3627 g_slice_free (UnityLensImplSetViewTypeData, _data_);
3628 }
3629
3630
3631 static void unity_lens_impl_real_set_view_type (UnityLensService* base, guint view_type, GAsyncReadyCallback _callback_, gpointer _user_data_) {
3632 UnityLensImpl * self;
3633 UnityLensImplSetViewTypeData* _data_;
3634 UnityLensImpl* _tmp0_;
3635 guint _tmp1_;
3636 self = (UnityLensImpl*) base;
3637 _data_ = g_slice_new0 (UnityLensImplSetViewTypeData);
3638 _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_lens_impl_real_set_view_type);
3639 g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, unity_lens_impl_real_set_view_type_data_free);
3640 _tmp0_ = _g_object_ref0 (self);
3641 _data_->self = _tmp0_;
3642 _tmp1_ = view_type;
3643 _data_->view_type = _tmp1_;
3644 unity_lens_impl_real_set_view_type_co (_data_);
3645 }
3646
3647
3648 static void unity_lens_impl_real_set_view_type_finish (UnityLensService* base, GAsyncResult* _res_, GError** error) {
3649 UnityLensImplSetViewTypeData* _data_;
3650 if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
3651 return;
3652 }
3653 _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
3654 }
3655
3656
3657 static gboolean unity_lens_impl_real_set_view_type_co (UnityLensImplSetViewTypeData* _data_) {
3658 switch (_data_->_state_) {
3659 case 0:
3660 goto _state_0;
3661 default:
3662 g_assert_not_reached ();
3663 }
3664 _state_0:
3665 {
3666 _data_->_tmp0_ = _data_->self->priv->_scope_factory;
3667 _data_->_tmp1_ = _data_->_tmp0_->scopes;
3668 _data_->_tmp2_ = _g_object_ref0 (_data_->_tmp1_);
3669 _data_->_scope_list = _data_->_tmp2_;
3670 _data_->_tmp3_ = _data_->_scope_list;
3671 _data_->_tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _data_->_tmp3_);
3672 _data_->_tmp5_ = _data_->_tmp4_;
3673 _data_->_scope_size = _data_->_tmp5_;
3674 _data_->_scope_index = -1;
3675 while (TRUE) {
3676 _data_->_tmp6_ = _data_->_scope_index;
3677 _data_->_scope_index = _data_->_tmp6_ + 1;
3678 _data_->_tmp7_ = _data_->_scope_index;
3679 _data_->_tmp8_ = _data_->_scope_size;
3680 if (!(_data_->_tmp7_ < _data_->_tmp8_)) {
3681 break;
3682 }
3683 _data_->_tmp9_ = _data_->_scope_list;
3684 _data_->_tmp10_ = _data_->_scope_index;
3685 _data_->_tmp11_ = NULL;
3686 _data_->_tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp9_, _data_->_tmp10_);
3687 _data_->scope = (UnityScopeProxy*) _data_->_tmp11_;
3688 _data_->_tmp12_ = _data_->scope;
3689 _data_->_tmp13_ = _data_->view_type;
3690 unity_scope_proxy_set_view_type (_data_->_tmp12_, (UnityViewType) _data_->_tmp13_);
3691 _g_object_unref0 (_data_->scope);
3692 }
3693 _g_object_unref0 (_data_->_scope_list);
3694 }
3695 _data_->_tmp14_ = _data_->self->priv->_owner;
3696 _data_->_tmp15_ = _data_->view_type;
3697 unity_lens_set_active_internal (_data_->_tmp14_, _data_->_tmp15_ != ((guint) UNITY_VIEW_TYPE_HIDDEN));
3698 if (_data_->_state_ == 0) {
3699 g_simple_async_result_complete_in_idle (_data_->_async_result);
3700 } else {
3701 g_simple_async_result_complete (_data_->_async_result);
3702 }
3703 g_object_unref (_data_->_async_result);
3704 return FALSE;
3705 }
3706
3707
3708 static UnityScopeProxy* unity_lens_impl_get_scope_for_uid (UnityLensImpl* self, const gchar* uid) {
3709 UnityScopeProxy* result = NULL;
3710 g_return_val_if_fail (self != NULL, NULL);
3711 g_return_val_if_fail (uid != NULL, NULL);
3712 {
3713 UnityScopeFactory* _tmp0_;
3714 GeeArrayList* _tmp1_;
3715 GeeArrayList* _tmp2_;
3716 GeeArrayList* _scope_list;
3717 GeeArrayList* _tmp3_;
3718 gint _tmp4_;
3719 gint _tmp5_;
3720 gint _scope_size;
3721 gint _scope_index;
3722 _tmp0_ = self->priv->_scope_factory;
3723 _tmp1_ = _tmp0_->scopes;
3724 _tmp2_ = _g_object_ref0 (_tmp1_);
3725 _scope_list = _tmp2_;
3726 _tmp3_ = _scope_list;
3727 _tmp4_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp3_);
3728 _tmp5_ = _tmp4_;
3729 _scope_size = _tmp5_;
3730 _scope_index = -1;
3731 while (TRUE) {
3732 gint _tmp6_;
3733 gint _tmp7_;
3734 gint _tmp8_;
3735 GeeArrayList* _tmp9_;
3736 gint _tmp10_;
3737 gpointer _tmp11_ = NULL;
3738 UnityScopeProxy* scope;
3739 const gchar* _tmp12_;
3740 UnityScopeProxy* _tmp13_;
3741 gchar* _tmp14_ = NULL;
3742 gchar* _tmp15_;
3743 gboolean _tmp16_;
3744 _tmp6_ = _scope_index;
3745 _scope_index = _tmp6_ + 1;
3746 _tmp7_ = _scope_index;
3747 _tmp8_ = _scope_size;
3748 if (!(_tmp7_ < _tmp8_)) {
3749 break;
3750 }
3751 _tmp9_ = _scope_list;
3752 _tmp10_ = _scope_index;
3753 _tmp11_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _tmp10_);
3754 scope = (UnityScopeProxy*) _tmp11_;
3755 _tmp12_ = uid;
3756 _tmp13_ = scope;
3757 _tmp14_ = unity_lens_impl_uid_for_scope (self, _tmp13_);
3758 _tmp15_ = _tmp14_;
3759 _tmp16_ = g_strcmp0 (_tmp12_, _tmp15_) == 0;
3760 _g_free0 (_tmp15_);
3761 if (_tmp16_) {
3762 result = scope;
3763 _g_object_unref0 (_scope_list);
3764 return result;
3765 }
3766 _g_object_unref0 (scope);
3767 }
3768 _g_object_unref0 (_scope_list);
3769 }
3770 result = NULL;
3771 return result;
3772 }
3773
3774
3775 static gchar* unity_lens_impl_uid_for_scope (UnityLensImpl* self, UnityScopeProxy* scope) {
3776 gchar* result = NULL;
3777 UnityScopeProxy* _tmp0_;
3778 gchar* _tmp1_ = NULL;
3779 g_return_val_if_fail (self != NULL, NULL);
3780 g_return_val_if_fail (scope != NULL, NULL);
3781 _tmp0_ = scope;
3782 _tmp1_ = g_strdup_printf ("%p", _tmp0_);
3783 result = _tmp1_;
3784 return result;
3785 }
3786
3787
3788 UnityResultsSynchronizer* unity_lens_impl_get_results_sync (UnityLensImpl* self) {
3789 UnityResultsSynchronizer* result;
3790 UnityResultsSynchronizer* _tmp0_;
3791 g_return_val_if_fail (self != NULL, NULL);
3792 _tmp0_ = self->priv->_results_sync;
3793 result = _tmp0_;
3794 return result;
3795 }
3796
3797
3798 UnityResultsSynchronizer* unity_lens_impl_get_global_results_sync (UnityLensImpl* self) {
3799 UnityResultsSynchronizer* result;
3800 UnityResultsSynchronizer* _tmp0_;
3801 g_return_val_if_fail (self != NULL, NULL);
3802 _tmp0_ = self->priv->_global_results_sync;
3803 result = _tmp0_;
3804 return result;
3805 }
3806
3807
3808 static void unity_lens_impl_class_init (UnityLensImplClass * klass) {
3809 const gchar* _tmp0_ = NULL;
3810 const gchar* _tmp1_;
3811 unity_lens_impl_parent_class = g_type_class_peek_parent (klass);
3812 g_type_class_add_private (klass, sizeof (UnityLensImplPrivate));
3813 G_OBJECT_CLASS (klass)->get_property = _vala_unity_lens_impl_get_property;
3814 G_OBJECT_CLASS (klass)->finalize = unity_lens_impl_finalize;
3815 g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_IMPL_RESULTS_SYNC, g_param_spec_object ("results-sync", "results-sync", "results-sync", UNITY_TYPE_RESULTS_SYNCHRONIZER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
3816 g_object_class_install_property (G_OBJECT_CLASS (klass), UNITY_LENS_IMPL_GLOBAL_RESULTS_SYNC, g_param_spec_object ("global-results-sync", "global-results-sync", "global-results-sync", UNITY_TYPE_RESULTS_SYNCHRONIZER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
3817 _tmp0_ = g_getenv ("LIBUNITY_LENS_DIRECTORY");
3818 unity_lens_impl_LENS_DIRECTORY = _tmp0_;
3819 _tmp1_ = unity_lens_impl_LENS_DIRECTORY;
3820 if (_tmp1_ == NULL) {
3821 unity_lens_impl_LENS_DIRECTORY = "";
3822 }
3823 }
3824
3825
3826 static void unity_lens_impl_unity_lens_service_interface_init (UnityLensServiceIface * iface) {
3827 unity_lens_impl_unity_lens_service_parent_iface = g_type_interface_peek_parent (iface);
3828 iface->info_request = (void (*)(UnityLensService*, GError**)) unity_lens_impl_real_info_request;
3829 iface->info_request_finish = unity_lens_impl_real_info_request_finish;
3830 iface->activate = (void (*)(UnityLensService*, const gchar*, guint, UnityActivationReplyRaw*, GError**)) unity_lens_impl_real_activate;
3831 iface->activate_finish = unity_lens_impl_real_activate_finish;
3832 iface->search = (GHashTable* (*)(UnityLensService*, const gchar*, GHashTable*, GError**)) unity_lens_impl_real_search;
3833 iface->search_finish = unity_lens_impl_real_search_finish;
3834 iface->global_search = (GHashTable* (*)(UnityLensService*, const gchar*, GHashTable*, GError**)) unity_lens_impl_real_global_search;
3835 iface->global_search_finish = unity_lens_impl_real_global_search_finish;
3836 iface->preview = (void (*)(UnityLensService*, const gchar*, UnityPreviewReplyRaw*, GError**)) unity_lens_impl_real_preview;
3837 iface->preview_finish = unity_lens_impl_real_preview_finish;
3838 iface->update_filter = (void (*)(UnityLensService*, const gchar*, GHashTable*, GError**)) unity_lens_impl_real_update_filter;
3839 iface->update_filter_finish = unity_lens_impl_real_update_filter_finish;
3840 iface->set_view_type = (void (*)(UnityLensService*, guint, GError**)) unity_lens_impl_real_set_view_type;
3841 iface->set_view_type_finish = unity_lens_impl_real_set_view_type_finish;
3842 }
3843
3844
3845 static void unity_lens_impl_instance_init (UnityLensImpl * self) {
3846 self->priv = UNITY_LENS_IMPL_GET_PRIVATE (self);
3847 }
3848
3849
3850 static void unity_lens_impl_finalize (GObject* obj) {
3851 UnityLensImpl * self;
3852 self = UNITY_LENS_IMPL (obj);
3853 _g_object_unref0 (self->priv->_results_model);
3854 _g_object_unref0 (self->priv->_global_results_model);
3855 _g_object_unref0 (self->priv->_categories_model);
3856 _g_object_unref0 (self->priv->_filters_model);
3857 _g_object_unref0 (self->priv->_sources);
3858 _g_object_unref0 (self->priv->_scope_factory);
3859 _g_object_unref0 (self->priv->_filters_sync);
3860 _g_object_unref0 (self->priv->_results_sync);
3861 _g_object_unref0 (self->priv->_global_results_sync);
3862 G_OBJECT_CLASS (unity_lens_impl_parent_class)->finalize (obj);
3863 }
3864
3865
3866 GType unity_lens_impl_get_type (void) {
3867 static volatile gsize unity_lens_impl_type_id__volatile = 0;
3868 if (g_once_init_enter (&unity_lens_impl_type_id__volatile)) {
3869 static const GTypeInfo g_define_type_info = { sizeof (UnityLensImplClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) unity_lens_impl_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (UnityLensImpl), 0, (GInstanceInitFunc) unity_lens_impl_instance_init, NULL };
3870 static const GInterfaceInfo unity_lens_service_info = { (GInterfaceInitFunc) unity_lens_impl_unity_lens_service_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
3871 GType unity_lens_impl_type_id;
3872 unity_lens_impl_type_id = g_type_register_static (G_TYPE_OBJECT, "UnityLensImpl", &g_define_type_info, 0);
3873 g_type_add_interface_static (unity_lens_impl_type_id, UNITY_TYPE_LENS_SERVICE, &unity_lens_service_info);
3874 g_once_init_leave (&unity_lens_impl_type_id__volatile, unity_lens_impl_type_id);
3875 }
3876 return unity_lens_impl_type_id__volatile;
3877 }
3878
3879
3880 static void _vala_unity_lens_impl_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
3881 UnityLensImpl * self;
3882 self = UNITY_LENS_IMPL (object);
3883 switch (property_id) {
3884 case UNITY_LENS_IMPL_RESULTS_SYNC:
3885 g_value_set_object (value, unity_lens_impl_get_results_sync (self));
3886 break;
3887 case UNITY_LENS_IMPL_GLOBAL_RESULTS_SYNC:
3888 g_value_set_object (value, unity_lens_impl_get_global_results_sync (self));
3889 break;
3890 default:
3891 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
3892 break;
3893 }
3894 }
3895
3896
3897 static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
3898 if ((array != NULL) && (destroy_func != NULL)) {
3899 int i;
3900 for (i = 0; i < array_length; i = i + 1) {
3901 if (((gpointer*) array)[i] != NULL) {
3902 destroy_func (((gpointer*) array)[i]);
3903 }
3904 }
3905 }
3906 }
3907
3908
3909 static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
3910 _vala_array_destroy (array, array_length, destroy_func);
3911 g_free (array);
3912 }
3913
3914
3915 static gint _vala_array_length (gpointer array) {
3916 int length;
3917 length = 0;
3918 if (array) {
3919 while (((gpointer*) array)[length]) {
3920 length++;
3921 }
3922 }
3923 return length;
3924 }