~timo-jyrinki/ubuntu/quantal/unity-lens-applications/ubuntu.680

« back to all changes in this revision

Viewing changes to src/daemon.c

  • Committer: timo.jyrinki at canonical
  • Date: 2012-09-19 11:36:13 UTC
  • mfrom: (31.1.39)
  • Revision ID: timo.jyrinki@canonical.com-20120919113613-rdpqtk96xc2cl3gw
* New upstream release.
  - Home Lens requires binary names to be provided with results
    (LP: #1043775)
  - Dash - App Lens ratings are not working (LP: #1039789)
  - Dash - When an application is installed direct from a Dash Preview, the
    Software Centre should not be launched and the Software Centre window
    should not be opened (LP: #1045330)
  - [FFE][UIFE]Dash - Finesse the placement, movement and behaviour of the
    12.10 Dash (LP: #1049593)
  - Icons are missing in the previews for apps available for download
    (LP: #1050344)
  - Don't show 'Uninstall' button for critical apps (i.e. the ones that
    depend on ubuntu-desktop). (LP: #1047315)
  - List 10 'What's new' apps and the 12 'Top Rated' apps from Software 
    Center in 'Apps Available for Download' before user performs any search 
    if no filters are active. List 100 top rated apps according to active 
    filters if search string is empty. (LP: #1045762)
  - Implemented price ribbons for Application Lens search results.
    (LP: #1049593)
* Bump dependency on libunity-dev to 5.96.0+bzr176

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include <glib/gi18n-lib.h>
36
36
#include <dee.h>
37
37
#include <glib/gstdio.h>
38
 
#include <float.h>
39
 
#include <math.h>
40
38
#include <gio/gdesktopappinfo.h>
41
39
 
42
40
 
110
108
 
111
109
typedef struct _UnityApplicationsLensAppWatcher UnityApplicationsLensAppWatcher;
112
110
typedef struct _UnityApplicationsLensAppWatcherClass UnityApplicationsLensAppWatcherClass;
 
111
 
 
112
#define UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER (unity_applications_lens_purchase_info_helper_get_type ())
 
113
#define UNITY_APPLICATIONS_LENS_PURCHASE_INFO_HELPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER, UnityApplicationsLensPurchaseInfoHelper))
 
114
#define UNITY_APPLICATIONS_LENS_PURCHASE_INFO_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER, UnityApplicationsLensPurchaseInfoHelperClass))
 
115
#define UNITY_APPLICATIONS_LENS_IS_PURCHASE_INFO_HELPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER))
 
116
#define UNITY_APPLICATIONS_LENS_IS_PURCHASE_INFO_HELPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER))
 
117
#define UNITY_APPLICATIONS_LENS_PURCHASE_INFO_HELPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_APPLICATIONS_LENS_TYPE_PURCHASE_INFO_HELPER, UnityApplicationsLensPurchaseInfoHelperClass))
 
118
 
 
119
typedef struct _UnityApplicationsLensPurchaseInfoHelper UnityApplicationsLensPurchaseInfoHelper;
 
120
typedef struct _UnityApplicationsLensPurchaseInfoHelperClass UnityApplicationsLensPurchaseInfoHelperClass;
113
121
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
114
122
#define _unity_package_searcher_free0(var) ((var == NULL) ? NULL : (var = (unity_package_searcher_free (var), NULL)))
115
123
#define _unity_ratings_database_free0(var) ((var == NULL) ? NULL : (var = (unity_ratings_database_free (var), NULL)))
118
126
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
119
127
#define _gmenu_tree_unref0(var) ((var == NULL) ? NULL : (var = (gmenu_tree_unref (var), NULL)))
120
128
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
 
129
#define _unity_applications_lens_purchase_info_helper_unref0(var) ((var == NULL) ? NULL : (var = (unity_applications_lens_purchase_info_helper_unref (var), NULL)))
121
130
typedef struct _UnityApplicationsLensDaemonDispatchSearchData UnityApplicationsLensDaemonDispatchSearchData;
122
131
#define __g_list_free__g_object_unref0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free__g_object_unref0_ (var), NULL)))
123
132
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
126
135
#define UNITY_APPLICATIONS_LENS_TYPE_CATEGORY (unity_applications_lens_category_get_type ())
127
136
#define _unity_package_search_result_free0(var) ((var == NULL) ? NULL : (var = (unity_package_search_result_free (var), NULL)))
128
137
#define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
 
138
 
 
139
#define UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE (unity_applications_lens_software_center_data_cache_get_type ())
 
140
#define UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE, UnityApplicationsLensSoftwareCenterDataCache))
 
141
#define UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE, UnityApplicationsLensSoftwareCenterDataCacheClass))
 
142
#define UNITY_APPLICATIONS_LENS_IS_SOFTWARE_CENTER_DATA_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE))
 
143
#define UNITY_APPLICATIONS_LENS_IS_SOFTWARE_CENTER_DATA_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE))
 
144
#define UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_APPLICATIONS_LENS_TYPE_SOFTWARE_CENTER_DATA_CACHE, UnityApplicationsLensSoftwareCenterDataCacheClass))
 
145
 
 
146
typedef struct _UnityApplicationsLensSoftwareCenterDataCache UnityApplicationsLensSoftwareCenterDataCache;
 
147
typedef struct _UnityApplicationsLensSoftwareCenterDataCacheClass UnityApplicationsLensSoftwareCenterDataCacheClass;
 
148
 
 
149
#define UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_PROVIDER_SERVICE_TYPE_APP_INFO (unity_applications_lens_software_center_data_provider_service_app_info_get_type ())
 
150
typedef struct _UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo;
 
151
#define __g_slist_free__g_free0_0(var) ((var == NULL) ? NULL : (var = (_g_slist_free__g_free0_ (var), NULL)))
129
152
typedef struct _UnityApplicationsLensDaemonUpdateScopeSearchData UnityApplicationsLensDaemonUpdateScopeSearchData;
130
153
typedef struct _UnityApplicationsLensDaemonUpdateGlobalSearchData UnityApplicationsLensDaemonUpdateGlobalSearchData;
131
154
typedef struct _UnityApplicationsLensDaemonUpdateGlobalWithoutSearchData UnityApplicationsLensDaemonUpdateGlobalWithoutSearchData;
 
155
 
 
156
#define UNITY_APPLICATIONS_LENS_PURCHASE_INFO_HELPER_TYPE_APP_INFO (unity_applications_lens_purchase_info_helper_app_info_get_type ())
 
157
typedef struct _UnityApplicationsLensPurchaseInfoHelperAppInfo UnityApplicationsLensPurchaseInfoHelperAppInfo;
 
158
#define _unity_applications_lens_purchase_info_helper_app_info_free0(var) ((var == NULL) ? NULL : (var = (unity_applications_lens_purchase_info_helper_app_info_free (var), NULL)))
132
159
typedef struct _UnityApplicationsLensDaemonCallInstallPackagesData UnityApplicationsLensDaemonCallInstallPackagesData;
133
160
typedef struct _UnityApplicationsLensDaemonCallRemovePackagesData UnityApplicationsLensDaemonCallRemovePackagesData;
134
161
typedef struct _Block1Data Block1Data;
182
209
        GSettings* gp_settings;
183
210
        gboolean _display_recent_apps;
184
211
        gboolean _display_available_apps;
 
212
        UnityApplicationsLensPurchaseInfoHelper* purchase_info;
185
213
};
186
214
 
187
215
struct _UnityApplicationsLensDaemonDispatchSearchData {
256
284
};
257
285
 
258
286
typedef enum  {
 
287
        UNITY_APPLICATIONS_LENS_CATEGORY_APPLICATIONS,
259
288
        UNITY_APPLICATIONS_LENS_CATEGORY_RECENT,
260
289
        UNITY_APPLICATIONS_LENS_CATEGORY_RECENT_APPS,
261
290
        UNITY_APPLICATIONS_LENS_CATEGORY_INSTALLED,
262
 
        UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE,
263
 
        UNITY_APPLICATIONS_LENS_CATEGORY_APPLICATIONS
 
291
        UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE
264
292
} UnityApplicationsLensCategory;
265
293
 
 
294
struct _UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo {
 
295
        gchar* application_name;
 
296
        gchar* package_name;
 
297
        gchar* icon;
 
298
        gchar* desktop_file;
 
299
};
 
300
 
266
301
struct _UnityApplicationsLensDaemonUpdateScopeSearchData {
267
302
        int _state_;
268
303
        GObject* _source_object_;
286
321
        UnityOptionsFilter* _tmp10_;
287
322
        gchar* _tmp11_;
288
323
        gchar* pkg_search_string;
289
 
        UnityLensSearch* _tmp12_;
290
 
        gboolean _tmp13_;
 
324
        gboolean _tmp12_;
 
325
        UnityOptionsFilter* _tmp13_;
 
326
        UnityOptionsFilter* _tmp14_;
 
327
        gboolean _tmp15_;
 
328
        gboolean _tmp16_;
 
329
        gboolean _tmp17_;
 
330
        gboolean has_filter;
 
331
        UnityLensSearch* _tmp18_;
 
332
        gboolean _tmp19_;
291
333
        gboolean has_search;
292
 
        GTimer* _tmp14_;
 
334
        GTimer* _tmp20_;
293
335
        GTimer* timer;
294
 
        DeeSerializableModel* _tmp15_;
295
 
        DeeTransaction* _tmp16_;
 
336
        DeeSerializableModel* _tmp21_;
 
337
        DeeTransaction* _tmp22_;
296
338
        DeeTransaction* transaction;
297
 
        DeeTransaction* _tmp17_;
298
 
        GeeHashSet* _tmp18_;
 
339
        DeeTransaction* _tmp23_;
 
340
        GeeHashSet* _tmp24_;
299
341
        GeeSet* installed_uris;
300
 
        GeeHashSet* _tmp19_;
 
342
        GeeHashSet* _tmp25_;
301
343
        GeeSet* available_uris;
302
 
        UnityPackageSort _tmp20_;
303
 
        gboolean _tmp21_;
304
 
        UnityPackageSearcher* _tmp22_;
305
 
        const gchar* _tmp23_;
306
 
        UnityPackageSort _tmp24_;
307
 
        UnityPackageSearchResult* _tmp25_;
308
 
        UnityPackageSearchResult* appresults;
309
 
        gboolean _tmp26_;
 
344
        UnityPackageSort _tmp26_;
310
345
        gboolean _tmp27_;
311
 
        UnityPackageSearchResult* _tmp28_;
312
 
        UnityPackageSearchResult* _tmp29_;
313
 
        GeeSet* _tmp30_;
314
 
        GeeSet* _tmp31_;
315
 
        DeeTransaction* _tmp32_;
316
 
        GTimer* _tmp33_;
 
346
        UnityPackageSearcher* _tmp28_;
 
347
        const gchar* _tmp29_;
 
348
        UnityPackageSort _tmp30_;
 
349
        UnityPackageSearchResult* _tmp31_;
 
350
        UnityPackageSearchResult* appresults;
 
351
        gboolean _tmp32_;
 
352
        gboolean _tmp33_;
317
353
        UnityPackageSearchResult* _tmp34_;
318
 
        gint _tmp35_;
319
 
        GTimer* _tmp36_;
320
 
        gdouble _tmp37_;
321
 
        const gchar* _tmp38_;
322
 
        gboolean _tmp39_;
323
 
        gboolean _tmp40_;
324
 
        gboolean _tmp41_;
325
 
        gboolean _tmp42_;
326
 
        GTimer* _tmp43_;
327
 
        UnityOptionsFilter* _tmp44_;
328
 
        gchar* _tmp45_;
 
354
        UnityPackageSearchResult* _tmp35_;
 
355
        GeeSet* _tmp36_;
 
356
        GeeSet* _tmp37_;
 
357
        DeeTransaction* _tmp38_;
 
358
        GTimer* _tmp39_;
 
359
        UnityPackageSearchResult* _tmp40_;
 
360
        gint _tmp41_;
 
361
        GTimer* _tmp42_;
 
362
        gdouble _tmp43_;
 
363
        const gchar* _tmp44_;
 
364
        gboolean _tmp45_;
 
365
        gboolean _tmp46_;
 
366
        gboolean _tmp47_;
 
367
        gboolean _tmp48_;
 
368
        GTimer* _tmp49_;
 
369
        UnityOptionsFilter* _tmp50_;
 
370
        gchar* _tmp51_;
329
371
        gchar* zg_search_string;
330
 
        ZeitgeistIndex* _tmp46_;
331
 
        const gchar* _tmp47_;
332
 
        ZeitgeistTimeRange* _tmp48_;
333
 
        ZeitgeistTimeRange* _tmp49_;
334
 
        GPtrArray* _tmp50_;
335
 
        GPtrArray* _tmp51_;
336
 
        GCancellable* _tmp52_;
337
 
        ZeitgeistResultSet* _tmp53_;
338
 
        ZeitgeistResultSet* _tmp54_;
339
 
        ZeitgeistResultSet* results;
340
 
        ZeitgeistResultSet* _tmp55_;
341
 
        DeeTransaction* _tmp56_;
342
 
        GeeSet* _tmp57_;
343
 
        GTimer* _tmp58_;
 
372
        ZeitgeistIndex* _tmp52_;
 
373
        const gchar* _tmp53_;
 
374
        ZeitgeistTimeRange* _tmp54_;
 
375
        ZeitgeistTimeRange* _tmp55_;
 
376
        GPtrArray* _tmp56_;
 
377
        GPtrArray* _tmp57_;
 
378
        GCancellable* _tmp58_;
344
379
        ZeitgeistResultSet* _tmp59_;
345
 
        guint _tmp60_;
 
380
        ZeitgeistResultSet* _tmp60_;
 
381
        ZeitgeistResultSet* results;
346
382
        ZeitgeistResultSet* _tmp61_;
347
 
        guint _tmp62_;
348
 
        GTimer* _tmp63_;
349
 
        gdouble _tmp64_;
350
 
        const gchar* _tmp65_;
 
383
        DeeTransaction* _tmp62_;
 
384
        GeeSet* _tmp63_;
 
385
        GTimer* _tmp64_;
 
386
        ZeitgeistResultSet* _tmp65_;
 
387
        guint _tmp66_;
 
388
        ZeitgeistResultSet* _tmp67_;
 
389
        guint _tmp68_;
 
390
        GTimer* _tmp69_;
 
391
        gdouble _tmp70_;
 
392
        const gchar* _tmp71_;
351
393
        GError* ioe;
352
394
        GError* e;
353
 
        UnityLensSearch* _tmp66_;
354
 
        const gchar* _tmp67_;
355
 
        const gchar* _tmp68_;
356
 
        GError* _tmp69_;
357
 
        const gchar* _tmp70_;
358
 
        DeeTransaction* _tmp71_;
359
 
        gboolean _tmp72_;
360
 
        gboolean _tmp73_;
361
 
        gboolean _tmp74_;
362
 
        gboolean _tmp75_;
363
 
        gboolean _tmp76_;
364
 
        UnityPackageSearcher* _tmp77_;
365
 
        gboolean _tmp78_;
 
395
        UnityLensSearch* _tmp72_;
 
396
        const gchar* _tmp73_;
 
397
        const gchar* _tmp74_;
 
398
        GError* _tmp75_;
 
399
        const gchar* _tmp76_;
 
400
        DeeTransaction* _tmp77_;
 
401
        UnityApplicationsLensPurchaseInfoHelper* _tmp78_;
366
402
        gboolean _tmp79_;
367
 
        GTimer* _tmp80_;
368
 
        UnityPackageSearcher* _tmp81_;
369
 
        const gchar* _tmp82_;
370
 
        UnityPackageSearchResult* _tmp83_;
 
403
        gboolean _tmp80_;
 
404
        gboolean _tmp81_;
 
405
        gboolean _tmp82_;
 
406
        gboolean _tmp83_;
 
407
        UnityPackageSearcher* _tmp84_;
 
408
        gboolean _tmp85_;
 
409
        gboolean _tmp86_;
 
410
        GTimer* _tmp87_;
 
411
        UnityPackageSearcher* _tmp88_;
 
412
        const gchar* _tmp89_;
 
413
        UnityPackageSearchResult* _tmp90_;
371
414
        UnityPackageSearchResult* pkgresults;
372
 
        UnityPackageSearchResult* _tmp84_;
373
 
        GeeSet* _tmp85_;
374
 
        GeeSet* _tmp86_;
375
 
        DeeSerializableModel* _tmp87_;
376
 
        GTimer* _tmp88_;
377
 
        UnityPackageSearchResult* _tmp89_;
378
 
        gint _tmp90_;
379
 
        GTimer* _tmp91_;
380
 
        gdouble _tmp92_;
381
 
        const gchar* _tmp93_;
382
 
        GTimer* _tmp94_;
383
 
        UnityLensSearch* _tmp95_;
384
 
        UnityOptionsFilter* _tmp96_;
385
 
        gchar* _tmp97_;
 
415
        UnityPackageSearchResult* _tmp91_;
 
416
        GeeSet* _tmp92_;
 
417
        GeeSet* _tmp93_;
 
418
        DeeSerializableModel* _tmp94_;
 
419
        GTimer* _tmp95_;
 
420
        UnityPackageSearchResult* _tmp96_;
 
421
        gint _tmp97_;
 
422
        GTimer* _tmp98_;
 
423
        gdouble _tmp99_;
 
424
        const gchar* _tmp100_;
 
425
        gboolean _tmp101_;
 
426
        GTimer* _tmp102_;
 
427
        UnityLensSearch* _tmp103_;
 
428
        UnityOptionsFilter* _tmp104_;
 
429
        gchar* _tmp105_;
386
430
        gchar* filter_query;
387
 
        UnityPackageSearcher* _tmp98_;
388
 
        const gchar* _tmp99_;
389
 
        UnityPackageSearchResult* _tmp100_;
390
 
        UnityPackageSearchResult* random_pkgresults;
391
 
        UnityPackageSearchResult* _tmp101_;
392
 
        GeeSet* _tmp102_;
393
 
        GeeSet* _tmp103_;
394
 
        DeeSerializableModel* _tmp104_;
395
 
        GTimer* _tmp105_;
396
 
        UnityPackageSearchResult* _tmp106_;
397
 
        gint _tmp107_;
398
 
        GTimer* _tmp108_;
399
 
        gdouble _tmp109_;
400
 
        DeeSerializableModel* _tmp110_;
401
 
        guint _tmp111_;
402
 
        UnityLensSearch* _tmp112_;
403
 
        const gchar* _tmp113_;
404
 
        GVariant* _tmp114_;
405
 
        UnityLensSearch* _tmp115_;
 
431
        UnityPackageSearcher* _tmp106_;
 
432
        const gchar* _tmp107_;
 
433
        UnityPackageSearchResult* _tmp108_;
 
434
        UnityPackageSearchResult* _vala1_pkgresults;
 
435
        UnityApplicationsLensPurchaseInfoHelper* _tmp109_;
 
436
        UnityPackageSearchResult* _tmp110_;
 
437
        UnityPackageSearchResult* _tmp111_;
 
438
        GeeSet* _tmp112_;
 
439
        GeeSet* _tmp113_;
 
440
        DeeSerializableModel* _tmp114_;
 
441
        GTimer* _tmp115_;
 
442
        UnityPackageSearchResult* _tmp116_;
 
443
        gint _tmp117_;
 
444
        GTimer* _tmp118_;
 
445
        gdouble _tmp119_;
 
446
        GTimer* _tmp120_;
 
447
        guint hits;
 
448
        GeeHashSet* _tmp121_;
 
449
        GeeSet* duplicates_lookup;
 
450
        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp122_;
 
451
        UnityApplicationsLensSoftwareCenterDataCache* _tmp123_;
 
452
        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp124_;
 
453
        gint _tmp125_;
 
454
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp126_;
 
455
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** whats_new;
 
456
        gint whats_new_length1;
 
457
        gint _whats_new_size_;
 
458
        UnityApplicationsLensPurchaseInfoHelper* _tmp127_;
 
459
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp128_;
 
460
        gint _tmp128__length1;
 
461
        GSList* _tmp129_;
 
462
        GSList* query;
 
463
        UnityPackageSearcher* _tmp130_;
 
464
        GSList* _tmp131_;
 
465
        UnityPackageSearchResult* _tmp132_;
 
466
        UnityPackageSearchResult* tmpresults;
 
467
        UnityApplicationsLensPurchaseInfoHelper* _tmp133_;
 
468
        UnityPackageSearchResult* _tmp134_;
 
469
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp135_;
 
470
        gint _tmp135__length1;
 
471
        DeeSerializableModel* _tmp136_;
 
472
        guint _tmp137_;
 
473
        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp138_;
 
474
        gint _tmp139_;
 
475
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp140_;
 
476
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** top_rated;
 
477
        gint top_rated_length1;
 
478
        gint _top_rated_size_;
 
479
        UnityApplicationsLensPurchaseInfoHelper* _tmp141_;
 
480
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp142_;
 
481
        gint _tmp142__length1;
 
482
        GSList* _tmp143_;
 
483
        UnityPackageSearcher* _tmp144_;
 
484
        GSList* _tmp145_;
 
485
        UnityPackageSearchResult* _tmp146_;
 
486
        UnityApplicationsLensPurchaseInfoHelper* _tmp147_;
 
487
        UnityPackageSearchResult* _tmp148_;
 
488
        guint _tmp149_;
 
489
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp150_;
 
490
        gint _tmp150__length1;
 
491
        DeeSerializableModel* _tmp151_;
 
492
        guint _tmp152_;
 
493
        GError* _vala1_e;
 
494
        GError* _tmp153_;
 
495
        const gchar* _tmp154_;
 
496
        GTimer* _tmp155_;
 
497
        guint _tmp156_;
 
498
        GTimer* _tmp157_;
 
499
        gdouble _tmp158_;
 
500
        DeeSerializableModel* _tmp159_;
 
501
        guint _tmp160_;
 
502
        UnityLensSearch* _tmp161_;
 
503
        const gchar* _tmp162_;
 
504
        GVariant* _tmp163_;
 
505
        UnityLensSearch* _tmp164_;
406
506
        GError * _inner_error_;
407
507
};
408
508
 
508
608
        GError * _inner_error_;
509
609
};
510
610
 
 
611
struct _UnityApplicationsLensPurchaseInfoHelperAppInfo {
 
612
        gchar* application_name;
 
613
        gchar* package_name;
 
614
        gchar* formatted_price;
 
615
        gboolean paid;
 
616
};
 
617
 
511
618
struct _UnityApplicationsLensDaemonCallInstallPackagesData {
512
619
        int _state_;
513
620
        GObject* _source_object_;
571
678
 
572
679
static gpointer unity_applications_lens_daemon_parent_class = NULL;
573
680
 
574
 
#define CONFIG_DATADIR "/usr/share"
 
681
#define UNITY_APPLICATIONS_LENS_MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY ((guint) 100)
 
682
#define UNITY_APPLICATIONS_LENS_MAX_TOP_RATED_APPS_FOR_EMPTY_QUERY ((guint) 12)
 
683
#define UNITY_APPLICATIONS_LENS_MAX_WHATS_NEW_APPS_FOR_EMPTY_QUERY ((guint) 10)
 
684
#define UNITY_APPLICATIONS_LENS_TOP_RATED_ITEMS_CACHE_LIFETIME ((gint64) (24 * 3600))
 
685
#define CONFIG_DATADIR "/usr/local/share"
575
686
#define UNITY_APPLICATIONS_LENS_ICON_PATH CONFIG_DATADIR "/icons/unity-icon-theme/places/svg/"
576
687
#define UNITY_APPLICATIONS_LENS_ICON_APP_INSTALL_PATH CONFIG_DATADIR "/app-install/icons"
577
688
GType unity_applications_lens_daemon_get_type (void) G_GNUC_CONST;
581
692
GType unity_applications_lens_software_center_data_provider_proxy_get_type (void) G_GNUC_CONST;
582
693
GType unity_applications_lens_runner_get_type (void) G_GNUC_CONST;
583
694
GType unity_applications_lens_app_watcher_get_type (void) G_GNUC_CONST;
 
695
gpointer unity_applications_lens_purchase_info_helper_ref (gpointer instance);
 
696
void unity_applications_lens_purchase_info_helper_unref (gpointer instance);
 
697
GParamSpec* unity_applications_lens_param_spec_purchase_info_helper (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
698
void unity_applications_lens_value_set_purchase_info_helper (GValue* value, gpointer v_object);
 
699
void unity_applications_lens_value_take_purchase_info_helper (GValue* value, gpointer v_object);
 
700
gpointer unity_applications_lens_value_get_purchase_info_helper (const GValue* value);
 
701
GType unity_applications_lens_purchase_info_helper_get_type (void) G_GNUC_CONST;
584
702
#define UNITY_APPLICATIONS_LENS_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_APPLICATIONS_LENS_TYPE_DAEMON, UnityApplicationsLensDaemonPrivate))
585
703
enum  {
586
704
        UNITY_APPLICATIONS_LENS_DAEMON_DUMMY_PROPERTY,
620
738
static void unity_applications_lens_daemon_update_popularities_data_free (gpointer _data);
621
739
static gboolean unity_applications_lens_daemon_update_popularities_co (UnityApplicationsLensDaemonUpdatePopularitiesData* _data_);
622
740
static void unity_applications_lens_daemon_update_popularities_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
741
gboolean unity_applications_lens_daemon_filter_cb (UnityApplicationsLensDaemon* self, UnityPackageInfo* pkginfo);
623
742
static void unity_applications_lens_daemon_update_scope_search_data_free (gpointer _data);
624
743
static gboolean unity_applications_lens_daemon_update_scope_search_co (UnityApplicationsLensDaemonUpdateScopeSearchData* _data_);
625
744
static gchar* unity_applications_lens_daemon_prepare_pkg_search_string (UnityApplicationsLensDaemon* self, UnityLensSearch* search, UnityOptionsFilter* options);
630
749
gboolean unity_applications_lens_daemon_get_display_recent_apps (UnityApplicationsLensDaemon* self);
631
750
static void unity_applications_lens_daemon_update_scope_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
632
751
void unity_applications_lens_daemon_append_events_with_category (UnityApplicationsLensDaemon* self, ZeitgeistResultSet* events, DeeModel* results, guint category_id, gboolean include_favorites, gint max_results, GeeSet* allowed_uris);
 
752
UnityApplicationsLensPurchaseInfoHelper* unity_applications_lens_purchase_info_helper_new (void);
 
753
UnityApplicationsLensPurchaseInfoHelper* unity_applications_lens_purchase_info_helper_construct (GType object_type);
633
754
gboolean unity_applications_lens_daemon_get_display_available_apps (UnityApplicationsLensDaemon* self);
 
755
static gboolean _unity_applications_lens_daemon_filter_cb_unity_package_app_filter_callback (UnityPackageInfo* pkginfo, gpointer self);
 
756
void unity_applications_lens_purchase_info_helper_from_pkgresults (UnityApplicationsLensPurchaseInfoHelper* self, UnityPackageSearchResult* results);
 
757
UnityApplicationsLensSoftwareCenterDataCache* unity_applications_lens_software_center_data_cache_new (gint64 category_items_lifetime);
 
758
UnityApplicationsLensSoftwareCenterDataCache* unity_applications_lens_software_center_data_cache_construct (GType object_type, gint64 category_items_lifetime);
 
759
GType unity_applications_lens_software_center_data_cache_get_type (void) G_GNUC_CONST;
 
760
GType unity_applications_lens_software_center_data_provider_service_app_info_get_type (void) G_GNUC_CONST;
 
761
UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* unity_applications_lens_software_center_data_provider_service_app_info_dup (const UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* self);
 
762
void unity_applications_lens_software_center_data_provider_service_app_info_free (UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* self);
 
763
void unity_applications_lens_software_center_data_provider_service_app_info_copy (const UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* self, UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* dest);
 
764
void unity_applications_lens_software_center_data_provider_service_app_info_destroy (UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo* self);
 
765
UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** unity_applications_lens_software_center_data_provider_proxy_get_items_for_category (UnityApplicationsLensSoftwareCenterDataProviderProxy* self, const gchar* category_name, int* result_length1, GError** error);
 
766
GSList* unity_applications_lens_purchase_info_helper_create_pkgsearch_query (UnityApplicationsLensPurchaseInfoHelper* self, UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** results, int results_length1);
 
767
static guint unity_applications_lens_daemon_add_sc_category_results (UnityApplicationsLensDaemon* self, UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** results, int results_length1, DeeModel* model, UnityApplicationsLensCategory category, GeeSet** duplicates_lookup, guint max_results);
 
768
static void _g_slist_free__g_free0_ (GSList* self);
634
769
static GVariant* _variant_new4 (const gchar* value);
635
770
static void unity_applications_lens_daemon_update_global_search_data_free (gpointer _data);
636
771
static gboolean unity_applications_lens_daemon_update_global_search_co (UnityApplicationsLensDaemonUpdateGlobalSearchData* _data_);
640
775
static void unity_applications_lens_daemon_update_global_without_search_data_free (gpointer _data);
641
776
static gboolean unity_applications_lens_daemon_update_global_without_search_co (UnityApplicationsLensDaemonUpdateGlobalWithoutSearchData* _data_);
642
777
static void unity_applications_lens_daemon_update_global_without_search_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
643
 
static gchar* unity_applications_lens_daemon_find_app_install_icon_path (UnityApplicationsLensDaemon* self);
644
 
GIcon* unity_applications_lens_daemon_find_pkg_icon (UnityApplicationsLensDaemon* self, UnityPackageInfo* pkginfo);
 
778
static gchar* unity_applications_lens_daemon_find_app_install_icon_path (UnityApplicationsLensDaemon* self, const gchar* icon_name);
 
779
GIcon* unity_applications_lens_daemon_find_pkg_icon (UnityApplicationsLensDaemon* self, const gchar* desktop_file, const gchar* icon_name);
645
780
static gchar* unity_applications_lens_daemon_extract_desktop_id (UnityApplicationsLensDaemon* self, const gchar* desktop_file, gboolean unmangle);
646
781
static gint __lambda7_ (UnityApplicationsLensDaemon* self, UnityPackageInfo* a, UnityPackageInfo* b);
647
782
static gint ___lambda7__gcompare_data_func (gconstpointer a, gconstpointer b, gpointer self);
 
783
static gchar* unity_applications_lens_daemon_sanitize_binary_name (const gchar* name);
 
784
static gchar* unity_applications_lens_daemon_get_annotated_icon (UnityApplicationsLensDaemon* self, GIcon* app_icon, const gchar* price, gboolean paid);
 
785
GType unity_applications_lens_purchase_info_helper_app_info_get_type (void) G_GNUC_CONST;
 
786
UnityApplicationsLensPurchaseInfoHelperAppInfo* unity_applications_lens_purchase_info_helper_app_info_dup (const UnityApplicationsLensPurchaseInfoHelperAppInfo* self);
 
787
void unity_applications_lens_purchase_info_helper_app_info_free (UnityApplicationsLensPurchaseInfoHelperAppInfo* self);
 
788
void unity_applications_lens_purchase_info_helper_app_info_copy (const UnityApplicationsLensPurchaseInfoHelperAppInfo* self, UnityApplicationsLensPurchaseInfoHelperAppInfo* dest);
 
789
void unity_applications_lens_purchase_info_helper_app_info_destroy (UnityApplicationsLensPurchaseInfoHelperAppInfo* self);
 
790
UnityApplicationsLensPurchaseInfoHelperAppInfo* unity_applications_lens_purchase_info_helper_find (UnityApplicationsLensPurchaseInfoHelper* self, const gchar* application_name, const gchar* package_name);
648
791
const gchar* unity_applications_lens_category_to_string (UnityApplicationsLensCategory self);
649
792
static void unity_applications_lens_daemon_call_install_packages_data_free (gpointer _data);
650
793
static void unity_applications_lens_daemon_call_install_packages (UnityApplicationsLensDaemon* self, const gchar* package_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
684
827
static void ____lambda10_ (Block2Data* _data2_, GObject* obj, GAsyncResult* res);
685
828
static void _____lambda10__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
686
829
UnityPreview* unity_applications_lens_daemon_preview (UnityApplicationsLensDaemon* self, const gchar* uri);
687
 
UnityApplicationsLensSoftwareCenterDataProviderProxy* unity_applications_lens_software_center_data_provider_proxy_new (void);
688
 
UnityApplicationsLensSoftwareCenterDataProviderProxy* unity_applications_lens_software_center_data_provider_proxy_construct (GType object_type);
689
830
void unity_applications_lens_software_center_data_provider_proxy_connect_to (UnityApplicationsLensSoftwareCenterDataProviderProxy* self, GError** error);
690
831
GHashTable* unity_applications_lens_software_center_data_provider_proxy_get_app_details (UnityApplicationsLensSoftwareCenterDataProviderProxy* self, const gchar* appname, const gchar* pkgname, GError** error);
691
832
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_icon (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
700
841
UnityApplicationsLensSoftwareCenterDataProviderProxyPackageState unity_applications_lens_software_center_data_provider_proxy_get_pkg_state (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
701
842
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_price (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
702
843
static UnityActivationResponse* _unity_applications_lens_daemon_app_preview_buy_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
 
844
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_raw_price (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
703
845
static UnityActivationResponse* _unity_applications_lens_daemon_app_preview_install_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
704
846
static UnityActivationResponse* _unity_applications_lens_daemon_app_preview_install_commercial_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
705
847
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_website (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
706
848
static UnityActivationResponse* _unity_applications_lens_daemon_app_preview_website_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
707
849
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_installation_date (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
 
850
gboolean unity_applications_lens_software_center_data_provider_proxy_get_is_desktop_dependency (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
708
851
static UnityActivationResponse* _unity_applications_lens_daemon_app_preview_uninstall_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
709
852
const gchar* unity_applications_lens_software_center_data_provider_proxy_get_desktop_file (UnityApplicationsLensSoftwareCenterDataProviderProxy* self);
710
853
static void _g_list_free__g_free0_ (GList* self);
1047
1190
        categories = NULL;
1048
1191
        _tmp0_ = g_file_new_for_path (UNITY_APPLICATIONS_LENS_ICON_PATH);
1049
1192
        icon_dir = _tmp0_;
1050
 
        _tmp1_ = _ ("Recently Used");
1051
 
        _tmp2_ = g_file_get_child (icon_dir, "group-recent.svg");
 
1193
        _tmp1_ = _ ("Applications");
 
1194
        _tmp2_ = g_file_get_child (icon_dir, "group-apps.svg");
1052
1195
        _tmp3_ = _tmp2_;
1053
1196
        _tmp4_ = (GFileIcon*) g_file_icon_new (_tmp3_);
1054
1197
        _tmp5_ = _tmp4_;
1060
1203
        _tmp8_ = cat;
1061
1204
        _tmp9_ = _g_object_ref0 (_tmp8_);
1062
1205
        categories = g_list_append (categories, _tmp9_);
1063
 
        _tmp10_ = _ ("Recent Apps");
1064
 
        _tmp11_ = g_file_get_child (icon_dir, "group-apps.svg");
 
1206
        _tmp10_ = _ ("Recently Used");
 
1207
        _tmp11_ = g_file_get_child (icon_dir, "group-recent.svg");
1065
1208
        _tmp12_ = _tmp11_;
1066
1209
        _tmp13_ = (GFileIcon*) g_file_icon_new (_tmp12_);
1067
1210
        _tmp14_ = _tmp13_;
1073
1216
        _tmp16_ = cat;
1074
1217
        _tmp17_ = _g_object_ref0 (_tmp16_);
1075
1218
        categories = g_list_append (categories, _tmp17_);
1076
 
        _tmp18_ = _ ("Installed");
1077
 
        _tmp19_ = g_file_get_child (icon_dir, "group-installed.svg");
 
1219
        _tmp18_ = _ ("Recent Apps");
 
1220
        _tmp19_ = g_file_get_child (icon_dir, "group-apps.svg");
1078
1221
        _tmp20_ = _tmp19_;
1079
1222
        _tmp21_ = (GFileIcon*) g_file_icon_new (_tmp20_);
1080
1223
        _tmp22_ = _tmp21_;
1086
1229
        _tmp24_ = cat;
1087
1230
        _tmp25_ = _g_object_ref0 (_tmp24_);
1088
1231
        categories = g_list_append (categories, _tmp25_);
1089
 
        _tmp26_ = _ ("Apps Available for Download");
1090
 
        _tmp27_ = g_file_get_child (icon_dir, "group-downloads.svg");
 
1232
        _tmp26_ = _ ("Installed");
 
1233
        _tmp27_ = g_file_get_child (icon_dir, "group-installed.svg");
1091
1234
        _tmp28_ = _tmp27_;
1092
1235
        _tmp29_ = (GFileIcon*) g_file_icon_new (_tmp28_);
1093
1236
        _tmp30_ = _tmp29_;
1094
 
        _tmp31_ = unity_category_new (_tmp26_, (GIcon*) _tmp30_, UNITY_CATEGORY_RENDERER_FLOW);
 
1237
        _tmp31_ = unity_category_new (_tmp26_, (GIcon*) _tmp30_, UNITY_CATEGORY_RENDERER_VERTICAL_TILE);
1095
1238
        _g_object_unref0 (cat);
1096
1239
        cat = _tmp31_;
1097
1240
        _g_object_unref0 (_tmp30_);
1099
1242
        _tmp32_ = cat;
1100
1243
        _tmp33_ = _g_object_ref0 (_tmp32_);
1101
1244
        categories = g_list_append (categories, _tmp33_);
1102
 
        _tmp34_ = _ ("Applications");
1103
 
        _tmp35_ = g_file_get_child (icon_dir, "group-apps.svg");
 
1245
        _tmp34_ = _ ("More suggestions");
 
1246
        _tmp35_ = g_file_get_child (icon_dir, "group-treat-yourself.svg");
1104
1247
        _tmp36_ = _tmp35_;
1105
1248
        _tmp37_ = (GFileIcon*) g_file_icon_new (_tmp36_);
1106
1249
        _tmp38_ = _tmp37_;
1107
 
        _tmp39_ = unity_category_new (_tmp34_, (GIcon*) _tmp38_, UNITY_CATEGORY_RENDERER_VERTICAL_TILE);
 
1250
        _tmp39_ = unity_category_new (_tmp34_, (GIcon*) _tmp38_, UNITY_CATEGORY_RENDERER_FLOW);
1108
1251
        _g_object_unref0 (cat);
1109
1252
        cat = _tmp39_;
1110
1253
        _g_object_unref0 (_tmp38_);
1122
1265
 
1123
1266
static void unity_applications_lens_daemon_populate_filters (UnityApplicationsLensDaemon* self) {
1124
1267
        GList* filters;
1125
 
        UnityLens* _tmp45_;
 
1268
        UnityLens* _tmp42_;
1126
1269
        g_return_if_fail (self != NULL);
1127
1270
        filters = NULL;
1128
1271
        {
1229
1372
                filters = g_list_append (filters, _tmp41_);
1230
1373
                _g_object_unref0 (filter);
1231
1374
        }
1232
 
        {
1233
 
                const gchar* _tmp42_ = NULL;
1234
 
                UnityRatingsFilter* _tmp43_;
1235
 
                UnityRatingsFilter* filter;
1236
 
                UnityFilter* _tmp44_;
1237
 
                _tmp42_ = _ ("Rating");
1238
 
                _tmp43_ = unity_ratings_filter_new ("rating", _tmp42_, NULL, FALSE);
1239
 
                filter = _tmp43_;
1240
 
                _tmp44_ = _g_object_ref0 ((UnityFilter*) filter);
1241
 
                filters = g_list_append (filters, _tmp44_);
1242
 
                _g_object_unref0 (filter);
1243
 
        }
1244
 
        _tmp45_ = self->priv->lens;
1245
 
        unity_lens_set_filters (_tmp45_, filters);
 
1375
        _tmp42_ = self->priv->lens;
 
1376
        unity_lens_set_filters (_tmp42_, filters);
1246
1377
        __g_list_free__g_object_unref0_0 (filters);
1247
1378
}
1248
1379
 
1366
1497
                GMenuTree* _tmp1_ = NULL;
1367
1498
                GMenuTree* _tmp2_;
1368
1499
                GMenuTree* _tmp3_;
1369
 
                g_debug ("daemon.vala:359: Building initial application menu");
 
1500
                g_debug ("daemon.vala:370: Building initial application menu");
1370
1501
                _tmp1_ = gmenu_tree_lookup ("unity-lens-applications.menu", GMENU_TREE_FLAGS_INCLUDE_NODISPLAY);
1371
1502
                _tmp2_ = _gmenu_tree_ref0 (_tmp1_);
1372
1503
                _gmenu_tree_unref0 (self->priv->app_menu);
1374
1505
                _tmp3_ = self->priv->app_menu;
1375
1506
                gmenu_tree_add_monitor (_tmp3_, ____lambda8__gmenu_tree_changed_func, self);
1376
1507
        }
1377
 
        g_debug ("daemon.vala:379: Indexing application menu");
 
1508
        g_debug ("daemon.vala:390: Indexing application menu");
1378
1509
        _tmp4_ = self->priv->app_menu;
1379
1510
        _tmp5_ = unity_package_searcher_new_for_menu (_tmp4_);
1380
1511
        _unity_package_searcher_free0 (self->appsearcher);
1696
1827
                _data_->_inner_error_ = NULL;
1697
1828
                _data_->_tmp32_ = _data_->err;
1698
1829
                _data_->_tmp33_ = _data_->_tmp32_->message;
1699
 
                g_warning ("daemon.vala:466: %s", _data_->_tmp33_);
 
1830
                g_warning ("daemon.vala:477: %s", _data_->_tmp33_);
1700
1831
                _g_error_free0 (_data_->err);
1701
1832
        }
1702
1833
        __finally2:
1715
1846
}
1716
1847
 
1717
1848
 
 
1849
gboolean unity_applications_lens_daemon_filter_cb (UnityApplicationsLensDaemon* self, UnityPackageInfo* pkginfo) {
 
1850
        gboolean result = FALSE;
 
1851
        UnityAppInfoManager* _tmp0_ = NULL;
 
1852
        UnityAppInfoManager* appmanager;
 
1853
        UnityPackageInfo* _tmp1_;
 
1854
        const gchar* _tmp2_;
 
1855
        GAppInfo* _tmp3_ = NULL;
 
1856
        GAppInfo* app;
 
1857
        g_return_val_if_fail (self != NULL, FALSE);
 
1858
        g_return_val_if_fail (pkginfo != NULL, FALSE);
 
1859
        _tmp0_ = unity_app_info_manager_get_default ();
 
1860
        appmanager = _tmp0_;
 
1861
        _tmp1_ = pkginfo;
 
1862
        _tmp2_ = _tmp1_->desktop_file;
 
1863
        _tmp3_ = unity_app_info_manager_lookup (appmanager, _tmp2_);
 
1864
        app = _tmp3_;
 
1865
        result = app == NULL;
 
1866
        _g_object_unref0 (app);
 
1867
        _g_object_unref0 (appmanager);
 
1868
        return result;
 
1869
}
 
1870
 
 
1871
 
1718
1872
static void unity_applications_lens_daemon_update_scope_search_data_free (gpointer _data) {
1719
1873
        UnityApplicationsLensDaemonUpdateScopeSearchData* _data_;
1720
1874
        _data_ = _data;
1762
1916
}
1763
1917
 
1764
1918
 
 
1919
static gboolean _unity_applications_lens_daemon_filter_cb_unity_package_app_filter_callback (UnityPackageInfo* pkginfo, gpointer self) {
 
1920
        gboolean result;
 
1921
        result = unity_applications_lens_daemon_filter_cb (self, pkginfo);
 
1922
        return result;
 
1923
}
 
1924
 
 
1925
 
 
1926
static void _g_slist_free__g_free0_ (GSList* self) {
 
1927
        g_slist_foreach (self, (GFunc) _g_free0_, NULL);
 
1928
        g_slist_free (self);
 
1929
}
 
1930
 
 
1931
 
1765
1932
static GVariant* _variant_new4 (const gchar* value) {
1766
1933
        return g_variant_ref_sink (g_variant_new_string (value));
1767
1934
}
1785
1952
        _data_->_tmp4_ = _data_->search;
1786
1953
        _data_->_tmp5_ = unity_lens_search_get_search_string (_data_->_tmp4_);
1787
1954
        _data_->_tmp6_ = _data_->_tmp5_;
1788
 
        g_debug ("daemon.vala:477: Searching for: %s", _data_->_tmp6_);
 
1955
        g_debug ("daemon.vala:496: Searching for: %s", _data_->_tmp6_);
1789
1956
        _data_->_tmp7_ = _data_->self->priv->scope;
1790
1957
        _data_->_tmp8_ = NULL;
1791
1958
        _data_->_tmp8_ = unity_scope_get_filter (_data_->_tmp7_, "type");
1795
1962
        _data_->_tmp11_ = NULL;
1796
1963
        _data_->_tmp11_ = unity_applications_lens_daemon_prepare_pkg_search_string (_data_->self, _data_->_tmp9_, _data_->_tmp10_);
1797
1964
        _data_->pkg_search_string = _data_->_tmp11_;
1798
 
        _data_->_tmp12_ = _data_->search;
1799
 
        _data_->_tmp13_ = FALSE;
1800
 
        _data_->_tmp13_ = unity_applications_lens_utils_is_search_empty (_data_->_tmp12_);
1801
 
        _data_->has_search = !_data_->_tmp13_;
1802
 
        _data_->_tmp14_ = g_timer_new ();
1803
 
        _data_->timer = _data_->_tmp14_;
1804
 
        _data_->_tmp15_ = _data_->model;
1805
 
        _data_->_tmp16_ = (DeeTransaction*) dee_transaction_new ((DeeModel*) _data_->_tmp15_);
1806
 
        _data_->transaction = _data_->_tmp16_;
1807
 
        _data_->_tmp17_ = _data_->transaction;
1808
 
        dee_model_clear ((DeeModel*) _data_->_tmp17_);
1809
 
        _data_->_tmp18_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
1810
 
        _data_->installed_uris = (GeeSet*) _data_->_tmp18_;
1811
 
        _data_->_tmp19_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
1812
 
        _data_->available_uris = (GeeSet*) _data_->_tmp19_;
1813
 
        _data_->_tmp21_ = _data_->has_search;
1814
 
        if (_data_->_tmp21_) {
1815
 
                _data_->_tmp20_ = UNITY_PACKAGE_SORT_BY_RELEVANCY;
1816
 
        } else {
1817
 
                _data_->_tmp20_ = UNITY_PACKAGE_SORT_BY_NAME;
1818
 
        }
1819
 
        _data_->_tmp22_ = _data_->self->appsearcher;
1820
 
        _data_->_tmp23_ = _data_->pkg_search_string;
1821
 
        _data_->_tmp24_ = _data_->_tmp20_;
1822
 
        _data_->_tmp25_ = NULL;
1823
 
        _data_->_tmp25_ = unity_package_searcher_search (_data_->_tmp22_, _data_->_tmp23_, (guint) 0, UNITY_PACKAGE_SEARCHTYPE_PREFIX, _data_->_tmp24_);
1824
 
        _data_->appresults = _data_->_tmp25_;
1825
 
        _data_->_tmp26_ = FALSE;
1826
 
        _data_->_tmp26_ = unity_applications_lens_daemon_local_apps_active (_data_->self);
1827
 
        if (_data_->_tmp26_) {
1828
 
                _data_->_tmp27_ = _data_->has_search;
1829
 
                if (_data_->_tmp27_) {
1830
 
                        _data_->_tmp28_ = _data_->appresults;
1831
 
                        unity_applications_lens_daemon_resort_pkg_search_results (_data_->self, _data_->_tmp28_);
 
1965
        _data_->_tmp13_ = _data_->filter;
 
1966
        if (_data_->_tmp13_ != NULL) {
 
1967
                _data_->_tmp14_ = _data_->filter;
 
1968
                _data_->_tmp15_ = unity_filter_get_filtering ((UnityFilter*) _data_->_tmp14_);
 
1969
                _data_->_tmp16_ = _data_->_tmp15_;
 
1970
                _data_->_tmp12_ = _data_->_tmp16_;
 
1971
        } else {
 
1972
                _data_->_tmp12_ = FALSE;
 
1973
        }
 
1974
        _data_->_tmp17_ = _data_->_tmp12_;
 
1975
        _data_->has_filter = _data_->_tmp17_;
 
1976
        _data_->_tmp18_ = _data_->search;
 
1977
        _data_->_tmp19_ = FALSE;
 
1978
        _data_->_tmp19_ = unity_applications_lens_utils_is_search_empty (_data_->_tmp18_);
 
1979
        _data_->has_search = !_data_->_tmp19_;
 
1980
        _data_->_tmp20_ = g_timer_new ();
 
1981
        _data_->timer = _data_->_tmp20_;
 
1982
        _data_->_tmp21_ = _data_->model;
 
1983
        _data_->_tmp22_ = (DeeTransaction*) dee_transaction_new ((DeeModel*) _data_->_tmp21_);
 
1984
        _data_->transaction = _data_->_tmp22_;
 
1985
        _data_->_tmp23_ = _data_->transaction;
 
1986
        dee_model_clear ((DeeModel*) _data_->_tmp23_);
 
1987
        _data_->_tmp24_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
1988
        _data_->installed_uris = (GeeSet*) _data_->_tmp24_;
 
1989
        _data_->_tmp25_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
1990
        _data_->available_uris = (GeeSet*) _data_->_tmp25_;
 
1991
        _data_->_tmp27_ = _data_->has_search;
 
1992
        if (_data_->_tmp27_) {
 
1993
                _data_->_tmp26_ = UNITY_PACKAGE_SORT_BY_RELEVANCY;
 
1994
        } else {
 
1995
                _data_->_tmp26_ = UNITY_PACKAGE_SORT_BY_NAME;
 
1996
        }
 
1997
        _data_->_tmp28_ = _data_->self->appsearcher;
 
1998
        _data_->_tmp29_ = _data_->pkg_search_string;
 
1999
        _data_->_tmp30_ = _data_->_tmp26_;
 
2000
        _data_->_tmp31_ = NULL;
 
2001
        _data_->_tmp31_ = unity_package_searcher_search (_data_->_tmp28_, _data_->_tmp29_, (guint) 0, UNITY_PACKAGE_SEARCHTYPE_PREFIX, _data_->_tmp30_);
 
2002
        _data_->appresults = _data_->_tmp31_;
 
2003
        _data_->_tmp32_ = FALSE;
 
2004
        _data_->_tmp32_ = unity_applications_lens_daemon_local_apps_active (_data_->self);
 
2005
        if (_data_->_tmp32_) {
 
2006
                _data_->_tmp33_ = _data_->has_search;
 
2007
                if (_data_->_tmp33_) {
 
2008
                        _data_->_tmp34_ = _data_->appresults;
 
2009
                        unity_applications_lens_daemon_resort_pkg_search_results (_data_->self, _data_->_tmp34_);
1832
2010
                }
1833
 
                _data_->_tmp29_ = _data_->appresults;
1834
 
                _data_->_tmp30_ = _data_->installed_uris;
1835
 
                _data_->_tmp31_ = _data_->available_uris;
1836
 
                _data_->_tmp32_ = _data_->transaction;
1837
 
                unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp29_, _data_->_tmp30_, _data_->_tmp31_, (DeeModel*) _data_->_tmp32_, UNITY_APPLICATIONS_LENS_CATEGORY_INSTALLED, (guint) 0);
 
2011
                _data_->_tmp35_ = _data_->appresults;
 
2012
                _data_->_tmp36_ = _data_->installed_uris;
 
2013
                _data_->_tmp37_ = _data_->available_uris;
 
2014
                _data_->_tmp38_ = _data_->transaction;
 
2015
                unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp35_, _data_->_tmp36_, _data_->_tmp37_, (DeeModel*) _data_->_tmp38_, UNITY_APPLICATIONS_LENS_CATEGORY_INSTALLED, (guint) 0);
1838
2016
        }
1839
 
        _data_->_tmp33_ = _data_->timer;
1840
 
        g_timer_stop (_data_->_tmp33_);
1841
 
        _data_->_tmp34_ = _data_->appresults;
1842
 
        _data_->_tmp35_ = _data_->_tmp34_->num_hits;
1843
 
        _data_->_tmp36_ = _data_->timer;
1844
 
        _data_->_tmp37_ = 0.0;
1845
 
        _data_->_tmp37_ = g_timer_elapsed (_data_->_tmp36_, NULL);
1846
 
        _data_->_tmp38_ = _data_->pkg_search_string;
1847
 
        g_debug ("daemon.vala:510: Entry search listed %i Installed apps in %fms for que" \
1848
 
"ry: %s", _data_->_tmp35_, _data_->_tmp37_ * 1000, _data_->_tmp38_);
1849
 
        _data_->_tmp40_ = FALSE;
1850
 
        _data_->_tmp40_ = unity_applications_lens_daemon_local_apps_active (_data_->self);
1851
 
        if (_data_->_tmp40_) {
1852
 
                _data_->_tmp41_ = _data_->self->priv->_display_recent_apps;
1853
 
                _data_->_tmp39_ = _data_->_tmp41_;
 
2017
        _data_->_tmp39_ = _data_->timer;
 
2018
        g_timer_stop (_data_->_tmp39_);
 
2019
        _data_->_tmp40_ = _data_->appresults;
 
2020
        _data_->_tmp41_ = _data_->_tmp40_->num_hits;
 
2021
        _data_->_tmp42_ = _data_->timer;
 
2022
        _data_->_tmp43_ = 0.0;
 
2023
        _data_->_tmp43_ = g_timer_elapsed (_data_->_tmp42_, NULL);
 
2024
        _data_->_tmp44_ = _data_->pkg_search_string;
 
2025
        g_debug ("daemon.vala:530: Entry search listed %i Installed apps in %fms for que" \
 
2026
"ry: %s", _data_->_tmp41_, _data_->_tmp43_ * 1000, _data_->_tmp44_);
 
2027
        _data_->_tmp46_ = FALSE;
 
2028
        _data_->_tmp46_ = unity_applications_lens_daemon_local_apps_active (_data_->self);
 
2029
        if (_data_->_tmp46_) {
 
2030
                _data_->_tmp47_ = _data_->self->priv->_display_recent_apps;
 
2031
                _data_->_tmp45_ = _data_->_tmp47_;
1854
2032
        } else {
1855
 
                _data_->_tmp39_ = FALSE;
 
2033
                _data_->_tmp45_ = FALSE;
1856
2034
        }
1857
 
        _data_->_tmp42_ = _data_->_tmp39_;
1858
 
        if (_data_->_tmp42_) {
 
2035
        _data_->_tmp48_ = _data_->_tmp45_;
 
2036
        if (_data_->_tmp48_) {
1859
2037
                {
1860
 
                        _data_->_tmp43_ = _data_->timer;
1861
 
                        g_timer_start (_data_->_tmp43_);
1862
 
                        _data_->_tmp44_ = _data_->filter;
1863
 
                        _data_->_tmp45_ = NULL;
1864
 
                        _data_->_tmp45_ = unity_applications_lens_daemon_prepare_zg_search_string (_data_->self, "", _data_->_tmp44_);
1865
 
                        _data_->zg_search_string = _data_->_tmp45_;
1866
 
                        _data_->_tmp46_ = _data_->self->priv->zg_index;
1867
 
                        _data_->_tmp47_ = _data_->zg_search_string;
1868
 
                        _data_->_tmp48_ = zeitgeist_time_range_new_anytime ();
1869
 
                        _data_->_tmp49_ = g_object_ref_sink (_data_->_tmp48_);
1870
 
                        _data_->_tmp50_ = _data_->self->priv->zg_templates;
1871
 
                        _data_->_tmp51_ = _g_ptr_array_ref0 (_data_->_tmp50_);
1872
 
                        _data_->_tmp52_ = _data_->cancellable;
 
2038
                        _data_->_tmp49_ = _data_->timer;
 
2039
                        g_timer_start (_data_->_tmp49_);
 
2040
                        _data_->_tmp50_ = _data_->filter;
 
2041
                        _data_->_tmp51_ = NULL;
 
2042
                        _data_->_tmp51_ = unity_applications_lens_daemon_prepare_zg_search_string (_data_->self, "", _data_->_tmp50_);
 
2043
                        _data_->zg_search_string = _data_->_tmp51_;
 
2044
                        _data_->_tmp52_ = _data_->self->priv->zg_index;
 
2045
                        _data_->_tmp53_ = _data_->zg_search_string;
 
2046
                        _data_->_tmp54_ = zeitgeist_time_range_new_anytime ();
 
2047
                        _data_->_tmp55_ = g_object_ref_sink (_data_->_tmp54_);
 
2048
                        _data_->_tmp56_ = _data_->self->priv->zg_templates;
 
2049
                        _data_->_tmp57_ = _g_ptr_array_ref0 (_data_->_tmp56_);
 
2050
                        _data_->_tmp58_ = _data_->cancellable;
1873
2051
                        _data_->_state_ = 1;
1874
 
                        zeitgeist_index_search (_data_->_tmp46_, _data_->_tmp47_, _data_->_tmp49_, _data_->_tmp51_, (guint32) 0, (guint32) 20, ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, _data_->_tmp52_, unity_applications_lens_daemon_update_scope_search_ready, _data_);
 
2052
                        zeitgeist_index_search (_data_->_tmp52_, _data_->_tmp53_, _data_->_tmp55_, _data_->_tmp57_, (guint32) 0, (guint32) 20, ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, _data_->_tmp58_, unity_applications_lens_daemon_update_scope_search_ready, _data_);
1875
2053
                        return FALSE;
1876
2054
                        _state_1:
1877
 
                        _data_->_tmp53_ = NULL;
1878
 
                        _data_->_tmp53_ = zeitgeist_index_search_finish (_data_->_tmp46_, _data_->_res_, &_data_->_inner_error_);
1879
 
                        _data_->_tmp54_ = _data_->_tmp53_;
1880
 
                        _g_object_unref0 (_data_->_tmp49_);
1881
 
                        _data_->results = _data_->_tmp54_;
 
2055
                        _data_->_tmp59_ = NULL;
 
2056
                        _data_->_tmp59_ = zeitgeist_index_search_finish (_data_->_tmp52_, _data_->_res_, &_data_->_inner_error_);
 
2057
                        _data_->_tmp60_ = _data_->_tmp59_;
 
2058
                        _g_object_unref0 (_data_->_tmp55_);
 
2059
                        _data_->results = _data_->_tmp60_;
1882
2060
                        if (_data_->_inner_error_ != NULL) {
1883
2061
                                _g_free0 (_data_->zg_search_string);
1884
2062
                                if (g_error_matches (_data_->_inner_error_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
1886
2064
                                }
1887
2065
                                goto __catch3_g_error;
1888
2066
                        }
1889
 
                        _data_->_tmp55_ = _data_->results;
1890
 
                        _data_->_tmp56_ = _data_->transaction;
1891
 
                        _data_->_tmp57_ = _data_->installed_uris;
1892
 
                        unity_applications_lens_daemon_append_events_with_category (_data_->self, _data_->_tmp55_, (DeeModel*) _data_->_tmp56_, (guint) UNITY_APPLICATIONS_LENS_CATEGORY_RECENT, FALSE, 6, _data_->_tmp57_);
1893
 
                        _data_->_tmp58_ = _data_->timer;
1894
 
                        g_timer_stop (_data_->_tmp58_);
1895
 
                        _data_->_tmp59_ = _data_->results;
1896
 
                        _data_->_tmp60_ = 0U;
1897
 
                        _data_->_tmp60_ = zeitgeist_result_set_size (_data_->_tmp59_);
1898
2067
                        _data_->_tmp61_ = _data_->results;
1899
 
                        _data_->_tmp62_ = 0U;
1900
 
                        _data_->_tmp62_ = zeitgeist_result_set_estimated_matches (_data_->_tmp61_);
1901
 
                        _data_->_tmp63_ = _data_->timer;
1902
 
                        _data_->_tmp64_ = 0.0;
1903
 
                        _data_->_tmp64_ = g_timer_elapsed (_data_->_tmp63_, NULL);
1904
 
                        _data_->_tmp65_ = _data_->zg_search_string;
1905
 
                        g_debug ("daemon.vala:535: Entry search found %u/%u Recently Used apps in %fms f" \
1906
 
"or query '%s'", _data_->_tmp60_, _data_->_tmp62_, _data_->_tmp64_ * 1000, _data_->_tmp65_);
 
2068
                        _data_->_tmp62_ = _data_->transaction;
 
2069
                        _data_->_tmp63_ = _data_->installed_uris;
 
2070
                        unity_applications_lens_daemon_append_events_with_category (_data_->self, _data_->_tmp61_, (DeeModel*) _data_->_tmp62_, (guint) UNITY_APPLICATIONS_LENS_CATEGORY_RECENT, FALSE, 6, _data_->_tmp63_);
 
2071
                        _data_->_tmp64_ = _data_->timer;
 
2072
                        g_timer_stop (_data_->_tmp64_);
 
2073
                        _data_->_tmp65_ = _data_->results;
 
2074
                        _data_->_tmp66_ = 0U;
 
2075
                        _data_->_tmp66_ = zeitgeist_result_set_size (_data_->_tmp65_);
 
2076
                        _data_->_tmp67_ = _data_->results;
 
2077
                        _data_->_tmp68_ = 0U;
 
2078
                        _data_->_tmp68_ = zeitgeist_result_set_estimated_matches (_data_->_tmp67_);
 
2079
                        _data_->_tmp69_ = _data_->timer;
 
2080
                        _data_->_tmp70_ = 0.0;
 
2081
                        _data_->_tmp70_ = g_timer_elapsed (_data_->_tmp69_, NULL);
 
2082
                        _data_->_tmp71_ = _data_->zg_search_string;
 
2083
                        g_debug ("daemon.vala:555: Entry search found %u/%u Recently Used apps in %fms f" \
 
2084
"or query '%s'", _data_->_tmp66_, _data_->_tmp68_, _data_->_tmp70_ * 1000, _data_->_tmp71_);
1907
2085
                        _g_object_unref0 (_data_->results);
1908
2086
                        _g_free0 (_data_->zg_search_string);
1909
2087
                }
1934
2112
                {
1935
2113
                        _data_->e = _data_->_inner_error_;
1936
2114
                        _data_->_inner_error_ = NULL;
1937
 
                        _data_->_tmp66_ = _data_->search;
1938
 
                        _data_->_tmp67_ = unity_lens_search_get_search_string (_data_->_tmp66_);
1939
 
                        _data_->_tmp68_ = _data_->_tmp67_;
1940
 
                        _data_->_tmp69_ = _data_->e;
1941
 
                        _data_->_tmp70_ = _data_->_tmp69_->message;
1942
 
                        g_warning ("daemon.vala:543: Error performing search '%s': %s", _data_->_tmp68_, _data_->_tmp70_);
 
2115
                        _data_->_tmp72_ = _data_->search;
 
2116
                        _data_->_tmp73_ = unity_lens_search_get_search_string (_data_->_tmp72_);
 
2117
                        _data_->_tmp74_ = _data_->_tmp73_;
 
2118
                        _data_->_tmp75_ = _data_->e;
 
2119
                        _data_->_tmp76_ = _data_->_tmp75_->message;
 
2120
                        g_warning ("daemon.vala:563: Error performing search '%s': %s", _data_->_tmp74_, _data_->_tmp76_);
1943
2121
                        _g_error_free0 (_data_->e);
1944
2122
                }
1945
2123
                __finally3:
1957
2135
                        return FALSE;
1958
2136
                }
1959
2137
        }
1960
 
        _data_->_tmp71_ = _data_->transaction;
1961
 
        dee_transaction_commit (_data_->_tmp71_, &_data_->_inner_error_);
 
2138
        _data_->_tmp77_ = _data_->transaction;
 
2139
        dee_transaction_commit (_data_->_tmp77_, &_data_->_inner_error_);
1962
2140
        if (_data_->_inner_error_ != NULL) {
1963
2141
                _unity_package_search_result_free0 (_data_->appresults);
1964
2142
                _g_object_unref0 (_data_->available_uris);
1972
2150
                g_clear_error (&_data_->_inner_error_);
1973
2151
                return FALSE;
1974
2152
        }
1975
 
        _data_->_tmp74_ = FALSE;
1976
 
        _data_->_tmp74_ = unity_applications_lens_daemon_usc_apps_active (_data_->self);
1977
 
        if (_data_->_tmp74_) {
1978
 
                _data_->_tmp75_ = _data_->self->priv->_display_available_apps;
1979
 
                _data_->_tmp73_ = _data_->_tmp75_;
1980
 
        } else {
1981
 
                _data_->_tmp73_ = FALSE;
1982
 
        }
1983
 
        _data_->_tmp76_ = _data_->_tmp73_;
1984
 
        if (_data_->_tmp76_) {
1985
 
                _data_->_tmp77_ = _data_->self->priv->pkgsearcher;
1986
 
                _data_->_tmp72_ = _data_->_tmp77_ != NULL;
1987
 
        } else {
1988
 
                _data_->_tmp72_ = FALSE;
1989
 
        }
1990
 
        _data_->_tmp78_ = _data_->_tmp72_;
1991
 
        if (_data_->_tmp78_) {
1992
 
                _data_->_tmp79_ = _data_->has_search;
1993
 
                if (_data_->_tmp79_) {
1994
 
                        _data_->_tmp80_ = _data_->timer;
1995
 
                        g_timer_start (_data_->_tmp80_);
1996
 
                        _data_->_tmp81_ = _data_->self->priv->pkgsearcher;
1997
 
                        _data_->_tmp82_ = _data_->pkg_search_string;
1998
 
                        _data_->_tmp83_ = NULL;
1999
 
                        _data_->_tmp83_ = unity_package_searcher_search (_data_->_tmp81_, _data_->_tmp82_, (guint) 50, UNITY_PACKAGE_SEARCHTYPE_PREFIX, UNITY_PACKAGE_SORT_BY_RELEVANCY);
2000
 
                        _data_->pkgresults = _data_->_tmp83_;
2001
 
                        _data_->_tmp84_ = _data_->pkgresults;
2002
 
                        _data_->_tmp85_ = _data_->installed_uris;
2003
 
                        _data_->_tmp86_ = _data_->available_uris;
2004
 
                        _data_->_tmp87_ = _data_->model;
2005
 
                        unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp84_, _data_->_tmp85_, _data_->_tmp86_, (DeeModel*) _data_->_tmp87_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, (guint) 0);
2006
 
                        _data_->_tmp88_ = _data_->timer;
2007
 
                        g_timer_stop (_data_->_tmp88_);
2008
 
                        _data_->_tmp89_ = _data_->pkgresults;
2009
 
                        _data_->_tmp90_ = _data_->_tmp89_->num_hits;
2010
 
                        _data_->_tmp91_ = _data_->timer;
2011
 
                        _data_->_tmp92_ = 0.0;
2012
 
                        _data_->_tmp92_ = g_timer_elapsed (_data_->_tmp91_, NULL);
2013
 
                        _data_->_tmp93_ = _data_->pkg_search_string;
2014
 
                        g_debug ("daemon.vala:561: Entry search listed %i Available apps in %fms for que" \
2015
 
"ry: %s", _data_->_tmp90_, _data_->_tmp92_ * 1000, _data_->_tmp93_);
 
2153
        _data_->_tmp78_ = unity_applications_lens_purchase_info_helper_new ();
 
2154
        _unity_applications_lens_purchase_info_helper_unref0 (_data_->self->priv->purchase_info);
 
2155
        _data_->self->priv->purchase_info = _data_->_tmp78_;
 
2156
        _data_->_tmp81_ = FALSE;
 
2157
        _data_->_tmp81_ = unity_applications_lens_daemon_usc_apps_active (_data_->self);
 
2158
        if (_data_->_tmp81_) {
 
2159
                _data_->_tmp82_ = _data_->self->priv->_display_available_apps;
 
2160
                _data_->_tmp80_ = _data_->_tmp82_;
 
2161
        } else {
 
2162
                _data_->_tmp80_ = FALSE;
 
2163
        }
 
2164
        _data_->_tmp83_ = _data_->_tmp80_;
 
2165
        if (_data_->_tmp83_) {
 
2166
                _data_->_tmp84_ = _data_->self->priv->pkgsearcher;
 
2167
                _data_->_tmp79_ = _data_->_tmp84_ != NULL;
 
2168
        } else {
 
2169
                _data_->_tmp79_ = FALSE;
 
2170
        }
 
2171
        _data_->_tmp85_ = _data_->_tmp79_;
 
2172
        if (_data_->_tmp85_) {
 
2173
                _data_->_tmp86_ = _data_->has_search;
 
2174
                if (_data_->_tmp86_) {
 
2175
                        _data_->_tmp87_ = _data_->timer;
 
2176
                        g_timer_start (_data_->_tmp87_);
 
2177
                        _data_->_tmp88_ = _data_->self->priv->pkgsearcher;
 
2178
                        _data_->_tmp89_ = _data_->pkg_search_string;
 
2179
                        _data_->_tmp90_ = NULL;
 
2180
                        _data_->_tmp90_ = unity_package_searcher_search (_data_->_tmp88_, _data_->_tmp89_, (guint) 50, UNITY_PACKAGE_SEARCHTYPE_PREFIX, UNITY_PACKAGE_SORT_BY_RELEVANCY);
 
2181
                        _data_->pkgresults = _data_->_tmp90_;
 
2182
                        _data_->_tmp91_ = _data_->pkgresults;
 
2183
                        _data_->_tmp92_ = _data_->installed_uris;
 
2184
                        _data_->_tmp93_ = _data_->available_uris;
 
2185
                        _data_->_tmp94_ = _data_->model;
 
2186
                        unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp91_, _data_->_tmp92_, _data_->_tmp93_, (DeeModel*) _data_->_tmp94_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, (guint) 0);
 
2187
                        _data_->_tmp95_ = _data_->timer;
 
2188
                        g_timer_stop (_data_->_tmp95_);
 
2189
                        _data_->_tmp96_ = _data_->pkgresults;
 
2190
                        _data_->_tmp97_ = _data_->_tmp96_->num_hits;
 
2191
                        _data_->_tmp98_ = _data_->timer;
 
2192
                        _data_->_tmp99_ = 0.0;
 
2193
                        _data_->_tmp99_ = g_timer_elapsed (_data_->_tmp98_, NULL);
 
2194
                        _data_->_tmp100_ = _data_->pkg_search_string;
 
2195
                        g_debug ("daemon.vala:583: Entry search listed %i Available apps in %fms for que" \
 
2196
"ry: %s", _data_->_tmp97_, _data_->_tmp99_ * 1000, _data_->_tmp100_);
2016
2197
                        _unity_package_search_result_free0 (_data_->pkgresults);
2017
2198
                } else {
2018
 
                        _data_->_tmp94_ = _data_->timer;
2019
 
                        g_timer_start (_data_->_tmp94_);
2020
 
                        _data_->_tmp95_ = _data_->search;
2021
 
                        _data_->_tmp96_ = _data_->filter;
2022
 
                        _data_->_tmp97_ = NULL;
2023
 
                        _data_->_tmp97_ = unity_applications_lens_daemon_prepare_pkg_search_string (_data_->self, _data_->_tmp95_, _data_->_tmp96_);
2024
 
                        _data_->filter_query = _data_->_tmp97_;
2025
 
                        _data_->_tmp98_ = _data_->self->priv->pkgsearcher;
2026
 
                        _data_->_tmp99_ = _data_->filter_query;
2027
 
                        _data_->_tmp100_ = NULL;
2028
 
                        _data_->_tmp100_ = unity_package_searcher_get_random_apps (_data_->_tmp98_, _data_->_tmp99_, (guint) 12);
2029
 
                        _data_->random_pkgresults = _data_->_tmp100_;
2030
 
                        _data_->_tmp101_ = _data_->random_pkgresults;
2031
 
                        _data_->_tmp102_ = _data_->installed_uris;
2032
 
                        _data_->_tmp103_ = _data_->available_uris;
2033
 
                        _data_->_tmp104_ = _data_->model;
2034
 
                        unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp101_, _data_->_tmp102_, _data_->_tmp103_, (DeeModel*) _data_->_tmp104_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, (guint) 6);
2035
 
                        _data_->_tmp105_ = _data_->timer;
2036
 
                        g_timer_stop (_data_->_tmp105_);
2037
 
                        _data_->_tmp106_ = _data_->random_pkgresults;
2038
 
                        _data_->_tmp107_ = _data_->_tmp106_->num_hits;
2039
 
                        _data_->_tmp108_ = _data_->timer;
2040
 
                        _data_->_tmp109_ = 0.0;
2041
 
                        _data_->_tmp109_ = g_timer_elapsed (_data_->_tmp108_, NULL);
2042
 
                        g_debug ("daemon.vala:572: Entry search listed %i random Available apps in %fms", _data_->_tmp107_, _data_->_tmp109_ * 1000);
2043
 
                        _unity_package_search_result_free0 (_data_->random_pkgresults);
2044
 
                        _g_free0 (_data_->filter_query);
 
2199
                        _data_->_tmp101_ = _data_->has_filter;
 
2200
                        if (_data_->_tmp101_) {
 
2201
                                _data_->_tmp102_ = _data_->timer;
 
2202
                                g_timer_start (_data_->_tmp102_);
 
2203
                                _data_->_tmp103_ = _data_->search;
 
2204
                                _data_->_tmp104_ = _data_->filter;
 
2205
                                _data_->_tmp105_ = NULL;
 
2206
                                _data_->_tmp105_ = unity_applications_lens_daemon_prepare_pkg_search_string (_data_->self, _data_->_tmp103_, _data_->_tmp104_);
 
2207
                                _data_->filter_query = _data_->_tmp105_;
 
2208
                                _data_->_tmp106_ = _data_->self->priv->pkgsearcher;
 
2209
                                _data_->_tmp107_ = _data_->filter_query;
 
2210
                                _data_->_tmp108_ = NULL;
 
2211
                                _data_->_tmp108_ = unity_package_searcher_get_apps (_data_->_tmp106_, _data_->_tmp107_, UNITY_APPLICATIONS_LENS_MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY, _unity_applications_lens_daemon_filter_cb_unity_package_app_filter_callback, _data_->self);
 
2212
                                _data_->_vala1_pkgresults = _data_->_tmp108_;
 
2213
                                _data_->_tmp109_ = _data_->self->priv->purchase_info;
 
2214
                                _data_->_tmp110_ = _data_->_vala1_pkgresults;
 
2215
                                unity_applications_lens_purchase_info_helper_from_pkgresults (_data_->_tmp109_, _data_->_tmp110_);
 
2216
                                _data_->_tmp111_ = _data_->_vala1_pkgresults;
 
2217
                                _data_->_tmp112_ = _data_->installed_uris;
 
2218
                                _data_->_tmp113_ = _data_->available_uris;
 
2219
                                _data_->_tmp114_ = _data_->model;
 
2220
                                unity_applications_lens_daemon_add_pkg_search_result (_data_->self, _data_->_tmp111_, _data_->_tmp112_, _data_->_tmp113_, (DeeModel*) _data_->_tmp114_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, UNITY_APPLICATIONS_LENS_MAX_APP_FOR_DOWNLOAD_FOR_EMPTY_QUERY);
 
2221
                                _data_->_tmp115_ = _data_->timer;
 
2222
                                g_timer_stop (_data_->_tmp115_);
 
2223
                                _data_->_tmp116_ = _data_->_vala1_pkgresults;
 
2224
                                _data_->_tmp117_ = _data_->_tmp116_->num_hits;
 
2225
                                _data_->_tmp118_ = _data_->timer;
 
2226
                                _data_->_tmp119_ = 0.0;
 
2227
                                _data_->_tmp119_ = g_timer_elapsed (_data_->_tmp118_, NULL);
 
2228
                                g_debug ("daemon.vala:595: Entry search listed %i Available apps in %fms", _data_->_tmp117_, _data_->_tmp119_ * 1000);
 
2229
                                _unity_package_search_result_free0 (_data_->_vala1_pkgresults);
 
2230
                                _g_free0 (_data_->filter_query);
 
2231
                        } else {
 
2232
                                _data_->_tmp120_ = _data_->timer;
 
2233
                                g_timer_start (_data_->_tmp120_);
 
2234
                                _data_->hits = (guint) 0;
 
2235
                                {
 
2236
                                        _data_->_tmp121_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
2237
                                        _data_->duplicates_lookup = (GeeSet*) _data_->_tmp121_;
 
2238
                                        _data_->_tmp122_ = _data_->self->priv->sc_data_provider;
 
2239
                                        if (_data_->_tmp122_ == NULL) {
 
2240
                                                _data_->_tmp123_ = unity_applications_lens_software_center_data_cache_new (UNITY_APPLICATIONS_LENS_TOP_RATED_ITEMS_CACHE_LIFETIME);
 
2241
                                                _g_object_unref0 (_data_->self->priv->sc_data_provider);
 
2242
                                                _data_->self->priv->sc_data_provider = (UnityApplicationsLensSoftwareCenterDataProviderProxy*) _data_->_tmp123_;
 
2243
                                        }
 
2244
                                        _data_->_tmp124_ = _data_->self->priv->sc_data_provider;
 
2245
                                        _data_->_tmp125_ = 0;
 
2246
                                        _data_->_tmp126_ = NULL;
 
2247
                                        _data_->_tmp126_ = unity_applications_lens_software_center_data_provider_proxy_get_items_for_category (_data_->_tmp124_, "unity-whats-new", &_data_->_tmp125_, &_data_->_inner_error_);
 
2248
                                        _data_->whats_new = _data_->_tmp126_;
 
2249
                                        _data_->whats_new_length1 = _data_->_tmp125_;
 
2250
                                        _data_->_whats_new_size_ = _data_->whats_new_length1;
 
2251
                                        if (_data_->_inner_error_ != NULL) {
 
2252
                                                _g_object_unref0 (_data_->duplicates_lookup);
 
2253
                                                goto __catch4_g_error;
 
2254
                                        }
 
2255
                                        _data_->_tmp127_ = _data_->self->priv->purchase_info;
 
2256
                                        _data_->_tmp128_ = _data_->whats_new;
 
2257
                                        _data_->_tmp128__length1 = _data_->whats_new_length1;
 
2258
                                        _data_->_tmp129_ = NULL;
 
2259
                                        _data_->_tmp129_ = unity_applications_lens_purchase_info_helper_create_pkgsearch_query (_data_->_tmp127_, _data_->_tmp128_, _data_->_tmp128__length1);
 
2260
                                        _data_->query = _data_->_tmp129_;
 
2261
                                        _data_->_tmp130_ = _data_->self->priv->pkgsearcher;
 
2262
                                        _data_->_tmp131_ = _data_->query;
 
2263
                                        _data_->_tmp132_ = NULL;
 
2264
                                        _data_->_tmp132_ = unity_package_searcher_get_by_exact_names (_data_->_tmp130_, _data_->_tmp131_);
 
2265
                                        _data_->tmpresults = _data_->_tmp132_;
 
2266
                                        _data_->_tmp133_ = _data_->self->priv->purchase_info;
 
2267
                                        _data_->_tmp134_ = _data_->tmpresults;
 
2268
                                        unity_applications_lens_purchase_info_helper_from_pkgresults (_data_->_tmp133_, _data_->_tmp134_);
 
2269
                                        _data_->_tmp135_ = _data_->whats_new;
 
2270
                                        _data_->_tmp135__length1 = _data_->whats_new_length1;
 
2271
                                        _data_->_tmp136_ = _data_->model;
 
2272
                                        _data_->_tmp137_ = 0U;
 
2273
                                        _data_->_tmp137_ = unity_applications_lens_daemon_add_sc_category_results (_data_->self, _data_->_tmp135_, _data_->_tmp135__length1, (DeeModel*) _data_->_tmp136_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, &_data_->duplicates_lookup, UNITY_APPLICATIONS_LENS_MAX_WHATS_NEW_APPS_FOR_EMPTY_QUERY);
 
2274
                                        _data_->hits = _data_->_tmp137_;
 
2275
                                        _data_->_tmp138_ = _data_->self->priv->sc_data_provider;
 
2276
                                        _data_->_tmp139_ = 0;
 
2277
                                        _data_->_tmp140_ = NULL;
 
2278
                                        _data_->_tmp140_ = unity_applications_lens_software_center_data_provider_proxy_get_items_for_category (_data_->_tmp138_, "unity-top-rated", &_data_->_tmp139_, &_data_->_inner_error_);
 
2279
                                        _data_->top_rated = _data_->_tmp140_;
 
2280
                                        _data_->top_rated_length1 = _data_->_tmp139_;
 
2281
                                        _data_->_top_rated_size_ = _data_->top_rated_length1;
 
2282
                                        if (_data_->_inner_error_ != NULL) {
 
2283
                                                _unity_package_search_result_free0 (_data_->tmpresults);
 
2284
                                                __g_slist_free__g_free0_0 (_data_->query);
 
2285
                                                _data_->whats_new = (_vala_array_free (_data_->whats_new, _data_->whats_new_length1, (GDestroyNotify) unity_applications_lens_software_center_data_provider_service_app_info_free), NULL);
 
2286
                                                _g_object_unref0 (_data_->duplicates_lookup);
 
2287
                                                goto __catch4_g_error;
 
2288
                                        }
 
2289
                                        _data_->_tmp141_ = _data_->self->priv->purchase_info;
 
2290
                                        _data_->_tmp142_ = _data_->top_rated;
 
2291
                                        _data_->_tmp142__length1 = _data_->top_rated_length1;
 
2292
                                        _data_->_tmp143_ = NULL;
 
2293
                                        _data_->_tmp143_ = unity_applications_lens_purchase_info_helper_create_pkgsearch_query (_data_->_tmp141_, _data_->_tmp142_, _data_->_tmp142__length1);
 
2294
                                        __g_slist_free__g_free0_0 (_data_->query);
 
2295
                                        _data_->query = _data_->_tmp143_;
 
2296
                                        _data_->_tmp144_ = _data_->self->priv->pkgsearcher;
 
2297
                                        _data_->_tmp145_ = _data_->query;
 
2298
                                        _data_->_tmp146_ = NULL;
 
2299
                                        _data_->_tmp146_ = unity_package_searcher_get_by_exact_names (_data_->_tmp144_, _data_->_tmp145_);
 
2300
                                        _unity_package_search_result_free0 (_data_->tmpresults);
 
2301
                                        _data_->tmpresults = _data_->_tmp146_;
 
2302
                                        _data_->_tmp147_ = _data_->self->priv->purchase_info;
 
2303
                                        _data_->_tmp148_ = _data_->tmpresults;
 
2304
                                        unity_applications_lens_purchase_info_helper_from_pkgresults (_data_->_tmp147_, _data_->_tmp148_);
 
2305
                                        _data_->_tmp149_ = _data_->hits;
 
2306
                                        _data_->_tmp150_ = _data_->top_rated;
 
2307
                                        _data_->_tmp150__length1 = _data_->top_rated_length1;
 
2308
                                        _data_->_tmp151_ = _data_->model;
 
2309
                                        _data_->_tmp152_ = 0U;
 
2310
                                        _data_->_tmp152_ = unity_applications_lens_daemon_add_sc_category_results (_data_->self, _data_->_tmp150_, _data_->_tmp150__length1, (DeeModel*) _data_->_tmp151_, UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE, &_data_->duplicates_lookup, UNITY_APPLICATIONS_LENS_MAX_TOP_RATED_APPS_FOR_EMPTY_QUERY);
 
2311
                                        _data_->hits = _data_->_tmp149_ + _data_->_tmp152_;
 
2312
                                        _data_->top_rated = (_vala_array_free (_data_->top_rated, _data_->top_rated_length1, (GDestroyNotify) unity_applications_lens_software_center_data_provider_service_app_info_free), NULL);
 
2313
                                        _unity_package_search_result_free0 (_data_->tmpresults);
 
2314
                                        __g_slist_free__g_free0_0 (_data_->query);
 
2315
                                        _data_->whats_new = (_vala_array_free (_data_->whats_new, _data_->whats_new_length1, (GDestroyNotify) unity_applications_lens_software_center_data_provider_service_app_info_free), NULL);
 
2316
                                        _g_object_unref0 (_data_->duplicates_lookup);
 
2317
                                }
 
2318
                                goto __finally4;
 
2319
                                __catch4_g_error:
 
2320
                                {
 
2321
                                        _data_->_vala1_e = _data_->_inner_error_;
 
2322
                                        _data_->_inner_error_ = NULL;
 
2323
                                        _data_->_tmp153_ = _data_->_vala1_e;
 
2324
                                        _data_->_tmp154_ = _data_->_tmp153_->message;
 
2325
                                        g_warning ("daemon.vala:624: Failed to get top rated apps: %s", _data_->_tmp154_);
 
2326
                                        _g_error_free0 (_data_->_vala1_e);
 
2327
                                }
 
2328
                                __finally4:
 
2329
                                if (_data_->_inner_error_ != NULL) {
 
2330
                                        _unity_package_search_result_free0 (_data_->appresults);
 
2331
                                        _g_object_unref0 (_data_->available_uris);
 
2332
                                        _g_object_unref0 (_data_->installed_uris);
 
2333
                                        _g_object_unref0 (_data_->transaction);
 
2334
                                        _g_timer_destroy0 (_data_->timer);
 
2335
                                        _g_free0 (_data_->pkg_search_string);
 
2336
                                        _g_object_unref0 (_data_->filter);
 
2337
                                        _g_object_unref0 (_data_->model);
 
2338
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
2339
                                        g_clear_error (&_data_->_inner_error_);
 
2340
                                        return FALSE;
 
2341
                                }
 
2342
                                _data_->_tmp155_ = _data_->timer;
 
2343
                                g_timer_stop (_data_->_tmp155_);
 
2344
                                _data_->_tmp156_ = _data_->hits;
 
2345
                                _data_->_tmp157_ = _data_->timer;
 
2346
                                _data_->_tmp158_ = 0.0;
 
2347
                                _data_->_tmp158_ = g_timer_elapsed (_data_->_tmp157_, NULL);
 
2348
                                g_debug ("daemon.vala:628: Entry search listed %u top rated/new available apps i" \
 
2349
"n %fms", _data_->_tmp156_, _data_->_tmp158_ * 1000);
 
2350
                        }
2045
2351
                }
2046
2352
        }
2047
 
        _data_->_tmp110_ = _data_->model;
2048
 
        _data_->_tmp111_ = 0U;
2049
 
        _data_->_tmp111_ = dee_model_get_n_rows ((DeeModel*) _data_->_tmp110_);
2050
 
        if (_data_->_tmp111_ == ((guint) 0)) {
2051
 
                _data_->_tmp112_ = _data_->search;
2052
 
                _data_->_tmp113_ = NULL;
2053
 
                _data_->_tmp113_ = _ ("Sorry, there are no applications that match your search.");
2054
 
                _data_->_tmp114_ = _variant_new4 (_data_->_tmp113_);
2055
 
                unity_lens_search_set_reply_hint (_data_->_tmp112_, "no-results-hint", _data_->_tmp114_);
 
2353
        _data_->_tmp159_ = _data_->model;
 
2354
        _data_->_tmp160_ = 0U;
 
2355
        _data_->_tmp160_ = dee_model_get_n_rows ((DeeModel*) _data_->_tmp159_);
 
2356
        if (_data_->_tmp160_ == ((guint) 0)) {
 
2357
                _data_->_tmp161_ = _data_->search;
 
2358
                _data_->_tmp162_ = NULL;
 
2359
                _data_->_tmp162_ = _ ("Sorry, there are no applications that match your search.");
 
2360
                _data_->_tmp163_ = _variant_new4 (_data_->_tmp162_);
 
2361
                unity_lens_search_set_reply_hint (_data_->_tmp161_, "no-results-hint", _data_->_tmp163_);
2056
2362
        }
2057
 
        _data_->_tmp115_ = _data_->search;
2058
 
        g_signal_emit_by_name (_data_->_tmp115_, "finished");
 
2363
        _data_->_tmp164_ = _data_->search;
 
2364
        g_signal_emit_by_name (_data_->_tmp164_, "finished");
2059
2365
        _unity_package_search_result_free0 (_data_->appresults);
2060
2366
        _g_object_unref0 (_data_->available_uris);
2061
2367
        _g_object_unref0 (_data_->installed_uris);
2187
2493
        _data_->_tmp26_ = 0.0;
2188
2494
        _data_->_tmp26_ = g_timer_elapsed (_data_->_tmp25_, NULL);
2189
2495
        _data_->_tmp27_ = _data_->search_string;
2190
 
        g_debug ("daemon.vala:616: Global search listed %i Installed apps in %fms for qu" \
 
2496
        g_debug ("daemon.vala:672: Global search listed %i Installed apps in %fms for qu" \
2191
2497
"ery: %s", _data_->_tmp24_, _data_->_tmp26_ * 1000, _data_->_tmp27_);
2192
2498
        _data_->_tmp28_ = _data_->search;
2193
2499
        g_signal_emit_by_name (_data_->_tmp28_, "finished");
2307
2613
                                _g_object_unref0 (_data_->time_range);
2308
2614
                                _g_free0 (_data_->zg_search_string);
2309
2615
                                if (g_error_matches (_data_->_inner_error_, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
2310
 
                                        goto __catch4_g_io_error_cancelled;
 
2616
                                        goto __catch5_g_io_error_cancelled;
2311
2617
                                }
2312
 
                                goto __catch4_g_error;
 
2618
                                goto __catch5_g_error;
2313
2619
                        }
2314
2620
                        _data_->_tmp21_ = _data_->model;
2315
2621
                        dee_model_clear ((DeeModel*) _data_->_tmp21_);
2329
2635
                        _data_->_tmp31_ = 0.0;
2330
2636
                        _data_->_tmp31_ = g_timer_elapsed (_data_->_tmp30_, NULL);
2331
2637
                        _data_->_tmp32_ = _data_->zg_search_string;
2332
 
                        g_debug ("daemon.vala:657: Entry search found %u/%u Recently Used apps in %fms f" \
 
2638
                        g_debug ("daemon.vala:713: Entry search found %u/%u Recently Used apps in %fms f" \
2333
2639
"or query '%s'", _data_->_tmp27_, _data_->_tmp29_, _data_->_tmp31_ * 1000, _data_->_tmp32_);
2334
2640
                        _g_object_unref0 (_data_->results);
2335
2641
                        _g_object_unref0 (_data_->time_range);
2336
2642
                        _g_free0 (_data_->zg_search_string);
2337
2643
                }
2338
 
                goto __finally4;
2339
 
                __catch4_g_io_error_cancelled:
 
2644
                goto __finally5;
 
2645
                __catch5_g_io_error_cancelled:
2340
2646
                {
2341
2647
                        _data_->ioe = _data_->_inner_error_;
2342
2648
                        _data_->_inner_error_ = NULL;
2351
2657
                        g_object_unref (_data_->_async_result);
2352
2658
                        return FALSE;
2353
2659
                }
2354
 
                goto __finally4;
2355
 
                __catch4_g_error:
 
2660
                goto __finally5;
 
2661
                __catch5_g_error:
2356
2662
                {
2357
2663
                        _data_->e = _data_->_inner_error_;
2358
2664
                        _data_->_inner_error_ = NULL;
2361
2667
                        _data_->_tmp35_ = _data_->_tmp34_;
2362
2668
                        _data_->_tmp36_ = _data_->e;
2363
2669
                        _data_->_tmp37_ = _data_->_tmp36_->message;
2364
 
                        g_warning ("daemon.vala:665: Error performing search '%s': %s", _data_->_tmp35_, _data_->_tmp37_);
 
2670
                        g_warning ("daemon.vala:721: Error performing search '%s': %s", _data_->_tmp35_, _data_->_tmp37_);
2365
2671
                        _g_error_free0 (_data_->e);
2366
2672
                }
2367
 
                __finally4:
 
2673
                __finally5:
2368
2674
                if (_data_->_inner_error_ != NULL) {
2369
2675
                        _g_timer_destroy0 (_data_->timer);
2370
2676
                        _g_object_unref0 (_data_->model);
2643
2949
 
2644
2950
 
2645
2951
/**
2646
 
     * Find app icon in DATADIR/app-install/icons based on preview_installable_icon_file
2647
 
     * obtained from S-C data provider.
2648
 
     * trying all supported image extensions.
 
2952
     * Find app icon in DATADIR/app-install/icons trying all supported image extensions.
2649
2953
     */
2650
 
static gchar* unity_applications_lens_daemon_find_app_install_icon_path (UnityApplicationsLensDaemon* self) {
 
2954
static gchar* unity_applications_lens_daemon_find_app_install_icon_path (UnityApplicationsLensDaemon* self, const gchar* icon_name) {
2651
2955
        gchar* result = NULL;
2652
2956
        const gchar* _tmp0_ = NULL;
2653
2957
        const gchar* _tmp1_;
2659
2963
        GThemedIcon* _tmp21_;
2660
2964
        gchar* _tmp22_ = NULL;
2661
2965
        g_return_val_if_fail (self != NULL, NULL);
 
2966
        g_return_val_if_fail (icon_name != NULL, NULL);
2662
2967
        _tmp0_ = string_to_string (UNITY_APPLICATIONS_LENS_ICON_APP_INSTALL_PATH);
2663
 
        _tmp1_ = self->priv->preview_installable_icon_file;
 
2968
        _tmp1_ = icon_name;
2664
2969
        _tmp2_ = string_to_string (_tmp1_);
2665
2970
        _tmp3_ = g_strconcat (_tmp0_, "/", _tmp2_, ".", NULL);
2666
2971
        icon = _tmp3_;
2748
3053
}
2749
3054
 
2750
3055
 
2751
 
GIcon* unity_applications_lens_daemon_find_pkg_icon (UnityApplicationsLensDaemon* self, UnityPackageInfo* pkginfo) {
 
3056
GIcon* unity_applications_lens_daemon_find_pkg_icon (UnityApplicationsLensDaemon* self, const gchar* desktop_file, const gchar* icon_name) {
2752
3057
        GIcon* result = NULL;
2753
 
        UnityPackageInfo* _tmp0_;
2754
 
        const gchar* _tmp1_;
2755
 
        gchar* _tmp2_ = NULL;
 
3058
        const gchar* _tmp0_;
 
3059
        gchar* _tmp1_ = NULL;
2756
3060
        gchar* desktop_id;
2757
 
        UnityAppInfoManager* _tmp3_ = NULL;
2758
 
        UnityAppInfoManager* _tmp4_;
2759
 
        const gchar* _tmp5_;
2760
 
        GAppInfo* _tmp6_ = NULL;
2761
 
        GAppInfo* _tmp7_;
 
3061
        UnityAppInfoManager* _tmp2_ = NULL;
 
3062
        UnityAppInfoManager* _tmp3_;
 
3063
        const gchar* _tmp4_;
 
3064
        GAppInfo* _tmp5_ = NULL;
 
3065
        GAppInfo* _tmp6_;
 
3066
        gboolean _tmp7_;
 
3067
        gboolean installed;
2762
3068
        gboolean _tmp8_;
2763
 
        gboolean installed;
2764
 
        gboolean _tmp9_;
2765
 
        UnityPackageInfo* _tmp13_;
2766
 
        const gchar* _tmp14_;
2767
 
        gboolean _tmp15_ = FALSE;
2768
 
        GThemedIcon* _tmp94_;
 
3069
        const gchar* _tmp11_;
 
3070
        gboolean _tmp12_ = FALSE;
 
3071
        GThemedIcon* _tmp82_;
2769
3072
        GThemedIcon* icon;
2770
 
        GHashTable* _tmp95_;
2771
 
        UnityPackageInfo* _tmp96_;
2772
 
        const gchar* _tmp97_;
2773
 
        gchar* _tmp98_;
2774
 
        GThemedIcon* _tmp99_;
2775
 
        GIcon* _tmp100_;
 
3073
        GHashTable* _tmp83_;
 
3074
        const gchar* _tmp84_;
 
3075
        gchar* _tmp85_;
 
3076
        GThemedIcon* _tmp86_;
 
3077
        GIcon* _tmp87_;
2776
3078
        g_return_val_if_fail (self != NULL, NULL);
2777
 
        g_return_val_if_fail (pkginfo != NULL, NULL);
2778
 
        _tmp0_ = pkginfo;
2779
 
        _tmp1_ = _tmp0_->desktop_file;
2780
 
        _tmp2_ = g_path_get_basename (_tmp1_);
2781
 
        desktop_id = _tmp2_;
2782
 
        _tmp3_ = unity_app_info_manager_get_default ();
2783
 
        _tmp4_ = _tmp3_;
2784
 
        _tmp5_ = desktop_id;
2785
 
        _tmp6_ = unity_app_info_manager_lookup (_tmp4_, _tmp5_);
2786
 
        _tmp7_ = _tmp6_;
2787
 
        _tmp8_ = _tmp7_ != NULL;
2788
 
        _g_object_unref0 (_tmp7_);
2789
 
        _g_object_unref0 (_tmp4_);
2790
 
        installed = _tmp8_;
2791
 
        _tmp9_ = installed;
2792
 
        if (_tmp9_) {
2793
 
                UnityPackageInfo* _tmp10_;
2794
 
                const gchar* _tmp11_;
2795
 
                GThemedIcon* _tmp12_;
2796
 
                _tmp10_ = pkginfo;
2797
 
                _tmp11_ = _tmp10_->icon;
2798
 
                _tmp12_ = (GThemedIcon*) g_themed_icon_new (_tmp11_);
2799
 
                result = (GIcon*) _tmp12_;
 
3079
        g_return_val_if_fail (desktop_file != NULL, NULL);
 
3080
        g_return_val_if_fail (icon_name != NULL, NULL);
 
3081
        _tmp0_ = desktop_file;
 
3082
        _tmp1_ = g_path_get_basename (_tmp0_);
 
3083
        desktop_id = _tmp1_;
 
3084
        _tmp2_ = unity_app_info_manager_get_default ();
 
3085
        _tmp3_ = _tmp2_;
 
3086
        _tmp4_ = desktop_id;
 
3087
        _tmp5_ = unity_app_info_manager_lookup (_tmp3_, _tmp4_);
 
3088
        _tmp6_ = _tmp5_;
 
3089
        _tmp7_ = _tmp6_ != NULL;
 
3090
        _g_object_unref0 (_tmp6_);
 
3091
        _g_object_unref0 (_tmp3_);
 
3092
        installed = _tmp7_;
 
3093
        _tmp8_ = installed;
 
3094
        if (_tmp8_) {
 
3095
                const gchar* _tmp9_;
 
3096
                GThemedIcon* _tmp10_;
 
3097
                _tmp9_ = icon_name;
 
3098
                _tmp10_ = (GThemedIcon*) g_themed_icon_new (_tmp9_);
 
3099
                result = (GIcon*) _tmp10_;
2800
3100
                _g_free0 (desktop_id);
2801
3101
                return result;
2802
3102
        }
2803
 
        _tmp13_ = pkginfo;
2804
 
        _tmp14_ = _tmp13_->icon;
2805
 
        _tmp15_ = g_str_has_prefix (_tmp14_, "/");
2806
 
        if (_tmp15_) {
2807
 
                UnityPackageInfo* _tmp16_;
2808
 
                const gchar* _tmp17_;
2809
 
                GFile* _tmp18_ = NULL;
2810
 
                GFile* _tmp19_;
2811
 
                GFileIcon* _tmp20_;
 
3103
        _tmp11_ = icon_name;
 
3104
        _tmp12_ = g_str_has_prefix (_tmp11_, "/");
 
3105
        if (_tmp12_) {
 
3106
                const gchar* _tmp13_;
 
3107
                GFile* _tmp14_ = NULL;
 
3108
                GFile* _tmp15_;
 
3109
                GFileIcon* _tmp16_;
 
3110
                GIcon* _tmp17_;
 
3111
                _tmp13_ = icon_name;
 
3112
                _tmp14_ = g_file_new_for_path (_tmp13_);
 
3113
                _tmp15_ = _tmp14_;
 
3114
                _tmp16_ = (GFileIcon*) g_file_icon_new (_tmp15_);
 
3115
                _tmp17_ = (GIcon*) _tmp16_;
 
3116
                _g_object_unref0 (_tmp15_);
 
3117
                result = _tmp17_;
 
3118
                _g_free0 (desktop_id);
 
3119
                return result;
 
3120
        } else {
 
3121
                GHashTable* _tmp18_;
 
3122
                const gchar* _tmp19_;
 
3123
                gconstpointer _tmp20_ = NULL;
2812
3124
                GIcon* _tmp21_;
2813
 
                _tmp16_ = pkginfo;
2814
 
                _tmp17_ = _tmp16_->icon;
2815
 
                _tmp18_ = g_file_new_for_path (_tmp17_);
2816
 
                _tmp19_ = _tmp18_;
2817
 
                _tmp20_ = (GFileIcon*) g_file_icon_new (_tmp19_);
2818
 
                _tmp21_ = (GIcon*) _tmp20_;
2819
 
                _g_object_unref0 (_tmp19_);
2820
 
                result = _tmp21_;
2821
 
                _g_free0 (desktop_id);
2822
 
                return result;
2823
 
        } else {
2824
 
                GHashTable* _tmp22_;
2825
 
                UnityPackageInfo* _tmp23_;
2826
 
                const gchar* _tmp24_;
2827
 
                gconstpointer _tmp25_ = NULL;
2828
 
                GIcon* _tmp26_;
2829
3125
                GIcon* icon;
2830
 
                GIcon* _tmp27_;
 
3126
                GIcon* _tmp22_;
2831
3127
                gchar* path = NULL;
2832
 
                UnityPackageInfo* _tmp28_;
2833
 
                const gchar* _tmp29_;
2834
 
                gboolean _tmp30_ = FALSE;
2835
 
                _tmp22_ = self->priv->file_icon_cache;
2836
 
                _tmp23_ = pkginfo;
2837
 
                _tmp24_ = _tmp23_->icon;
2838
 
                _tmp25_ = g_hash_table_lookup (_tmp22_, _tmp24_);
2839
 
                _tmp26_ = _g_object_ref0 ((GIcon*) _tmp25_);
2840
 
                icon = _tmp26_;
2841
 
                _tmp27_ = icon;
2842
 
                if (_tmp27_ != NULL) {
 
3128
                const gchar* _tmp23_;
 
3129
                gboolean _tmp24_ = FALSE;
 
3130
                _tmp18_ = self->priv->file_icon_cache;
 
3131
                _tmp19_ = icon_name;
 
3132
                _tmp20_ = g_hash_table_lookup (_tmp18_, _tmp19_);
 
3133
                _tmp21_ = _g_object_ref0 ((GIcon*) _tmp20_);
 
3134
                icon = _tmp21_;
 
3135
                _tmp22_ = icon;
 
3136
                if (_tmp22_ != NULL) {
2843
3137
                        result = icon;
2844
3138
                        _g_free0 (desktop_id);
2845
3139
                        return result;
2846
3140
                }
2847
 
                _tmp28_ = pkginfo;
2848
 
                _tmp29_ = _tmp28_->icon;
2849
 
                _tmp30_ = string_contains (_tmp29_, ".");
2850
 
                if (_tmp30_) {
2851
 
                        const gchar* _tmp31_ = NULL;
2852
 
                        UnityPackageInfo* _tmp32_;
2853
 
                        const gchar* _tmp33_;
2854
 
                        const gchar* _tmp34_ = NULL;
2855
 
                        gchar* _tmp35_ = NULL;
2856
 
                        const gchar* _tmp36_;
2857
 
                        gboolean _tmp37_ = FALSE;
2858
 
                        const gchar* _tmp48_ = NULL;
2859
 
                        UnityPackageInfo* _tmp49_;
2860
 
                        const gchar* _tmp50_;
2861
 
                        gchar* _tmp51_ = NULL;
2862
 
                        const gchar* _tmp52_;
2863
 
                        gboolean _tmp53_ = FALSE;
2864
 
                        _tmp31_ = string_to_string (CONFIG_DATADIR);
2865
 
                        _tmp32_ = pkginfo;
2866
 
                        _tmp33_ = _tmp32_->icon;
2867
 
                        _tmp34_ = string_to_string (_tmp33_);
2868
 
                        _tmp35_ = g_strconcat (_tmp31_, "/app-install/icons/", _tmp34_, NULL);
 
3141
                _tmp23_ = icon_name;
 
3142
                _tmp24_ = string_contains (_tmp23_, ".");
 
3143
                if (_tmp24_) {
 
3144
                        const gchar* _tmp25_ = NULL;
 
3145
                        const gchar* _tmp26_;
 
3146
                        const gchar* _tmp27_ = NULL;
 
3147
                        gchar* _tmp28_ = NULL;
 
3148
                        const gchar* _tmp29_;
 
3149
                        gboolean _tmp30_ = FALSE;
 
3150
                        const gchar* _tmp40_ = NULL;
 
3151
                        const gchar* _tmp41_;
 
3152
                        gchar* _tmp42_ = NULL;
 
3153
                        const gchar* _tmp43_;
 
3154
                        gboolean _tmp44_ = FALSE;
 
3155
                        _tmp25_ = string_to_string (CONFIG_DATADIR);
 
3156
                        _tmp26_ = icon_name;
 
3157
                        _tmp27_ = string_to_string (_tmp26_);
 
3158
                        _tmp28_ = g_strconcat (_tmp25_, "/app-install/icons/", _tmp27_, NULL);
2869
3159
                        _g_free0 (path);
2870
 
                        path = _tmp35_;
2871
 
                        _tmp36_ = path;
2872
 
                        _tmp37_ = g_file_test (_tmp36_, G_FILE_TEST_EXISTS);
2873
 
                        if (_tmp37_) {
2874
 
                                const gchar* _tmp38_;
2875
 
                                GFile* _tmp39_ = NULL;
2876
 
                                GFile* _tmp40_;
2877
 
                                GFileIcon* _tmp41_;
2878
 
                                GHashTable* _tmp42_;
2879
 
                                UnityPackageInfo* _tmp43_;
2880
 
                                const gchar* _tmp44_;
2881
 
                                gchar* _tmp45_;
2882
 
                                GIcon* _tmp46_;
2883
 
                                GIcon* _tmp47_;
2884
 
                                _tmp38_ = path;
2885
 
                                _tmp39_ = g_file_new_for_path (_tmp38_);
2886
 
                                _tmp40_ = _tmp39_;
2887
 
                                _tmp41_ = (GFileIcon*) g_file_icon_new (_tmp40_);
 
3160
                        path = _tmp28_;
 
3161
                        _tmp29_ = path;
 
3162
                        _tmp30_ = g_file_test (_tmp29_, G_FILE_TEST_EXISTS);
 
3163
                        if (_tmp30_) {
 
3164
                                const gchar* _tmp31_;
 
3165
                                GFile* _tmp32_ = NULL;
 
3166
                                GFile* _tmp33_;
 
3167
                                GFileIcon* _tmp34_;
 
3168
                                GHashTable* _tmp35_;
 
3169
                                const gchar* _tmp36_;
 
3170
                                gchar* _tmp37_;
 
3171
                                GIcon* _tmp38_;
 
3172
                                GIcon* _tmp39_;
 
3173
                                _tmp31_ = path;
 
3174
                                _tmp32_ = g_file_new_for_path (_tmp31_);
 
3175
                                _tmp33_ = _tmp32_;
 
3176
                                _tmp34_ = (GFileIcon*) g_file_icon_new (_tmp33_);
2888
3177
                                _g_object_unref0 (icon);
2889
 
                                icon = (GIcon*) _tmp41_;
2890
 
                                _g_object_unref0 (_tmp40_);
2891
 
                                _tmp42_ = self->priv->file_icon_cache;
2892
 
                                _tmp43_ = pkginfo;
2893
 
                                _tmp44_ = _tmp43_->icon;
2894
 
                                _tmp45_ = g_strdup (_tmp44_);
2895
 
                                _tmp46_ = icon;
2896
 
                                _tmp47_ = _g_object_ref0 (_tmp46_);
2897
 
                                g_hash_table_insert (_tmp42_, _tmp45_, _tmp47_);
 
3178
                                icon = (GIcon*) _tmp34_;
 
3179
                                _g_object_unref0 (_tmp33_);
 
3180
                                _tmp35_ = self->priv->file_icon_cache;
 
3181
                                _tmp36_ = icon_name;
 
3182
                                _tmp37_ = g_strdup (_tmp36_);
 
3183
                                _tmp38_ = icon;
 
3184
                                _tmp39_ = _g_object_ref0 (_tmp38_);
 
3185
                                g_hash_table_insert (_tmp35_, _tmp37_, _tmp39_);
2898
3186
                                result = icon;
2899
3187
                                _g_free0 (path);
2900
3188
                                _g_free0 (desktop_id);
2901
3189
                                return result;
2902
3190
                        }
2903
 
                        _tmp48_ = g_get_user_cache_dir ();
2904
 
                        _tmp49_ = pkginfo;
2905
 
                        _tmp50_ = _tmp49_->icon;
2906
 
                        _tmp51_ = g_build_filename (_tmp48_, "software-center", "icons", _tmp50_, NULL);
 
3191
                        _tmp40_ = g_get_user_cache_dir ();
 
3192
                        _tmp41_ = icon_name;
 
3193
                        _tmp42_ = g_build_filename (_tmp40_, "software-center", "icons", _tmp41_, NULL);
2907
3194
                        _g_free0 (path);
2908
 
                        path = _tmp51_;
2909
 
                        _tmp52_ = path;
2910
 
                        _tmp53_ = g_file_test (_tmp52_, G_FILE_TEST_EXISTS);
2911
 
                        if (_tmp53_) {
2912
 
                                const gchar* _tmp54_;
2913
 
                                GFile* _tmp55_ = NULL;
2914
 
                                GFile* _tmp56_;
2915
 
                                GFileIcon* _tmp57_;
2916
 
                                GHashTable* _tmp58_;
2917
 
                                UnityPackageInfo* _tmp59_;
2918
 
                                const gchar* _tmp60_;
2919
 
                                gchar* _tmp61_;
2920
 
                                GIcon* _tmp62_;
2921
 
                                GIcon* _tmp63_;
2922
 
                                _tmp54_ = path;
2923
 
                                _tmp55_ = g_file_new_for_path (_tmp54_);
2924
 
                                _tmp56_ = _tmp55_;
2925
 
                                _tmp57_ = (GFileIcon*) g_file_icon_new (_tmp56_);
 
3195
                        path = _tmp42_;
 
3196
                        _tmp43_ = path;
 
3197
                        _tmp44_ = g_file_test (_tmp43_, G_FILE_TEST_EXISTS);
 
3198
                        if (_tmp44_) {
 
3199
                                const gchar* _tmp45_;
 
3200
                                GFile* _tmp46_ = NULL;
 
3201
                                GFile* _tmp47_;
 
3202
                                GFileIcon* _tmp48_;
 
3203
                                GHashTable* _tmp49_;
 
3204
                                const gchar* _tmp50_;
 
3205
                                gchar* _tmp51_;
 
3206
                                GIcon* _tmp52_;
 
3207
                                GIcon* _tmp53_;
 
3208
                                _tmp45_ = path;
 
3209
                                _tmp46_ = g_file_new_for_path (_tmp45_);
 
3210
                                _tmp47_ = _tmp46_;
 
3211
                                _tmp48_ = (GFileIcon*) g_file_icon_new (_tmp47_);
2926
3212
                                _g_object_unref0 (icon);
2927
 
                                icon = (GIcon*) _tmp57_;
2928
 
                                _g_object_unref0 (_tmp56_);
2929
 
                                _tmp58_ = self->priv->file_icon_cache;
2930
 
                                _tmp59_ = pkginfo;
2931
 
                                _tmp60_ = _tmp59_->icon;
2932
 
                                _tmp61_ = g_strdup (_tmp60_);
2933
 
                                _tmp62_ = icon;
2934
 
                                _tmp63_ = _g_object_ref0 (_tmp62_);
2935
 
                                g_hash_table_insert (_tmp58_, _tmp61_, _tmp63_);
 
3213
                                icon = (GIcon*) _tmp48_;
 
3214
                                _g_object_unref0 (_tmp47_);
 
3215
                                _tmp49_ = self->priv->file_icon_cache;
 
3216
                                _tmp50_ = icon_name;
 
3217
                                _tmp51_ = g_strdup (_tmp50_);
 
3218
                                _tmp52_ = icon;
 
3219
                                _tmp53_ = _g_object_ref0 (_tmp52_);
 
3220
                                g_hash_table_insert (_tmp49_, _tmp51_, _tmp53_);
2936
3221
                                result = icon;
2937
3222
                                _g_free0 (path);
2938
3223
                                _g_free0 (desktop_id);
2940
3225
                        }
2941
3226
                }
2942
3227
                {
2943
 
                        GeeList* _tmp64_;
2944
 
                        GeeList* _tmp65_;
 
3228
                        GeeList* _tmp54_;
 
3229
                        GeeList* _tmp55_;
2945
3230
                        GeeList* _ext_list;
2946
 
                        GeeList* _tmp66_;
2947
 
                        gint _tmp67_;
2948
 
                        gint _tmp68_;
 
3231
                        GeeList* _tmp56_;
 
3232
                        gint _tmp57_;
 
3233
                        gint _tmp58_;
2949
3234
                        gint _ext_size;
2950
3235
                        gint _ext_index;
2951
 
                        _tmp64_ = self->priv->image_extensions;
2952
 
                        _tmp65_ = _g_object_ref0 (_tmp64_);
2953
 
                        _ext_list = _tmp65_;
2954
 
                        _tmp66_ = _ext_list;
2955
 
                        _tmp67_ = gee_collection_get_size ((GeeCollection*) _tmp66_);
2956
 
                        _tmp68_ = _tmp67_;
2957
 
                        _ext_size = _tmp68_;
 
3236
                        _tmp54_ = self->priv->image_extensions;
 
3237
                        _tmp55_ = _g_object_ref0 (_tmp54_);
 
3238
                        _ext_list = _tmp55_;
 
3239
                        _tmp56_ = _ext_list;
 
3240
                        _tmp57_ = gee_collection_get_size ((GeeCollection*) _tmp56_);
 
3241
                        _tmp58_ = _tmp57_;
 
3242
                        _ext_size = _tmp58_;
2958
3243
                        _ext_index = -1;
2959
3244
                        while (TRUE) {
2960
 
                                gint _tmp69_;
2961
 
                                gint _tmp70_;
2962
 
                                gint _tmp71_;
2963
 
                                GeeList* _tmp72_;
2964
 
                                gint _tmp73_;
2965
 
                                gpointer _tmp74_ = NULL;
 
3245
                                gint _tmp59_;
 
3246
                                gint _tmp60_;
 
3247
                                gint _tmp61_;
 
3248
                                GeeList* _tmp62_;
 
3249
                                gint _tmp63_;
 
3250
                                gpointer _tmp64_ = NULL;
2966
3251
                                gchar* ext;
2967
 
                                const gchar* _tmp75_ = NULL;
2968
 
                                UnityPackageInfo* _tmp76_;
2969
 
                                const gchar* _tmp77_;
2970
 
                                const gchar* _tmp78_ = NULL;
2971
 
                                const gchar* _tmp79_;
2972
 
                                const gchar* _tmp80_ = NULL;
2973
 
                                gchar* _tmp81_ = NULL;
2974
 
                                const gchar* _tmp82_;
2975
 
                                gboolean _tmp83_ = FALSE;
2976
 
                                _tmp69_ = _ext_index;
2977
 
                                _ext_index = _tmp69_ + 1;
2978
 
                                _tmp70_ = _ext_index;
2979
 
                                _tmp71_ = _ext_size;
2980
 
                                if (!(_tmp70_ < _tmp71_)) {
 
3252
                                const gchar* _tmp65_ = NULL;
 
3253
                                const gchar* _tmp66_;
 
3254
                                const gchar* _tmp67_ = NULL;
 
3255
                                const gchar* _tmp68_;
 
3256
                                const gchar* _tmp69_ = NULL;
 
3257
                                gchar* _tmp70_ = NULL;
 
3258
                                const gchar* _tmp71_;
 
3259
                                gboolean _tmp72_ = FALSE;
 
3260
                                _tmp59_ = _ext_index;
 
3261
                                _ext_index = _tmp59_ + 1;
 
3262
                                _tmp60_ = _ext_index;
 
3263
                                _tmp61_ = _ext_size;
 
3264
                                if (!(_tmp60_ < _tmp61_)) {
2981
3265
                                        break;
2982
3266
                                }
2983
 
                                _tmp72_ = _ext_list;
2984
 
                                _tmp73_ = _ext_index;
2985
 
                                _tmp74_ = gee_list_get (_tmp72_, _tmp73_);
2986
 
                                ext = (gchar*) _tmp74_;
2987
 
                                _tmp75_ = string_to_string (CONFIG_DATADIR);
2988
 
                                _tmp76_ = pkginfo;
2989
 
                                _tmp77_ = _tmp76_->icon;
2990
 
                                _tmp78_ = string_to_string (_tmp77_);
2991
 
                                _tmp79_ = ext;
2992
 
                                _tmp80_ = string_to_string (_tmp79_);
2993
 
                                _tmp81_ = g_strconcat (_tmp75_, "/app-install/icons/", _tmp78_, ".", _tmp80_, NULL);
 
3267
                                _tmp62_ = _ext_list;
 
3268
                                _tmp63_ = _ext_index;
 
3269
                                _tmp64_ = gee_list_get (_tmp62_, _tmp63_);
 
3270
                                ext = (gchar*) _tmp64_;
 
3271
                                _tmp65_ = string_to_string (CONFIG_DATADIR);
 
3272
                                _tmp66_ = icon_name;
 
3273
                                _tmp67_ = string_to_string (_tmp66_);
 
3274
                                _tmp68_ = ext;
 
3275
                                _tmp69_ = string_to_string (_tmp68_);
 
3276
                                _tmp70_ = g_strconcat (_tmp65_, "/app-install/icons/", _tmp67_, ".", _tmp69_, NULL);
2994
3277
                                _g_free0 (path);
2995
 
                                path = _tmp81_;
2996
 
                                _tmp82_ = path;
2997
 
                                _tmp83_ = g_file_test (_tmp82_, G_FILE_TEST_EXISTS);
2998
 
                                if (_tmp83_) {
2999
 
                                        const gchar* _tmp84_;
3000
 
                                        GFile* _tmp85_ = NULL;
3001
 
                                        GFile* _tmp86_;
3002
 
                                        GFileIcon* _tmp87_;
3003
 
                                        GHashTable* _tmp88_;
3004
 
                                        UnityPackageInfo* _tmp89_;
3005
 
                                        const gchar* _tmp90_;
3006
 
                                        gchar* _tmp91_;
3007
 
                                        GIcon* _tmp92_;
3008
 
                                        GIcon* _tmp93_;
3009
 
                                        _tmp84_ = path;
3010
 
                                        _tmp85_ = g_file_new_for_path (_tmp84_);
3011
 
                                        _tmp86_ = _tmp85_;
3012
 
                                        _tmp87_ = (GFileIcon*) g_file_icon_new (_tmp86_);
 
3278
                                path = _tmp70_;
 
3279
                                _tmp71_ = path;
 
3280
                                _tmp72_ = g_file_test (_tmp71_, G_FILE_TEST_EXISTS);
 
3281
                                if (_tmp72_) {
 
3282
                                        const gchar* _tmp73_;
 
3283
                                        GFile* _tmp74_ = NULL;
 
3284
                                        GFile* _tmp75_;
 
3285
                                        GFileIcon* _tmp76_;
 
3286
                                        GHashTable* _tmp77_;
 
3287
                                        const gchar* _tmp78_;
 
3288
                                        gchar* _tmp79_;
 
3289
                                        GIcon* _tmp80_;
 
3290
                                        GIcon* _tmp81_;
 
3291
                                        _tmp73_ = path;
 
3292
                                        _tmp74_ = g_file_new_for_path (_tmp73_);
 
3293
                                        _tmp75_ = _tmp74_;
 
3294
                                        _tmp76_ = (GFileIcon*) g_file_icon_new (_tmp75_);
3013
3295
                                        _g_object_unref0 (icon);
3014
 
                                        icon = (GIcon*) _tmp87_;
3015
 
                                        _g_object_unref0 (_tmp86_);
3016
 
                                        _tmp88_ = self->priv->file_icon_cache;
3017
 
                                        _tmp89_ = pkginfo;
3018
 
                                        _tmp90_ = _tmp89_->icon;
3019
 
                                        _tmp91_ = g_strdup (_tmp90_);
3020
 
                                        _tmp92_ = icon;
3021
 
                                        _tmp93_ = _g_object_ref0 (_tmp92_);
3022
 
                                        g_hash_table_insert (_tmp88_, _tmp91_, _tmp93_);
 
3296
                                        icon = (GIcon*) _tmp76_;
 
3297
                                        _g_object_unref0 (_tmp75_);
 
3298
                                        _tmp77_ = self->priv->file_icon_cache;
 
3299
                                        _tmp78_ = icon_name;
 
3300
                                        _tmp79_ = g_strdup (_tmp78_);
 
3301
                                        _tmp80_ = icon;
 
3302
                                        _tmp81_ = _g_object_ref0 (_tmp80_);
 
3303
                                        g_hash_table_insert (_tmp77_, _tmp79_, _tmp81_);
3023
3304
                                        result = icon;
3024
3305
                                        _g_free0 (ext);
3025
3306
                                        _g_object_unref0 (_ext_list);
3034
3315
                _g_free0 (path);
3035
3316
                _g_object_unref0 (icon);
3036
3317
        }
3037
 
        _tmp94_ = (GThemedIcon*) g_themed_icon_new ("applications-other");
3038
 
        icon = _tmp94_;
3039
 
        _tmp95_ = self->priv->file_icon_cache;
3040
 
        _tmp96_ = pkginfo;
3041
 
        _tmp97_ = _tmp96_->icon;
3042
 
        _tmp98_ = g_strdup (_tmp97_);
3043
 
        _tmp99_ = icon;
3044
 
        _tmp100_ = _g_object_ref0 ((GIcon*) _tmp99_);
3045
 
        g_hash_table_insert (_tmp95_, _tmp98_, _tmp100_);
 
3318
        _tmp82_ = (GThemedIcon*) g_themed_icon_new ("applications-other");
 
3319
        icon = _tmp82_;
 
3320
        _tmp83_ = self->priv->file_icon_cache;
 
3321
        _tmp84_ = icon_name;
 
3322
        _tmp85_ = g_strdup (_tmp84_);
 
3323
        _tmp86_ = icon;
 
3324
        _tmp87_ = _g_object_ref0 ((GIcon*) _tmp86_);
 
3325
        g_hash_table_insert (_tmp83_, _tmp85_, _tmp87_);
3046
3326
        result = (GIcon*) icon;
3047
3327
        _g_free0 (desktop_id);
3048
3328
        return result;
3176
3456
                regex = _tmp4_;
3177
3457
                if (_inner_error_ != NULL) {
3178
3458
                        if (_inner_error_->domain == G_REGEX_ERROR) {
3179
 
                                goto __catch5_g_regex_error;
 
3459
                                goto __catch6_g_regex_error;
3180
3460
                        }
3181
3461
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
3182
3462
                        g_clear_error (&_inner_error_);
3189
3469
                if (_inner_error_ != NULL) {
3190
3470
                        _g_regex_unref0 (regex);
3191
3471
                        if (_inner_error_->domain == G_REGEX_ERROR) {
3192
 
                                goto __catch5_g_regex_error;
 
3472
                                goto __catch6_g_regex_error;
3193
3473
                        }
3194
3474
                        _g_regex_unref0 (regex);
3195
3475
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
3200
3480
                _g_regex_unref0 (regex);
3201
3481
                return result;
3202
3482
        }
3203
 
        goto __finally5;
3204
 
        __catch5_g_regex_error:
 
3483
        goto __finally6;
 
3484
        __catch6_g_regex_error:
3205
3485
        {
3206
3486
                GError* e = NULL;
3207
3487
                e = _inner_error_;
3209
3489
                g_assert_not_reached ();
3210
3490
                _g_error_free0 (e);
3211
3491
        }
3212
 
        __finally5:
 
3492
        __finally6:
3213
3493
        if (_inner_error_ != NULL) {
3214
3494
                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);
3215
3495
                g_clear_error (&_inner_error_);
3399
3679
}
3400
3680
 
3401
3681
 
 
3682
/**
 
3683
     * Sanitize executable name -- make it suitable for Home Lens. 
 
3684
     */
 
3685
static gchar* unity_applications_lens_daemon_sanitize_binary_name (const gchar* name) {
 
3686
        gchar* result = NULL;
 
3687
        const gchar* _tmp0_;
 
3688
        gchar* _tmp1_ = NULL;
 
3689
        g_return_val_if_fail (name != NULL, NULL);
 
3690
        _tmp0_ = name;
 
3691
        _tmp1_ = g_path_get_basename (_tmp0_);
 
3692
        result = _tmp1_;
 
3693
        return result;
 
3694
}
 
3695
 
 
3696
 
 
3697
static gchar* unity_applications_lens_daemon_get_annotated_icon (UnityApplicationsLensDaemon* self, GIcon* app_icon, const gchar* price, gboolean paid) {
 
3698
        gchar* result = NULL;
 
3699
        GIcon* _tmp0_;
 
3700
        UnityAnnotatedIcon* _tmp1_;
 
3701
        UnityAnnotatedIcon* annotated_icon;
 
3702
        UnityAnnotatedIcon* _tmp2_;
 
3703
        gboolean _tmp3_ = FALSE;
 
3704
        const gchar* _tmp4_;
 
3705
        gboolean _tmp6_;
 
3706
        UnityAnnotatedIcon* _tmp14_;
 
3707
        gchar* _tmp15_ = NULL;
 
3708
        g_return_val_if_fail (self != NULL, NULL);
 
3709
        g_return_val_if_fail (app_icon != NULL, NULL);
 
3710
        g_return_val_if_fail (price != NULL, NULL);
 
3711
        _tmp0_ = app_icon;
 
3712
        _tmp1_ = unity_annotated_icon_new (_tmp0_);
 
3713
        annotated_icon = _tmp1_;
 
3714
        _tmp2_ = annotated_icon;
 
3715
        unity_annotated_icon_set_category (_tmp2_, UNITY_CATEGORY_TYPE_APPLICATION);
 
3716
        _tmp4_ = price;
 
3717
        if (_tmp4_ != NULL) {
 
3718
                const gchar* _tmp5_;
 
3719
                _tmp5_ = price;
 
3720
                _tmp3_ = g_strcmp0 (_tmp5_, "") != 0;
 
3721
        } else {
 
3722
                _tmp3_ = FALSE;
 
3723
        }
 
3724
        _tmp6_ = _tmp3_;
 
3725
        if (_tmp6_) {
 
3726
                gboolean _tmp7_;
 
3727
                _tmp7_ = paid;
 
3728
                if (_tmp7_) {
 
3729
                        UnityAnnotatedIcon* _tmp8_;
 
3730
                        const gchar* _tmp9_ = NULL;
 
3731
                        _tmp8_ = annotated_icon;
 
3732
                        _tmp9_ = _ ("Paid");
 
3733
                        unity_annotated_icon_set_ribbon (_tmp8_, _tmp9_);
 
3734
                } else {
 
3735
                        UnityAnnotatedIcon* _tmp10_;
 
3736
                        const gchar* _tmp11_;
 
3737
                        _tmp10_ = annotated_icon;
 
3738
                        _tmp11_ = price;
 
3739
                        unity_annotated_icon_set_ribbon (_tmp10_, _tmp11_);
 
3740
                }
 
3741
        } else {
 
3742
                UnityAnnotatedIcon* _tmp12_;
 
3743
                const gchar* _tmp13_ = NULL;
 
3744
                _tmp12_ = annotated_icon;
 
3745
                _tmp13_ = _ ("Free");
 
3746
                unity_annotated_icon_set_ribbon (_tmp12_, _tmp13_);
 
3747
        }
 
3748
        _tmp14_ = annotated_icon;
 
3749
        _tmp15_ = unity_annotated_icon_to_string (_tmp14_);
 
3750
        result = _tmp15_;
 
3751
        _g_object_unref0 (annotated_icon);
 
3752
        return result;
 
3753
}
 
3754
 
 
3755
 
 
3756
/**
 
3757
     * Add all results obtained from SoftwareCenterDataProvider
 
3758
     */
 
3759
static guint unity_applications_lens_daemon_add_sc_category_results (UnityApplicationsLensDaemon* self, UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** results, int results_length1, DeeModel* model, UnityApplicationsLensCategory category, GeeSet** duplicates_lookup, guint max_results) {
 
3760
        guint result = 0U;
 
3761
        guint i;
 
3762
        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** _tmp0_;
 
3763
        gint _tmp0__length1;
 
3764
        g_return_val_if_fail (self != NULL, 0U);
 
3765
        g_return_val_if_fail (model != NULL, 0U);
 
3766
        g_return_val_if_fail (*duplicates_lookup != NULL, 0U);
 
3767
        i = (guint) 0;
 
3768
        _tmp0_ = results;
 
3769
        _tmp0__length1 = results_length1;
 
3770
        {
 
3771
                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo** app_collection = NULL;
 
3772
                gint app_collection_length1 = 0;
 
3773
                gint _app_collection_size_ = 0;
 
3774
                gint app_it = 0;
 
3775
                app_collection = _tmp0_;
 
3776
                app_collection_length1 = _tmp0__length1;
 
3777
                for (app_it = 0; app_it < _tmp0__length1; app_it = app_it + 1) {
 
3778
                        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp1_ = {0};
 
3779
                        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo app = {0};
 
3780
                        unity_applications_lens_software_center_data_provider_service_app_info_copy (app_collection[app_it], &_tmp1_);
 
3781
                        app = _tmp1_;
 
3782
                        {
 
3783
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp2_;
 
3784
                                const gchar* _tmp3_;
 
3785
                                const gchar* _tmp4_ = NULL;
 
3786
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp5_;
 
3787
                                const gchar* _tmp6_;
 
3788
                                const gchar* _tmp7_ = NULL;
 
3789
                                gchar* _tmp8_ = NULL;
 
3790
                                gchar* uri;
 
3791
                                GeeSet* _tmp9_;
 
3792
                                const gchar* _tmp10_;
 
3793
                                gboolean _tmp11_ = FALSE;
 
3794
                                gchar* icon_obj = NULL;
 
3795
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp12_;
 
3796
                                const gchar* _tmp13_;
 
3797
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp14_;
 
3798
                                const gchar* _tmp15_;
 
3799
                                GIcon* _tmp16_ = NULL;
 
3800
                                GIcon* app_icon;
 
3801
                                UnityApplicationsLensPurchaseInfoHelper* _tmp17_;
 
3802
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp18_;
 
3803
                                const gchar* _tmp19_;
 
3804
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp20_;
 
3805
                                const gchar* _tmp21_;
 
3806
                                UnityApplicationsLensPurchaseInfoHelperAppInfo* _tmp22_ = NULL;
 
3807
                                UnityApplicationsLensPurchaseInfoHelperAppInfo* pinfo;
 
3808
                                UnityApplicationsLensPurchaseInfoHelperAppInfo* _tmp23_;
 
3809
                                DeeModel* _tmp39_;
 
3810
                                const gchar* _tmp40_;
 
3811
                                const gchar* _tmp41_;
 
3812
                                UnityApplicationsLensCategory _tmp42_;
 
3813
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp43_;
 
3814
                                const gchar* _tmp44_;
 
3815
                                UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp45_;
 
3816
                                const gchar* _tmp46_;
 
3817
                                gchar* _tmp47_;
 
3818
                                gchar* _tmp48_;
 
3819
                                GeeSet* _tmp49_;
 
3820
                                const gchar* _tmp50_;
 
3821
                                guint _tmp51_;
 
3822
                                guint _tmp52_;
 
3823
                                guint _tmp53_;
 
3824
                                _tmp2_ = app;
 
3825
                                _tmp3_ = _tmp2_.package_name;
 
3826
                                _tmp4_ = string_to_string (_tmp3_);
 
3827
                                _tmp5_ = app;
 
3828
                                _tmp6_ = _tmp5_.application_name;
 
3829
                                _tmp7_ = string_to_string (_tmp6_);
 
3830
                                _tmp8_ = g_strconcat ("unity-install://", _tmp4_, "/", _tmp7_, NULL);
 
3831
                                uri = _tmp8_;
 
3832
                                _tmp9_ = *duplicates_lookup;
 
3833
                                _tmp10_ = uri;
 
3834
                                _tmp11_ = gee_collection_contains ((GeeCollection*) _tmp9_, _tmp10_);
 
3835
                                if (_tmp11_) {
 
3836
                                        _g_free0 (uri);
 
3837
                                        unity_applications_lens_software_center_data_provider_service_app_info_destroy (&app);
 
3838
                                        continue;
 
3839
                                }
 
3840
                                _tmp12_ = app;
 
3841
                                _tmp13_ = _tmp12_.desktop_file;
 
3842
                                _tmp14_ = app;
 
3843
                                _tmp15_ = _tmp14_.icon;
 
3844
                                _tmp16_ = unity_applications_lens_daemon_find_pkg_icon (self, _tmp13_, _tmp15_);
 
3845
                                app_icon = _tmp16_;
 
3846
                                _tmp17_ = self->priv->purchase_info;
 
3847
                                _tmp18_ = app;
 
3848
                                _tmp19_ = _tmp18_.application_name;
 
3849
                                _tmp20_ = app;
 
3850
                                _tmp21_ = _tmp20_.package_name;
 
3851
                                _tmp22_ = unity_applications_lens_purchase_info_helper_find (_tmp17_, _tmp19_, _tmp21_);
 
3852
                                pinfo = _tmp22_;
 
3853
                                _tmp23_ = pinfo;
 
3854
                                if (_tmp23_ != NULL) {
 
3855
                                        GIcon* _tmp24_;
 
3856
                                        UnityApplicationsLensPurchaseInfoHelperAppInfo* _tmp25_;
 
3857
                                        const gchar* _tmp26_;
 
3858
                                        UnityApplicationsLensPurchaseInfoHelperAppInfo* _tmp27_;
 
3859
                                        gboolean _tmp28_;
 
3860
                                        gchar* _tmp29_ = NULL;
 
3861
                                        gchar* annotated_icon;
 
3862
                                        const gchar* _tmp30_;
 
3863
                                        const gchar* _tmp31_ = NULL;
 
3864
                                        gchar* _tmp32_;
 
3865
                                        _tmp24_ = app_icon;
 
3866
                                        _tmp25_ = pinfo;
 
3867
                                        _tmp26_ = (*_tmp25_).formatted_price;
 
3868
                                        _tmp27_ = pinfo;
 
3869
                                        _tmp28_ = (*_tmp27_).paid;
 
3870
                                        _tmp29_ = unity_applications_lens_daemon_get_annotated_icon (self, _tmp24_, _tmp26_, _tmp28_);
 
3871
                                        annotated_icon = _tmp29_;
 
3872
                                        _tmp30_ = annotated_icon;
 
3873
                                        _tmp31_ = string_to_string (_tmp30_);
 
3874
                                        _tmp32_ = g_strdup (_tmp31_);
 
3875
                                        _g_free0 (icon_obj);
 
3876
                                        icon_obj = _tmp32_;
 
3877
                                        _g_free0 (annotated_icon);
 
3878
                                } else {
 
3879
                                        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp33_;
 
3880
                                        const gchar* _tmp34_;
 
3881
                                        UnityApplicationsLensSoftwareCenterDataProviderServiceAppInfo _tmp35_;
 
3882
                                        const gchar* _tmp36_;
 
3883
                                        GIcon* _tmp37_;
 
3884
                                        gchar* _tmp38_ = NULL;
 
3885
                                        _tmp33_ = app;
 
3886
                                        _tmp34_ = _tmp33_.application_name;
 
3887
                                        _tmp35_ = app;
 
3888
                                        _tmp36_ = _tmp35_.package_name;
 
3889
                                        g_warning ("daemon.vala:989: No purchase info for: %s, %s", _tmp34_, _tmp36_);
 
3890
                                        _tmp37_ = app_icon;
 
3891
                                        _tmp38_ = g_icon_to_string (_tmp37_);
 
3892
                                        _g_free0 (icon_obj);
 
3893
                                        icon_obj = _tmp38_;
 
3894
                                }
 
3895
                                _tmp39_ = model;
 
3896
                                _tmp40_ = uri;
 
3897
                                _tmp41_ = icon_obj;
 
3898
                                _tmp42_ = category;
 
3899
                                _tmp43_ = app;
 
3900
                                _tmp44_ = _tmp43_.application_name;
 
3901
                                _tmp45_ = app;
 
3902
                                _tmp46_ = _tmp45_.desktop_file;
 
3903
                                _tmp47_ = g_strconcat ("file://", _tmp46_, NULL);
 
3904
                                _tmp48_ = _tmp47_;
 
3905
                                dee_model_append (_tmp39_, _tmp40_, _tmp41_, _tmp42_, "application/x-desktop", _tmp44_, "", _tmp48_, NULL);
 
3906
                                _g_free0 (_tmp48_);
 
3907
                                _tmp49_ = *duplicates_lookup;
 
3908
                                _tmp50_ = uri;
 
3909
                                gee_collection_add ((GeeCollection*) _tmp49_, _tmp50_);
 
3910
                                _tmp51_ = i;
 
3911
                                i = _tmp51_ + 1;
 
3912
                                _tmp52_ = i;
 
3913
                                _tmp53_ = max_results;
 
3914
                                if (_tmp52_ == _tmp53_) {
 
3915
                                        _unity_applications_lens_purchase_info_helper_app_info_free0 (pinfo);
 
3916
                                        _g_object_unref0 (app_icon);
 
3917
                                        _g_free0 (icon_obj);
 
3918
                                        _g_free0 (uri);
 
3919
                                        unity_applications_lens_software_center_data_provider_service_app_info_destroy (&app);
 
3920
                                        break;
 
3921
                                }
 
3922
                                _unity_applications_lens_purchase_info_helper_app_info_free0 (pinfo);
 
3923
                                _g_object_unref0 (app_icon);
 
3924
                                _g_free0 (icon_obj);
 
3925
                                _g_free0 (uri);
 
3926
                                unity_applications_lens_software_center_data_provider_service_app_info_destroy (&app);
 
3927
                        }
 
3928
                }
 
3929
        }
 
3930
        result = i;
 
3931
        return result;
 
3932
}
 
3933
 
 
3934
 
3402
3935
static void unity_applications_lens_daemon_add_pkg_search_result (UnityApplicationsLensDaemon* self, UnityPackageSearchResult* results, GeeSet* installed_uris, GeeSet* available_uris, DeeModel* model, UnityApplicationsLensCategory category, guint max_add) {
3403
3936
        UnityAppInfoManager* _tmp0_ = NULL;
3404
3937
        UnityAppInfoManager* appmanager;
3405
 
        UnityScope* _tmp1_;
3406
 
        UnityFilter* _tmp2_ = NULL;
3407
 
        UnityRatingsFilter* ratings_filter;
3408
3938
        guint n_added;
3409
 
        UnityPackageSearchResult* _tmp3_;
3410
 
        GSList* _tmp4_;
 
3939
        UnityPackageSearchResult* _tmp1_;
 
3940
        GSList* _tmp2_;
3411
3941
        g_return_if_fail (self != NULL);
3412
3942
        g_return_if_fail (results != NULL);
3413
3943
        g_return_if_fail (installed_uris != NULL);
3415
3945
        g_return_if_fail (model != NULL);
3416
3946
        _tmp0_ = unity_app_info_manager_get_default ();
3417
3947
        appmanager = _tmp0_;
3418
 
        _tmp1_ = self->priv->scope;
3419
 
        _tmp2_ = unity_scope_get_filter (_tmp1_, "rating");
3420
 
        ratings_filter = UNITY_IS_RATINGS_FILTER (_tmp2_) ? ((UnityRatingsFilter*) _tmp2_) : NULL;
3421
3948
        n_added = (guint) 0;
3422
 
        _tmp3_ = results;
3423
 
        _tmp4_ = _tmp3_->results;
 
3949
        _tmp1_ = results;
 
3950
        _tmp2_ = _tmp1_->results;
3424
3951
        {
3425
3952
                GSList* pkginfo_collection = NULL;
3426
3953
                GSList* pkginfo_it = NULL;
3427
 
                pkginfo_collection = _tmp4_;
 
3954
                pkginfo_collection = _tmp2_;
3428
3955
                for (pkginfo_it = pkginfo_collection; pkginfo_it != NULL; pkginfo_it = pkginfo_it->next) {
3429
3956
                        UnityPackageInfo* pkginfo = NULL;
3430
3957
                        pkginfo = (UnityPackageInfo*) pkginfo_it->data;
3431
3958
                        {
 
3959
                                UnityPackageInfo* _tmp3_;
 
3960
                                const gchar* _tmp4_;
3432
3961
                                UnityPackageInfo* _tmp5_;
3433
3962
                                const gchar* _tmp6_;
3434
 
                                UnityPackageInfo* _tmp7_;
3435
 
                                const gchar* _tmp8_;
3436
 
                                UnityApplicationsLensCategory _tmp9_;
3437
 
                                gchar* _tmp10_ = NULL;
 
3963
                                UnityApplicationsLensCategory _tmp7_;
 
3964
                                gchar* _tmp8_ = NULL;
3438
3965
                                gchar* desktop_id;
3439
3966
                                gchar* full_path = NULL;
3440
 
                                UnityAppInfoManager* _tmp11_;
3441
 
                                const gchar* _tmp12_;
3442
 
                                GAppInfo* _tmp13_ = NULL;
 
3967
                                UnityAppInfoManager* _tmp9_;
 
3968
                                const gchar* _tmp10_;
 
3969
                                GAppInfo* _tmp11_ = NULL;
3443
3970
                                GAppInfo* app;
3444
 
                                UnityAppInfoManager* _tmp14_;
 
3971
                                UnityAppInfoManager* _tmp12_;
 
3972
                                const gchar* _tmp13_;
 
3973
                                gchar* _tmp14_ = NULL;
3445
3974
                                const gchar* _tmp15_;
3446
 
                                gchar* _tmp16_ = NULL;
3447
 
                                const gchar* _tmp17_;
3448
 
                                const gchar* _tmp18_ = NULL;
3449
 
                                gchar* _tmp19_ = NULL;
 
3975
                                const gchar* _tmp16_ = NULL;
 
3976
                                gchar* _tmp17_ = NULL;
3450
3977
                                gchar* uri;
3451
 
                                gboolean _tmp20_ = FALSE;
3452
 
                                GeeSet* _tmp21_;
3453
 
                                const gchar* _tmp22_;
3454
 
                                gboolean _tmp23_ = FALSE;
3455
 
                                gboolean _tmp27_;
 
3978
                                gboolean _tmp18_ = FALSE;
 
3979
                                GeeSet* _tmp19_;
 
3980
                                const gchar* _tmp20_;
 
3981
                                gboolean _tmp21_ = FALSE;
 
3982
                                gboolean _tmp25_;
3456
3983
                                gchar* display_name = NULL;
3457
3984
                                gchar* comment = NULL;
3458
 
                                UnityApplicationsLensCategory _tmp28_;
3459
 
                                gboolean _tmp47_ = FALSE;
3460
 
                                GAppInfo* _tmp48_;
3461
 
                                gboolean _tmp51_;
3462
 
                                UnityApplicationsLensCategory _tmp52_;
3463
 
                                UnityPackageInfo* _tmp79_;
3464
 
                                GIcon* _tmp80_ = NULL;
 
3985
                                UnityApplicationsLensCategory _tmp26_;
 
3986
                                gboolean _tmp45_ = FALSE;
 
3987
                                GAppInfo* _tmp46_;
 
3988
                                gboolean _tmp49_;
 
3989
                                UnityPackageInfo* _tmp50_;
 
3990
                                const gchar* _tmp51_;
 
3991
                                UnityPackageInfo* _tmp52_;
 
3992
                                const gchar* _tmp53_;
 
3993
                                GIcon* _tmp54_ = NULL;
3465
3994
                                GIcon* icon;
3466
 
                                const gchar* _tmp81_ = NULL;
3467
 
                                const gchar* _tmp82_;
3468
 
                                const gchar* _tmp84_ = NULL;
3469
 
                                const gchar* _tmp85_;
3470
 
                                gchar* _tmp87_ = NULL;
3471
 
                                const gchar* _tmp88_;
3472
 
                                DeeModel* _tmp92_;
3473
 
                                const gchar* _tmp93_;
3474
 
                                GIcon* _tmp94_;
3475
 
                                gchar* _tmp95_ = NULL;
3476
 
                                gchar* _tmp96_;
3477
 
                                UnityApplicationsLensCategory _tmp97_;
3478
 
                                const gchar* _tmp98_;
3479
 
                                const gchar* _tmp99_;
3480
 
                                const gchar* _tmp100_;
3481
 
                                guint _tmp101_;
3482
 
                                gboolean _tmp102_ = FALSE;
3483
 
                                guint _tmp103_;
3484
 
                                gboolean _tmp106_;
 
3995
                                gchar* icon_str = NULL;
 
3996
                                UnityApplicationsLensCategory _tmp55_;
 
3997
                                const gchar* _tmp74_ = NULL;
 
3998
                                const gchar* _tmp75_;
 
3999
                                const gchar* _tmp77_ = NULL;
 
4000
                                const gchar* _tmp78_;
 
4001
                                gchar* _tmp80_ = NULL;
 
4002
                                const gchar* _tmp81_;
 
4003
                                DeeModel* _tmp85_;
 
4004
                                const gchar* _tmp86_;
 
4005
                                const gchar* _tmp87_;
 
4006
                                UnityApplicationsLensCategory _tmp88_;
 
4007
                                const gchar* _tmp89_;
 
4008
                                const gchar* _tmp90_;
 
4009
                                const gchar* _tmp91_;
 
4010
                                guint _tmp92_;
 
4011
                                gboolean _tmp93_ = FALSE;
 
4012
                                guint _tmp94_;
 
4013
                                gboolean _tmp97_;
 
4014
                                _tmp3_ = pkginfo;
 
4015
                                _tmp4_ = _tmp3_->desktop_file;
 
4016
                                if (_tmp4_ == NULL) {
 
4017
                                        continue;
 
4018
                                }
3485
4019
                                _tmp5_ = pkginfo;
3486
4020
                                _tmp6_ = _tmp5_->desktop_file;
3487
 
                                if (_tmp6_ == NULL) {
3488
 
                                        continue;
3489
 
                                }
3490
 
                                _tmp7_ = pkginfo;
3491
 
                                _tmp8_ = _tmp7_->desktop_file;
3492
 
                                _tmp9_ = category;
3493
 
                                _tmp10_ = unity_applications_lens_daemon_extract_desktop_id (self, _tmp8_, _tmp9_ == UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE);
3494
 
                                desktop_id = _tmp10_;
3495
 
                                _tmp11_ = appmanager;
3496
 
                                _tmp12_ = desktop_id;
3497
 
                                _tmp13_ = unity_app_info_manager_lookup (_tmp11_, _tmp12_);
3498
 
                                app = _tmp13_;
3499
 
                                _tmp14_ = appmanager;
 
4021
                                _tmp7_ = category;
 
4022
                                _tmp8_ = unity_applications_lens_daemon_extract_desktop_id (self, _tmp6_, _tmp7_ == UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE);
 
4023
                                desktop_id = _tmp8_;
 
4024
                                _tmp9_ = appmanager;
 
4025
                                _tmp10_ = desktop_id;
 
4026
                                _tmp11_ = unity_app_info_manager_lookup (_tmp9_, _tmp10_);
 
4027
                                app = _tmp11_;
 
4028
                                _tmp12_ = appmanager;
 
4029
                                _tmp13_ = desktop_id;
 
4030
                                _tmp14_ = unity_app_info_manager_get_path (_tmp12_, _tmp13_);
 
4031
                                _g_free0 (full_path);
 
4032
                                full_path = _tmp14_;
3500
4033
                                _tmp15_ = desktop_id;
3501
 
                                _tmp16_ = unity_app_info_manager_get_path (_tmp14_, _tmp15_);
3502
 
                                _g_free0 (full_path);
3503
 
                                full_path = _tmp16_;
3504
 
                                _tmp17_ = desktop_id;
3505
 
                                _tmp18_ = string_to_string (_tmp17_);
3506
 
                                _tmp19_ = g_strconcat ("application://", _tmp18_, NULL);
3507
 
                                uri = _tmp19_;
3508
 
                                _tmp21_ = installed_uris;
3509
 
                                _tmp22_ = uri;
3510
 
                                _tmp23_ = gee_collection_contains ((GeeCollection*) _tmp21_, _tmp22_);
3511
 
                                if (_tmp23_) {
3512
 
                                        _tmp20_ = TRUE;
 
4034
                                _tmp16_ = string_to_string (_tmp15_);
 
4035
                                _tmp17_ = g_strconcat ("application://", _tmp16_, NULL);
 
4036
                                uri = _tmp17_;
 
4037
                                _tmp19_ = installed_uris;
 
4038
                                _tmp20_ = uri;
 
4039
                                _tmp21_ = gee_collection_contains ((GeeCollection*) _tmp19_, _tmp20_);
 
4040
                                if (_tmp21_) {
 
4041
                                        _tmp18_ = TRUE;
3513
4042
                                } else {
3514
 
                                        GeeSet* _tmp24_;
3515
 
                                        const gchar* _tmp25_;
3516
 
                                        gboolean _tmp26_ = FALSE;
3517
 
                                        _tmp24_ = available_uris;
3518
 
                                        _tmp25_ = uri;
3519
 
                                        _tmp26_ = gee_collection_contains ((GeeCollection*) _tmp24_, _tmp25_);
3520
 
                                        _tmp20_ = _tmp26_;
 
4043
                                        GeeSet* _tmp22_;
 
4044
                                        const gchar* _tmp23_;
 
4045
                                        gboolean _tmp24_ = FALSE;
 
4046
                                        _tmp22_ = available_uris;
 
4047
                                        _tmp23_ = uri;
 
4048
                                        _tmp24_ = gee_collection_contains ((GeeCollection*) _tmp22_, _tmp23_);
 
4049
                                        _tmp18_ = _tmp24_;
3521
4050
                                }
3522
 
                                _tmp27_ = _tmp20_;
3523
 
                                if (_tmp27_) {
 
4051
                                _tmp25_ = _tmp18_;
 
4052
                                if (_tmp25_) {
3524
4053
                                        _g_free0 (uri);
3525
4054
                                        _g_object_unref0 (app);
3526
4055
                                        _g_free0 (full_path);
3527
4056
                                        _g_free0 (desktop_id);
3528
4057
                                        continue;
3529
4058
                                }
3530
 
                                _tmp28_ = category;
3531
 
                                switch (_tmp28_) {
 
4059
                                _tmp26_ = category;
 
4060
                                switch (_tmp26_) {
3532
4061
                                        case UNITY_APPLICATIONS_LENS_CATEGORY_INSTALLED:
3533
4062
                                        case UNITY_APPLICATIONS_LENS_CATEGORY_APPLICATIONS:
3534
4063
                                        {
3535
 
                                                GeeSet* _tmp29_;
3536
 
                                                const gchar* _tmp30_;
3537
 
                                                GAppInfo* _tmp31_;
3538
 
                                                const gchar* _tmp32_ = NULL;
3539
 
                                                gchar* _tmp33_;
3540
 
                                                GAppInfo* _tmp34_;
3541
 
                                                const gchar* _tmp35_ = NULL;
3542
 
                                                gchar* _tmp36_;
3543
 
                                                _tmp29_ = installed_uris;
3544
 
                                                _tmp30_ = uri;
3545
 
                                                gee_collection_add ((GeeCollection*) _tmp29_, _tmp30_);
3546
 
                                                _tmp31_ = app;
3547
 
                                                _tmp32_ = g_app_info_get_display_name (_tmp31_);
3548
 
                                                _tmp33_ = g_strdup (_tmp32_);
 
4064
                                                GeeSet* _tmp27_;
 
4065
                                                const gchar* _tmp28_;
 
4066
                                                GAppInfo* _tmp29_;
 
4067
                                                const gchar* _tmp30_ = NULL;
 
4068
                                                gchar* _tmp31_;
 
4069
                                                GAppInfo* _tmp32_;
 
4070
                                                const gchar* _tmp33_ = NULL;
 
4071
                                                gchar* _tmp34_ = NULL;
 
4072
                                                _tmp27_ = installed_uris;
 
4073
                                                _tmp28_ = uri;
 
4074
                                                gee_collection_add ((GeeCollection*) _tmp27_, _tmp28_);
 
4075
                                                _tmp29_ = app;
 
4076
                                                _tmp30_ = g_app_info_get_display_name (_tmp29_);
 
4077
                                                _tmp31_ = g_strdup (_tmp30_);
3549
4078
                                                _g_free0 (display_name);
3550
 
                                                display_name = _tmp33_;
3551
 
                                                _tmp34_ = app;
3552
 
                                                _tmp35_ = g_app_info_get_description (_tmp34_);
3553
 
                                                _tmp36_ = g_strdup (_tmp35_);
 
4079
                                                display_name = _tmp31_;
 
4080
                                                _tmp32_ = app;
 
4081
                                                _tmp33_ = g_app_info_get_executable (_tmp32_);
 
4082
                                                _tmp34_ = unity_applications_lens_daemon_sanitize_binary_name (_tmp33_);
3554
4083
                                                _g_free0 (comment);
3555
 
                                                comment = _tmp36_;
 
4084
                                                comment = _tmp34_;
3556
4085
                                                break;
3557
4086
                                        }
3558
4087
                                        case UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE:
3559
4088
                                        {
3560
 
                                                GeeSet* _tmp37_;
 
4089
                                                GeeSet* _tmp35_;
 
4090
                                                const gchar* _tmp36_;
 
4091
                                                UnityPackageInfo* _tmp37_;
3561
4092
                                                const gchar* _tmp38_;
3562
 
                                                UnityPackageInfo* _tmp39_;
3563
 
                                                const gchar* _tmp40_;
3564
 
                                                gchar* _tmp41_;
3565
 
                                                gchar* _tmp42_;
3566
 
                                                _tmp37_ = available_uris;
3567
 
                                                _tmp38_ = uri;
3568
 
                                                gee_collection_add ((GeeCollection*) _tmp37_, _tmp38_);
3569
 
                                                _tmp39_ = pkginfo;
3570
 
                                                _tmp40_ = _tmp39_->application_name;
3571
 
                                                _tmp41_ = g_strdup (_tmp40_);
 
4093
                                                gchar* _tmp39_;
 
4094
                                                gchar* _tmp40_;
 
4095
                                                _tmp35_ = available_uris;
 
4096
                                                _tmp36_ = uri;
 
4097
                                                gee_collection_add ((GeeCollection*) _tmp35_, _tmp36_);
 
4098
                                                _tmp37_ = pkginfo;
 
4099
                                                _tmp38_ = _tmp37_->application_name;
 
4100
                                                _tmp39_ = g_strdup (_tmp38_);
3572
4101
                                                _g_free0 (display_name);
3573
 
                                                display_name = _tmp41_;
3574
 
                                                _tmp42_ = g_strdup ("");
 
4102
                                                display_name = _tmp39_;
 
4103
                                                _tmp40_ = g_strdup ("");
3575
4104
                                                _g_free0 (comment);
3576
 
                                                comment = _tmp42_;
 
4105
                                                comment = _tmp40_;
3577
4106
                                                break;
3578
4107
                                        }
3579
4108
                                        default:
3580
4109
                                        {
3581
 
                                                UnityApplicationsLensCategory _tmp43_;
3582
 
                                                GEnumValue* _tmp44_;
3583
 
                                                gchar* _tmp45_ = NULL;
3584
 
                                                gchar* _tmp46_;
3585
 
                                                _tmp43_ = category;
3586
 
                                                _tmp44_ = g_enum_get_value (g_type_class_ref (UNITY_APPLICATIONS_LENS_TYPE_CATEGORY), _tmp43_);
3587
 
                                                _tmp45_ = g_strconcat ("Illegal category for package search ", (_tmp44_ != NULL) ? _tmp44_->value_name : NULL, NULL);
3588
 
                                                _tmp46_ = _tmp45_;
3589
 
                                                g_warning ("daemon.vala:929: %s", _tmp46_);
3590
 
                                                _g_free0 (_tmp46_);
 
4110
                                                UnityApplicationsLensCategory _tmp41_;
 
4111
                                                GEnumValue* _tmp42_;
 
4112
                                                gchar* _tmp43_ = NULL;
 
4113
                                                gchar* _tmp44_;
 
4114
                                                _tmp41_ = category;
 
4115
                                                _tmp42_ = g_enum_get_value (g_type_class_ref (UNITY_APPLICATIONS_LENS_TYPE_CATEGORY), _tmp41_);
 
4116
                                                _tmp43_ = g_strconcat ("Illegal category for package search ", (_tmp42_ != NULL) ? _tmp42_->value_name : NULL, NULL);
 
4117
                                                _tmp44_ = _tmp43_;
 
4118
                                                g_warning ("daemon.vala:1053: %s", _tmp44_);
 
4119
                                                _g_free0 (_tmp44_);
3591
4120
                                                continue;
3592
4121
                                        }
3593
4122
                                }
3594
 
                                _tmp48_ = app;
3595
 
                                if (_tmp48_ != NULL) {
3596
 
                                        GAppInfo* _tmp49_;
3597
 
                                        gboolean _tmp50_ = FALSE;
3598
 
                                        _tmp49_ = app;
3599
 
                                        _tmp50_ = g_app_info_should_show (_tmp49_);
3600
 
                                        _tmp47_ = !_tmp50_;
 
4123
                                _tmp46_ = app;
 
4124
                                if (_tmp46_ != NULL) {
 
4125
                                        GAppInfo* _tmp47_;
 
4126
                                        gboolean _tmp48_ = FALSE;
 
4127
                                        _tmp47_ = app;
 
4128
                                        _tmp48_ = g_app_info_should_show (_tmp47_);
 
4129
                                        _tmp45_ = !_tmp48_;
3601
4130
                                } else {
3602
 
                                        _tmp47_ = FALSE;
 
4131
                                        _tmp45_ = FALSE;
3603
4132
                                }
3604
 
                                _tmp51_ = _tmp47_;
3605
 
                                if (_tmp51_) {
 
4133
                                _tmp49_ = _tmp45_;
 
4134
                                if (_tmp49_) {
3606
4135
                                        _g_free0 (comment);
3607
4136
                                        _g_free0 (display_name);
3608
4137
                                        _g_free0 (uri);
3611
4140
                                        _g_free0 (desktop_id);
3612
4141
                                        continue;
3613
4142
                                }
3614
 
                                _tmp52_ = category;
3615
 
                                if (_tmp52_ == UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE) {
3616
 
                                        GAppInfo* _tmp53_;
3617
 
                                        gboolean _tmp54_ = FALSE;
3618
 
                                        UnityRatingsDatabase* _tmp55_;
3619
 
                                        gboolean _tmp59_;
3620
 
                                        UnityPackageInfo* _tmp70_;
3621
 
                                        const gchar* _tmp71_;
3622
 
                                        const gchar* _tmp72_ = NULL;
3623
 
                                        UnityPackageInfo* _tmp73_;
3624
 
                                        const gchar* _tmp74_;
3625
 
                                        const gchar* _tmp75_ = NULL;
3626
 
                                        gchar* _tmp76_ = NULL;
3627
 
                                        GeeSet* _tmp77_;
3628
 
                                        const gchar* _tmp78_;
3629
 
                                        _tmp53_ = app;
3630
 
                                        if (_tmp53_ != NULL) {
 
4143
                                _tmp50_ = pkginfo;
 
4144
                                _tmp51_ = _tmp50_->desktop_file;
 
4145
                                _tmp52_ = pkginfo;
 
4146
                                _tmp53_ = _tmp52_->icon;
 
4147
                                _tmp54_ = unity_applications_lens_daemon_find_pkg_icon (self, _tmp51_, _tmp53_);
 
4148
                                icon = _tmp54_;
 
4149
                                _tmp55_ = category;
 
4150
                                if (_tmp55_ == UNITY_APPLICATIONS_LENS_CATEGORY_AVAILABLE) {
 
4151
                                        GAppInfo* _tmp56_;
 
4152
                                        UnityPackageInfo* _tmp57_;
 
4153
                                        const gchar* _tmp58_;
 
4154
                                        const gchar* _tmp59_ = NULL;
 
4155
                                        UnityPackageInfo* _tmp60_;
 
4156
                                        const gchar* _tmp61_;
 
4157
                                        const gchar* _tmp62_ = NULL;
 
4158
                                        gchar* _tmp63_ = NULL;
 
4159
                                        GeeSet* _tmp64_;
 
4160
                                        const gchar* _tmp65_;
 
4161
                                        GIcon* _tmp66_;
 
4162
                                        UnityPackageInfo* _tmp67_;
 
4163
                                        const gchar* _tmp68_;
 
4164
                                        UnityPackageInfo* _tmp69_;
 
4165
                                        gboolean _tmp70_;
 
4166
                                        gchar* _tmp71_ = NULL;
 
4167
                                        _tmp56_ = app;
 
4168
                                        if (_tmp56_ != NULL) {
 
4169
                                                _g_free0 (icon_str);
 
4170
                                                _g_object_unref0 (icon);
3631
4171
                                                _g_free0 (comment);
3632
4172
                                                _g_free0 (display_name);
3633
4173
                                                _g_free0 (uri);
3636
4176
                                                _g_free0 (desktop_id);
3637
4177
                                                continue;
3638
4178
                                        }
3639
 
                                        _tmp55_ = self->priv->ratings;
3640
 
                                        if (_tmp55_ != NULL) {
3641
 
                                                UnityRatingsFilter* _tmp56_;
3642
 
                                                gfloat _tmp57_;
3643
 
                                                gfloat _tmp58_;
3644
 
                                                _tmp56_ = ratings_filter;
3645
 
                                                _tmp57_ = unity_ratings_filter_get_rating (_tmp56_);
3646
 
                                                _tmp58_ = _tmp57_;
3647
 
                                                _tmp54_ = ((gdouble) _tmp58_) > 0.00001;
3648
 
                                        } else {
3649
 
                                                _tmp54_ = FALSE;
3650
 
                                        }
3651
 
                                        _tmp59_ = _tmp54_;
3652
 
                                        if (_tmp59_) {
3653
 
                                                UnityRatingsResult _result_ = {0};
3654
 
                                                UnityRatingsDatabase* _tmp60_;
3655
 
                                                UnityPackageInfo* _tmp61_;
3656
 
                                                const gchar* _tmp62_;
3657
 
                                                UnityRatingsResult _tmp63_ = {0};
3658
 
                                                gboolean _tmp64_ = FALSE;
3659
 
                                                _tmp60_ = self->priv->ratings;
3660
 
                                                _tmp61_ = pkginfo;
3661
 
                                                _tmp62_ = _tmp61_->package_name;
3662
 
                                                _tmp64_ = unity_ratings_database_query (_tmp60_, _tmp62_, &_tmp63_);
3663
 
                                                _result_ = _tmp63_;
3664
 
                                                if (_tmp64_) {
3665
 
                                                        UnityRatingsResult _tmp65_;
3666
 
                                                        gint32 _tmp66_;
3667
 
                                                        UnityRatingsFilter* _tmp67_;
3668
 
                                                        gfloat _tmp68_;
3669
 
                                                        gfloat _tmp69_;
3670
 
                                                        _tmp65_ = _result_;
3671
 
                                                        _tmp66_ = _tmp65_.average_rating;
3672
 
                                                        _tmp67_ = ratings_filter;
3673
 
                                                        _tmp68_ = unity_ratings_filter_get_rating (_tmp67_);
3674
 
                                                        _tmp69_ = _tmp68_;
3675
 
                                                        if (((gdouble) _tmp66_) < ((_tmp69_ * 5) - 0.2)) {
3676
 
                                                                _g_free0 (comment);
3677
 
                                                                _g_free0 (display_name);
3678
 
                                                                _g_free0 (uri);
3679
 
                                                                _g_object_unref0 (app);
3680
 
                                                                _g_free0 (full_path);
3681
 
                                                                _g_free0 (desktop_id);
3682
 
                                                                continue;
3683
 
                                                        }
3684
 
                                                } else {
3685
 
                                                        _g_free0 (comment);
3686
 
                                                        _g_free0 (display_name);
3687
 
                                                        _g_free0 (uri);
3688
 
                                                        _g_object_unref0 (app);
3689
 
                                                        _g_free0 (full_path);
3690
 
                                                        _g_free0 (desktop_id);
3691
 
                                                        continue;
3692
 
                                                }
3693
 
                                        }
3694
 
                                        _tmp70_ = pkginfo;
3695
 
                                        _tmp71_ = _tmp70_->package_name;
3696
 
                                        _tmp72_ = string_to_string (_tmp71_);
3697
 
                                        _tmp73_ = pkginfo;
3698
 
                                        _tmp74_ = _tmp73_->application_name;
3699
 
                                        _tmp75_ = string_to_string (_tmp74_);
3700
 
                                        _tmp76_ = g_strconcat ("unity-install://", _tmp72_, "/", _tmp75_, NULL);
 
4179
                                        _tmp57_ = pkginfo;
 
4180
                                        _tmp58_ = _tmp57_->package_name;
 
4181
                                        _tmp59_ = string_to_string (_tmp58_);
 
4182
                                        _tmp60_ = pkginfo;
 
4183
                                        _tmp61_ = _tmp60_->application_name;
 
4184
                                        _tmp62_ = string_to_string (_tmp61_);
 
4185
                                        _tmp63_ = g_strconcat ("unity-install://", _tmp59_, "/", _tmp62_, NULL);
3701
4186
                                        _g_free0 (uri);
3702
 
                                        uri = _tmp76_;
3703
 
                                        _tmp77_ = available_uris;
3704
 
                                        _tmp78_ = uri;
3705
 
                                        gee_collection_add ((GeeCollection*) _tmp77_, _tmp78_);
3706
 
                                }
3707
 
                                _tmp79_ = pkginfo;
3708
 
                                _tmp80_ = unity_applications_lens_daemon_find_pkg_icon (self, _tmp79_);
3709
 
                                icon = _tmp80_;
3710
 
                                _tmp82_ = display_name;
3711
 
                                if (_tmp82_ != NULL) {
3712
 
                                        const gchar* _tmp83_;
3713
 
                                        _tmp83_ = display_name;
3714
 
                                        _tmp81_ = _tmp83_;
3715
 
                                } else {
3716
 
                                        _tmp81_ = "";
3717
 
                                }
3718
 
                                _tmp85_ = comment;
3719
 
                                if (_tmp85_ != NULL) {
3720
 
                                        const gchar* _tmp86_;
3721
 
                                        _tmp86_ = comment;
3722
 
                                        _tmp84_ = _tmp86_;
3723
 
                                } else {
3724
 
                                        _tmp84_ = "";
3725
 
                                }
3726
 
                                _tmp88_ = full_path;
3727
 
                                if (_tmp88_ != NULL) {
3728
 
                                        const gchar* _tmp89_;
3729
 
                                        gchar* _tmp90_;
3730
 
                                        _tmp89_ = full_path;
3731
 
                                        _tmp90_ = g_strconcat ("file://", _tmp89_, NULL);
3732
 
                                        _g_free0 (_tmp87_);
3733
 
                                        _tmp87_ = _tmp90_;
3734
 
                                } else {
3735
 
                                        gchar* _tmp91_;
3736
 
                                        _tmp91_ = g_strdup ("");
3737
 
                                        _g_free0 (_tmp87_);
3738
 
                                        _tmp87_ = _tmp91_;
3739
 
                                }
3740
 
                                _tmp92_ = model;
3741
 
                                _tmp93_ = uri;
3742
 
                                _tmp94_ = icon;
3743
 
                                _tmp95_ = g_icon_to_string (_tmp94_);
3744
 
                                _tmp96_ = _tmp95_;
3745
 
                                _tmp97_ = category;
3746
 
                                _tmp98_ = _tmp81_;
3747
 
                                _tmp99_ = _tmp84_;
3748
 
                                _tmp100_ = _tmp87_;
3749
 
                                dee_model_append (_tmp92_, _tmp93_, _tmp96_, _tmp97_, "application/x-desktop", _tmp98_, _tmp99_, _tmp100_, NULL);
3750
 
                                _g_free0 (_tmp96_);
3751
 
                                _tmp101_ = n_added;
3752
 
                                n_added = _tmp101_ + 1;
3753
 
                                _tmp103_ = max_add;
3754
 
                                if (_tmp103_ > ((guint) 0)) {
3755
 
                                        guint _tmp104_;
3756
 
                                        guint _tmp105_;
3757
 
                                        _tmp104_ = n_added;
3758
 
                                        _tmp105_ = max_add;
3759
 
                                        _tmp102_ = _tmp104_ >= _tmp105_;
3760
 
                                } else {
3761
 
                                        _tmp102_ = FALSE;
3762
 
                                }
3763
 
                                _tmp106_ = _tmp102_;
3764
 
                                if (_tmp106_) {
3765
 
                                        _g_free0 (_tmp87_);
 
4187
                                        uri = _tmp63_;
 
4188
                                        _tmp64_ = available_uris;
 
4189
                                        _tmp65_ = uri;
 
4190
                                        gee_collection_add ((GeeCollection*) _tmp64_, _tmp65_);
 
4191
                                        _tmp66_ = icon;
 
4192
                                        _tmp67_ = pkginfo;
 
4193
                                        _tmp68_ = _tmp67_->price;
 
4194
                                        _tmp69_ = pkginfo;
 
4195
                                        _tmp70_ = _tmp69_->needs_purchase;
 
4196
                                        _tmp71_ = unity_applications_lens_daemon_get_annotated_icon (self, _tmp66_, _tmp68_, !_tmp70_);
 
4197
                                        _g_free0 (icon_str);
 
4198
                                        icon_str = _tmp71_;
 
4199
                                } else {
 
4200
                                        GIcon* _tmp72_;
 
4201
                                        gchar* _tmp73_ = NULL;
 
4202
                                        _tmp72_ = icon;
 
4203
                                        _tmp73_ = g_icon_to_string (_tmp72_);
 
4204
                                        _g_free0 (icon_str);
 
4205
                                        icon_str = _tmp73_;
 
4206
                                }
 
4207
                                _tmp75_ = display_name;
 
4208
                                if (_tmp75_ != NULL) {
 
4209
                                        const gchar* _tmp76_;
 
4210
                                        _tmp76_ = display_name;
 
4211
                                        _tmp74_ = _tmp76_;
 
4212
                                } else {
 
4213
                                        _tmp74_ = "";
 
4214
                                }
 
4215
                                _tmp78_ = comment;
 
4216
                                if (_tmp78_ != NULL) {
 
4217
                                        const gchar* _tmp79_;
 
4218
                                        _tmp79_ = comment;
 
4219
                                        _tmp77_ = _tmp79_;
 
4220
                                } else {
 
4221
                                        _tmp77_ = "";
 
4222
                                }
 
4223
                                _tmp81_ = full_path;
 
4224
                                if (_tmp81_ != NULL) {
 
4225
                                        const gchar* _tmp82_;
 
4226
                                        gchar* _tmp83_;
 
4227
                                        _tmp82_ = full_path;
 
4228
                                        _tmp83_ = g_strconcat ("file://", _tmp82_, NULL);
 
4229
                                        _g_free0 (_tmp80_);
 
4230
                                        _tmp80_ = _tmp83_;
 
4231
                                } else {
 
4232
                                        gchar* _tmp84_;
 
4233
                                        _tmp84_ = g_strdup ("");
 
4234
                                        _g_free0 (_tmp80_);
 
4235
                                        _tmp80_ = _tmp84_;
 
4236
                                }
 
4237
                                _tmp85_ = model;
 
4238
                                _tmp86_ = uri;
 
4239
                                _tmp87_ = icon_str;
 
4240
                                _tmp88_ = category;
 
4241
                                _tmp89_ = _tmp74_;
 
4242
                                _tmp90_ = _tmp77_;
 
4243
                                _tmp91_ = _tmp80_;
 
4244
                                dee_model_append (_tmp85_, _tmp86_, _tmp87_, _tmp88_, "application/x-desktop", _tmp89_, _tmp90_, _tmp91_, NULL);
 
4245
                                _tmp92_ = n_added;
 
4246
                                n_added = _tmp92_ + 1;
 
4247
                                _tmp94_ = max_add;
 
4248
                                if (_tmp94_ > ((guint) 0)) {
 
4249
                                        guint _tmp95_;
 
4250
                                        guint _tmp96_;
 
4251
                                        _tmp95_ = n_added;
 
4252
                                        _tmp96_ = max_add;
 
4253
                                        _tmp93_ = _tmp95_ >= _tmp96_;
 
4254
                                } else {
 
4255
                                        _tmp93_ = FALSE;
 
4256
                                }
 
4257
                                _tmp97_ = _tmp93_;
 
4258
                                if (_tmp97_) {
 
4259
                                        _g_free0 (_tmp80_);
 
4260
                                        _g_free0 (icon_str);
3766
4261
                                        _g_object_unref0 (icon);
3767
4262
                                        _g_free0 (comment);
3768
4263
                                        _g_free0 (display_name);
3770
4265
                                        _g_object_unref0 (app);
3771
4266
                                        _g_free0 (full_path);
3772
4267
                                        _g_free0 (desktop_id);
3773
 
                                        _g_object_unref0 (ratings_filter);
3774
4268
                                        _g_object_unref0 (appmanager);
3775
4269
                                        return;
3776
4270
                                }
3777
 
                                _g_free0 (_tmp87_);
 
4271
                                _g_free0 (_tmp80_);
 
4272
                                _g_free0 (icon_str);
3778
4273
                                _g_object_unref0 (icon);
3779
4274
                                _g_free0 (comment);
3780
4275
                                _g_free0 (display_name);
3785
4280
                        }
3786
4281
                }
3787
4282
        }
3788
 
        _g_object_unref0 (ratings_filter);
3789
4283
        _g_object_unref0 (appmanager);
3790
4284
}
3791
4285
 
4150
4644
                const gchar* _tmp10_;
4151
4645
                gchar* _tmp11_;
4152
4646
                gchar* desktop_file;
4153
 
                gchar* _tmp12_ = NULL;
 
4647
                const gchar* _tmp12_;
 
4648
                gchar* _tmp13_ = NULL;
4154
4649
                gchar* icon;
4155
 
                UnityApplicationsLensLauncherProxy* _tmp13_;
4156
 
                const gchar* _tmp14_;
 
4650
                UnityApplicationsLensLauncherProxy* _tmp14_;
4157
4651
                const gchar* _tmp15_;
4158
4652
                const gchar* _tmp16_;
4159
4653
                const gchar* _tmp17_;
 
4654
                const gchar* _tmp18_;
4160
4655
                _tmp0_ = res;
4161
4656
                unity_applications_lens_daemon_call_install_packages_finish (self, _tmp0_, &_tmp1_, &_inner_error_);
4162
4657
                _g_free0 (tid);
4164
4659
                if (_inner_error_ != NULL) {
4165
4660
                        _g_free0 (tid);
4166
4661
                        if (_inner_error_->domain == G_IO_ERROR) {
4167
 
                                goto __catch7_g_io_error;
 
4662
                                goto __catch8_g_io_error;
4168
4663
                        }
4169
4664
                        _g_free0 (tid);
4170
4665
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4173
4668
                }
4174
4669
                _tmp2_ = tid;
4175
4670
                _tmp3_ = _data1_->pkgname;
4176
 
                g_debug ("daemon.vala:1023: transaction started: %s, pkg: %s\n", _tmp2_, _tmp3_);
 
4671
                g_debug ("daemon.vala:1140: transaction started: %s, pkg: %s\n", _tmp2_, _tmp3_);
4177
4672
                _tmp4_ = unity_applications_lens_aptd_transaction_proxy_new ();
4178
4673
                _g_object_unref0 (self->priv->aptd_transaction);
4179
4674
                self->priv->aptd_transaction = _tmp4_;
4183
4678
                if (_inner_error_ != NULL) {
4184
4679
                        _g_free0 (tid);
4185
4680
                        if (_inner_error_->domain == G_IO_ERROR) {
4186
 
                                goto __catch7_g_io_error;
 
4681
                                goto __catch8_g_io_error;
4187
4682
                        }
4188
4683
                        _g_free0 (tid);
4189
4684
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4195
4690
                if (_inner_error_ != NULL) {
4196
4691
                        _g_free0 (tid);
4197
4692
                        if (_inner_error_->domain == G_IO_ERROR) {
4198
 
                                goto __catch7_g_io_error;
 
4693
                                goto __catch8_g_io_error;
4199
4694
                        }
4200
4695
                        _g_free0 (tid);
4201
4696
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4207
4702
                if (_inner_error_ != NULL) {
4208
4703
                        _g_free0 (tid);
4209
4704
                        if (_inner_error_->domain == G_IO_ERROR) {
4210
 
                                goto __catch7_g_io_error;
 
4705
                                goto __catch8_g_io_error;
4211
4706
                        }
4212
4707
                        _g_free0 (tid);
4213
4708
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4219
4714
                if (_inner_error_ != NULL) {
4220
4715
                        _g_free0 (tid);
4221
4716
                        if (_inner_error_->domain == G_IO_ERROR) {
4222
 
                                goto __catch7_g_io_error;
 
4717
                                goto __catch8_g_io_error;
4223
4718
                        }
4224
4719
                        _g_free0 (tid);
4225
4720
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4229
4724
                _tmp10_ = self->priv->preview_installable_desktop_file;
4230
4725
                _tmp11_ = g_strdup (_tmp10_);
4231
4726
                desktop_file = _tmp11_;
4232
 
                _tmp12_ = unity_applications_lens_daemon_find_app_install_icon_path (self);
4233
 
                icon = _tmp12_;
4234
 
                _tmp13_ = self->priv->launcherservice;
4235
 
                _tmp14_ = _data1_->appname;
4236
 
                _tmp15_ = icon;
4237
 
                _tmp16_ = desktop_file;
4238
 
                _tmp17_ = tid;
4239
 
                unity_applications_lens_launcher_proxy_add_launcher_item_from_position (_tmp13_, _tmp14_, _tmp15_, 0, 0, 32, _tmp16_, _tmp17_, NULL, NULL);
 
4727
                _tmp12_ = self->priv->preview_installable_icon_file;
 
4728
                _tmp13_ = unity_applications_lens_daemon_find_app_install_icon_path (self, _tmp12_);
 
4729
                icon = _tmp13_;
 
4730
                _tmp14_ = self->priv->launcherservice;
 
4731
                _tmp15_ = _data1_->appname;
 
4732
                _tmp16_ = icon;
 
4733
                _tmp17_ = desktop_file;
 
4734
                _tmp18_ = tid;
 
4735
                unity_applications_lens_launcher_proxy_add_launcher_item_from_position (_tmp14_, _tmp15_, _tmp16_, 0, 0, 32, _tmp17_, _tmp18_, NULL, NULL);
4240
4736
                _g_free0 (icon);
4241
4737
                _g_free0 (desktop_file);
4242
4738
                _g_free0 (tid);
4243
4739
        }
4244
 
        goto __finally7;
4245
 
        __catch7_g_io_error:
 
4740
        goto __finally8;
 
4741
        __catch8_g_io_error:
4246
4742
        {
4247
4743
                GError* e = NULL;
4248
 
                const gchar* _tmp18_;
4249
 
                GError* _tmp19_;
4250
 
                const gchar* _tmp20_;
 
4744
                const gchar* _tmp19_;
 
4745
                GError* _tmp20_;
 
4746
                const gchar* _tmp21_;
4251
4747
                e = _inner_error_;
4252
4748
                _inner_error_ = NULL;
4253
 
                _tmp18_ = _data1_->pkgname;
4254
 
                _tmp19_ = e;
4255
 
                _tmp20_ = _tmp19_->message;
4256
 
                g_warning ("daemon.vala:1037: Package '%s' installation failed: %s", _tmp18_, _tmp20_);
 
4749
                _tmp19_ = _data1_->pkgname;
 
4750
                _tmp20_ = e;
 
4751
                _tmp21_ = _tmp20_->message;
 
4752
                g_warning ("daemon.vala:1154: Package '%s' installation failed: %s", _tmp19_, _tmp21_);
4257
4753
                _g_error_free0 (e);
4258
4754
        }
4259
 
        __finally7:
 
4755
        __finally8:
4260
4756
        if (_inner_error_ != NULL) {
4261
4757
                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);
4262
4758
                g_clear_error (&_inner_error_);
4334
4830
                                unity_applications_lens_aptd_proxy_connect_to_aptd (_tmp14_, &_inner_error_);
4335
4831
                                if (_inner_error_ != NULL) {
4336
4832
                                        if (_inner_error_->domain == G_IO_ERROR) {
4337
 
                                                goto __catch6_g_io_error;
 
4833
                                                goto __catch7_g_io_error;
4338
4834
                                        }
4339
4835
                                        block1_data_unref (_data1_);
4340
4836
                                        _data1_ = NULL;
4345
4841
                                        return NULL;
4346
4842
                                }
4347
4843
                        }
4348
 
                        goto __finally6;
4349
 
                        __catch6_g_io_error:
 
4844
                        goto __finally7;
 
4845
                        __catch7_g_io_error:
4350
4846
                        {
4351
4847
                                GError* e = NULL;
4352
4848
                                GError* _tmp15_;
4357
4853
                                _inner_error_ = NULL;
4358
4854
                                _tmp15_ = e;
4359
4855
                                _tmp16_ = _tmp15_->message;
4360
 
                                g_warning ("daemon.vala:1015: Failed to connect to aptd: '%s'", _tmp16_);
 
4856
                                g_warning ("daemon.vala:1132: Failed to connect to aptd: '%s'", _tmp16_);
4361
4857
                                _tmp17_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4362
4858
                                _tmp18_ = g_object_ref_sink (_tmp17_);
4363
4859
                                result = _tmp18_;
4368
4864
                                _g_free0 (app);
4369
4865
                                return result;
4370
4866
                        }
4371
 
                        __finally6:
 
4867
                        __finally7:
4372
4868
                        if (_inner_error_ != NULL) {
4373
4869
                                block1_data_unref (_data1_);
4374
4870
                                _data1_ = NULL;
4385
4881
                } else {
4386
4882
                        const gchar* _tmp20_;
4387
4883
                        _tmp20_ = uri;
4388
 
                        g_warning ("daemon.vala:1043: Bad install uri: '%s'", _tmp20_);
 
4884
                        g_warning ("daemon.vala:1160: Bad install uri: '%s'", _tmp20_);
4389
4885
                }
4390
4886
                parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
4391
4887
                _g_free0 (app);
4394
4890
                UnityActivationResponse* _tmp22_;
4395
4891
                UnityActivationResponse* _tmp23_;
4396
4892
                _tmp21_ = uri;
4397
 
                g_warning ("daemon.vala:1048: Can't handle '%s' in app_preview_install handler", _tmp21_);
 
4893
                g_warning ("daemon.vala:1165: Can't handle '%s' in app_preview_install handler", _tmp21_);
4398
4894
                _tmp22_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4399
4895
                _tmp23_ = g_object_ref_sink (_tmp22_);
4400
4896
                result = _tmp23_;
4447
4943
                _tmp0_ = self->priv->preview_developer_website;
4448
4944
                g_app_info_launch_default_for_uri (_tmp0_, NULL, &_inner_error_);
4449
4945
                if (_inner_error_ != NULL) {
4450
 
                        goto __catch8_g_error;
 
4946
                        goto __catch9_g_error;
4451
4947
                }
4452
4948
                _tmp1_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4453
4949
                _tmp2_ = g_object_ref_sink (_tmp1_);
4454
4950
                result = _tmp2_;
4455
4951
                return result;
4456
4952
        }
4457
 
        goto __finally8;
4458
 
        __catch8_g_error:
 
4953
        goto __finally9;
 
4954
        __catch9_g_error:
4459
4955
        {
4460
4956
                GError* e = NULL;
4461
4957
                const gchar* _tmp3_;
4466
4962
                _tmp3_ = uri;
4467
4963
                _tmp4_ = e;
4468
4964
                _tmp5_ = _tmp4_->message;
4469
 
                g_warning ("daemon.vala:1073: Failed to launch a web browser for uri '%s': '%s'", _tmp3_, _tmp5_);
 
4965
                g_warning ("daemon.vala:1190: Failed to launch a web browser for uri '%s': '%s'", _tmp3_, _tmp5_);
4470
4966
                _g_error_free0 (e);
4471
4967
        }
4472
 
        __finally8:
 
4968
        __finally9:
4473
4969
        if (_inner_error_ != NULL) {
4474
4970
                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);
4475
4971
                g_clear_error (&_inner_error_);
4525
5021
                if (_inner_error_ != NULL) {
4526
5022
                        _g_free0 (tid);
4527
5023
                        if (_inner_error_->domain == G_IO_ERROR) {
4528
 
                                goto __catch10_g_io_error;
 
5024
                                goto __catch11_g_io_error;
4529
5025
                        }
4530
5026
                        _g_free0 (tid);
4531
5027
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4535
5031
                _tmp2_ = tid;
4536
5032
                _tmp3_ = _data2_->pkginfo;
4537
5033
                _tmp4_ = _tmp3_->package_name;
4538
 
                g_debug ("daemon.vala:1109: transaction started: %s, pkg: %s\n", _tmp2_, _tmp4_);
 
5034
                g_debug ("daemon.vala:1226: transaction started: %s, pkg: %s\n", _tmp2_, _tmp4_);
4539
5035
                _tmp5_ = unity_applications_lens_aptd_transaction_proxy_new ();
4540
5036
                _g_object_unref0 (self->priv->aptd_transaction);
4541
5037
                self->priv->aptd_transaction = _tmp5_;
4545
5041
                if (_inner_error_ != NULL) {
4546
5042
                        _g_free0 (tid);
4547
5043
                        if (_inner_error_->domain == G_IO_ERROR) {
4548
 
                                goto __catch10_g_io_error;
 
5044
                                goto __catch11_g_io_error;
4549
5045
                        }
4550
5046
                        _g_free0 (tid);
4551
5047
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4557
5053
                if (_inner_error_ != NULL) {
4558
5054
                        _g_free0 (tid);
4559
5055
                        if (_inner_error_->domain == G_IO_ERROR) {
4560
 
                                goto __catch10_g_io_error;
 
5056
                                goto __catch11_g_io_error;
4561
5057
                        }
4562
5058
                        _g_free0 (tid);
4563
5059
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4569
5065
                if (_inner_error_ != NULL) {
4570
5066
                        _g_free0 (tid);
4571
5067
                        if (_inner_error_->domain == G_IO_ERROR) {
4572
 
                                goto __catch10_g_io_error;
 
5068
                                goto __catch11_g_io_error;
4573
5069
                        }
4574
5070
                        _g_free0 (tid);
4575
5071
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
4578
5074
                }
4579
5075
                _g_free0 (tid);
4580
5076
        }
4581
 
        goto __finally10;
4582
 
        __catch10_g_io_error:
 
5077
        goto __finally11;
 
5078
        __catch11_g_io_error:
4583
5079
        {
4584
5080
                GError* e = NULL;
4585
5081
                UnityPackageInfo* _tmp10_;
4600
5096
                _tmp15_ = string_to_string (_tmp14_);
4601
5097
                _tmp16_ = g_strconcat ("Package '", _tmp12_, "' removal failed: ", _tmp15_, NULL);
4602
5098
                _tmp17_ = _tmp16_;
4603
 
                g_warning ("daemon.vala:1117: %s", _tmp17_);
 
5099
                g_warning ("daemon.vala:1234: %s", _tmp17_);
4604
5100
                _g_free0 (_tmp17_);
4605
5101
                _g_error_free0 (e);
4606
5102
        }
4607
 
        __finally10:
 
5103
        __finally11:
4608
5104
        if (_inner_error_ != NULL) {
4609
5105
                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);
4610
5106
                g_clear_error (&_inner_error_);
4692
5188
                                unity_applications_lens_aptd_proxy_connect_to_aptd (_tmp19_, &_inner_error_);
4693
5189
                                if (_inner_error_ != NULL) {
4694
5190
                                        if (_inner_error_->domain == G_IO_ERROR) {
4695
 
                                                goto __catch9_g_io_error;
 
5191
                                                goto __catch10_g_io_error;
4696
5192
                                        }
4697
5193
                                        _g_free0 (desktopfile);
4698
5194
                                        block2_data_unref (_data2_);
4702
5198
                                        return NULL;
4703
5199
                                }
4704
5200
                        }
4705
 
                        goto __finally9;
4706
 
                        __catch9_g_io_error:
 
5201
                        goto __finally10;
 
5202
                        __catch10_g_io_error:
4707
5203
                        {
4708
5204
                                GError* e = NULL;
4709
5205
                                GError* _tmp20_;
4714
5210
                                _inner_error_ = NULL;
4715
5211
                                _tmp20_ = e;
4716
5212
                                _tmp21_ = _tmp20_->message;
4717
 
                                g_warning ("daemon.vala:1100: Failed to connect to aptd: '%s'", _tmp21_);
 
5213
                                g_warning ("daemon.vala:1217: Failed to connect to aptd: '%s'", _tmp21_);
4718
5214
                                _tmp22_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4719
5215
                                _tmp23_ = g_object_ref_sink (_tmp22_);
4720
5216
                                result = _tmp23_;
4724
5220
                                _data2_ = NULL;
4725
5221
                                return result;
4726
5222
                        }
4727
 
                        __finally9:
 
5223
                        __finally10:
4728
5224
                        if (_inner_error_ != NULL) {
4729
5225
                                _g_free0 (desktopfile);
4730
5226
                                block2_data_unref (_data2_);
4752
5248
                        _tmp29_ = string_to_string (_tmp28_);
4753
5249
                        _tmp30_ = g_strconcat ("Cannot find package info for ", _tmp29_, NULL);
4754
5250
                        _tmp31_ = _tmp30_;
4755
 
                        g_warning ("daemon.vala:1124: %s", _tmp31_);
 
5251
                        g_warning ("daemon.vala:1241: %s", _tmp31_);
4756
5252
                        _g_free0 (_tmp31_);
4757
5253
                }
4758
5254
                _g_free0 (desktopfile);
4760
5256
                _data2_ = NULL;
4761
5257
        }
4762
5258
        _tmp32_ = uri;
4763
 
        g_warning ("daemon.vala:1127: Can't handle '%s' in app_preview_uninstall handler", _tmp32_);
 
5259
        g_warning ("daemon.vala:1244: Can't handle '%s' in app_preview_uninstall handler", _tmp32_);
4764
5260
        _tmp33_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4765
5261
        _tmp34_ = g_object_ref_sink (_tmp33_);
4766
5262
        result = _tmp34_;
4810
5306
        gchar* pkgname;
4811
5307
        gchar* _tmp1_;
4812
5308
        gchar* appname;
4813
 
        gboolean _tmp2_ = FALSE;
4814
 
        const gchar* _tmp3_;
 
5309
        const gchar* _tmp2_;
 
5310
        gboolean _tmp3_ = FALSE;
 
5311
        gboolean installed;
4815
5312
        gboolean _tmp4_ = FALSE;
4816
 
        gboolean _tmp7_;
 
5313
        gboolean _tmp5_;
 
5314
        gboolean _tmp8_;
4817
5315
        GError * _inner_error_ = NULL;
4818
5316
        g_return_val_if_fail (self != NULL, NULL);
4819
5317
        g_return_val_if_fail (uri != NULL, NULL);
4822
5320
        pkgname = _tmp0_;
4823
5321
        _tmp1_ = g_strdup ("");
4824
5322
        appname = _tmp1_;
4825
 
        _tmp3_ = uri;
4826
 
        _tmp4_ = g_str_has_prefix (_tmp3_, "application://");
4827
 
        if (_tmp4_) {
4828
 
                _tmp2_ = TRUE;
 
5323
        _tmp2_ = uri;
 
5324
        _tmp3_ = g_str_has_prefix (_tmp2_, "application://");
 
5325
        installed = _tmp3_;
 
5326
        _tmp5_ = installed;
 
5327
        if (_tmp5_) {
 
5328
                _tmp4_ = TRUE;
4829
5329
        } else {
4830
 
                const gchar* _tmp5_;
4831
 
                gboolean _tmp6_ = FALSE;
4832
 
                _tmp5_ = uri;
4833
 
                _tmp6_ = g_str_has_prefix (_tmp5_, "unity-install://");
4834
 
                _tmp2_ = _tmp6_;
 
5330
                const gchar* _tmp6_;
 
5331
                gboolean _tmp7_ = FALSE;
 
5332
                _tmp6_ = uri;
 
5333
                _tmp7_ = g_str_has_prefix (_tmp6_, "unity-install://");
 
5334
                _tmp4_ = _tmp7_;
4835
5335
        }
4836
 
        _tmp7_ = _tmp2_;
4837
 
        if (_tmp7_) {
 
5336
        _tmp8_ = _tmp4_;
 
5337
        if (_tmp8_) {
4838
5338
                gchar* desktopfile;
4839
 
                const gchar* _tmp8_;
4840
 
                gboolean _tmp9_ = FALSE;
 
5339
                gboolean _tmp9_;
4841
5340
                const gchar* _tmp41_;
4842
 
                gboolean _tmp205_ = FALSE;
4843
 
                UnityApplicationPreview* _tmp206_;
4844
 
                gboolean _tmp208_;
4845
 
                UnityApplicationPreview* _tmp228_;
 
5341
                gboolean _tmp222_ = FALSE;
 
5342
                UnityApplicationPreview* _tmp223_;
 
5343
                gboolean _tmp225_;
 
5344
                UnityApplicationPreview* _tmp245_;
4846
5345
                desktopfile = NULL;
4847
 
                _tmp8_ = uri;
4848
 
                _tmp9_ = g_str_has_prefix (_tmp8_, "application://");
 
5346
                _tmp9_ = installed;
4849
5347
                if (_tmp9_) {
4850
5348
                        const gchar* _tmp10_;
4851
5349
                        gchar* _tmp11_ = NULL;
4958
5456
                                const gchar* _tmp49_;
4959
5457
                                GHashTable* _tmp50_ = NULL;
4960
5458
                                GHashTable* _tmp51_;
4961
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp52_;
4962
 
                                const gchar* _tmp53_;
4963
 
                                const gchar* _tmp54_;
4964
 
                                GThemedIcon* _tmp55_;
4965
 
                                GIcon* icon;
 
5459
                                GIcon* icon = NULL;
 
5460
                                gboolean _tmp52_;
4966
5461
                                GIcon* screenshot;
4967
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp56_;
4968
 
                                const gchar* _tmp57_;
4969
 
                                const gchar* _tmp58_;
4970
 
                                gchar* _tmp65_;
 
5462
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp65_;
 
5463
                                const gchar* _tmp66_;
 
5464
                                const gchar* _tmp67_;
 
5465
                                gchar* _tmp74_;
4971
5466
                                gchar* subtitle;
4972
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp66_;
4973
 
                                const gchar* _tmp67_;
4974
 
                                const gchar* _tmp68_;
4975
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp74_;
4976
 
                                gint64 _tmp75_;
4977
 
                                gint64 _tmp76_;
4978
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp89_;
4979
 
                                const gchar* _tmp90_;
4980
 
                                const gchar* _tmp91_;
4981
 
                                const gchar* _tmp92_;
4982
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp93_;
4983
 
                                const gchar* _tmp94_;
4984
 
                                const gchar* _tmp95_;
4985
 
                                GIcon* _tmp96_;
4986
 
                                GIcon* _tmp97_;
4987
 
                                UnityApplicationPreview* _tmp98_;
4988
 
                                UnityApplicationPreview* _tmp99_;
4989
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp100_;
 
5467
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp75_;
 
5468
                                const gchar* _tmp76_;
 
5469
                                const gchar* _tmp77_;
 
5470
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp83_;
 
5471
                                gint64 _tmp84_;
 
5472
                                gint64 _tmp85_;
 
5473
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp98_;
 
5474
                                const gchar* _tmp99_;
 
5475
                                const gchar* _tmp100_;
4990
5476
                                const gchar* _tmp101_;
4991
 
                                const gchar* _tmp102_;
4992
 
                                UnityRatingsDatabase* _tmp103_;
4993
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp112_;
4994
 
                                const gchar* _tmp113_;
4995
 
                                const gchar* _tmp114_;
 
5477
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp102_;
 
5478
                                const gchar* _tmp103_;
 
5479
                                const gchar* _tmp104_;
 
5480
                                GIcon* _tmp105_;
 
5481
                                GIcon* _tmp106_;
 
5482
                                UnityApplicationPreview* _tmp107_;
 
5483
                                UnityApplicationPreview* _tmp108_;
 
5484
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp109_;
 
5485
                                const gchar* _tmp110_;
 
5486
                                const gchar* _tmp111_;
 
5487
                                UnityRatingsDatabase* _tmp112_;
 
5488
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp121_;
4996
5489
                                const gchar* _tmp122_;
4997
 
                                gboolean _tmp123_ = FALSE;
4998
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp194_;
4999
 
                                const gchar* _tmp195_;
5000
 
                                const gchar* _tmp196_;
5001
 
                                gchar* _tmp197_;
5002
 
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp198_;
5003
 
                                const gchar* _tmp199_;
5004
 
                                const gchar* _tmp200_;
5005
 
                                gchar* _tmp201_;
 
5490
                                const gchar* _tmp123_;
 
5491
                                const gchar* _tmp131_;
 
5492
                                gboolean _tmp132_ = FALSE;
 
5493
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp211_;
 
5494
                                const gchar* _tmp212_;
 
5495
                                const gchar* _tmp213_;
 
5496
                                gchar* _tmp214_;
 
5497
                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp215_;
 
5498
                                const gchar* _tmp216_;
 
5499
                                const gchar* _tmp217_;
 
5500
                                gchar* _tmp218_;
5006
5501
                                _tmp42_ = self->priv->sc_data_provider;
5007
5502
                                if (_tmp42_ == NULL) {
5008
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp43_;
 
5503
                                        UnityApplicationsLensSoftwareCenterDataCache* _tmp43_;
5009
5504
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp44_;
5010
 
                                        _tmp43_ = unity_applications_lens_software_center_data_provider_proxy_new ();
 
5505
                                        _tmp43_ = unity_applications_lens_software_center_data_cache_new (UNITY_APPLICATIONS_LENS_TOP_RATED_ITEMS_CACHE_LIFETIME);
5011
5506
                                        _g_object_unref0 (self->priv->sc_data_provider);
5012
 
                                        self->priv->sc_data_provider = _tmp43_;
 
5507
                                        self->priv->sc_data_provider = (UnityApplicationsLensSoftwareCenterDataProviderProxy*) _tmp43_;
5013
5508
                                        _tmp44_ = self->priv->sc_data_provider;
5014
5509
                                        unity_applications_lens_software_center_data_provider_proxy_connect_to (_tmp44_, &_inner_error_);
5015
5510
                                        if (_inner_error_ != NULL) {
5016
 
                                                goto __catch11_g_error;
 
5511
                                                goto __catch12_g_error;
5017
5512
                                        }
5018
5513
                                }
5019
5514
                                _tmp45_ = pkgname;
5020
5515
                                _tmp46_ = appname;
5021
 
                                g_debug ("daemon.vala:1178: Requesting pkg info: %s, %s\n", _tmp45_, _tmp46_);
 
5516
                                g_debug ("daemon.vala:1296: Requesting pkg info: %s, %s\n", _tmp45_, _tmp46_);
5022
5517
                                _tmp47_ = self->priv->sc_data_provider;
5023
5518
                                _tmp48_ = appname;
5024
5519
                                _tmp49_ = pkgname;
5026
5521
                                _tmp51_ = _tmp50_;
5027
5522
                                _g_hash_table_unref0 (_tmp51_);
5028
5523
                                if (_inner_error_ != NULL) {
5029
 
                                        goto __catch11_g_error;
 
5524
                                        goto __catch12_g_error;
5030
5525
                                }
5031
 
                                _tmp52_ = self->priv->sc_data_provider;
5032
 
                                _tmp53_ = unity_applications_lens_software_center_data_provider_proxy_get_icon (_tmp52_);
5033
 
                                _tmp54_ = _tmp53_;
5034
 
                                _tmp55_ = (GThemedIcon*) g_themed_icon_new (_tmp54_);
5035
 
                                icon = (GIcon*) _tmp55_;
5036
 
                                screenshot = NULL;
5037
 
                                _tmp56_ = self->priv->sc_data_provider;
5038
 
                                _tmp57_ = unity_applications_lens_software_center_data_provider_proxy_get_screenshot (_tmp56_);
5039
 
                                _tmp58_ = _tmp57_;
5040
 
                                if (_tmp58_ != NULL) {
5041
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp59_;
5042
 
                                        const gchar* _tmp60_;
5043
 
                                        const gchar* _tmp61_;
 
5526
                                _tmp52_ = installed;
 
5527
                                if (_tmp52_) {
 
5528
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp53_;
 
5529
                                        const gchar* _tmp54_;
 
5530
                                        const gchar* _tmp55_;
 
5531
                                        GThemedIcon* _tmp56_;
 
5532
                                        _tmp53_ = self->priv->sc_data_provider;
 
5533
                                        _tmp54_ = unity_applications_lens_software_center_data_provider_proxy_get_icon (_tmp53_);
 
5534
                                        _tmp55_ = _tmp54_;
 
5535
                                        _tmp56_ = (GThemedIcon*) g_themed_icon_new (_tmp55_);
 
5536
                                        _g_object_unref0 (icon);
 
5537
                                        icon = (GIcon*) _tmp56_;
 
5538
                                } else {
 
5539
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp57_;
 
5540
                                        const gchar* _tmp58_;
 
5541
                                        const gchar* _tmp59_;
 
5542
                                        gchar* _tmp60_ = NULL;
 
5543
                                        gchar* _tmp61_;
5044
5544
                                        GFile* _tmp62_ = NULL;
5045
 
                                        GFile* scr_file;
5046
5545
                                        GFile* _tmp63_;
5047
5546
                                        GFileIcon* _tmp64_;
5048
 
                                        _tmp59_ = self->priv->sc_data_provider;
5049
 
                                        _tmp60_ = unity_applications_lens_software_center_data_provider_proxy_get_screenshot (_tmp59_);
 
5547
                                        _tmp57_ = self->priv->sc_data_provider;
 
5548
                                        _tmp58_ = unity_applications_lens_software_center_data_provider_proxy_get_icon (_tmp57_);
 
5549
                                        _tmp59_ = _tmp58_;
 
5550
                                        _tmp60_ = unity_applications_lens_daemon_find_app_install_icon_path (self, _tmp59_);
5050
5551
                                        _tmp61_ = _tmp60_;
5051
 
                                        _tmp62_ = g_file_new_for_uri (_tmp61_);
5052
 
                                        scr_file = _tmp62_;
5053
 
                                        _tmp63_ = scr_file;
 
5552
                                        _tmp62_ = g_file_new_for_path (_tmp61_);
 
5553
                                        _tmp63_ = _tmp62_;
5054
5554
                                        _tmp64_ = (GFileIcon*) g_file_icon_new (_tmp63_);
 
5555
                                        _g_object_unref0 (icon);
 
5556
                                        icon = (GIcon*) _tmp64_;
 
5557
                                        _g_object_unref0 (_tmp63_);
 
5558
                                        _g_free0 (_tmp61_);
 
5559
                                }
 
5560
                                screenshot = NULL;
 
5561
                                _tmp65_ = self->priv->sc_data_provider;
 
5562
                                _tmp66_ = unity_applications_lens_software_center_data_provider_proxy_get_screenshot (_tmp65_);
 
5563
                                _tmp67_ = _tmp66_;
 
5564
                                if (_tmp67_ != NULL) {
 
5565
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp68_;
 
5566
                                        const gchar* _tmp69_;
 
5567
                                        const gchar* _tmp70_;
 
5568
                                        GFile* _tmp71_ = NULL;
 
5569
                                        GFile* scr_file;
 
5570
                                        GFile* _tmp72_;
 
5571
                                        GFileIcon* _tmp73_;
 
5572
                                        _tmp68_ = self->priv->sc_data_provider;
 
5573
                                        _tmp69_ = unity_applications_lens_software_center_data_provider_proxy_get_screenshot (_tmp68_);
 
5574
                                        _tmp70_ = _tmp69_;
 
5575
                                        _tmp71_ = g_file_new_for_uri (_tmp70_);
 
5576
                                        scr_file = _tmp71_;
 
5577
                                        _tmp72_ = scr_file;
 
5578
                                        _tmp73_ = (GFileIcon*) g_file_icon_new (_tmp72_);
5055
5579
                                        _g_object_unref0 (screenshot);
5056
 
                                        screenshot = (GIcon*) _tmp64_;
 
5580
                                        screenshot = (GIcon*) _tmp73_;
5057
5581
                                        _g_object_unref0 (scr_file);
5058
5582
                                }
5059
 
                                _tmp65_ = g_strdup ("");
5060
 
                                subtitle = _tmp65_;
5061
 
                                _tmp66_ = self->priv->sc_data_provider;
5062
 
                                _tmp67_ = unity_applications_lens_software_center_data_provider_proxy_get_version (_tmp66_);
5063
 
                                _tmp68_ = _tmp67_;
5064
 
                                if (g_strcmp0 (_tmp68_, "") != 0) {
5065
 
                                        const gchar* _tmp69_ = NULL;
5066
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp70_;
5067
 
                                        const gchar* _tmp71_;
5068
 
                                        const gchar* _tmp72_;
5069
 
                                        gchar* _tmp73_ = NULL;
5070
 
                                        _tmp69_ = _ ("Version %s");
5071
 
                                        _tmp70_ = self->priv->sc_data_provider;
5072
 
                                        _tmp71_ = unity_applications_lens_software_center_data_provider_proxy_get_version (_tmp70_);
5073
 
                                        _tmp72_ = _tmp71_;
5074
 
                                        _tmp73_ = g_strdup_printf (_tmp69_, _tmp72_);
5075
 
                                        _g_free0 (subtitle);
5076
 
                                        subtitle = _tmp73_;
5077
 
                                }
5078
 
                                _tmp74_ = self->priv->sc_data_provider;
5079
 
                                _tmp75_ = unity_applications_lens_software_center_data_provider_proxy_get_size (_tmp74_);
5080
 
                                _tmp76_ = _tmp75_;
5081
 
                                if (_tmp76_ > ((gint64) 0)) {
5082
 
                                        const gchar* _tmp77_;
 
5583
                                _tmp74_ = g_strdup ("");
 
5584
                                subtitle = _tmp74_;
 
5585
                                _tmp75_ = self->priv->sc_data_provider;
 
5586
                                _tmp76_ = unity_applications_lens_software_center_data_provider_proxy_get_version (_tmp75_);
 
5587
                                _tmp77_ = _tmp76_;
 
5588
                                if (g_strcmp0 (_tmp77_, "") != 0) {
 
5589
                                        const gchar* _tmp78_ = NULL;
 
5590
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp79_;
5083
5591
                                        const gchar* _tmp80_;
5084
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp81_;
5085
 
                                        gint64 _tmp82_;
5086
 
                                        gint64 _tmp83_;
5087
 
                                        gchar* _tmp84_ = NULL;
5088
 
                                        gchar* _tmp85_;
5089
 
                                        gchar* _tmp86_ = NULL;
5090
 
                                        gchar* _tmp87_;
5091
 
                                        gchar* _tmp88_;
5092
 
                                        _tmp77_ = subtitle;
5093
 
                                        if (g_strcmp0 (_tmp77_, "") != 0) {
5094
 
                                                const gchar* _tmp78_;
5095
 
                                                gchar* _tmp79_;
5096
 
                                                _tmp78_ = subtitle;
5097
 
                                                _tmp79_ = g_strconcat (_tmp78_, ", ", NULL);
 
5592
                                        const gchar* _tmp81_;
 
5593
                                        gchar* _tmp82_ = NULL;
 
5594
                                        _tmp78_ = _ ("Version %s");
 
5595
                                        _tmp79_ = self->priv->sc_data_provider;
 
5596
                                        _tmp80_ = unity_applications_lens_software_center_data_provider_proxy_get_version (_tmp79_);
 
5597
                                        _tmp81_ = _tmp80_;
 
5598
                                        _tmp82_ = g_strdup_printf (_tmp78_, _tmp81_);
 
5599
                                        _g_free0 (subtitle);
 
5600
                                        subtitle = _tmp82_;
 
5601
                                }
 
5602
                                _tmp83_ = self->priv->sc_data_provider;
 
5603
                                _tmp84_ = unity_applications_lens_software_center_data_provider_proxy_get_size (_tmp83_);
 
5604
                                _tmp85_ = _tmp84_;
 
5605
                                if (_tmp85_ > ((gint64) 0)) {
 
5606
                                        const gchar* _tmp86_;
 
5607
                                        const gchar* _tmp89_;
 
5608
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp90_;
 
5609
                                        gint64 _tmp91_;
 
5610
                                        gint64 _tmp92_;
 
5611
                                        gchar* _tmp93_ = NULL;
 
5612
                                        gchar* _tmp94_;
 
5613
                                        gchar* _tmp95_ = NULL;
 
5614
                                        gchar* _tmp96_;
 
5615
                                        gchar* _tmp97_;
 
5616
                                        _tmp86_ = subtitle;
 
5617
                                        if (g_strcmp0 (_tmp86_, "") != 0) {
 
5618
                                                const gchar* _tmp87_;
 
5619
                                                gchar* _tmp88_;
 
5620
                                                _tmp87_ = subtitle;
 
5621
                                                _tmp88_ = g_strconcat (_tmp87_, ", ", NULL);
5098
5622
                                                _g_free0 (subtitle);
5099
 
                                                subtitle = _tmp79_;
 
5623
                                                subtitle = _tmp88_;
5100
5624
                                        }
5101
 
                                        _tmp80_ = subtitle;
5102
 
                                        _tmp81_ = self->priv->sc_data_provider;
5103
 
                                        _tmp82_ = unity_applications_lens_software_center_data_provider_proxy_get_size (_tmp81_);
5104
 
                                        _tmp83_ = _tmp82_;
5105
 
                                        _tmp84_ = g_format_size_full ((guint64) _tmp83_, G_FORMAT_SIZE_DEFAULT);
5106
 
                                        _tmp85_ = _tmp84_;
5107
 
                                        _tmp86_ = g_strdup_printf ("Size %s", _tmp85_);
5108
 
                                        _tmp87_ = _tmp86_;
5109
 
                                        _tmp88_ = g_strconcat (_tmp80_, _tmp87_, NULL);
 
5625
                                        _tmp89_ = subtitle;
 
5626
                                        _tmp90_ = self->priv->sc_data_provider;
 
5627
                                        _tmp91_ = unity_applications_lens_software_center_data_provider_proxy_get_size (_tmp90_);
 
5628
                                        _tmp92_ = _tmp91_;
 
5629
                                        _tmp93_ = g_format_size_full ((guint64) _tmp92_, G_FORMAT_SIZE_DEFAULT);
 
5630
                                        _tmp94_ = _tmp93_;
 
5631
                                        _tmp95_ = g_strdup_printf ("Size %s", _tmp94_);
 
5632
                                        _tmp96_ = _tmp95_;
 
5633
                                        _tmp97_ = g_strconcat (_tmp89_, _tmp96_, NULL);
5110
5634
                                        _g_free0 (subtitle);
5111
 
                                        subtitle = _tmp88_;
5112
 
                                        _g_free0 (_tmp87_);
5113
 
                                        _g_free0 (_tmp85_);
 
5635
                                        subtitle = _tmp97_;
 
5636
                                        _g_free0 (_tmp96_);
 
5637
                                        _g_free0 (_tmp94_);
5114
5638
                                }
5115
 
                                _tmp89_ = self->priv->sc_data_provider;
5116
 
                                _tmp90_ = unity_applications_lens_software_center_data_provider_proxy_get_name (_tmp89_);
5117
 
                                _tmp91_ = _tmp90_;
5118
 
                                _tmp92_ = subtitle;
5119
 
                                _tmp93_ = self->priv->sc_data_provider;
5120
 
                                _tmp94_ = unity_applications_lens_software_center_data_provider_proxy_get_description (_tmp93_);
5121
 
                                _tmp95_ = _tmp94_;
5122
 
                                _tmp96_ = icon;
5123
 
                                _tmp97_ = screenshot;
5124
 
                                _tmp98_ = unity_application_preview_new (_tmp91_, _tmp92_, _tmp95_, _tmp96_, _tmp97_);
 
5639
                                _tmp98_ = self->priv->sc_data_provider;
 
5640
                                _tmp99_ = unity_applications_lens_software_center_data_provider_proxy_get_name (_tmp98_);
 
5641
                                _tmp100_ = _tmp99_;
 
5642
                                _tmp101_ = subtitle;
 
5643
                                _tmp102_ = self->priv->sc_data_provider;
 
5644
                                _tmp103_ = unity_applications_lens_software_center_data_provider_proxy_get_description (_tmp102_);
 
5645
                                _tmp104_ = _tmp103_;
 
5646
                                _tmp105_ = icon;
 
5647
                                _tmp106_ = screenshot;
 
5648
                                _tmp107_ = unity_application_preview_new (_tmp100_, _tmp101_, _tmp104_, _tmp105_, _tmp106_);
5125
5649
                                _g_object_unref0 (preview);
5126
 
                                preview = _tmp98_;
5127
 
                                _tmp99_ = preview;
5128
 
                                _tmp100_ = self->priv->sc_data_provider;
5129
 
                                _tmp101_ = unity_applications_lens_software_center_data_provider_proxy_get_license (_tmp100_);
5130
 
                                _tmp102_ = _tmp101_;
5131
 
                                unity_application_preview_set_license (_tmp99_, _tmp102_);
5132
 
                                _tmp103_ = self->priv->ratings;
5133
 
                                if (_tmp103_ != NULL) {
 
5650
                                preview = _tmp107_;
 
5651
                                _tmp108_ = preview;
 
5652
                                _tmp109_ = self->priv->sc_data_provider;
 
5653
                                _tmp110_ = unity_applications_lens_software_center_data_provider_proxy_get_license (_tmp109_);
 
5654
                                _tmp111_ = _tmp110_;
 
5655
                                unity_application_preview_set_license (_tmp108_, _tmp111_);
 
5656
                                _tmp112_ = self->priv->ratings;
 
5657
                                if (_tmp112_ != NULL) {
5134
5658
                                        UnityRatingsResult _result_ = {0};
5135
 
                                        UnityRatingsDatabase* _tmp104_;
5136
 
                                        const gchar* _tmp105_;
5137
 
                                        UnityRatingsResult _tmp106_ = {0};
5138
 
                                        UnityApplicationPreview* _tmp107_;
5139
 
                                        UnityRatingsResult _tmp108_;
5140
 
                                        gint32 _tmp109_;
5141
 
                                        UnityRatingsResult _tmp110_;
5142
 
                                        gint32 _tmp111_;
5143
 
                                        _tmp104_ = self->priv->ratings;
5144
 
                                        _tmp105_ = pkgname;
5145
 
                                        unity_ratings_database_query (_tmp104_, _tmp105_, &_tmp106_);
5146
 
                                        _result_ = _tmp106_;
5147
 
                                        _tmp107_ = preview;
5148
 
                                        _tmp108_ = _result_;
5149
 
                                        _tmp109_ = _tmp108_.average_rating;
5150
 
                                        _tmp110_ = _result_;
5151
 
                                        _tmp111_ = _tmp110_.total_rating;
5152
 
                                        unity_application_preview_set_rating (_tmp107_, (gfloat) _tmp109_, (guint) _tmp111_);
5153
 
                                }
5154
 
                                _tmp112_ = self->priv->sc_data_provider;
5155
 
                                _tmp113_ = unity_applications_lens_software_center_data_provider_proxy_get_hardware_requirements (_tmp112_);
5156
 
                                _tmp114_ = _tmp113_;
5157
 
                                if (g_strcmp0 (_tmp114_, "") != 0) {
5158
 
                                        UnityApplicationPreview* _tmp115_;
5159
 
                                        const gchar* _tmp116_ = NULL;
5160
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp117_;
5161
 
                                        const gchar* _tmp118_;
5162
 
                                        const gchar* _tmp119_;
5163
 
                                        UnityInfoHint* _tmp120_;
5164
 
                                        UnityInfoHint* _tmp121_;
5165
 
                                        _tmp115_ = preview;
5166
 
                                        _tmp116_ = _ ("Hardware requirements");
5167
 
                                        _tmp117_ = self->priv->sc_data_provider;
5168
 
                                        _tmp118_ = unity_applications_lens_software_center_data_provider_proxy_get_hardware_requirements (_tmp117_);
5169
 
                                        _tmp119_ = _tmp118_;
5170
 
                                        _tmp120_ = unity_info_hint_new ("hardware-requirements", _tmp116_, NULL, _tmp119_);
5171
 
                                        _tmp121_ = g_object_ref_sink (_tmp120_);
5172
 
                                        unity_preview_add_info ((UnityPreview*) _tmp115_, _tmp121_);
5173
 
                                        _g_object_unref0 (_tmp121_);
5174
 
                                }
5175
 
                                _tmp122_ = uri;
5176
 
                                _tmp123_ = g_str_has_prefix (_tmp122_, "unity-install://");
5177
 
                                if (_tmp123_) {
5178
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp124_;
5179
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxyPackageState _tmp125_;
5180
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxyPackageState _tmp126_;
5181
 
                                        gboolean _tmp161_ = FALSE;
5182
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp162_;
5183
 
                                        const gchar* _tmp163_;
5184
 
                                        const gchar* _tmp164_;
5185
 
                                        gboolean _tmp168_;
5186
 
                                        _tmp124_ = self->priv->sc_data_provider;
5187
 
                                        _tmp125_ = unity_applications_lens_software_center_data_provider_proxy_get_pkg_state (_tmp124_);
5188
 
                                        _tmp126_ = _tmp125_;
5189
 
                                        if (_tmp126_ == UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_PROVIDER_PROXY_PACKAGE_STATE_NEEDS_PURCHASE) {
5190
 
                                                const gchar* _tmp127_ = NULL;
5191
 
                                                gchar* _tmp128_;
 
5659
                                        UnityRatingsDatabase* _tmp113_;
 
5660
                                        const gchar* _tmp114_;
 
5661
                                        UnityRatingsResult _tmp115_ = {0};
 
5662
                                        UnityApplicationPreview* _tmp116_;
 
5663
                                        UnityRatingsResult _tmp117_;
 
5664
                                        gint32 _tmp118_;
 
5665
                                        UnityRatingsResult _tmp119_;
 
5666
                                        gint32 _tmp120_;
 
5667
                                        _tmp113_ = self->priv->ratings;
 
5668
                                        _tmp114_ = pkgname;
 
5669
                                        unity_ratings_database_query (_tmp113_, _tmp114_, &_tmp115_);
 
5670
                                        _result_ = _tmp115_;
 
5671
                                        _tmp116_ = preview;
 
5672
                                        _tmp117_ = _result_;
 
5673
                                        _tmp118_ = _tmp117_.average_rating;
 
5674
                                        _tmp119_ = _result_;
 
5675
                                        _tmp120_ = _tmp119_.total_rating;
 
5676
                                        unity_application_preview_set_rating (_tmp116_, _tmp118_ / 5.0f, (guint) _tmp120_);
 
5677
                                }
 
5678
                                _tmp121_ = self->priv->sc_data_provider;
 
5679
                                _tmp122_ = unity_applications_lens_software_center_data_provider_proxy_get_hardware_requirements (_tmp121_);
 
5680
                                _tmp123_ = _tmp122_;
 
5681
                                if (g_strcmp0 (_tmp123_, "") != 0) {
 
5682
                                        UnityApplicationPreview* _tmp124_;
 
5683
                                        const gchar* _tmp125_ = NULL;
 
5684
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp126_;
 
5685
                                        const gchar* _tmp127_;
 
5686
                                        const gchar* _tmp128_;
 
5687
                                        UnityInfoHint* _tmp129_;
 
5688
                                        UnityInfoHint* _tmp130_;
 
5689
                                        _tmp124_ = preview;
 
5690
                                        _tmp125_ = _ ("Hardware requirements");
 
5691
                                        _tmp126_ = self->priv->sc_data_provider;
 
5692
                                        _tmp127_ = unity_applications_lens_software_center_data_provider_proxy_get_hardware_requirements (_tmp126_);
 
5693
                                        _tmp128_ = _tmp127_;
 
5694
                                        _tmp129_ = unity_info_hint_new ("hardware-requirements", _tmp125_, NULL, _tmp128_);
 
5695
                                        _tmp130_ = g_object_ref_sink (_tmp129_);
 
5696
                                        unity_preview_add_info ((UnityPreview*) _tmp124_, _tmp130_);
 
5697
                                        _g_object_unref0 (_tmp130_);
 
5698
                                }
 
5699
                                _tmp131_ = uri;
 
5700
                                _tmp132_ = g_str_has_prefix (_tmp131_, "unity-install://");
 
5701
                                if (_tmp132_) {
 
5702
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp133_;
 
5703
                                        UnityApplicationsLensSoftwareCenterDataProviderProxyPackageState _tmp134_;
 
5704
                                        UnityApplicationsLensSoftwareCenterDataProviderProxyPackageState _tmp135_;
 
5705
                                        gboolean _tmp175_ = FALSE;
 
5706
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp176_;
 
5707
                                        const gchar* _tmp177_;
 
5708
                                        const gchar* _tmp178_;
 
5709
                                        gboolean _tmp182_;
 
5710
                                        _tmp133_ = self->priv->sc_data_provider;
 
5711
                                        _tmp134_ = unity_applications_lens_software_center_data_provider_proxy_get_pkg_state (_tmp133_);
 
5712
                                        _tmp135_ = _tmp134_;
 
5713
                                        if (_tmp135_ == UNITY_APPLICATIONS_LENS_SOFTWARE_CENTER_DATA_PROVIDER_PROXY_PACKAGE_STATE_NEEDS_PURCHASE) {
 
5714
                                                const gchar* _tmp136_ = NULL;
 
5715
                                                gchar* _tmp137_;
5192
5716
                                                gchar* buy_str;
5193
 
                                                gboolean _tmp129_ = FALSE;
5194
 
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp130_;
5195
 
                                                const gchar* _tmp131_;
5196
 
                                                const gchar* _tmp132_;
5197
 
                                                gboolean _tmp136_;
5198
 
                                                const gchar* _tmp144_;
5199
 
                                                UnityPreviewAction* _tmp145_;
 
5717
                                                gboolean _tmp138_ = FALSE;
 
5718
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp139_;
 
5719
                                                const gchar* _tmp140_;
 
5720
                                                const gchar* _tmp141_;
 
5721
                                                gboolean _tmp145_;
 
5722
                                                const gchar* _tmp153_;
 
5723
                                                UnityPreviewAction* _tmp154_;
5200
5724
                                                UnityPreviewAction* buy_action;
5201
 
                                                UnityPreviewAction* _tmp146_;
5202
 
                                                UnityApplicationPreview* _tmp147_;
5203
 
                                                UnityPreviewAction* _tmp148_;
5204
 
                                                _tmp127_ = _ ("Buy");
5205
 
                                                _tmp128_ = g_strdup (_tmp127_);
5206
 
                                                buy_str = _tmp128_;
5207
 
                                                _tmp130_ = self->priv->sc_data_provider;
5208
 
                                                _tmp131_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp130_);
5209
 
                                                _tmp132_ = _tmp131_;
5210
 
                                                if (_tmp132_ != NULL) {
5211
 
                                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp133_;
5212
 
                                                        const gchar* _tmp134_;
5213
 
                                                        const gchar* _tmp135_;
5214
 
                                                        _tmp133_ = self->priv->sc_data_provider;
5215
 
                                                        _tmp134_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp133_);
5216
 
                                                        _tmp135_ = _tmp134_;
5217
 
                                                        _tmp129_ = g_strcmp0 (_tmp135_, "") != 0;
 
5725
                                                UnityPreviewAction* _tmp155_;
 
5726
                                                UnityApplicationPreview* _tmp156_;
 
5727
                                                UnityPreviewAction* _tmp157_;
 
5728
                                                _tmp136_ = _ ("Buy");
 
5729
                                                _tmp137_ = g_strdup (_tmp136_);
 
5730
                                                buy_str = _tmp137_;
 
5731
                                                _tmp139_ = self->priv->sc_data_provider;
 
5732
                                                _tmp140_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp139_);
 
5733
                                                _tmp141_ = _tmp140_;
 
5734
                                                if (_tmp141_ != NULL) {
 
5735
                                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp142_;
 
5736
                                                        const gchar* _tmp143_;
 
5737
                                                        const gchar* _tmp144_;
 
5738
                                                        _tmp142_ = self->priv->sc_data_provider;
 
5739
                                                        _tmp143_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp142_);
 
5740
                                                        _tmp144_ = _tmp143_;
 
5741
                                                        _tmp138_ = g_strcmp0 (_tmp144_, "") != 0;
5218
5742
                                                } else {
5219
 
                                                        _tmp129_ = FALSE;
 
5743
                                                        _tmp138_ = FALSE;
5220
5744
                                                }
5221
 
                                                _tmp136_ = _tmp129_;
5222
 
                                                if (_tmp136_) {
5223
 
                                                        const gchar* _tmp137_;
5224
 
                                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp138_;
5225
 
                                                        const gchar* _tmp139_;
5226
 
                                                        const gchar* _tmp140_;
5227
 
                                                        gchar* _tmp141_;
5228
 
                                                        gchar* _tmp142_;
5229
 
                                                        gchar* _tmp143_;
5230
 
                                                        _tmp137_ = buy_str;
5231
 
                                                        _tmp138_ = self->priv->sc_data_provider;
5232
 
                                                        _tmp139_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp138_);
5233
 
                                                        _tmp140_ = _tmp139_;
5234
 
                                                        _tmp141_ = g_strconcat (" ", _tmp140_, NULL);
5235
 
                                                        _tmp142_ = _tmp141_;
5236
 
                                                        _tmp143_ = g_strconcat (_tmp137_, _tmp142_, NULL);
 
5745
                                                _tmp145_ = _tmp138_;
 
5746
                                                if (_tmp145_) {
 
5747
                                                        const gchar* _tmp146_;
 
5748
                                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp147_;
 
5749
                                                        const gchar* _tmp148_;
 
5750
                                                        const gchar* _tmp149_;
 
5751
                                                        gchar* _tmp150_;
 
5752
                                                        gchar* _tmp151_;
 
5753
                                                        gchar* _tmp152_;
 
5754
                                                        _tmp146_ = buy_str;
 
5755
                                                        _tmp147_ = self->priv->sc_data_provider;
 
5756
                                                        _tmp148_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp147_);
 
5757
                                                        _tmp149_ = _tmp148_;
 
5758
                                                        _tmp150_ = g_strconcat (" ", _tmp149_, NULL);
 
5759
                                                        _tmp151_ = _tmp150_;
 
5760
                                                        _tmp152_ = g_strconcat (_tmp146_, _tmp151_, NULL);
5237
5761
                                                        _g_free0 (buy_str);
5238
 
                                                        buy_str = _tmp143_;
5239
 
                                                        _g_free0 (_tmp142_);
 
5762
                                                        buy_str = _tmp152_;
 
5763
                                                        _g_free0 (_tmp151_);
5240
5764
                                                }
5241
 
                                                _tmp144_ = buy_str;
5242
 
                                                _tmp145_ = unity_preview_action_new ("buy", _tmp144_, NULL);
5243
 
                                                buy_action = _tmp145_;
5244
 
                                                _tmp146_ = buy_action;
5245
 
                                                g_signal_connect_object (_tmp146_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_buy_unity_preview_action_activated, self, 0);
5246
 
                                                _tmp147_ = preview;
5247
 
                                                _tmp148_ = buy_action;
5248
 
                                                unity_preview_add_action ((UnityPreview*) _tmp147_, _tmp148_);
 
5765
                                                _tmp153_ = buy_str;
 
5766
                                                _tmp154_ = unity_preview_action_new ("buy", _tmp153_, NULL);
 
5767
                                                buy_action = _tmp154_;
 
5768
                                                _tmp155_ = buy_action;
 
5769
                                                g_signal_connect_object (_tmp155_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_buy_unity_preview_action_activated, self, 0);
 
5770
                                                _tmp156_ = preview;
 
5771
                                                _tmp157_ = buy_action;
 
5772
                                                unity_preview_add_action ((UnityPreview*) _tmp156_, _tmp157_);
5249
5773
                                                _g_object_unref0 (buy_action);
5250
5774
                                                _g_free0 (buy_str);
5251
5775
                                        } else {
5252
5776
                                                UnityPreviewAction* install_action;
5253
 
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp149_;
5254
 
                                                const gchar* _tmp150_;
5255
 
                                                const gchar* _tmp151_;
5256
 
                                                UnityApplicationPreview* _tmp159_;
5257
 
                                                UnityPreviewAction* _tmp160_;
 
5777
                                                gboolean _tmp158_ = FALSE;
 
5778
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp159_;
 
5779
                                                const gchar* _tmp160_;
 
5780
                                                const gchar* _tmp161_;
 
5781
                                                gboolean _tmp165_;
 
5782
                                                UnityApplicationPreview* _tmp173_;
 
5783
                                                UnityPreviewAction* _tmp174_;
5258
5784
                                                install_action = NULL;
5259
 
                                                _tmp149_ = self->priv->sc_data_provider;
5260
 
                                                _tmp150_ = unity_applications_lens_software_center_data_provider_proxy_get_price (_tmp149_);
5261
 
                                                _tmp151_ = _tmp150_;
5262
 
                                                if (g_strcmp0 (_tmp151_, "") == 0) {
5263
 
                                                        const gchar* _tmp152_ = NULL;
5264
 
                                                        UnityPreviewAction* _tmp153_;
5265
 
                                                        UnityPreviewAction* _tmp154_;
5266
 
                                                        _tmp152_ = _ ("Free Download");
5267
 
                                                        _tmp153_ = unity_preview_action_new ("install", _tmp152_, NULL);
5268
 
                                                        _g_object_unref0 (install_action);
5269
 
                                                        install_action = _tmp153_;
5270
 
                                                        _tmp154_ = install_action;
5271
 
                                                        g_signal_connect_object (_tmp154_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_unity_preview_action_activated, self, 0);
5272
 
                                                } else {
5273
 
                                                        const gchar* _tmp155_ = NULL;
5274
 
                                                        UnityPreviewAction* _tmp156_;
5275
 
                                                        UnityPreviewAction* _tmp157_;
5276
 
                                                        UnityPreviewAction* _tmp158_;
5277
 
                                                        _tmp155_ = _ ("Install");
5278
 
                                                        _tmp156_ = unity_preview_action_new ("install", _tmp155_, NULL);
5279
 
                                                        _g_object_unref0 (install_action);
5280
 
                                                        install_action = _tmp156_;
5281
 
                                                        _tmp157_ = install_action;
5282
 
                                                        g_signal_connect_object (_tmp157_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_commercial_unity_preview_action_activated, self, 0);
5283
 
                                                        _tmp158_ = install_action;
5284
 
                                                        g_signal_connect_object (_tmp158_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_unity_preview_action_activated, self, 0);
5285
 
                                                }
5286
 
                                                _tmp159_ = preview;
5287
 
                                                _tmp160_ = install_action;
5288
 
                                                unity_preview_add_action ((UnityPreview*) _tmp159_, _tmp160_);
 
5785
                                                _tmp159_ = self->priv->sc_data_provider;
 
5786
                                                _tmp160_ = unity_applications_lens_software_center_data_provider_proxy_get_raw_price (_tmp159_);
 
5787
                                                _tmp161_ = _tmp160_;
 
5788
                                                if (_tmp161_ == NULL) {
 
5789
                                                        _tmp158_ = TRUE;
 
5790
                                                } else {
 
5791
                                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp162_;
 
5792
                                                        const gchar* _tmp163_;
 
5793
                                                        const gchar* _tmp164_;
 
5794
                                                        _tmp162_ = self->priv->sc_data_provider;
 
5795
                                                        _tmp163_ = unity_applications_lens_software_center_data_provider_proxy_get_raw_price (_tmp162_);
 
5796
                                                        _tmp164_ = _tmp163_;
 
5797
                                                        _tmp158_ = g_strcmp0 (_tmp164_, "") == 0;
 
5798
                                                }
 
5799
                                                _tmp165_ = _tmp158_;
 
5800
                                                if (_tmp165_) {
 
5801
                                                        const gchar* _tmp166_ = NULL;
 
5802
                                                        UnityPreviewAction* _tmp167_;
 
5803
                                                        UnityPreviewAction* _tmp168_;
 
5804
                                                        _tmp166_ = _ ("Free Download");
 
5805
                                                        _tmp167_ = unity_preview_action_new ("install", _tmp166_, NULL);
 
5806
                                                        _g_object_unref0 (install_action);
 
5807
                                                        install_action = _tmp167_;
 
5808
                                                        _tmp168_ = install_action;
 
5809
                                                        g_signal_connect_object (_tmp168_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_unity_preview_action_activated, self, 0);
 
5810
                                                } else {
 
5811
                                                        const gchar* _tmp169_ = NULL;
 
5812
                                                        UnityPreviewAction* _tmp170_;
 
5813
                                                        UnityPreviewAction* _tmp171_;
 
5814
                                                        UnityPreviewAction* _tmp172_;
 
5815
                                                        _tmp169_ = _ ("Install");
 
5816
                                                        _tmp170_ = unity_preview_action_new ("install", _tmp169_, NULL);
 
5817
                                                        _g_object_unref0 (install_action);
 
5818
                                                        install_action = _tmp170_;
 
5819
                                                        _tmp171_ = install_action;
 
5820
                                                        g_signal_connect_object (_tmp171_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_commercial_unity_preview_action_activated, self, 0);
 
5821
                                                        _tmp172_ = install_action;
 
5822
                                                        g_signal_connect_object (_tmp172_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_install_unity_preview_action_activated, self, 0);
 
5823
                                                }
 
5824
                                                _tmp173_ = preview;
 
5825
                                                _tmp174_ = install_action;
 
5826
                                                unity_preview_add_action ((UnityPreview*) _tmp173_, _tmp174_);
5289
5827
                                                _g_object_unref0 (install_action);
5290
5828
                                        }
5291
 
                                        _tmp162_ = self->priv->sc_data_provider;
5292
 
                                        _tmp163_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp162_);
5293
 
                                        _tmp164_ = _tmp163_;
5294
 
                                        if (_tmp164_ != NULL) {
5295
 
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp165_;
5296
 
                                                const gchar* _tmp166_;
5297
 
                                                const gchar* _tmp167_;
5298
 
                                                _tmp165_ = self->priv->sc_data_provider;
5299
 
                                                _tmp166_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp165_);
5300
 
                                                _tmp167_ = _tmp166_;
5301
 
                                                _tmp161_ = g_strcmp0 (_tmp167_, "") != 0;
 
5829
                                        _tmp176_ = self->priv->sc_data_provider;
 
5830
                                        _tmp177_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp176_);
 
5831
                                        _tmp178_ = _tmp177_;
 
5832
                                        if (_tmp178_ != NULL) {
 
5833
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp179_;
 
5834
                                                const gchar* _tmp180_;
 
5835
                                                const gchar* _tmp181_;
 
5836
                                                _tmp179_ = self->priv->sc_data_provider;
 
5837
                                                _tmp180_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp179_);
 
5838
                                                _tmp181_ = _tmp180_;
 
5839
                                                _tmp175_ = g_strcmp0 (_tmp181_, "") != 0;
5302
5840
                                        } else {
5303
 
                                                _tmp161_ = FALSE;
 
5841
                                                _tmp175_ = FALSE;
5304
5842
                                        }
5305
 
                                        _tmp168_ = _tmp161_;
5306
 
                                        if (_tmp168_) {
5307
 
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp169_;
5308
 
                                                const gchar* _tmp170_;
5309
 
                                                const gchar* _tmp171_;
5310
 
                                                gchar* _tmp172_;
5311
 
                                                const gchar* _tmp173_ = NULL;
5312
 
                                                UnityPreviewAction* _tmp174_;
 
5843
                                        _tmp182_ = _tmp175_;
 
5844
                                        if (_tmp182_) {
 
5845
                                                UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp183_;
 
5846
                                                const gchar* _tmp184_;
 
5847
                                                const gchar* _tmp185_;
 
5848
                                                gchar* _tmp186_;
 
5849
                                                const gchar* _tmp187_ = NULL;
 
5850
                                                UnityPreviewAction* _tmp188_;
5313
5851
                                                UnityPreviewAction* website_action;
5314
 
                                                UnityPreviewAction* _tmp175_;
5315
 
                                                UnityApplicationPreview* _tmp176_;
5316
 
                                                UnityPreviewAction* _tmp177_;
5317
 
                                                _tmp169_ = self->priv->sc_data_provider;
5318
 
                                                _tmp170_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp169_);
5319
 
                                                _tmp171_ = _tmp170_;
5320
 
                                                _tmp172_ = g_strdup (_tmp171_);
 
5852
                                                UnityPreviewAction* _tmp189_;
 
5853
                                                UnityApplicationPreview* _tmp190_;
 
5854
                                                UnityPreviewAction* _tmp191_;
 
5855
                                                _tmp183_ = self->priv->sc_data_provider;
 
5856
                                                _tmp184_ = unity_applications_lens_software_center_data_provider_proxy_get_website (_tmp183_);
 
5857
                                                _tmp185_ = _tmp184_;
 
5858
                                                _tmp186_ = g_strdup (_tmp185_);
5321
5859
                                                _g_free0 (self->priv->preview_developer_website);
5322
 
                                                self->priv->preview_developer_website = _tmp172_;
5323
 
                                                _tmp173_ = _ ("Developer Site");
5324
 
                                                _tmp174_ = unity_preview_action_new ("website", _tmp173_, NULL);
5325
 
                                                website_action = _tmp174_;
5326
 
                                                _tmp175_ = website_action;
5327
 
                                                g_signal_connect_object (_tmp175_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_website_unity_preview_action_activated, self, 0);
5328
 
                                                _tmp176_ = preview;
5329
 
                                                _tmp177_ = website_action;
5330
 
                                                unity_preview_add_action ((UnityPreview*) _tmp176_, _tmp177_);
 
5860
                                                self->priv->preview_developer_website = _tmp186_;
 
5861
                                                _tmp187_ = _ ("Developer Site");
 
5862
                                                _tmp188_ = unity_preview_action_new ("website", _tmp187_, NULL);
 
5863
                                                website_action = _tmp188_;
 
5864
                                                _tmp189_ = website_action;
 
5865
                                                g_signal_connect_object (_tmp189_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_website_unity_preview_action_activated, self, 0);
 
5866
                                                _tmp190_ = preview;
 
5867
                                                _tmp191_ = website_action;
 
5868
                                                unity_preview_add_action ((UnityPreview*) _tmp190_, _tmp191_);
5331
5869
                                                _g_object_unref0 (website_action);
5332
5870
                                        }
5333
5871
                                } else {
5334
 
                                        UnityApplicationPreview* _tmp178_;
5335
 
                                        const gchar* _tmp179_ = NULL;
5336
 
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp180_;
5337
 
                                        const gchar* _tmp181_;
5338
 
                                        const gchar* _tmp182_;
5339
 
                                        UnityInfoHint* _tmp183_;
5340
 
                                        UnityInfoHint* _tmp184_;
5341
 
                                        const gchar* _tmp185_ = NULL;
5342
 
                                        UnityPreviewAction* _tmp186_;
 
5872
                                        UnityApplicationPreview* _tmp192_;
 
5873
                                        const gchar* _tmp193_ = NULL;
 
5874
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp194_;
 
5875
                                        const gchar* _tmp195_;
 
5876
                                        const gchar* _tmp196_;
 
5877
                                        UnityInfoHint* _tmp197_;
 
5878
                                        UnityInfoHint* _tmp198_;
 
5879
                                        const gchar* _tmp199_ = NULL;
 
5880
                                        UnityPreviewAction* _tmp200_;
5343
5881
                                        UnityPreviewAction* launch_action;
5344
 
                                        UnityApplicationPreview* _tmp187_;
5345
 
                                        UnityPreviewAction* _tmp188_;
5346
 
                                        const gchar* _tmp189_ = NULL;
5347
 
                                        UnityPreviewAction* _tmp190_;
5348
 
                                        UnityPreviewAction* uninstall_action;
5349
 
                                        UnityPreviewAction* _tmp191_;
5350
 
                                        UnityApplicationPreview* _tmp192_;
5351
 
                                        UnityPreviewAction* _tmp193_;
5352
 
                                        _tmp178_ = preview;
5353
 
                                        _tmp179_ = _ ("Installed on");
5354
 
                                        _tmp180_ = self->priv->sc_data_provider;
5355
 
                                        _tmp181_ = unity_applications_lens_software_center_data_provider_proxy_get_installation_date (_tmp180_);
5356
 
                                        _tmp182_ = _tmp181_;
5357
 
                                        _tmp183_ = unity_info_hint_new ("date-installed", _tmp179_, NULL, _tmp182_);
5358
 
                                        _tmp184_ = g_object_ref_sink (_tmp183_);
5359
 
                                        unity_preview_add_info ((UnityPreview*) _tmp178_, _tmp184_);
5360
 
                                        _g_object_unref0 (_tmp184_);
5361
 
                                        _tmp185_ = _ ("Launch");
5362
 
                                        _tmp186_ = unity_preview_action_new ("launch", _tmp185_, NULL);
5363
 
                                        launch_action = _tmp186_;
5364
 
                                        _tmp187_ = preview;
5365
 
                                        _tmp188_ = launch_action;
5366
 
                                        unity_preview_add_action ((UnityPreview*) _tmp187_, _tmp188_);
5367
 
                                        _tmp189_ = _ ("Uninstall");
5368
 
                                        _tmp190_ = unity_preview_action_new ("uninstall", _tmp189_, NULL);
5369
 
                                        uninstall_action = _tmp190_;
5370
 
                                        _tmp191_ = uninstall_action;
5371
 
                                        g_signal_connect_object (_tmp191_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_uninstall_unity_preview_action_activated, self, 0);
 
5882
                                        UnityApplicationPreview* _tmp201_;
 
5883
                                        UnityPreviewAction* _tmp202_;
 
5884
                                        UnityApplicationsLensSoftwareCenterDataProviderProxy* _tmp203_;
 
5885
                                        gboolean _tmp204_;
 
5886
                                        gboolean _tmp205_;
5372
5887
                                        _tmp192_ = preview;
5373
 
                                        _tmp193_ = uninstall_action;
5374
 
                                        unity_preview_add_action ((UnityPreview*) _tmp192_, _tmp193_);
5375
 
                                        _g_object_unref0 (uninstall_action);
 
5888
                                        _tmp193_ = _ ("Installed on");
 
5889
                                        _tmp194_ = self->priv->sc_data_provider;
 
5890
                                        _tmp195_ = unity_applications_lens_software_center_data_provider_proxy_get_installation_date (_tmp194_);
 
5891
                                        _tmp196_ = _tmp195_;
 
5892
                                        _tmp197_ = unity_info_hint_new ("date-installed", _tmp193_, NULL, _tmp196_);
 
5893
                                        _tmp198_ = g_object_ref_sink (_tmp197_);
 
5894
                                        unity_preview_add_info ((UnityPreview*) _tmp192_, _tmp198_);
 
5895
                                        _g_object_unref0 (_tmp198_);
 
5896
                                        _tmp199_ = _ ("Launch");
 
5897
                                        _tmp200_ = unity_preview_action_new ("launch", _tmp199_, NULL);
 
5898
                                        launch_action = _tmp200_;
 
5899
                                        _tmp201_ = preview;
 
5900
                                        _tmp202_ = launch_action;
 
5901
                                        unity_preview_add_action ((UnityPreview*) _tmp201_, _tmp202_);
 
5902
                                        _tmp203_ = self->priv->sc_data_provider;
 
5903
                                        _tmp204_ = unity_applications_lens_software_center_data_provider_proxy_get_is_desktop_dependency (_tmp203_);
 
5904
                                        _tmp205_ = _tmp204_;
 
5905
                                        if (!_tmp205_) {
 
5906
                                                const gchar* _tmp206_ = NULL;
 
5907
                                                UnityPreviewAction* _tmp207_;
 
5908
                                                UnityPreviewAction* uninstall_action;
 
5909
                                                UnityPreviewAction* _tmp208_;
 
5910
                                                UnityApplicationPreview* _tmp209_;
 
5911
                                                UnityPreviewAction* _tmp210_;
 
5912
                                                _tmp206_ = _ ("Uninstall");
 
5913
                                                _tmp207_ = unity_preview_action_new ("uninstall", _tmp206_, NULL);
 
5914
                                                uninstall_action = _tmp207_;
 
5915
                                                _tmp208_ = uninstall_action;
 
5916
                                                g_signal_connect_object (_tmp208_, "activated", (GCallback) _unity_applications_lens_daemon_app_preview_uninstall_unity_preview_action_activated, self, 0);
 
5917
                                                _tmp209_ = preview;
 
5918
                                                _tmp210_ = uninstall_action;
 
5919
                                                unity_preview_add_action ((UnityPreview*) _tmp209_, _tmp210_);
 
5920
                                                _g_object_unref0 (uninstall_action);
 
5921
                                        }
5376
5922
                                        _g_object_unref0 (launch_action);
5377
5923
                                }
5378
 
                                _tmp194_ = self->priv->sc_data_provider;
5379
 
                                _tmp195_ = unity_applications_lens_software_center_data_provider_proxy_get_desktop_file (_tmp194_);
5380
 
                                _tmp196_ = _tmp195_;
5381
 
                                _tmp197_ = g_strdup (_tmp196_);
 
5924
                                _tmp211_ = self->priv->sc_data_provider;
 
5925
                                _tmp212_ = unity_applications_lens_software_center_data_provider_proxy_get_desktop_file (_tmp211_);
 
5926
                                _tmp213_ = _tmp212_;
 
5927
                                _tmp214_ = g_strdup (_tmp213_);
5382
5928
                                _g_free0 (self->priv->preview_installable_desktop_file);
5383
 
                                self->priv->preview_installable_desktop_file = _tmp197_;
5384
 
                                _tmp198_ = self->priv->sc_data_provider;
5385
 
                                _tmp199_ = unity_applications_lens_software_center_data_provider_proxy_get_icon (_tmp198_);
5386
 
                                _tmp200_ = _tmp199_;
5387
 
                                _tmp201_ = g_strdup (_tmp200_);
 
5929
                                self->priv->preview_installable_desktop_file = _tmp214_;
 
5930
                                _tmp215_ = self->priv->sc_data_provider;
 
5931
                                _tmp216_ = unity_applications_lens_software_center_data_provider_proxy_get_icon (_tmp215_);
 
5932
                                _tmp217_ = _tmp216_;
 
5933
                                _tmp218_ = g_strdup (_tmp217_);
5388
5934
                                _g_free0 (self->priv->preview_installable_icon_file);
5389
 
                                self->priv->preview_installable_icon_file = _tmp201_;
 
5935
                                self->priv->preview_installable_icon_file = _tmp218_;
5390
5936
                                _g_free0 (subtitle);
5391
5937
                                _g_object_unref0 (screenshot);
5392
5938
                                _g_object_unref0 (icon);
5393
5939
                        }
5394
 
                        goto __finally11;
5395
 
                        __catch11_g_error:
 
5940
                        goto __finally12;
 
5941
                        __catch12_g_error:
5396
5942
                        {
5397
5943
                                GError* e = NULL;
5398
 
                                const gchar* _tmp202_;
5399
 
                                GError* _tmp203_;
5400
 
                                const gchar* _tmp204_;
 
5944
                                const gchar* _tmp219_;
 
5945
                                GError* _tmp220_;
 
5946
                                const gchar* _tmp221_;
5401
5947
                                e = _inner_error_;
5402
5948
                                _inner_error_ = NULL;
5403
 
                                _tmp202_ = uri;
5404
 
                                _tmp203_ = e;
5405
 
                                _tmp204_ = _tmp203_->message;
5406
 
                                g_warning ("daemon.vala:1267: Failed to get package details for '%s': %s", _tmp202_, _tmp204_);
 
5949
                                _tmp219_ = uri;
 
5950
                                _tmp220_ = e;
 
5951
                                _tmp221_ = _tmp220_->message;
 
5952
                                g_warning ("daemon.vala:1393: Failed to get package details for '%s': %s", _tmp219_, _tmp221_);
5407
5953
                                _g_object_unref0 (preview);
5408
5954
                                preview = NULL;
5409
5955
                                _g_error_free0 (e);
5410
5956
                        }
5411
 
                        __finally11:
 
5957
                        __finally12:
5412
5958
                        if (_inner_error_ != NULL) {
5413
5959
                                _g_free0 (desktopfile);
5414
5960
                                _g_free0 (appname);
5419
5965
                                return NULL;
5420
5966
                        }
5421
5967
                }
5422
 
                _tmp206_ = preview;
5423
 
                if (_tmp206_ == NULL) {
5424
 
                        const gchar* _tmp207_;
5425
 
                        _tmp207_ = desktopfile;
5426
 
                        _tmp205_ = _tmp207_ != NULL;
 
5968
                _tmp223_ = preview;
 
5969
                if (_tmp223_ == NULL) {
 
5970
                        const gchar* _tmp224_;
 
5971
                        _tmp224_ = desktopfile;
 
5972
                        _tmp222_ = _tmp224_ != NULL;
5427
5973
                } else {
5428
 
                        _tmp205_ = FALSE;
 
5974
                        _tmp222_ = FALSE;
5429
5975
                }
5430
 
                _tmp208_ = _tmp205_;
5431
 
                if (_tmp208_) {
5432
 
                        const gchar* _tmp209_;
5433
 
                        GDesktopAppInfo* _tmp210_;
 
5976
                _tmp225_ = _tmp222_;
 
5977
                if (_tmp225_) {
 
5978
                        const gchar* _tmp226_;
 
5979
                        GDesktopAppInfo* _tmp227_;
5434
5980
                        GDesktopAppInfo* app_info;
5435
 
                        GDesktopAppInfo* _tmp211_;
5436
 
                        _tmp209_ = desktopfile;
5437
 
                        _tmp210_ = g_desktop_app_info_new (_tmp209_);
5438
 
                        app_info = _tmp210_;
5439
 
                        _tmp211_ = app_info;
5440
 
                        if (_tmp211_ != NULL) {
5441
 
                                GDesktopAppInfo* _tmp212_;
5442
 
                                const gchar* _tmp213_ = NULL;
5443
 
                                gchar* _tmp214_;
5444
 
                                gchar* _tmp215_;
5445
 
                                const gchar* _tmp216_;
5446
 
                                GDesktopAppInfo* _tmp218_;
5447
 
                                const gchar* _tmp219_ = NULL;
5448
 
                                const gchar* _tmp220_;
5449
 
                                GDesktopAppInfo* _tmp221_;
5450
 
                                GIcon* _tmp222_ = NULL;
5451
 
                                UnityApplicationPreview* _tmp223_;
5452
 
                                const gchar* _tmp224_ = NULL;
5453
 
                                UnityPreviewAction* _tmp225_;
 
5981
                        GDesktopAppInfo* _tmp228_;
 
5982
                        _tmp226_ = desktopfile;
 
5983
                        _tmp227_ = g_desktop_app_info_new (_tmp226_);
 
5984
                        app_info = _tmp227_;
 
5985
                        _tmp228_ = app_info;
 
5986
                        if (_tmp228_ != NULL) {
 
5987
                                GDesktopAppInfo* _tmp229_;
 
5988
                                const gchar* _tmp230_ = NULL;
 
5989
                                gchar* _tmp231_;
 
5990
                                gchar* _tmp232_;
 
5991
                                const gchar* _tmp233_;
 
5992
                                GDesktopAppInfo* _tmp235_;
 
5993
                                const gchar* _tmp236_ = NULL;
 
5994
                                const gchar* _tmp237_;
 
5995
                                GDesktopAppInfo* _tmp238_;
 
5996
                                GIcon* _tmp239_ = NULL;
 
5997
                                UnityApplicationPreview* _tmp240_;
 
5998
                                const gchar* _tmp241_ = NULL;
 
5999
                                UnityPreviewAction* _tmp242_;
5454
6000
                                UnityPreviewAction* launch_action;
5455
 
                                UnityApplicationPreview* _tmp226_;
5456
 
                                UnityPreviewAction* _tmp227_;
5457
 
                                _tmp212_ = app_info;
5458
 
                                _tmp213_ = g_app_info_get_description ((GAppInfo*) _tmp212_);
5459
 
                                _tmp214_ = g_strdup (_tmp213_);
5460
 
                                _tmp215_ = _tmp214_;
5461
 
                                _tmp216_ = _tmp215_;
5462
 
                                if (_tmp216_ == NULL) {
5463
 
                                        gchar* _tmp217_;
5464
 
                                        _tmp217_ = g_strdup ("");
5465
 
                                        _g_free0 (_tmp215_);
5466
 
                                        _tmp215_ = _tmp217_;
 
6001
                                UnityApplicationPreview* _tmp243_;
 
6002
                                UnityPreviewAction* _tmp244_;
 
6003
                                _tmp229_ = app_info;
 
6004
                                _tmp230_ = g_app_info_get_description ((GAppInfo*) _tmp229_);
 
6005
                                _tmp231_ = g_strdup (_tmp230_);
 
6006
                                _tmp232_ = _tmp231_;
 
6007
                                _tmp233_ = _tmp232_;
 
6008
                                if (_tmp233_ == NULL) {
 
6009
                                        gchar* _tmp234_;
 
6010
                                        _tmp234_ = g_strdup ("");
 
6011
                                        _g_free0 (_tmp232_);
 
6012
                                        _tmp232_ = _tmp234_;
5467
6013
                                }
5468
 
                                _tmp218_ = app_info;
5469
 
                                _tmp219_ = g_app_info_get_display_name ((GAppInfo*) _tmp218_);
5470
 
                                _tmp220_ = _tmp215_;
5471
 
                                _tmp221_ = app_info;
5472
 
                                _tmp222_ = g_app_info_get_icon ((GAppInfo*) _tmp221_);
5473
 
                                _tmp223_ = unity_application_preview_new (_tmp219_, "", _tmp220_, _tmp222_, NULL);
 
6014
                                _tmp235_ = app_info;
 
6015
                                _tmp236_ = g_app_info_get_display_name ((GAppInfo*) _tmp235_);
 
6016
                                _tmp237_ = _tmp232_;
 
6017
                                _tmp238_ = app_info;
 
6018
                                _tmp239_ = g_app_info_get_icon ((GAppInfo*) _tmp238_);
 
6019
                                _tmp240_ = unity_application_preview_new (_tmp236_, "", _tmp237_, _tmp239_, NULL);
5474
6020
                                _g_object_unref0 (preview);
5475
 
                                preview = _tmp223_;
5476
 
                                _tmp224_ = _ ("Launch");
5477
 
                                _tmp225_ = unity_preview_action_new ("launch", _tmp224_, NULL);
5478
 
                                launch_action = _tmp225_;
5479
 
                                _tmp226_ = preview;
5480
 
                                _tmp227_ = launch_action;
5481
 
                                unity_preview_add_action ((UnityPreview*) _tmp226_, _tmp227_);
 
6021
                                preview = _tmp240_;
 
6022
                                _tmp241_ = _ ("Launch");
 
6023
                                _tmp242_ = unity_preview_action_new ("launch", _tmp241_, NULL);
 
6024
                                launch_action = _tmp242_;
 
6025
                                _tmp243_ = preview;
 
6026
                                _tmp244_ = launch_action;
 
6027
                                unity_preview_add_action ((UnityPreview*) _tmp243_, _tmp244_);
5482
6028
                                _g_object_unref0 (launch_action);
5483
 
                                _g_free0 (_tmp215_);
 
6029
                                _g_free0 (_tmp232_);
5484
6030
                        }
5485
6031
                        _g_object_unref0 (app_info);
5486
6032
                }
5487
 
                _tmp228_ = preview;
5488
 
                if (_tmp228_ == NULL) {
5489
 
                        const gchar* _tmp229_;
5490
 
                        _tmp229_ = uri;
5491
 
                        g_warning ("daemon.vala:1287: No pksearcher nor desktop app info for '%s'", _tmp229_);
 
6033
                _tmp245_ = preview;
 
6034
                if (_tmp245_ == NULL) {
 
6035
                        const gchar* _tmp246_;
 
6036
                        _tmp246_ = uri;
 
6037
                        g_warning ("daemon.vala:1413: No pksearcher nor desktop app info for '%s'", _tmp246_);
5492
6038
                }
5493
6039
                _g_free0 (desktopfile);
5494
6040
        }
5557
6103
                _tmp3_ = string_offset (_tmp2_, (glong) 16);
5558
6104
                pkg = _tmp3_;
5559
6105
                _tmp4_ = pkg;
5560
 
                g_debug ("daemon.vala:1304: Installing: %s", _tmp4_);
 
6106
                g_debug ("daemon.vala:1430: Installing: %s", _tmp4_);
5561
6107
                _tmp5_ = g_new0 (gchar*, 2 + 1);
5562
6108
                args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5563
6109
                args = _tmp5_;
5651
6197
                                                if (_inner_error_ != NULL) {
5652
6198
                                                        _g_object_unref0 (file_manager);
5653
6199
                                                        __g_list_free__g_free0_0 (muris);
5654
 
                                                        goto __catch12_g_error;
 
6200
                                                        goto __catch13_g_error;
5655
6201
                                                }
5656
6202
                                                _g_object_unref0 (file_manager);
5657
6203
                                                __g_list_free__g_free0_0 (muris);
5660
6206
                                                _tmp36_ = orig;
5661
6207
                                                g_app_info_launch_default_for_uri (_tmp36_, NULL, &_inner_error_);
5662
6208
                                                if (_inner_error_ != NULL) {
5663
 
                                                        goto __catch12_g_error;
 
6209
                                                        goto __catch13_g_error;
5664
6210
                                                }
5665
6211
                                        }
5666
6212
                                }
5667
 
                                goto __finally12;
5668
 
                                __catch12_g_error:
 
6213
                                goto __finally13;
 
6214
                                __catch13_g_error:
5669
6215
                                {
5670
6216
                                        GError* _error_ = NULL;
5671
6217
                                        const gchar* _tmp37_;
5674
6220
                                        _error_ = _inner_error_;
5675
6221
                                        _inner_error_ = NULL;
5676
6222
                                        _tmp37_ = orig;
5677
 
                                        g_warning ("daemon.vala:1328: Failed to launch URI %s", _tmp37_);
 
6223
                                        g_warning ("daemon.vala:1454: Failed to launch URI %s", _tmp37_);
5678
6224
                                        _tmp38_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
5679
6225
                                        _tmp39_ = g_object_ref_sink (_tmp38_);
5680
6226
                                        result = _tmp39_;
5684
6230
                                        args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5685
6231
                                        return result;
5686
6232
                                }
5687
 
                                __finally12:
 
6233
                                __finally13:
5688
6234
                                if (_inner_error_ != NULL) {
5689
6235
                                        _g_free0 (orig);
5690
6236
                                        _g_free0 (exec_or_dir);
5810
6356
                        g_app_info_launch_default_for_uri (_tmp73_, NULL, &_inner_error_);
5811
6357
                        _g_free0 (_tmp73_);
5812
6358
                        if (_inner_error_ != NULL) {
5813
 
                                goto __catch13_g_error;
 
6359
                                goto __catch14_g_error;
5814
6360
                        }
5815
6361
                }
5816
 
                goto __finally13;
5817
 
                __catch13_g_error:
 
6362
                goto __finally14;
 
6363
                __catch14_g_error:
5818
6364
                {
5819
6365
                        GError* err = NULL;
5820
6366
                        const gchar* _tmp74_;
5827
6373
                        _tmp74_ = exec_or_dir;
5828
6374
                        _tmp75_ = err;
5829
6375
                        _tmp76_ = _tmp75_->message;
5830
 
                        g_warning ("daemon.vala:1356: Failed to open current folder '%s' in file manager: " \
 
6376
                        g_warning ("daemon.vala:1482: Failed to open current folder '%s' in file manager: " \
5831
6377
"%s", _tmp74_, _tmp76_);
5832
6378
                        _tmp77_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
5833
6379
                        _tmp78_ = g_object_ref_sink (_tmp77_);
5837
6383
                        args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5838
6384
                        return result;
5839
6385
                }
5840
 
                __finally13:
 
6386
                __finally14:
5841
6387
                if (_inner_error_ != NULL) {
5842
6388
                        _g_free0 (exec_or_dir);
5843
6389
                        args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5860
6406
                        g_spawn_async (_tmp80_, _tmp81_, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &_inner_error_);
5861
6407
                        if (_inner_error_ != NULL) {
5862
6408
                                if (_inner_error_->domain == G_SPAWN_ERROR) {
5863
 
                                        goto __catch14_g_spawn_error;
 
6409
                                        goto __catch15_g_spawn_error;
5864
6410
                                }
5865
6411
                                _g_free0 (exec_or_dir);
5866
6412
                                args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5869
6415
                                return NULL;
5870
6416
                        }
5871
6417
                }
5872
 
                goto __finally14;
5873
 
                __catch14_g_spawn_error:
 
6418
                goto __finally15;
 
6419
                __catch15_g_spawn_error:
5874
6420
                {
5875
6421
                        GError* e = NULL;
5876
6422
                        const gchar* _tmp82_;
5883
6429
                        _tmp82_ = uri;
5884
6430
                        _tmp83_ = e;
5885
6431
                        _tmp84_ = _tmp83_->message;
5886
 
                        g_warning ("daemon.vala:1367: Failed to spawn software-center or direct URI activa" \
 
6432
                        g_warning ("daemon.vala:1493: Failed to spawn software-center or direct URI activa" \
5887
6433
"tion '%s': %s", _tmp82_, _tmp84_);
5888
6434
                        _tmp85_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
5889
6435
                        _tmp86_ = g_object_ref_sink (_tmp85_);
5893
6439
                        args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5894
6440
                        return result;
5895
6441
                }
5896
 
                __finally14:
 
6442
                __finally15:
5897
6443
                if (_inner_error_ != NULL) {
5898
6444
                        _g_free0 (exec_or_dir);
5899
6445
                        args = (_vala_array_free (args, args_length1, (GDestroyNotify) g_free), NULL);
5977
6523
                        const gchar* _tmp65_ = NULL;
5978
6524
                        GAppInfo* _tmp66_;
5979
6525
                        const gchar* _tmp67_ = NULL;
5980
 
                        const gchar* _tmp68_;
 
6526
                        gchar* _tmp68_ = NULL;
 
6527
                        gchar* _tmp69_;
 
6528
                        const gchar* _tmp70_;
5981
6529
                        _tmp2_ = _ev_it;
5982
6530
                        _tmp3_ = _vala_zeitgeist_result_set_next_value (_tmp2_);
5983
6531
                        ev = _tmp3_;
6002
6550
                        }
6003
6551
                        _tmp11_ = app_uri;
6004
6552
                        if (_tmp11_ == NULL) {
6005
 
                                g_warning ("daemon.vala:1395: Unexpected event without subject");
 
6553
                                g_warning ("daemon.vala:1521: Unexpected event without subject");
6006
6554
                                _g_free0 (app_uri);
6007
6555
                                continue;
6008
6556
                        }
6143
6691
                        _tmp64_ = app;
6144
6692
                        _tmp65_ = g_app_info_get_display_name (_tmp64_);
6145
6693
                        _tmp66_ = app;
6146
 
                        _tmp67_ = g_app_info_get_description (_tmp66_);
6147
 
                        _tmp68_ = full_uri;
6148
 
                        dee_model_append (_tmp57_, _tmp58_, _tmp62_, _tmp63_, "application/x-desktop", _tmp65_, _tmp67_, _tmp68_, NULL);
 
6694
                        _tmp67_ = g_app_info_get_executable (_tmp66_);
 
6695
                        _tmp68_ = unity_applications_lens_daemon_sanitize_binary_name (_tmp67_);
 
6696
                        _tmp69_ = _tmp68_;
 
6697
                        _tmp70_ = full_uri;
 
6698
                        dee_model_append (_tmp57_, _tmp58_, _tmp62_, _tmp63_, "application/x-desktop", _tmp65_, _tmp69_, _tmp70_, NULL);
 
6699
                        _g_free0 (_tmp69_);
6149
6700
                        _g_free0 (_tmp62_);
6150
6701
                        _g_free0 (full_uri);
6151
6702
                        _g_free0 (_tmp49_);
6366
6917
        GHashTable* _tmp34_;
6367
6918
        UnityScope* _tmp35_;
6368
6919
        UnityScope* _tmp36_;
6369
 
        UnityOptionsFilter* _tmp37_;
 
6920
        UnityScope* _tmp37_;
6370
6921
        UnityOptionsFilter* _tmp38_;
6371
 
        const gchar* _tmp39_ = NULL;
6372
 
        UnityFilterOption* _tmp40_ = NULL;
6373
 
        gboolean _tmp41_;
6374
 
        UnityScope* _tmp47_;
 
6922
        UnityOptionsFilter* _tmp39_;
 
6923
        const gchar* _tmp40_ = NULL;
 
6924
        UnityFilterOption* _tmp41_ = NULL;
 
6925
        gboolean _tmp42_;
6375
6926
        UnityScope* _tmp48_;
6376
6927
        UnityScope* _tmp49_;
6377
6928
        UnityScope* _tmp50_;
6378
6929
        UnityScope* _tmp51_;
6379
6930
        UnityScope* _tmp52_;
6380
 
        UnityAppInfoManager* _tmp53_ = NULL;
6381
 
        UnityAppInfoManager* _tmp54_;
6382
 
        UnityApplicationsLensRunner* _tmp55_;
6383
 
        UnityLauncherFavorites* _tmp60_ = NULL;
6384
 
        UnityLauncherFavorites* _tmp61_;
 
6931
        UnityScope* _tmp53_;
 
6932
        UnityAppInfoManager* _tmp54_ = NULL;
 
6933
        UnityAppInfoManager* _tmp55_;
 
6934
        UnityApplicationsLensRunner* _tmp56_;
 
6935
        UnityLauncherFavorites* _tmp61_ = NULL;
6385
6936
        UnityLauncherFavorites* _tmp62_;
6386
 
        UnityApplicationsLensAppWatcher* _tmp63_;
 
6937
        UnityLauncherFavorites* _tmp63_;
6387
6938
        UnityApplicationsLensAppWatcher* _tmp64_;
6388
 
        UnityApplicationsLensAptdProxy* _tmp65_;
6389
 
        UnityApplicationsLensLauncherProxy* _tmp66_;
6390
 
        UnityLens* _tmp67_;
 
6939
        UnityApplicationsLensAppWatcher* _tmp65_;
 
6940
        UnityApplicationsLensAptdProxy* _tmp66_;
 
6941
        UnityApplicationsLensLauncherProxy* _tmp67_;
6391
6942
        UnityLens* _tmp68_;
6392
 
        const gchar* _tmp69_ = NULL;
6393
 
        UnityLens* _tmp70_;
 
6943
        UnityLens* _tmp69_;
 
6944
        const gchar* _tmp70_ = NULL;
6394
6945
        UnityLens* _tmp71_;
6395
6946
        UnityLens* _tmp72_;
6396
 
        const gchar* _tmp73_ = NULL;
6397
 
        UnityLens* _tmp74_;
6398
 
        UnityScope* _tmp75_;
6399
 
        UnityLens* _tmp76_;
 
6947
        UnityLens* _tmp73_;
 
6948
        const gchar* _tmp74_ = NULL;
 
6949
        UnityLens* _tmp75_;
 
6950
        UnityScope* _tmp76_;
 
6951
        UnityLens* _tmp77_;
6400
6952
        GError * _inner_error_ = NULL;
6401
6953
        parent_class = G_OBJECT_CLASS (unity_applications_lens_daemon_parent_class);
6402
6954
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
6441
6993
        self->priv->pkgsearcher = _tmp15_;
6442
6994
        _tmp16_ = self->priv->pkgsearcher;
6443
6995
        if (_tmp16_ == NULL) {
6444
 
                g_critical ("daemon.vala:138: Failed to load Software Center index. 'Apps Available" \
 
6996
                g_critical ("daemon.vala:154: Failed to load Software Center index. 'Apps Available" \
6445
6997
" for Download' will not be listed");
6446
6998
        }
6447
6999
        {
6451
7003
                _tmp18_ = _tmp17_;
6452
7004
                if (_inner_error_ != NULL) {
6453
7005
                        if (_inner_error_->domain == G_FILE_ERROR) {
6454
 
                                goto __catch15_g_file_error;
 
7006
                                goto __catch16_g_file_error;
6455
7007
                        }
6456
7008
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
6457
7009
                        g_clear_error (&_inner_error_);
6459
7011
                _unity_ratings_database_free0 (self->priv->ratings);
6460
7012
                self->priv->ratings = _tmp18_;
6461
7013
        }
6462
 
        goto __finally15;
6463
 
        __catch15_g_file_error:
 
7014
        goto __finally16;
 
7015
        __catch16_g_file_error:
6464
7016
        {
6465
7017
                GError* e = NULL;
6466
7018
                GError* _tmp19_;
6469
7021
                _inner_error_ = NULL;
6470
7022
                _tmp19_ = e;
6471
7023
                _tmp20_ = _tmp19_->message;
6472
 
                g_warning ("daemon.vala:144: %s", _tmp20_);
 
7024
                g_warning ("daemon.vala:160: %s", _tmp20_);
6473
7025
                _unity_ratings_database_free0 (self->priv->ratings);
6474
7026
                self->priv->ratings = NULL;
6475
7027
                _g_error_free0 (e);
6476
7028
        }
6477
 
        __finally15:
 
7029
        __finally16:
6478
7030
        if (_inner_error_ != NULL) {
6479
7031
                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);
6480
7032
                g_clear_error (&_inner_error_);
6511
7063
        _g_object_unref0 (self->priv->scope);
6512
7064
        self->priv->scope = _tmp35_;
6513
7065
        _tmp36_ = self->priv->scope;
6514
 
        _tmp37_ = unity_scope_get_sources (_tmp36_);
6515
 
        _tmp38_ = _tmp37_;
6516
 
        _tmp39_ = _ ("Local Apps");
6517
 
        _tmp40_ = unity_options_filter_add_option (_tmp38_, "local", _tmp39_, NULL);
 
7066
        unity_scope_set_provides_personal_content (_tmp36_, TRUE);
 
7067
        _tmp37_ = self->priv->scope;
 
7068
        _tmp38_ = unity_scope_get_sources (_tmp37_);
 
7069
        _tmp39_ = _tmp38_;
 
7070
        _tmp40_ = _ ("Local Apps");
 
7071
        _tmp41_ = unity_options_filter_add_option (_tmp39_, "local", _tmp40_, NULL);
6518
7072
        _g_object_unref0 (self->priv->local_apps_option);
6519
 
        self->priv->local_apps_option = _tmp40_;
6520
 
        _tmp41_ = self->priv->_display_available_apps;
6521
 
        if (_tmp41_) {
6522
 
                UnityScope* _tmp42_;
6523
 
                UnityOptionsFilter* _tmp43_;
 
7073
        self->priv->local_apps_option = _tmp41_;
 
7074
        _tmp42_ = self->priv->_display_available_apps;
 
7075
        if (_tmp42_) {
 
7076
                UnityScope* _tmp43_;
6524
7077
                UnityOptionsFilter* _tmp44_;
6525
 
                const gchar* _tmp45_ = NULL;
6526
 
                UnityFilterOption* _tmp46_ = NULL;
6527
 
                _tmp42_ = self->priv->scope;
6528
 
                _tmp43_ = unity_scope_get_sources (_tmp42_);
6529
 
                _tmp44_ = _tmp43_;
6530
 
                _tmp45_ = _ ("Software Center");
6531
 
                _tmp46_ = unity_options_filter_add_option (_tmp44_, "usc", _tmp45_, NULL);
 
7078
                UnityOptionsFilter* _tmp45_;
 
7079
                const gchar* _tmp46_ = NULL;
 
7080
                UnityFilterOption* _tmp47_ = NULL;
 
7081
                _tmp43_ = self->priv->scope;
 
7082
                _tmp44_ = unity_scope_get_sources (_tmp43_);
 
7083
                _tmp45_ = _tmp44_;
 
7084
                _tmp46_ = _ ("Software Center");
 
7085
                _tmp47_ = unity_options_filter_add_option (_tmp45_, "usc", _tmp46_, NULL);
6532
7086
                _g_object_unref0 (self->priv->usc_apps_option);
6533
 
                self->priv->usc_apps_option = _tmp46_;
 
7087
                self->priv->usc_apps_option = _tmp47_;
6534
7088
        }
6535
 
        _tmp47_ = self->priv->scope;
6536
 
        g_signal_connect_object (_tmp47_, "generate-search-key", (GCallback) __unity_applications_lens_daemon___lambda12__unity_scope_generate_search_key, self, 0);
6537
7089
        _tmp48_ = self->priv->scope;
6538
 
        g_signal_connect_object (_tmp48_, "search-changed", (GCallback) __unity_applications_lens_daemon___lambda13__unity_scope_search_changed, self, 0);
 
7090
        g_signal_connect_object (_tmp48_, "generate-search-key", (GCallback) __unity_applications_lens_daemon___lambda12__unity_scope_generate_search_key, self, 0);
6539
7091
        _tmp49_ = self->priv->scope;
6540
 
        g_signal_connect_object (_tmp49_, "filters-changed", (GCallback) __unity_applications_lens_daemon___lambda14__unity_scope_filters_changed, self, 0);
 
7092
        g_signal_connect_object (_tmp49_, "search-changed", (GCallback) __unity_applications_lens_daemon___lambda13__unity_scope_search_changed, self, 0);
6541
7093
        _tmp50_ = self->priv->scope;
6542
 
        g_signal_connect_object (_tmp50_, "active-sources-changed", (GCallback) __unity_applications_lens_daemon___lambda15__unity_scope_active_sources_changed, self, 0);
 
7094
        g_signal_connect_object (_tmp50_, "filters-changed", (GCallback) __unity_applications_lens_daemon___lambda14__unity_scope_filters_changed, self, 0);
6543
7095
        _tmp51_ = self->priv->scope;
6544
 
        g_signal_connect_object (_tmp51_, "activate-uri", (GCallback) _unity_applications_lens_daemon_activate_unity_scope_activate_uri, self, 0);
 
7096
        g_signal_connect_object (_tmp51_, "active-sources-changed", (GCallback) __unity_applications_lens_daemon___lambda15__unity_scope_active_sources_changed, self, 0);
6545
7097
        _tmp52_ = self->priv->scope;
6546
 
        g_signal_connect_object (_tmp52_, "preview-uri", (GCallback) _unity_applications_lens_daemon_preview_unity_scope_preview_uri, self, 0);
6547
 
        _tmp53_ = unity_app_info_manager_get_default ();
6548
 
        _tmp54_ = _tmp53_;
6549
 
        g_signal_connect_object (_tmp54_, "changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_app_info_manager_changed, self, 0);
6550
 
        _g_object_unref0 (_tmp54_);
6551
 
        _tmp55_ = unity_applications_lens_runner_new (self);
 
7098
        g_signal_connect_object (_tmp52_, "activate-uri", (GCallback) _unity_applications_lens_daemon_activate_unity_scope_activate_uri, self, 0);
 
7099
        _tmp53_ = self->priv->scope;
 
7100
        g_signal_connect_object (_tmp53_, "preview-uri", (GCallback) _unity_applications_lens_daemon_preview_unity_scope_preview_uri, self, 0);
 
7101
        _tmp54_ = unity_app_info_manager_get_default ();
 
7102
        _tmp55_ = _tmp54_;
 
7103
        g_signal_connect_object (_tmp55_, "changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_app_info_manager_changed, self, 0);
 
7104
        _g_object_unref0 (_tmp55_);
 
7105
        _tmp56_ = unity_applications_lens_runner_new (self);
6552
7106
        _g_object_unref0 (self->priv->runner);
6553
 
        self->priv->runner = _tmp55_;
 
7107
        self->priv->runner = _tmp56_;
6554
7108
        {
6555
 
                GRegex* _tmp56_;
6556
7109
                GRegex* _tmp57_;
6557
7110
                GRegex* _tmp58_;
6558
7111
                GRegex* _tmp59_;
6559
 
                _tmp56_ = g_regex_new ("^[a-z]+:.+$", 0, 0, &_inner_error_);
6560
 
                _tmp57_ = _tmp56_;
 
7112
                GRegex* _tmp60_;
 
7113
                _tmp57_ = g_regex_new ("^[a-z]+:.+$", 0, 0, &_inner_error_);
 
7114
                _tmp58_ = _tmp57_;
6561
7115
                if (_inner_error_ != NULL) {
6562
7116
                        if (_inner_error_->domain == G_REGEX_ERROR) {
6563
 
                                goto __catch16_g_regex_error;
 
7117
                                goto __catch17_g_regex_error;
6564
7118
                        }
6565
7119
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
6566
7120
                        g_clear_error (&_inner_error_);
6567
7121
                }
6568
7122
                _g_regex_unref0 (self->priv->uri_regex);
6569
 
                self->priv->uri_regex = _tmp57_;
6570
 
                _tmp58_ = g_regex_new ("((ftp|ssh|sftp|smb|dav)://).+", 0, 0, &_inner_error_);
6571
 
                _tmp59_ = _tmp58_;
 
7123
                self->priv->uri_regex = _tmp58_;
 
7124
                _tmp59_ = g_regex_new ("((ftp|ssh|sftp|smb|dav)://).+", 0, 0, &_inner_error_);
 
7125
                _tmp60_ = _tmp59_;
6572
7126
                if (_inner_error_ != NULL) {
6573
7127
                        if (_inner_error_->domain == G_REGEX_ERROR) {
6574
 
                                goto __catch16_g_regex_error;
 
7128
                                goto __catch17_g_regex_error;
6575
7129
                        }
6576
7130
                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
6577
7131
                        g_clear_error (&_inner_error_);
6578
7132
                }
6579
7133
                _g_regex_unref0 (self->priv->mountable_regex);
6580
 
                self->priv->mountable_regex = _tmp59_;
 
7134
                self->priv->mountable_regex = _tmp60_;
6581
7135
        }
6582
 
        goto __finally16;
6583
 
        __catch16_g_regex_error:
 
7136
        goto __finally17;
 
7137
        __catch17_g_regex_error:
6584
7138
        {
6585
7139
                GError* e = NULL;
6586
7140
                e = _inner_error_;
6587
7141
                _inner_error_ = NULL;
6588
7142
                _g_regex_unref0 (self->priv->uri_regex);
6589
7143
                self->priv->uri_regex = NULL;
6590
 
                g_critical ("daemon.vala:212: Failed to compile URI regex. URL launching will be di" \
 
7144
                g_critical ("daemon.vala:229: Failed to compile URI regex. URL launching will be di" \
6591
7145
"sabled");
6592
7146
                _g_error_free0 (e);
6593
7147
        }
6594
 
        __finally16:
 
7148
        __finally17:
6595
7149
        if (_inner_error_ != NULL) {
6596
7150
                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);
6597
7151
                g_clear_error (&_inner_error_);
6598
7152
        }
6599
 
        _tmp60_ = unity_launcher_favorites_get_default ();
6600
 
        _tmp61_ = _g_object_ref0 (_tmp60_);
 
7153
        _tmp61_ = unity_launcher_favorites_get_default ();
 
7154
        _tmp62_ = _g_object_ref0 (_tmp61_);
6601
7155
        _g_object_unref0 (self->priv->favorite_apps);
6602
 
        self->priv->favorite_apps = _tmp61_;
6603
 
        _tmp62_ = self->priv->favorite_apps;
6604
 
        g_signal_connect_object (_tmp62_, "changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_launcher_favorites_changed, self, 0);
6605
 
        _tmp63_ = unity_applications_lens_app_watcher_new ();
 
7156
        self->priv->favorite_apps = _tmp62_;
 
7157
        _tmp63_ = self->priv->favorite_apps;
 
7158
        g_signal_connect_object (_tmp63_, "changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_launcher_favorites_changed, self, 0);
 
7159
        _tmp64_ = unity_applications_lens_app_watcher_new ();
6606
7160
        _g_object_unref0 (self->priv->app_watcher);
6607
 
        self->priv->app_watcher = _tmp63_;
6608
 
        _tmp64_ = self->priv->app_watcher;
6609
 
        g_signal_connect_object (_tmp64_, "running-applications-changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_applications_lens_app_watcher_running_applications_changed, self, 0);
6610
 
        _tmp65_ = unity_applications_lens_aptd_proxy_new ();
 
7161
        self->priv->app_watcher = _tmp64_;
 
7162
        _tmp65_ = self->priv->app_watcher;
 
7163
        g_signal_connect_object (_tmp65_, "running-applications-changed", (GCallback) _unity_applications_lens_daemon_mark_dirty_unity_applications_lens_app_watcher_running_applications_changed, self, 0);
 
7164
        _tmp66_ = unity_applications_lens_aptd_proxy_new ();
6611
7165
        _g_object_unref0 (self->priv->aptdclient);
6612
 
        self->priv->aptdclient = _tmp65_;
6613
 
        _tmp66_ = unity_applications_lens_launcher_proxy_new ();
 
7166
        self->priv->aptdclient = _tmp66_;
 
7167
        _tmp67_ = unity_applications_lens_launcher_proxy_new ();
6614
7168
        _g_object_unref0 (self->priv->launcherservice);
6615
 
        self->priv->launcherservice = _tmp66_;
6616
 
        _tmp67_ = unity_lens_new ("/com/canonical/unity/lens/applications", "applications");
 
7169
        self->priv->launcherservice = _tmp67_;
 
7170
        _tmp68_ = unity_lens_new ("/com/canonical/unity/lens/applications", "applications");
6617
7171
        _g_object_unref0 (self->priv->lens);
6618
 
        self->priv->lens = _tmp67_;
6619
 
        _tmp68_ = self->priv->lens;
6620
 
        _tmp69_ = _ ("Search Applications");
6621
 
        unity_lens_set_search_hint (_tmp68_, _tmp69_);
6622
 
        _tmp70_ = self->priv->lens;
6623
 
        unity_lens_set_visible (_tmp70_, TRUE);
 
7172
        self->priv->lens = _tmp68_;
 
7173
        _tmp69_ = self->priv->lens;
 
7174
        _tmp70_ = _ ("Search Applications");
 
7175
        unity_lens_set_search_hint (_tmp69_, _tmp70_);
6624
7176
        _tmp71_ = self->priv->lens;
6625
 
        unity_lens_set_search_in_global (_tmp71_, TRUE);
 
7177
        unity_lens_set_visible (_tmp71_, TRUE);
6626
7178
        _tmp72_ = self->priv->lens;
6627
 
        _tmp73_ = _ ("Sources");
6628
 
        unity_lens_set_sources_display_name (_tmp72_, _tmp73_);
 
7179
        unity_lens_set_search_in_global (_tmp72_, TRUE);
 
7180
        _tmp73_ = self->priv->lens;
 
7181
        _tmp74_ = _ ("Sources");
 
7182
        unity_lens_set_sources_display_name (_tmp73_, _tmp74_);
6629
7183
        unity_applications_lens_daemon_populate_categories (self);
6630
7184
        unity_applications_lens_daemon_populate_filters (self);
6631
 
        _tmp74_ = self->priv->lens;
6632
 
        _tmp75_ = self->priv->scope;
6633
 
        unity_lens_add_local_scope (_tmp74_, _tmp75_);
6634
 
        _tmp76_ = self->priv->lens;
6635
 
        unity_lens_export (_tmp76_, &_inner_error_);
 
7185
        _tmp75_ = self->priv->lens;
 
7186
        _tmp76_ = self->priv->scope;
 
7187
        unity_lens_add_local_scope (_tmp75_, _tmp76_);
 
7188
        _tmp77_ = self->priv->lens;
 
7189
        unity_lens_export (_tmp77_, &_inner_error_);
6636
7190
        if (_inner_error_ != NULL) {
6637
7191
                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);
6638
7192
                g_clear_error (&_inner_error_);
6659
7213
        self->priv->app_menu = NULL;
6660
7214
        self->priv->_display_recent_apps = TRUE;
6661
7215
        self->priv->_display_available_apps = TRUE;
 
7216
        self->priv->purchase_info = NULL;
6662
7217
}
6663
7218
 
6664
7219
 
6695
7250
        _g_regex_unref0 (self->priv->uri_regex);
6696
7251
        _g_regex_unref0 (self->priv->mountable_regex);
6697
7252
        _g_object_unref0 (self->priv->gp_settings);
 
7253
        _unity_applications_lens_purchase_info_helper_unref0 (self->priv->purchase_info);
6698
7254
        G_OBJECT_CLASS (unity_applications_lens_daemon_parent_class)->finalize (obj);
6699
7255
}
6700
7256