~timo-jyrinki/ubuntu/quantal/unity-lens-files/ubuntu.660

« back to all changes in this revision

Viewing changes to src/daemon.c

  • Committer: timo.jyrinki at canonical
  • Date: 2012-09-19 15:55:12 UTC
  • mfrom: (14.2.226 unity-lens-files)
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: timo.jyrinki@canonical.com-20120919155512-0nb3rktt810d63ob
Tags: upstream-6.6.0
ImportĀ upstreamĀ versionĀ 6.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
typedef struct _UnityFilesLensBookmarks UnityFilesLensBookmarks;
56
56
typedef struct _UnityFilesLensBookmarksClass UnityFilesLensBookmarksClass;
57
57
 
 
58
#define UNITY_FILES_LENS_TYPE_DEVICES (unity_files_lens_devices_get_type ())
 
59
#define UNITY_FILES_LENS_DEVICES(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_FILES_LENS_TYPE_DEVICES, UnityFilesLensDevices))
 
60
#define UNITY_FILES_LENS_DEVICES_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_FILES_LENS_TYPE_DEVICES, UnityFilesLensDevicesClass))
 
61
#define UNITY_FILES_LENS_IS_DEVICES(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_FILES_LENS_TYPE_DEVICES))
 
62
#define UNITY_FILES_LENS_IS_DEVICES_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_FILES_LENS_TYPE_DEVICES))
 
63
#define UNITY_FILES_LENS_DEVICES_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_FILES_LENS_TYPE_DEVICES, UnityFilesLensDevicesClass))
 
64
 
 
65
typedef struct _UnityFilesLensDevices UnityFilesLensDevices;
 
66
typedef struct _UnityFilesLensDevicesClass UnityFilesLensDevicesClass;
 
67
 
58
68
#define UNITY_FILES_LENS_TYPE_URL_CHECKER (unity_files_lens_url_checker_get_type ())
59
69
#define UNITY_FILES_LENS_URL_CHECKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_FILES_LENS_TYPE_URL_CHECKER, UnityFilesLensUrlChecker))
60
70
#define UNITY_FILES_LENS_URL_CHECKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_FILES_LENS_TYPE_URL_CHECKER, UnityFilesLensUrlCheckerClass))
86
96
typedef struct _UnityFilesLensBookmarkClass UnityFilesLensBookmarkClass;
87
97
 
88
98
#define UNITY_FILES_LENS_TYPE_RESULT_FLAGS (unity_files_lens_result_flags_get_type ())
 
99
 
 
100
#define UNITY_FILES_LENS_TYPE_DEVICE (unity_files_lens_device_get_type ())
 
101
#define UNITY_FILES_LENS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_FILES_LENS_TYPE_DEVICE, UnityFilesLensDevice))
 
102
#define UNITY_FILES_LENS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_FILES_LENS_TYPE_DEVICE, UnityFilesLensDeviceClass))
 
103
#define UNITY_FILES_LENS_IS_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_FILES_LENS_TYPE_DEVICE))
 
104
#define UNITY_FILES_LENS_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_FILES_LENS_TYPE_DEVICE))
 
105
#define UNITY_FILES_LENS_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_FILES_LENS_TYPE_DEVICE, UnityFilesLensDeviceClass))
 
106
 
 
107
typedef struct _UnityFilesLensDevice UnityFilesLensDevice;
 
108
typedef struct _UnityFilesLensDeviceClass UnityFilesLensDeviceClass;
89
109
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
90
110
typedef struct _UnityFilesLensDaemonUpdateGlobalSearchAsyncData UnityFilesLensDaemonUpdateGlobalSearchAsyncData;
91
111
typedef struct _Block1Data Block1Data;
112
132
        ZeitgeistIndex* index;
113
133
        ZeitgeistMonitor* monitor;
114
134
        UnityFilesLensBookmarks* bookmarks;
 
135
        UnityFilesLensDevices* devices;
115
136
        UnityFilesLensUrlChecker* urls;
116
137
        UnityLens* lens;
117
138
        UnityScope* scope;
251
272
        GeeSet* _tmp60_;
252
273
        UnityFilesLensCategories _tmp61_;
253
274
        gboolean _tmp62_;
254
 
        UnityLensSearch* _tmp63_;
255
 
        ZeitgeistTimeRange* _tmp64_;
256
 
        ZeitgeistTimeRange* _tmp65_;
257
 
        GCancellable* _tmp66_;
258
 
        ZeitgeistResultSet* _tmp67_;
259
 
        ZeitgeistResultSet* _tmp68_;
260
 
        ZeitgeistResultSet* _tmp69_;
261
 
        UnityLensSearch* _tmp70_;
262
 
        const gchar* _tmp71_;
263
 
        const gchar* _tmp72_;
264
 
        ZeitgeistResultSet* _tmp73_;
265
 
        DeeSerializableModel* _tmp74_;
266
 
        gint64 _tmp75_;
267
 
        gboolean _tmp76_;
268
 
        gboolean _tmp77_;
269
 
        gboolean _tmp78_;
270
 
        gboolean _tmp79_;
271
 
        UnityLensSearch* _tmp80_;
272
 
        const gchar* _tmp81_;
 
275
        GList* matching_devices;
 
276
        gboolean _tmp63_;
 
277
        UnityFilesLensDevices* _tmp64_;
 
278
        UnityLensSearch* _tmp65_;
 
279
        const gchar* _tmp66_;
 
280
        const gchar* _tmp67_;
 
281
        GList* _tmp68_;
 
282
        UnityFilesLensDevices* _tmp69_;
 
283
        GList* _tmp70_;
 
284
        GList* _tmp71_;
 
285
        DeeSerializableModel* _tmp72_;
 
286
        gboolean _tmp73_;
 
287
        UnityLensSearch* _tmp74_;
 
288
        ZeitgeistTimeRange* _tmp75_;
 
289
        ZeitgeistTimeRange* _tmp76_;
 
290
        GCancellable* _tmp77_;
 
291
        ZeitgeistResultSet* _tmp78_;
 
292
        ZeitgeistResultSet* _tmp79_;
 
293
        ZeitgeistResultSet* _tmp80_;
 
294
        UnityLensSearch* _tmp81_;
273
295
        const gchar* _tmp82_;
274
 
        UnityLensSearch* _tmp83_;
275
 
        DeeSerializableModel* _tmp84_;
 
296
        const gchar* _tmp83_;
 
297
        ZeitgeistResultSet* _tmp84_;
276
298
        DeeSerializableModel* _tmp85_;
277
 
        GCancellable* _tmp86_;
 
299
        gint64 _tmp86_;
 
300
        gboolean _tmp87_;
 
301
        gboolean _tmp88_;
 
302
        gboolean _tmp89_;
 
303
        gboolean _tmp90_;
 
304
        UnityLensSearch* _tmp91_;
 
305
        const gchar* _tmp92_;
 
306
        const gchar* _tmp93_;
 
307
        UnityLensSearch* _tmp94_;
 
308
        DeeSerializableModel* _tmp95_;
 
309
        DeeSerializableModel* _tmp96_;
 
310
        GCancellable* _tmp97_;
278
311
        GError* ioe;
279
312
        GError* e;
280
 
        UnityLensSearch* _tmp87_;
281
 
        const gchar* _tmp88_;
282
 
        const gchar* _tmp89_;
283
 
        GError* _tmp90_;
284
 
        const gchar* _tmp91_;
 
313
        UnityLensSearch* _tmp98_;
 
314
        const gchar* _tmp99_;
 
315
        const gchar* _tmp100_;
 
316
        GError* _tmp101_;
 
317
        const gchar* _tmp102_;
285
318
        GError * _inner_error_;
286
319
};
287
320
 
449
482
        gint64 _tmp123_;
450
483
        gint64 _tmp124_;
451
484
        GeeHashSet* _tmp125_;
452
 
        DeeTransaction* _tmp126_;
453
 
        gboolean _tmp127_;
454
 
        DeeTransaction* _tmp128_;
455
 
        gboolean _tmp129_;
456
 
        gboolean _tmp130_;
457
 
        gboolean _tmp131_;
458
 
        gboolean _tmp132_;
459
 
        UnityLensSearch* _tmp133_;
460
 
        const gchar* _tmp134_;
461
 
        const gchar* _tmp135_;
462
 
        UnityLensSearch* _tmp136_;
463
 
        DeeSerializableModel* _tmp137_;
464
 
        DeeSerializableModel* _tmp138_;
465
 
        GCancellable* _tmp139_;
466
 
        GError* ioe;
467
 
        guint _tmp140_;
468
 
        guint _tmp141_;
469
 
        GError* e;
470
 
        UnityLensSearch* _tmp142_;
471
 
        const gchar* _tmp143_;
 
485
        GList* matching_devices;
 
486
        gboolean _tmp126_;
 
487
        UnityFilesLensDevices* _tmp127_;
 
488
        UnityLensSearch* _tmp128_;
 
489
        const gchar* _tmp129_;
 
490
        const gchar* _tmp130_;
 
491
        GList* _tmp131_;
 
492
        UnityFilesLensDevices* _tmp132_;
 
493
        GList* _tmp133_;
 
494
        GList* _tmp134_;
 
495
        DeeSerializableModel* _tmp135_;
 
496
        DeeTransaction* _tmp136_;
 
497
        gboolean _tmp137_;
 
498
        DeeTransaction* _tmp138_;
 
499
        gboolean _tmp139_;
 
500
        gboolean _tmp140_;
 
501
        gboolean _tmp141_;
 
502
        gboolean _tmp142_;
 
503
        UnityLensSearch* _tmp143_;
472
504
        const gchar* _tmp144_;
473
 
        GError* _tmp145_;
474
 
        const gchar* _tmp146_;
475
 
        DeeTransaction* _tmp147_;
476
 
        gboolean _tmp148_;
477
 
        DeeTransaction* _tmp149_;
 
505
        const gchar* _tmp145_;
 
506
        UnityLensSearch* _tmp146_;
 
507
        DeeSerializableModel* _tmp147_;
 
508
        DeeSerializableModel* _tmp148_;
 
509
        GCancellable* _tmp149_;
 
510
        GError* ioe;
478
511
        guint _tmp150_;
479
512
        guint _tmp151_;
 
513
        GError* e;
 
514
        UnityLensSearch* _tmp152_;
 
515
        const gchar* _tmp153_;
 
516
        const gchar* _tmp154_;
 
517
        GError* _tmp155_;
 
518
        const gchar* _tmp156_;
 
519
        DeeTransaction* _tmp157_;
 
520
        gboolean _tmp158_;
 
521
        DeeTransaction* _tmp159_;
 
522
        guint _tmp160_;
 
523
        guint _tmp161_;
480
524
        GError * _inner_error_;
481
525
};
482
526
 
666
710
 
667
711
static gpointer unity_files_lens_daemon_parent_class = NULL;
668
712
 
669
 
#define CONFIG_DATADIR "/usr/share"
 
713
#define CONFIG_DATADIR "/usr/local/share"
670
714
#define UNITY_FILES_LENS_ICON_PATH CONFIG_DATADIR "/icons/unity-icon-theme/places/svg/"
671
715
GType unity_files_lens_daemon_get_type (void) G_GNUC_CONST;
672
716
GType unity_files_lens_bookmarks_get_type (void) G_GNUC_CONST;
 
717
GType unity_files_lens_devices_get_type (void) G_GNUC_CONST;
673
718
GType unity_files_lens_url_checker_get_type (void) G_GNUC_CONST;
674
719
#define UNITY_FILES_LENS_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UNITY_FILES_LENS_TYPE_DAEMON, UnityFilesLensDaemonPrivate))
675
720
enum  {
714
759
const gchar* unity_files_lens_bookmark_get_dnd_uri (UnityFilesLensBookmark* self);
715
760
GType unity_files_lens_result_flags_get_type (void) G_GNUC_CONST;
716
761
void unity_files_lens_append_events_sorted (const gchar* search_string, ZeitgeistResultSet* events, DeeModel* results, gint64 min_size, gint64 max_size, UnityFilesLensResultFlags flags, GeeSet* excluded_uris, gint category_override);
 
762
GType unity_files_lens_device_get_type (void) G_GNUC_CONST;
 
763
GList* unity_files_lens_devices_search (UnityFilesLensDevices* self, const gchar* search);
 
764
GList* unity_files_lens_devices_list (UnityFilesLensDevices* self);
 
765
static void unity_files_lens_daemon_append_devices (UnityFilesLensDaemon* self, GList* devices, DeeModel* results_model, UnityFilesLensCategories category);
717
766
gboolean unity_files_lens_daemon_get_use_locate (UnityFilesLensDaemon* self);
718
767
static void unity_files_lens_daemon_perform_locate (UnityFilesLensDaemon* self, guint timeout, const gchar* query, DeeModel* results_model, GCancellable* cancellable, gint files_category, gint dirs_category, GAsyncReadyCallback _callback_, gpointer _user_data_);
719
768
static void unity_files_lens_daemon_perform_locate_finish (UnityFilesLensDaemon* self, GAsyncResult* _res_, GError** error);
725
774
static ZeitgeistTimeRange* unity_files_lens_daemon_get_current_timerange (UnityFilesLensDaemon* self);
726
775
static void unity_files_lens_daemon_update_search_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
727
776
static void unity_files_lens_daemon_get_current_size_limits (UnityFilesLensDaemon* self, gint64* min_size, gint64* max_size);
728
 
static gboolean ____lambda4_ (Block1Data* _data1_);
729
 
static gboolean _____lambda4__gsource_func (gpointer self);
 
777
static gboolean ____lambda8_ (Block1Data* _data1_);
 
778
static gboolean _____lambda8__gsource_func (gpointer self);
730
779
GList* unity_files_lens_bookmarks_list (UnityFilesLensBookmarks* self);
731
780
static void _vala_array_add2 (gchar*** array, int* length, int* size, gchar* value);
732
781
static void unity_files_lens_daemon_run_zg_query_data_free (gpointer _data);
736
785
const gchar* unity_files_lens_bookmark_get_icon (UnityFilesLensBookmark* self);
737
786
const gchar* unity_files_lens_bookmark_get_mimetype (UnityFilesLensBookmark* self);
738
787
const gchar* unity_files_lens_bookmark_get_display_name (UnityFilesLensBookmark* self);
 
788
const gchar* unity_files_lens_device_get_uri (UnityFilesLensDevice* self);
 
789
const gchar* unity_files_lens_device_get_icon_name (UnityFilesLensDevice* self);
 
790
const gchar* unity_files_lens_device_get_display_name (UnityFilesLensDevice* self);
 
791
const gchar* unity_files_lens_device_get_dnd_uri (UnityFilesLensDevice* self);
739
792
static void unity_files_lens_daemon_perform_locate_data_free (gpointer _data);
740
793
static gboolean unity_files_lens_daemon_perform_locate_co (UnityFilesLensDaemonPerformLocateData* _data_);
741
794
static gboolean _unity_files_lens_daemon_perform_locate_co_gsource_func (gpointer self);
747
800
gchar* unity_files_lens_utils_check_icon_string (const gchar* uri, const gchar* mimetype, GFileInfo* info);
748
801
gboolean unity_files_lens_utils_file_info_matches_any (GFileInfo* info, gchar** types, int types_length1);
749
802
static void _g_slist_free__g_object_unref0_ (GSList* self);
750
 
static void unity_files_lens_daemon_count_directory_items (UnityFilesLensDaemon* self, const gchar* top_path, gint* count, gint64* total_size, gboolean recurse, GError** error);
 
803
static void unity_files_lens_daemon_count_directory_items (UnityFilesLensDaemon* self, const gchar* top_path, gint* count, guint64* total_size, gboolean recurse, GError** error);
751
804
static void _g_queue_free__g_free0_ (GQueue* self);
752
805
UnityPreview* unity_files_lens_daemon_preview (UnityFilesLensDaemon* self, const gchar* uri);
753
806
gboolean unity_files_lens_bookmark_is_bookmark_uri (const gchar* uri);
754
807
gchar* unity_files_lens_bookmark_uri_from_bookmark (const gchar* uri);
 
808
gboolean unity_files_lens_device_is_device_uri (const gchar* uri);
 
809
static UnityGenericPreview* unity_files_lens_daemon_create_device_preview (UnityFilesLensDaemon* self, const gchar* uri);
755
810
UnityActivationResponse* unity_files_lens_daemon_on_preview_open (UnityFilesLensDaemon* self, const gchar* uri);
756
811
static UnityActivationResponse* _unity_files_lens_daemon_on_preview_open_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
757
812
UnityActivationResponse* unity_files_lens_daemon_on_preview_open_folder (UnityFilesLensDaemon* self, const gchar* uri);
758
813
static UnityActivationResponse* _unity_files_lens_daemon_on_preview_open_folder_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
759
814
UnityActivationResponse* unity_files_lens_daemon_on_email_file (UnityFilesLensDaemon* self, const gchar* uri);
760
815
static UnityActivationResponse* _unity_files_lens_daemon_on_email_file_unity_preview_action_activated (UnityPreviewAction* _sender, const gchar* uri, gpointer self);
 
816
UnityFilesLensDevice* unity_files_lens_devices_get_device_from_uri (UnityFilesLensDevices* self, const gchar* uri);
 
817
GIcon* unity_files_lens_device_get_icon (UnityFilesLensDevice* self);
 
818
GFile* unity_files_lens_device_get_root_file (UnityFilesLensDevice* self);
761
819
gboolean unity_files_lens_bookmarks_launch_if_bookmark (UnityFilesLensBookmarks* self, const gchar* uri, GError** error);
 
820
gboolean unity_files_lens_devices_launch_if_device (UnityFilesLensDevices* self, const gchar* uri, GError** error);
762
821
UnityActivationResponse* unity_files_lens_daemon_activate (UnityFilesLensDaemon* self, const gchar* uri);
763
822
static void _g_list_free__g_free0_ (GList* self);
764
823
static void unity_files_lens_daemon_on_zeitgeist_changed (UnityFilesLensDaemon* self);
775
834
UnityFilesLensBookmarks* unity_files_lens_bookmarks_construct (GType object_type);
776
835
UnityFilesLensUrlChecker* unity_files_lens_url_checker_new (void);
777
836
UnityFilesLensUrlChecker* unity_files_lens_url_checker_construct (GType object_type);
778
 
static void _unity_files_lens_daemon___lambda5_ (UnityFilesLensDaemon* self);
779
 
static void __unity_files_lens_daemon___lambda5__unity_scope_filters_changed (UnityScope* _sender, gpointer self);
780
 
static gchar* _unity_files_lens_daemon___lambda6_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search);
781
 
static gchar* __unity_files_lens_daemon___lambda6__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self);
782
 
static void _unity_files_lens_daemon___lambda7_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
783
 
static void __unity_files_lens_daemon___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
 
837
UnityFilesLensDevices* unity_files_lens_devices_new (void);
 
838
UnityFilesLensDevices* unity_files_lens_devices_construct (GType object_type);
 
839
static void _unity_files_lens_daemon___lambda9_ (UnityFilesLensDaemon* self);
 
840
static void __unity_files_lens_daemon___lambda9__unity_files_lens_devices_changed (UnityFilesLensDevices* _sender, gpointer self);
 
841
static void _unity_files_lens_daemon___lambda10_ (UnityFilesLensDaemon* self);
 
842
static void __unity_files_lens_daemon___lambda10__unity_scope_filters_changed (UnityScope* _sender, gpointer self);
 
843
static gchar* _unity_files_lens_daemon___lambda11_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search);
 
844
static gchar* __unity_files_lens_daemon___lambda11__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self);
 
845
static void _unity_files_lens_daemon___lambda12_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable);
 
846
static void __unity_files_lens_daemon___lambda12__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self);
784
847
static void unity_files_lens_daemon_finalize (GObject* obj);
785
848
static void _vala_unity_files_lens_daemon_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
786
849
static void _vala_unity_files_lens_daemon_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
2013
2076
                _data_->_tmp61_ = _data_->category_id;
2014
2077
                unity_files_lens_append_events_sorted (_data_->_tmp55_, _data_->_tmp56_, (DeeModel*) _data_->_tmp57_, (gint64) 0, _data_->_tmp58_, _data_->_tmp59_, _data_->_tmp60_, (gint) _data_->_tmp61_);
2015
2078
                _data_->_tmp62_ = _data_->has_search;
2016
 
                if (_data_->_tmp62_ == FALSE) {
2017
 
                        _data_->_tmp63_ = _data_->search;
2018
 
                        _data_->_tmp64_ = zeitgeist_time_range_new_anytime ();
2019
 
                        _data_->_tmp65_ = g_object_ref_sink (_data_->_tmp64_);
2020
 
                        _data_->_tmp66_ = _data_->cancellable;
 
2079
                if (_data_->_tmp62_) {
 
2080
                        _data_->_tmp63_ = _data_->has_search;
 
2081
                        if (_data_->_tmp63_) {
 
2082
                                _data_->_tmp64_ = _data_->self->priv->devices;
 
2083
                                _data_->_tmp65_ = _data_->search;
 
2084
                                _data_->_tmp66_ = unity_lens_search_get_search_string (_data_->_tmp65_);
 
2085
                                _data_->_tmp67_ = _data_->_tmp66_;
 
2086
                                _data_->_tmp68_ = NULL;
 
2087
                                _data_->_tmp68_ = unity_files_lens_devices_search (_data_->_tmp64_, _data_->_tmp67_);
 
2088
                                __g_list_free__g_object_unref0_0 (_data_->matching_devices);
 
2089
                                _data_->matching_devices = _data_->_tmp68_;
 
2090
                        } else {
 
2091
                                _data_->_tmp69_ = _data_->self->priv->devices;
 
2092
                                _data_->_tmp70_ = NULL;
 
2093
                                _data_->_tmp70_ = unity_files_lens_devices_list (_data_->_tmp69_);
 
2094
                                __g_list_free__g_object_unref0_0 (_data_->matching_devices);
 
2095
                                _data_->matching_devices = _data_->_tmp70_;
 
2096
                        }
 
2097
                        _data_->_tmp71_ = _data_->matching_devices;
 
2098
                        _data_->_tmp72_ = _data_->results_model;
 
2099
                        unity_files_lens_daemon_append_devices (_data_->self, _data_->_tmp71_, (DeeModel*) _data_->_tmp72_, UNITY_FILES_LENS_CATEGORIES_FILES_AND_FOLDERS);
 
2100
                        __g_list_free__g_object_unref0_0 (_data_->matching_devices);
 
2101
                }
 
2102
                _data_->_tmp73_ = _data_->has_search;
 
2103
                if (_data_->_tmp73_ == FALSE) {
 
2104
                        _data_->_tmp74_ = _data_->search;
 
2105
                        _data_->_tmp75_ = zeitgeist_time_range_new_anytime ();
 
2106
                        _data_->_tmp76_ = g_object_ref_sink (_data_->_tmp75_);
 
2107
                        _data_->_tmp77_ = _data_->cancellable;
2021
2108
                        _data_->_state_ = 2;
2022
 
                        unity_files_lens_daemon_run_zg_query (_data_->self, _data_->_tmp63_, _data_->_tmp65_, ZEITGEIST_RESULT_TYPE_MOST_RECENT_CURRENT_URI, NULL, (guint) 40, _data_->_tmp66_, TRUE, unity_files_lens_daemon_update_global_search_async_ready, _data_);
 
2109
                        unity_files_lens_daemon_run_zg_query (_data_->self, _data_->_tmp74_, _data_->_tmp76_, ZEITGEIST_RESULT_TYPE_MOST_RECENT_CURRENT_URI, NULL, (guint) 40, _data_->_tmp77_, TRUE, unity_files_lens_daemon_update_global_search_async_ready, _data_);
2023
2110
                        return FALSE;
2024
2111
                        _state_2:
2025
 
                        _data_->_tmp67_ = NULL;
2026
 
                        _data_->_tmp67_ = unity_files_lens_daemon_run_zg_query_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
2027
 
                        _data_->_tmp68_ = _data_->_tmp67_;
2028
 
                        _g_object_unref0 (_data_->_tmp65_);
2029
 
                        _data_->_tmp69_ = _data_->_tmp68_;
 
2112
                        _data_->_tmp78_ = NULL;
 
2113
                        _data_->_tmp78_ = unity_files_lens_daemon_run_zg_query_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
 
2114
                        _data_->_tmp79_ = _data_->_tmp78_;
 
2115
                        _g_object_unref0 (_data_->_tmp76_);
 
2116
                        _data_->_tmp80_ = _data_->_tmp79_;
2030
2117
                        if (_data_->_inner_error_ != NULL) {
2031
2118
                                _g_object_unref0 (_data_->bookmark_uris);
2032
2119
                                _g_free0 (_data_->checked_url);
2037
2124
                                goto __catch1_g_error;
2038
2125
                        }
2039
2126
                        _g_object_unref0 (_data_->results);
2040
 
                        _data_->results = _data_->_tmp69_;
2041
 
                        _data_->_tmp70_ = _data_->search;
2042
 
                        _data_->_tmp71_ = unity_lens_search_get_search_string (_data_->_tmp70_);
2043
 
                        _data_->_tmp72_ = _data_->_tmp71_;
2044
 
                        _data_->_tmp73_ = _data_->results;
2045
 
                        _data_->_tmp74_ = _data_->results_model;
2046
 
                        _data_->_tmp75_ = G_MAXINT64;
2047
 
                        unity_files_lens_append_events_sorted (_data_->_tmp72_, _data_->_tmp73_, (DeeModel*) _data_->_tmp74_, (gint64) 0, _data_->_tmp75_, UNITY_FILES_LENS_RESULT_FLAGS_NONE, NULL, (gint) UNITY_FILES_LENS_CATEGORIES_DOWNLOADS);
 
2127
                        _data_->results = _data_->_tmp80_;
 
2128
                        _data_->_tmp81_ = _data_->search;
 
2129
                        _data_->_tmp82_ = unity_lens_search_get_search_string (_data_->_tmp81_);
 
2130
                        _data_->_tmp83_ = _data_->_tmp82_;
 
2131
                        _data_->_tmp84_ = _data_->results;
 
2132
                        _data_->_tmp85_ = _data_->results_model;
 
2133
                        _data_->_tmp86_ = G_MAXINT64;
 
2134
                        unity_files_lens_append_events_sorted (_data_->_tmp83_, _data_->_tmp84_, (DeeModel*) _data_->_tmp85_, (gint64) 0, _data_->_tmp86_, UNITY_FILES_LENS_RESULT_FLAGS_NONE, NULL, (gint) UNITY_FILES_LENS_CATEGORIES_DOWNLOADS);
2048
2135
                }
2049
 
                _data_->_tmp77_ = _data_->has_search;
2050
 
                if (_data_->_tmp77_) {
2051
 
                        _data_->_tmp78_ = _data_->self->priv->_use_locate;
2052
 
                        _data_->_tmp76_ = _data_->_tmp78_;
 
2136
                _data_->_tmp88_ = _data_->has_search;
 
2137
                if (_data_->_tmp88_) {
 
2138
                        _data_->_tmp89_ = _data_->self->priv->_use_locate;
 
2139
                        _data_->_tmp87_ = _data_->_tmp89_;
2053
2140
                } else {
2054
 
                        _data_->_tmp76_ = FALSE;
 
2141
                        _data_->_tmp87_ = FALSE;
2055
2142
                }
2056
 
                _data_->_tmp79_ = _data_->_tmp76_;
2057
 
                if (_data_->_tmp79_) {
2058
 
                        _data_->_tmp80_ = _data_->search;
2059
 
                        _data_->_tmp81_ = unity_lens_search_get_search_string (_data_->_tmp80_);
2060
 
                        _data_->_tmp82_ = _data_->_tmp81_;
2061
 
                        _data_->_tmp83_ = _data_->search;
2062
 
                        _data_->_tmp84_ = unity_lens_search_get_results_model (_data_->_tmp83_);
2063
 
                        _data_->_tmp85_ = _data_->_tmp84_;
2064
 
                        _data_->_tmp86_ = _data_->cancellable;
 
2143
                _data_->_tmp90_ = _data_->_tmp87_;
 
2144
                if (_data_->_tmp90_) {
 
2145
                        _data_->_tmp91_ = _data_->search;
 
2146
                        _data_->_tmp92_ = unity_lens_search_get_search_string (_data_->_tmp91_);
 
2147
                        _data_->_tmp93_ = _data_->_tmp92_;
 
2148
                        _data_->_tmp94_ = _data_->search;
 
2149
                        _data_->_tmp95_ = unity_lens_search_get_results_model (_data_->_tmp94_);
 
2150
                        _data_->_tmp96_ = _data_->_tmp95_;
 
2151
                        _data_->_tmp97_ = _data_->cancellable;
2065
2152
                        _data_->_state_ = 3;
2066
 
                        unity_files_lens_daemon_perform_locate (_data_->self, (guint) 500, _data_->_tmp82_, (DeeModel*) _data_->_tmp85_, _data_->_tmp86_, (gint) UNITY_FILES_LENS_CATEGORIES_FILES_AND_FOLDERS, (gint) UNITY_FILES_LENS_CATEGORIES_FILES_AND_FOLDERS, unity_files_lens_daemon_update_global_search_async_ready, _data_);
 
2153
                        unity_files_lens_daemon_perform_locate (_data_->self, (guint) 500, _data_->_tmp93_, (DeeModel*) _data_->_tmp96_, _data_->_tmp97_, (gint) UNITY_FILES_LENS_CATEGORIES_FILES_AND_FOLDERS, (gint) UNITY_FILES_LENS_CATEGORIES_FILES_AND_FOLDERS, unity_files_lens_daemon_update_global_search_async_ready, _data_);
2067
2154
                        return FALSE;
2068
2155
                        _state_3:
2069
2156
                        unity_files_lens_daemon_perform_locate_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
2101
2188
        {
2102
2189
                _data_->e = _data_->_inner_error_;
2103
2190
                _data_->_inner_error_ = NULL;
2104
 
                _data_->_tmp87_ = _data_->search;
2105
 
                _data_->_tmp88_ = unity_lens_search_get_search_string (_data_->_tmp87_);
2106
 
                _data_->_tmp89_ = _data_->_tmp88_;
2107
 
                _data_->_tmp90_ = _data_->e;
2108
 
                _data_->_tmp91_ = _data_->_tmp90_->message;
2109
 
                g_warning ("daemon.vala:483: Error performing global search '%s': %s", _data_->_tmp89_, _data_->_tmp91_);
 
2191
                _data_->_tmp98_ = _data_->search;
 
2192
                _data_->_tmp99_ = unity_lens_search_get_search_string (_data_->_tmp98_);
 
2193
                _data_->_tmp100_ = _data_->_tmp99_;
 
2194
                _data_->_tmp101_ = _data_->e;
 
2195
                _data_->_tmp102_ = _data_->_tmp101_->message;
 
2196
                g_warning ("daemon.vala:504: Error performing global search '%s': %s", _data_->_tmp100_, _data_->_tmp102_);
2110
2197
                _g_error_free0 (_data_->e);
2111
2198
        }
2112
2199
        __finally1:
2194
2281
}
2195
2282
 
2196
2283
 
2197
 
static gboolean ____lambda4_ (Block1Data* _data1_) {
 
2284
static gboolean ____lambda8_ (Block1Data* _data1_) {
2198
2285
        UnityFilesLensDaemon * self;
2199
2286
        gboolean result = FALSE;
2200
2287
        gboolean _tmp0_ = FALSE;
2231
2318
}
2232
2319
 
2233
2320
 
2234
 
static gboolean _____lambda4__gsource_func (gpointer self) {
 
2321
static gboolean _____lambda8__gsource_func (gpointer self) {
2235
2322
        gboolean result;
2236
 
        result = ____lambda4_ (self);
 
2323
        result = ____lambda8_ (self);
2237
2324
        return result;
2238
2325
}
2239
2326
 
2416
2503
                _data_->_tmp76_ = dee_model_get_n_rows ((DeeModel*) _data_->_tmp75_);
2417
2504
                if (_data_->_tmp76_ > ((guint) 0)) {
2418
2505
                        _data_->_tmp77_ = 0U;
2419
 
                        _data_->_tmp77_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _____lambda4__gsource_func, block1_data_ref (_data_->_data1_), block1_data_unref);
 
2506
                        _data_->_tmp77_ = g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 200, _____lambda8__gsource_func, block1_data_ref (_data_->_data1_), block1_data_unref);
2420
2507
                        _data_->_data1_->timer_id = _data_->_tmp77_;
2421
2508
                }
2422
2509
                _data_->_tmp80_ = _data_->filter;
2529
2616
                        _data_->_tmp124_ = _data_->max_size;
2530
2617
                        _data_->_tmp125_ = _data_->bookmark_uris;
2531
2618
                        unity_files_lens_append_events_sorted (_data_->_tmp120_, _data_->_tmp121_, (DeeModel*) _data_->_tmp122_, _data_->_tmp123_, _data_->_tmp124_, UNITY_FILES_LENS_RESULT_FLAGS_USE_ORIGIN, (GeeSet*) _data_->_tmp125_, -1);
 
2619
                        _data_->_tmp126_ = _data_->has_search;
 
2620
                        if (_data_->_tmp126_) {
 
2621
                                _data_->_tmp127_ = _data_->self->priv->devices;
 
2622
                                _data_->_tmp128_ = _data_->search;
 
2623
                                _data_->_tmp129_ = unity_lens_search_get_search_string (_data_->_tmp128_);
 
2624
                                _data_->_tmp130_ = _data_->_tmp129_;
 
2625
                                _data_->_tmp131_ = NULL;
 
2626
                                _data_->_tmp131_ = unity_files_lens_devices_search (_data_->_tmp127_, _data_->_tmp130_);
 
2627
                                __g_list_free__g_object_unref0_0 (_data_->matching_devices);
 
2628
                                _data_->matching_devices = _data_->_tmp131_;
 
2629
                        } else {
 
2630
                                _data_->_tmp132_ = _data_->self->priv->devices;
 
2631
                                _data_->_tmp133_ = NULL;
 
2632
                                _data_->_tmp133_ = unity_files_lens_devices_list (_data_->_tmp132_);
 
2633
                                __g_list_free__g_object_unref0_0 (_data_->matching_devices);
 
2634
                                _data_->matching_devices = _data_->_tmp133_;
 
2635
                        }
 
2636
                        _data_->_tmp134_ = _data_->matching_devices;
 
2637
                        _data_->_tmp135_ = _data_->results_model;
 
2638
                        unity_files_lens_daemon_append_devices (_data_->self, _data_->_tmp134_, (DeeModel*) _data_->_tmp135_, UNITY_FILES_LENS_CATEGORIES_FOLDERS);
 
2639
                        __g_list_free__g_object_unref0_0 (_data_->matching_devices);
2532
2640
                        _g_object_unref0 (_data_->bookmark_uris);
2533
2641
                        __g_list_free__g_object_unref0_0 (_data_->matching_bookmarks);
2534
2642
                } else {
2535
 
                        _data_->_tmp126_ = _data_->_data1_->txn;
2536
 
                        _data_->_tmp127_ = FALSE;
2537
 
                        _data_->_tmp127_ = dee_transaction_is_committed (_data_->_tmp126_);
2538
 
                        if (!_data_->_tmp127_) {
2539
 
                                _data_->_tmp128_ = _data_->_data1_->txn;
2540
 
                                dee_transaction_commit (_data_->_tmp128_, &_data_->_inner_error_);
 
2643
                        _data_->_tmp136_ = _data_->_data1_->txn;
 
2644
                        _data_->_tmp137_ = FALSE;
 
2645
                        _data_->_tmp137_ = dee_transaction_is_committed (_data_->_tmp136_);
 
2646
                        if (!_data_->_tmp137_) {
 
2647
                                _data_->_tmp138_ = _data_->_data1_->txn;
 
2648
                                dee_transaction_commit (_data_->_tmp138_, &_data_->_inner_error_);
2541
2649
                                if (_data_->_inner_error_ != NULL) {
2542
2650
                                        _g_free0 (_data_->checked_url);
2543
2651
                                        _g_object_unref0 (_data_->results);
2548
2656
                                }
2549
2657
                        }
2550
2658
                }
2551
 
                _data_->_tmp130_ = _data_->has_search;
2552
 
                if (_data_->_tmp130_) {
2553
 
                        _data_->_tmp131_ = _data_->self->priv->_use_locate;
2554
 
                        _data_->_tmp129_ = _data_->_tmp131_;
 
2659
                _data_->_tmp140_ = _data_->has_search;
 
2660
                if (_data_->_tmp140_) {
 
2661
                        _data_->_tmp141_ = _data_->self->priv->_use_locate;
 
2662
                        _data_->_tmp139_ = _data_->_tmp141_;
2555
2663
                } else {
2556
 
                        _data_->_tmp129_ = FALSE;
 
2664
                        _data_->_tmp139_ = FALSE;
2557
2665
                }
2558
 
                _data_->_tmp132_ = _data_->_tmp129_;
2559
 
                if (_data_->_tmp132_) {
2560
 
                        _data_->_tmp133_ = _data_->search;
2561
 
                        _data_->_tmp134_ = unity_lens_search_get_search_string (_data_->_tmp133_);
2562
 
                        _data_->_tmp135_ = _data_->_tmp134_;
2563
 
                        _data_->_tmp136_ = _data_->search;
2564
 
                        _data_->_tmp137_ = unity_lens_search_get_results_model (_data_->_tmp136_);
2565
 
                        _data_->_tmp138_ = _data_->_tmp137_;
2566
 
                        _data_->_tmp139_ = _data_->_data1_->cancellable;
 
2666
                _data_->_tmp142_ = _data_->_tmp139_;
 
2667
                if (_data_->_tmp142_) {
 
2668
                        _data_->_tmp143_ = _data_->search;
 
2669
                        _data_->_tmp144_ = unity_lens_search_get_search_string (_data_->_tmp143_);
 
2670
                        _data_->_tmp145_ = _data_->_tmp144_;
 
2671
                        _data_->_tmp146_ = _data_->search;
 
2672
                        _data_->_tmp147_ = unity_lens_search_get_results_model (_data_->_tmp146_);
 
2673
                        _data_->_tmp148_ = _data_->_tmp147_;
 
2674
                        _data_->_tmp149_ = _data_->_data1_->cancellable;
2567
2675
                        _data_->_state_ = 4;
2568
 
                        unity_files_lens_daemon_perform_locate (_data_->self, (guint) 500, _data_->_tmp135_, (DeeModel*) _data_->_tmp138_, _data_->_tmp139_, (gint) UNITY_FILES_LENS_CATEGORIES_RECENT, (gint) UNITY_FILES_LENS_CATEGORIES_FOLDERS, unity_files_lens_daemon_update_search_async_ready, _data_);
 
2676
                        unity_files_lens_daemon_perform_locate (_data_->self, (guint) 500, _data_->_tmp145_, (DeeModel*) _data_->_tmp148_, _data_->_tmp149_, (gint) UNITY_FILES_LENS_CATEGORIES_RECENT, (gint) UNITY_FILES_LENS_CATEGORIES_FOLDERS, unity_files_lens_daemon_update_search_async_ready, _data_);
2569
2677
                        return FALSE;
2570
2678
                        _state_4:
2571
2679
                        unity_files_lens_daemon_perform_locate_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
2588
2696
                _data_->_inner_error_ = NULL;
2589
2697
                _g_error_free0 (_data_->ioe);
2590
2698
                {
2591
 
                        _data_->_tmp140_ = _data_->_data1_->timer_id;
2592
 
                        if (_data_->_tmp140_ != ((guint) 0)) {
2593
 
                                _data_->_tmp141_ = _data_->_data1_->timer_id;
2594
 
                                g_source_remove (_data_->_tmp141_);
 
2699
                        _data_->_tmp150_ = _data_->_data1_->timer_id;
 
2700
                        if (_data_->_tmp150_ != ((guint) 0)) {
 
2701
                                _data_->_tmp151_ = _data_->_data1_->timer_id;
 
2702
                                g_source_remove (_data_->_tmp151_);
2595
2703
                        }
2596
2704
                }
2597
2705
                _data_->active_filters = (_vala_array_free (_data_->active_filters, _data_->active_filters_length1, (GDestroyNotify) g_free), NULL);
2612
2720
        {
2613
2721
                _data_->e = _data_->_inner_error_;
2614
2722
                _data_->_inner_error_ = NULL;
2615
 
                _data_->_tmp142_ = _data_->search;
2616
 
                _data_->_tmp143_ = unity_lens_search_get_search_string (_data_->_tmp142_);
2617
 
                _data_->_tmp144_ = _data_->_tmp143_;
2618
 
                _data_->_tmp145_ = _data_->e;
2619
 
                _data_->_tmp146_ = _data_->_tmp145_->message;
2620
 
                g_warning ("daemon.vala:622: Error performing global search '%s': %s", _data_->_tmp144_, _data_->_tmp146_);
2621
 
                _data_->_tmp147_ = _data_->_data1_->txn;
2622
 
                _data_->_tmp148_ = FALSE;
2623
 
                _data_->_tmp148_ = dee_transaction_is_committed (_data_->_tmp147_);
2624
 
                if (!_data_->_tmp148_) {
2625
 
                        _data_->_tmp149_ = _data_->_data1_->txn;
2626
 
                        dee_transaction_commit (_data_->_tmp149_, &_data_->_inner_error_);
 
2723
                _data_->_tmp152_ = _data_->search;
 
2724
                _data_->_tmp153_ = unity_lens_search_get_search_string (_data_->_tmp152_);
 
2725
                _data_->_tmp154_ = _data_->_tmp153_;
 
2726
                _data_->_tmp155_ = _data_->e;
 
2727
                _data_->_tmp156_ = _data_->_tmp155_->message;
 
2728
                g_warning ("daemon.vala:653: Error performing global search '%s': %s", _data_->_tmp154_, _data_->_tmp156_);
 
2729
                _data_->_tmp157_ = _data_->_data1_->txn;
 
2730
                _data_->_tmp158_ = FALSE;
 
2731
                _data_->_tmp158_ = dee_transaction_is_committed (_data_->_tmp157_);
 
2732
                if (!_data_->_tmp158_) {
 
2733
                        _data_->_tmp159_ = _data_->_data1_->txn;
 
2734
                        dee_transaction_commit (_data_->_tmp159_, &_data_->_inner_error_);
2627
2735
                        if (_data_->_inner_error_ != NULL) {
2628
2736
                                _g_error_free0 (_data_->e);
2629
2737
                                goto __finally2;
2633
2741
        }
2634
2742
        __finally2:
2635
2743
        {
2636
 
                _data_->_tmp150_ = _data_->_data1_->timer_id;
2637
 
                if (_data_->_tmp150_ != ((guint) 0)) {
2638
 
                        _data_->_tmp151_ = _data_->_data1_->timer_id;
2639
 
                        g_source_remove (_data_->_tmp151_);
 
2744
                _data_->_tmp160_ = _data_->_data1_->timer_id;
 
2745
                if (_data_->_tmp160_ != ((guint) 0)) {
 
2746
                        _data_->_tmp161_ = _data_->_data1_->timer_id;
 
2747
                        g_source_remove (_data_->_tmp161_);
2640
2748
                }
2641
2749
        }
2642
2750
        if (_data_->_inner_error_ != NULL) {
3484
3592
        _data_->_tmp42_ = _data_->timer;
3485
3593
        _data_->_tmp43_ = 0.0;
3486
3594
        _data_->_tmp43_ = g_timer_elapsed (_data_->_tmp42_, NULL);
3487
 
        g_debug ("daemon.vala:782: Found %u/%u no search results in %fms", _data_->_tmp39_, _data_->_tmp41_, _data_->_tmp43_ * 1000);
 
3595
        g_debug ("daemon.vala:813: Found %u/%u no search results in %fms", _data_->_tmp39_, _data_->_tmp41_, _data_->_tmp43_ * 1000);
3488
3596
        _data_->result = _data_->results;
3489
3597
        _g_ptr_array_unref0 (_data_->ptr_arr);
3490
3598
        _g_ptr_array_unref0 (_data_->templates);
3567
3675
}
3568
3676
 
3569
3677
 
 
3678
static void unity_files_lens_daemon_append_devices (UnityFilesLensDaemon* self, GList* devices, DeeModel* results_model, UnityFilesLensCategories category) {
 
3679
        GList* _tmp0_;
 
3680
        g_return_if_fail (self != NULL);
 
3681
        g_return_if_fail (results_model != NULL);
 
3682
        _tmp0_ = devices;
 
3683
        {
 
3684
                GList* device_collection = NULL;
 
3685
                GList* device_it = NULL;
 
3686
                device_collection = _tmp0_;
 
3687
                for (device_it = device_collection; device_it != NULL; device_it = device_it->next) {
 
3688
                        UnityFilesLensDevice* _tmp1_;
 
3689
                        UnityFilesLensDevice* device = NULL;
 
3690
                        _tmp1_ = _g_object_ref0 ((UnityFilesLensDevice*) device_it->data);
 
3691
                        device = _tmp1_;
 
3692
                        {
 
3693
                                DeeModel* _tmp2_;
 
3694
                                UnityFilesLensDevice* _tmp3_;
 
3695
                                const gchar* _tmp4_;
 
3696
                                const gchar* _tmp5_;
 
3697
                                UnityFilesLensDevice* _tmp6_;
 
3698
                                const gchar* _tmp7_;
 
3699
                                const gchar* _tmp8_;
 
3700
                                UnityFilesLensCategories _tmp9_;
 
3701
                                UnityFilesLensDevice* _tmp10_;
 
3702
                                const gchar* _tmp11_;
 
3703
                                const gchar* _tmp12_;
 
3704
                                UnityFilesLensDevice* _tmp13_;
 
3705
                                const gchar* _tmp14_;
 
3706
                                const gchar* _tmp15_;
 
3707
                                _tmp2_ = results_model;
 
3708
                                _tmp3_ = device;
 
3709
                                _tmp4_ = unity_files_lens_device_get_uri (_tmp3_);
 
3710
                                _tmp5_ = _tmp4_;
 
3711
                                _tmp6_ = device;
 
3712
                                _tmp7_ = unity_files_lens_device_get_icon_name (_tmp6_);
 
3713
                                _tmp8_ = _tmp7_;
 
3714
                                _tmp9_ = category;
 
3715
                                _tmp10_ = device;
 
3716
                                _tmp11_ = unity_files_lens_device_get_display_name (_tmp10_);
 
3717
                                _tmp12_ = _tmp11_;
 
3718
                                _tmp13_ = device;
 
3719
                                _tmp14_ = unity_files_lens_device_get_dnd_uri (_tmp13_);
 
3720
                                _tmp15_ = _tmp14_;
 
3721
                                dee_model_append (_tmp2_, _tmp5_, _tmp8_, _tmp9_, "", _tmp12_, _tmp15_, NULL);
 
3722
                                _g_object_unref0 (device);
 
3723
                        }
 
3724
                }
 
3725
        }
 
3726
}
 
3727
 
 
3728
 
3570
3729
static void unity_files_lens_daemon_perform_locate_data_free (gpointer _data) {
3571
3730
        UnityFilesLensDaemonPerformLocateData* _data_;
3572
3731
        _data_ = _data;
3901
4060
}
3902
4061
 
3903
4062
 
3904
 
static void unity_files_lens_daemon_count_directory_items (UnityFilesLensDaemon* self, const gchar* top_path, gint* count, gint64* total_size, gboolean recurse, GError** error) {
 
4063
static void unity_files_lens_daemon_count_directory_items (UnityFilesLensDaemon* self, const gchar* top_path, gint* count, guint64* total_size, gboolean recurse, GError** error) {
3905
4064
        const gchar* _tmp0_;
3906
4065
        GFile* _tmp1_ = NULL;
3907
4066
        GFile* dir;
3969
4128
                                _tmp12_ = info;
3970
4129
                                _tmp13_ = g_file_info_get_file_type (_tmp12_);
3971
4130
                                if (_tmp13_ == G_FILE_TYPE_REGULAR) {
3972
 
                                        gint64 _tmp14_;
 
4131
                                        guint64 _tmp14_;
3973
4132
                                        GFileInfo* _tmp15_;
3974
4133
                                        gint64 _tmp16_ = 0LL;
3975
4134
                                        _tmp14_ = *total_size;
4106
4265
        gchar* real_uri = NULL;
4107
4266
        const gchar* _tmp1_;
4108
4267
        gboolean _tmp2_ = FALSE;
4109
 
        const gchar* _tmp7_;
4110
 
        GFile* _tmp8_ = NULL;
 
4268
        const gchar* _tmp11_;
 
4269
        GFile* _tmp12_ = NULL;
4111
4270
        GFile* file;
4112
 
        GFile* _tmp9_;
 
4271
        GFile* _tmp13_;
4113
4272
        GError * _inner_error_ = NULL;
4114
4273
        g_return_val_if_fail (self != NULL, NULL);
4115
4274
        g_return_val_if_fail (uri != NULL, NULL);
4116
4275
        _tmp0_ = uri;
4117
 
        g_debug ("daemon.vala:907: Previewing: %s", _tmp0_);
 
4276
        g_debug ("daemon.vala:950: Previewing: %s", _tmp0_);
4118
4277
        preview = NULL;
4119
4278
        _tmp1_ = uri;
4120
4279
        _tmp2_ = unity_files_lens_bookmark_is_bookmark_uri (_tmp1_);
4127
4286
                real_uri = _tmp4_;
4128
4287
        } else {
4129
4288
                const gchar* _tmp5_;
4130
 
                gchar* _tmp6_;
 
4289
                gboolean _tmp6_ = FALSE;
4131
4290
                _tmp5_ = uri;
4132
 
                _tmp6_ = g_strdup (_tmp5_);
4133
 
                _g_free0 (real_uri);
4134
 
                real_uri = _tmp6_;
 
4291
                _tmp6_ = unity_files_lens_device_is_device_uri (_tmp5_);
 
4292
                if (_tmp6_) {
 
4293
                        const gchar* _tmp7_;
 
4294
                        UnityGenericPreview* _tmp8_ = NULL;
 
4295
                        _tmp7_ = uri;
 
4296
                        _tmp8_ = unity_files_lens_daemon_create_device_preview (self, _tmp7_);
 
4297
                        _g_object_unref0 (preview);
 
4298
                        preview = _tmp8_;
 
4299
                        result = (UnityPreview*) preview;
 
4300
                        _g_free0 (real_uri);
 
4301
                        return result;
 
4302
                } else {
 
4303
                        const gchar* _tmp9_;
 
4304
                        gchar* _tmp10_;
 
4305
                        _tmp9_ = uri;
 
4306
                        _tmp10_ = g_strdup (_tmp9_);
 
4307
                        _g_free0 (real_uri);
 
4308
                        real_uri = _tmp10_;
 
4309
                }
4135
4310
        }
4136
 
        _tmp7_ = real_uri;
4137
 
        _tmp8_ = g_file_new_for_uri (_tmp7_);
4138
 
        file = _tmp8_;
4139
 
        _tmp9_ = file;
4140
 
        if (_tmp9_ != NULL) {
 
4311
        _tmp11_ = real_uri;
 
4312
        _tmp12_ = g_file_new_for_uri (_tmp11_);
 
4313
        file = _tmp12_;
 
4314
        _tmp13_ = file;
 
4315
        if (_tmp13_ != NULL) {
4141
4316
                GFileInfo* finfo;
4142
 
                GFileInfo* _tmp16_;
 
4317
                GFileInfo* _tmp20_;
4143
4318
                finfo = NULL;
4144
4319
                {
4145
 
                        GFile* _tmp10_;
4146
 
                        GFileInfo* _tmp11_ = NULL;
4147
 
                        GFileInfo* _tmp12_;
4148
 
                        _tmp10_ = file;
4149
 
                        _tmp11_ = g_file_query_info (_tmp10_, "*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
4150
 
                        _tmp12_ = _tmp11_;
 
4320
                        GFile* _tmp14_;
 
4321
                        GFileInfo* _tmp15_ = NULL;
 
4322
                        GFileInfo* _tmp16_;
 
4323
                        _tmp14_ = file;
 
4324
                        _tmp15_ = g_file_query_info (_tmp14_, "*", G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
 
4325
                        _tmp16_ = _tmp15_;
4151
4326
                        if (_inner_error_ != NULL) {
4152
4327
                                goto __catch3_g_error;
4153
4328
                        }
4154
4329
                        _g_object_unref0 (finfo);
4155
 
                        finfo = _tmp12_;
 
4330
                        finfo = _tmp16_;
4156
4331
                }
4157
4332
                goto __finally3;
4158
4333
                __catch3_g_error:
4159
4334
                {
4160
4335
                        GError* e = NULL;
4161
 
                        const gchar* _tmp13_;
4162
 
                        GError* _tmp14_;
4163
 
                        const gchar* _tmp15_;
 
4336
                        const gchar* _tmp17_;
 
4337
                        GError* _tmp18_;
 
4338
                        const gchar* _tmp19_;
4164
4339
                        e = _inner_error_;
4165
4340
                        _inner_error_ = NULL;
4166
 
                        _tmp13_ = uri;
4167
 
                        _tmp14_ = e;
4168
 
                        _tmp15_ = _tmp14_->message;
4169
 
                        g_warning ("daemon.vala:930: Error getting file info for '%s': %s", _tmp13_, _tmp15_);
 
4341
                        _tmp17_ = uri;
 
4342
                        _tmp18_ = e;
 
4343
                        _tmp19_ = _tmp18_->message;
 
4344
                        g_warning ("daemon.vala:978: Error getting file info for '%s': %s", _tmp17_, _tmp19_);
4170
4345
                        _g_error_free0 (e);
4171
4346
                }
4172
4347
                __finally3:
4179
4354
                        g_clear_error (&_inner_error_);
4180
4355
                        return NULL;
4181
4356
                }
4182
 
                _tmp16_ = finfo;
4183
 
                if (_tmp16_ != NULL) {
4184
 
                        GFileInfo* _tmp17_;
4185
 
                        const gchar* _tmp18_ = NULL;
4186
 
                        UnityGenericPreview* _tmp19_;
4187
 
                        const gchar* _tmp20_;
4188
 
                        gboolean _tmp21_ = FALSE;
4189
 
                        GFileInfo* _tmp28_;
4190
 
                        GTimeVal _tmp29_ = {0};
 
4357
                _tmp20_ = finfo;
 
4358
                if (_tmp20_ != NULL) {
 
4359
                        GFileInfo* _tmp21_;
 
4360
                        const gchar* _tmp22_ = NULL;
 
4361
                        UnityGenericPreview* _tmp23_;
 
4362
                        const gchar* _tmp24_;
 
4363
                        gboolean _tmp25_ = FALSE;
 
4364
                        GFileInfo* _tmp32_;
 
4365
                        GTimeVal _tmp33_ = {0};
4191
4366
                        GTimeVal mtime;
4192
 
                        GTimeVal _tmp30_;
4193
 
                        GDateTime* _tmp31_;
 
4367
                        GTimeVal _tmp34_;
 
4368
                        GDateTime* _tmp35_;
4194
4369
                        GDateTime* date_time;
4195
 
                        GDateTime* _tmp32_;
4196
 
                        GAppInfo* _tmp37_ = NULL;
 
4370
                        GDateTime* _tmp36_;
 
4371
                        GAppInfo* _tmp41_ = NULL;
4197
4372
                        GAppInfo* email_app_info;
4198
 
                        GFileInfo* _tmp38_;
4199
 
                        const gchar* _tmp39_ = NULL;
4200
 
                        gchar* _tmp40_;
 
4373
                        GFileInfo* _tmp42_;
 
4374
                        const gchar* _tmp43_ = NULL;
 
4375
                        gchar* _tmp44_;
4201
4376
                        gchar* mime_type;
4202
 
                        UnityGenericPreview* _tmp41_;
4203
 
                        const gchar* _tmp42_ = NULL;
4204
 
                        const gchar* _tmp43_;
4205
 
                        gchar* _tmp44_ = NULL;
4206
 
                        gchar* _tmp45_;
4207
 
                        UnityInfoHint* _tmp46_;
4208
 
                        UnityInfoHint* _tmp47_;
4209
 
                        const gchar* _tmp48_ = NULL;
4210
 
                        UnityPreviewAction* _tmp49_;
 
4377
                        UnityGenericPreview* _tmp45_;
 
4378
                        const gchar* _tmp46_ = NULL;
 
4379
                        const gchar* _tmp47_;
 
4380
                        gchar* _tmp48_ = NULL;
 
4381
                        gchar* _tmp49_;
 
4382
                        UnityInfoHint* _tmp50_;
 
4383
                        UnityInfoHint* _tmp51_;
 
4384
                        const gchar* _tmp52_ = NULL;
 
4385
                        UnityPreviewAction* _tmp53_;
4211
4386
                        UnityPreviewAction* open_action;
4212
 
                        UnityPreviewAction* _tmp50_;
4213
 
                        UnityGenericPreview* _tmp51_;
4214
 
                        UnityPreviewAction* _tmp52_;
4215
 
                        gint64 total_size;
4216
 
                        GFileInfo* _tmp53_;
4217
 
                        GFileType _tmp54_ = 0;
4218
 
                        _tmp17_ = finfo;
4219
 
                        _tmp18_ = g_file_info_get_name (_tmp17_);
4220
 
                        _tmp19_ = unity_generic_preview_new (_tmp18_, "", NULL);
 
4387
                        UnityPreviewAction* _tmp54_;
 
4388
                        UnityGenericPreview* _tmp55_;
 
4389
                        UnityPreviewAction* _tmp56_;
 
4390
                        guint64 total_size;
 
4391
                        GFileInfo* _tmp57_;
 
4392
                        GFileType _tmp58_ = 0;
 
4393
                        _tmp21_ = finfo;
 
4394
                        _tmp22_ = g_file_info_get_name (_tmp21_);
 
4395
                        _tmp23_ = unity_generic_preview_new (_tmp22_, "", NULL);
4221
4396
                        _g_object_unref0 (preview);
4222
 
                        preview = _tmp19_;
4223
 
                        _tmp20_ = uri;
4224
 
                        _tmp21_ = unity_files_lens_bookmark_is_bookmark_uri (_tmp20_);
4225
 
                        if (_tmp21_) {
4226
 
                                UnityGenericPreview* _tmp22_;
4227
 
                                const gchar* _tmp23_;
4228
 
                                gchar* _tmp24_ = NULL;
4229
 
                                gchar* _tmp25_;
4230
 
                                _tmp22_ = preview;
4231
 
                                _tmp23_ = uri;
4232
 
                                _tmp24_ = unity_files_lens_bookmark_uri_from_bookmark (_tmp23_);
4233
 
                                _tmp25_ = _tmp24_;
4234
 
                                unity_preview_set_image_source_uri ((UnityPreview*) _tmp22_, _tmp25_);
4235
 
                                _g_free0 (_tmp25_);
4236
 
                        } else {
 
4397
                        preview = _tmp23_;
 
4398
                        _tmp24_ = uri;
 
4399
                        _tmp25_ = unity_files_lens_bookmark_is_bookmark_uri (_tmp24_);
 
4400
                        if (_tmp25_) {
4237
4401
                                UnityGenericPreview* _tmp26_;
4238
4402
                                const gchar* _tmp27_;
 
4403
                                gchar* _tmp28_ = NULL;
 
4404
                                gchar* _tmp29_;
4239
4405
                                _tmp26_ = preview;
4240
4406
                                _tmp27_ = uri;
4241
 
                                unity_preview_set_image_source_uri ((UnityPreview*) _tmp26_, _tmp27_);
4242
 
                        }
4243
 
                        _tmp28_ = finfo;
4244
 
                        g_file_info_get_modification_time (_tmp28_, &_tmp29_);
4245
 
                        mtime = _tmp29_;
4246
 
                        _tmp30_ = mtime;
4247
 
                        _tmp31_ = g_date_time_new_from_timeval_local (&_tmp30_);
4248
 
                        date_time = _tmp31_;
4249
 
                        _tmp32_ = date_time;
4250
 
                        if (_tmp32_ != NULL) {
4251
 
                                UnityGenericPreview* _tmp33_;
4252
 
                                GDateTime* _tmp34_;
4253
 
                                gchar* _tmp35_ = NULL;
4254
 
                                gchar* _tmp36_;
4255
 
                                _tmp33_ = preview;
4256
 
                                _tmp34_ = date_time;
4257
 
                                _tmp35_ = g_date_time_format (_tmp34_, "%x, %X");
4258
 
                                _tmp36_ = _tmp35_;
4259
 
                                unity_preview_set_subtitle ((UnityPreview*) _tmp33_, _tmp36_);
4260
 
                                _g_free0 (_tmp36_);
4261
 
                        }
4262
 
                        _tmp37_ = g_app_info_get_default_for_uri_scheme ("mailto");
4263
 
                        email_app_info = _tmp37_;
4264
 
                        _tmp38_ = finfo;
4265
 
                        _tmp39_ = g_file_info_get_content_type (_tmp38_);
4266
 
                        _tmp40_ = g_strdup (_tmp39_);
4267
 
                        mime_type = _tmp40_;
4268
 
                        _tmp41_ = preview;
4269
 
                        _tmp42_ = _ ("Format");
4270
 
                        _tmp43_ = mime_type;
4271
 
                        _tmp44_ = g_content_type_get_description (_tmp43_);
4272
 
                        _tmp45_ = _tmp44_;
4273
 
                        _tmp46_ = unity_info_hint_new ("format", _tmp42_, NULL, _tmp45_);
4274
 
                        _tmp47_ = g_object_ref_sink (_tmp46_);
4275
 
                        unity_preview_add_info ((UnityPreview*) _tmp41_, _tmp47_);
4276
 
                        _g_object_unref0 (_tmp47_);
4277
 
                        _g_free0 (_tmp45_);
4278
 
                        _tmp48_ = _ ("Open");
4279
 
                        _tmp49_ = unity_preview_action_new ("open", _tmp48_, NULL);
4280
 
                        open_action = _tmp49_;
4281
 
                        _tmp50_ = open_action;
4282
 
                        g_signal_connect_object (_tmp50_, "activated", (GCallback) _unity_files_lens_daemon_on_preview_open_unity_preview_action_activated, self, 0);
4283
 
                        _tmp51_ = preview;
4284
 
                        _tmp52_ = open_action;
4285
 
                        unity_preview_add_action ((UnityPreview*) _tmp51_, _tmp52_);
4286
 
                        total_size = (gint64) 0;
4287
 
                        _tmp53_ = finfo;
4288
 
                        _tmp54_ = g_file_info_get_file_type (_tmp53_);
4289
 
                        if (_tmp54_ == G_FILE_TYPE_DIRECTORY) {
4290
 
                                GFile* _tmp55_;
4291
 
                                gchar* _tmp56_ = NULL;
4292
 
                                gchar* _tmp57_;
4293
 
                                gboolean _tmp58_;
4294
 
                                _tmp55_ = file;
4295
 
                                _tmp56_ = g_file_get_path (_tmp55_);
4296
 
                                _tmp57_ = _tmp56_;
4297
 
                                _tmp58_ = _tmp57_ != NULL;
4298
 
                                _g_free0 (_tmp57_);
4299
 
                                if (_tmp58_) {
 
4407
                                _tmp28_ = unity_files_lens_bookmark_uri_from_bookmark (_tmp27_);
 
4408
                                _tmp29_ = _tmp28_;
 
4409
                                unity_preview_set_image_source_uri ((UnityPreview*) _tmp26_, _tmp29_);
 
4410
                                _g_free0 (_tmp29_);
 
4411
                        } else {
 
4412
                                UnityGenericPreview* _tmp30_;
 
4413
                                const gchar* _tmp31_;
 
4414
                                _tmp30_ = preview;
 
4415
                                _tmp31_ = uri;
 
4416
                                unity_preview_set_image_source_uri ((UnityPreview*) _tmp30_, _tmp31_);
 
4417
                        }
 
4418
                        _tmp32_ = finfo;
 
4419
                        g_file_info_get_modification_time (_tmp32_, &_tmp33_);
 
4420
                        mtime = _tmp33_;
 
4421
                        _tmp34_ = mtime;
 
4422
                        _tmp35_ = g_date_time_new_from_timeval_local (&_tmp34_);
 
4423
                        date_time = _tmp35_;
 
4424
                        _tmp36_ = date_time;
 
4425
                        if (_tmp36_ != NULL) {
 
4426
                                UnityGenericPreview* _tmp37_;
 
4427
                                GDateTime* _tmp38_;
 
4428
                                gchar* _tmp39_ = NULL;
 
4429
                                gchar* _tmp40_;
 
4430
                                _tmp37_ = preview;
 
4431
                                _tmp38_ = date_time;
 
4432
                                _tmp39_ = g_date_time_format (_tmp38_, "%x, %X");
 
4433
                                _tmp40_ = _tmp39_;
 
4434
                                unity_preview_set_subtitle ((UnityPreview*) _tmp37_, _tmp40_);
 
4435
                                _g_free0 (_tmp40_);
 
4436
                        }
 
4437
                        _tmp41_ = g_app_info_get_default_for_uri_scheme ("mailto");
 
4438
                        email_app_info = _tmp41_;
 
4439
                        _tmp42_ = finfo;
 
4440
                        _tmp43_ = g_file_info_get_content_type (_tmp42_);
 
4441
                        _tmp44_ = g_strdup (_tmp43_);
 
4442
                        mime_type = _tmp44_;
 
4443
                        _tmp45_ = preview;
 
4444
                        _tmp46_ = _ ("Format");
 
4445
                        _tmp47_ = mime_type;
 
4446
                        _tmp48_ = g_content_type_get_description (_tmp47_);
 
4447
                        _tmp49_ = _tmp48_;
 
4448
                        _tmp50_ = unity_info_hint_new ("format", _tmp46_, NULL, _tmp49_);
 
4449
                        _tmp51_ = g_object_ref_sink (_tmp50_);
 
4450
                        unity_preview_add_info ((UnityPreview*) _tmp45_, _tmp51_);
 
4451
                        _g_object_unref0 (_tmp51_);
 
4452
                        _g_free0 (_tmp49_);
 
4453
                        _tmp52_ = _ ("Open");
 
4454
                        _tmp53_ = unity_preview_action_new ("open", _tmp52_, NULL);
 
4455
                        open_action = _tmp53_;
 
4456
                        _tmp54_ = open_action;
 
4457
                        g_signal_connect_object (_tmp54_, "activated", (GCallback) _unity_files_lens_daemon_on_preview_open_unity_preview_action_activated, self, 0);
 
4458
                        _tmp55_ = preview;
 
4459
                        _tmp56_ = open_action;
 
4460
                        unity_preview_add_action ((UnityPreview*) _tmp55_, _tmp56_);
 
4461
                        total_size = (guint64) 0;
 
4462
                        _tmp57_ = finfo;
 
4463
                        _tmp58_ = g_file_info_get_file_type (_tmp57_);
 
4464
                        if (_tmp58_ == G_FILE_TYPE_DIRECTORY) {
 
4465
                                GFile* _tmp59_;
 
4466
                                gchar* _tmp60_ = NULL;
 
4467
                                gchar* _tmp61_;
 
4468
                                gboolean _tmp62_;
 
4469
                                _tmp59_ = file;
 
4470
                                _tmp60_ = g_file_get_path (_tmp59_);
 
4471
                                _tmp61_ = _tmp60_;
 
4472
                                _tmp62_ = _tmp61_ != NULL;
 
4473
                                _g_free0 (_tmp61_);
 
4474
                                if (_tmp62_) {
4300
4475
                                        gint count;
4301
 
                                        UnityGenericPreview* _tmp67_;
4302
 
                                        const gchar* _tmp68_ = NULL;
4303
 
                                        const gchar* _tmp69_ = NULL;
4304
 
                                        gint64 _tmp70_;
4305
 
                                        gchar* _tmp71_ = NULL;
4306
 
                                        gchar* _tmp72_;
4307
 
                                        gint _tmp73_;
4308
 
                                        gchar* _tmp74_ = NULL;
4309
 
                                        gchar* _tmp75_;
4310
 
                                        UnityInfoHint* _tmp76_;
4311
 
                                        UnityInfoHint* _tmp77_;
 
4476
                                        UnityGenericPreview* _tmp71_;
 
4477
                                        const gchar* _tmp72_ = NULL;
 
4478
                                        const gchar* _tmp73_ = NULL;
 
4479
                                        guint64 _tmp74_;
 
4480
                                        gchar* _tmp75_ = NULL;
 
4481
                                        gchar* _tmp76_;
 
4482
                                        gint _tmp77_;
 
4483
                                        gchar* _tmp78_ = NULL;
 
4484
                                        gchar* _tmp79_;
 
4485
                                        UnityInfoHint* _tmp80_;
 
4486
                                        UnityInfoHint* _tmp81_;
4312
4487
                                        count = 0;
4313
4488
                                        {
4314
 
                                                GFile* _tmp59_;
4315
 
                                                gchar* _tmp60_ = NULL;
4316
 
                                                gchar* _tmp61_;
4317
 
                                                _tmp59_ = file;
4318
 
                                                _tmp60_ = g_file_get_path (_tmp59_);
4319
 
                                                _tmp61_ = _tmp60_;
4320
 
                                                unity_files_lens_daemon_count_directory_items (self, _tmp61_, &count, &total_size, FALSE, &_inner_error_);
4321
 
                                                _g_free0 (_tmp61_);
 
4489
                                                GFile* _tmp63_;
 
4490
                                                gchar* _tmp64_ = NULL;
 
4491
                                                gchar* _tmp65_;
 
4492
                                                _tmp63_ = file;
 
4493
                                                _tmp64_ = g_file_get_path (_tmp63_);
 
4494
                                                _tmp65_ = _tmp64_;
 
4495
                                                unity_files_lens_daemon_count_directory_items (self, _tmp65_, &count, &total_size, FALSE, &_inner_error_);
 
4496
                                                _g_free0 (_tmp65_);
4322
4497
                                                if (_inner_error_ != NULL) {
4323
4498
                                                        goto __catch4_g_error;
4324
4499
                                                }
4327
4502
                                        __catch4_g_error:
4328
4503
                                        {
4329
4504
                                                GError* e = NULL;
4330
 
                                                GFile* _tmp62_;
4331
 
                                                gchar* _tmp63_ = NULL;
4332
 
                                                gchar* _tmp64_;
4333
 
                                                GError* _tmp65_;
4334
 
                                                const gchar* _tmp66_;
 
4505
                                                GFile* _tmp66_;
 
4506
                                                gchar* _tmp67_ = NULL;
 
4507
                                                gchar* _tmp68_;
 
4508
                                                GError* _tmp69_;
 
4509
                                                const gchar* _tmp70_;
4335
4510
                                                e = _inner_error_;
4336
4511
                                                _inner_error_ = NULL;
4337
 
                                                _tmp62_ = file;
4338
 
                                                _tmp63_ = g_file_get_path (_tmp62_);
4339
 
                                                _tmp64_ = _tmp63_;
4340
 
                                                _tmp65_ = e;
4341
 
                                                _tmp66_ = _tmp65_->message;
4342
 
                                                g_warning ("daemon.vala:973: Error encounted when counting directory items for pat" \
4343
 
"h '%s': %s", _tmp64_, _tmp66_);
4344
 
                                                _g_free0 (_tmp64_);
 
4512
                                                _tmp66_ = file;
 
4513
                                                _tmp67_ = g_file_get_path (_tmp66_);
 
4514
                                                _tmp68_ = _tmp67_;
 
4515
                                                _tmp69_ = e;
 
4516
                                                _tmp70_ = _tmp69_->message;
 
4517
                                                g_warning ("daemon.vala:1021: Error encounted when counting directory items for pa" \
 
4518
"th '%s': %s", _tmp68_, _tmp70_);
 
4519
                                                _g_free0 (_tmp68_);
4345
4520
                                                _g_error_free0 (e);
4346
4521
                                        }
4347
4522
                                        __finally4:
4358
4533
                                                g_clear_error (&_inner_error_);
4359
4534
                                                return NULL;
4360
4535
                                        }
4361
 
                                        _tmp67_ = preview;
4362
 
                                        _tmp68_ = _ ("Size");
4363
 
                                        _tmp69_ = _ ("%s, %u items");
4364
 
                                        _tmp70_ = total_size;
4365
 
                                        _tmp71_ = g_format_size_full ((guint64) _tmp70_, G_FORMAT_SIZE_DEFAULT);
4366
 
                                        _tmp72_ = _tmp71_;
4367
 
                                        _tmp73_ = count;
4368
 
                                        _tmp74_ = g_strdup_printf (_tmp69_, _tmp72_, _tmp73_);
4369
 
                                        _tmp75_ = _tmp74_;
4370
 
                                        _tmp76_ = unity_info_hint_new ("size", _tmp68_, NULL, _tmp75_);
4371
 
                                        _tmp77_ = g_object_ref_sink (_tmp76_);
4372
 
                                        unity_preview_add_info ((UnityPreview*) _tmp67_, _tmp77_);
4373
 
                                        _g_object_unref0 (_tmp77_);
4374
 
                                        _g_free0 (_tmp75_);
4375
 
                                        _g_free0 (_tmp72_);
 
4536
                                        _tmp71_ = preview;
 
4537
                                        _tmp72_ = _ ("Size");
 
4538
                                        _tmp73_ = _ ("%s, %u items");
 
4539
                                        _tmp74_ = total_size;
 
4540
                                        _tmp75_ = g_format_size_full (_tmp74_, G_FORMAT_SIZE_DEFAULT);
 
4541
                                        _tmp76_ = _tmp75_;
 
4542
                                        _tmp77_ = count;
 
4543
                                        _tmp78_ = g_strdup_printf (_tmp73_, _tmp76_, _tmp77_);
 
4544
                                        _tmp79_ = _tmp78_;
 
4545
                                        _tmp80_ = unity_info_hint_new ("size", _tmp72_, NULL, _tmp79_);
 
4546
                                        _tmp81_ = g_object_ref_sink (_tmp80_);
 
4547
                                        unity_preview_add_info ((UnityPreview*) _tmp71_, _tmp81_);
 
4548
                                        _g_object_unref0 (_tmp81_);
 
4549
                                        _g_free0 (_tmp79_);
 
4550
                                        _g_free0 (_tmp76_);
4376
4551
                                } else {
4377
 
                                        const gchar* _tmp78_;
4378
 
                                        _tmp78_ = uri;
4379
 
                                        g_warning ("daemon.vala:979: No such uri '%s'\n", _tmp78_);
 
4552
                                        const gchar* _tmp82_;
 
4553
                                        _tmp82_ = uri;
 
4554
                                        g_warning ("daemon.vala:1027: No such uri '%s'\n", _tmp82_);
4380
4555
                                }
4381
4556
                        } else {
4382
 
                                GFileInfo* _tmp79_;
4383
 
                                gint64 _tmp80_ = 0LL;
4384
 
                                UnityGenericPreview* _tmp81_;
4385
 
                                const gchar* _tmp82_ = NULL;
4386
 
                                gint64 _tmp83_;
4387
 
                                gchar* _tmp84_ = NULL;
4388
 
                                gchar* _tmp85_;
4389
 
                                UnityInfoHint* _tmp86_;
4390
 
                                UnityInfoHint* _tmp87_;
4391
 
                                const gchar* _tmp88_ = NULL;
4392
 
                                UnityPreviewAction* _tmp89_;
 
4557
                                GFileInfo* _tmp83_;
 
4558
                                gint64 _tmp84_ = 0LL;
 
4559
                                UnityGenericPreview* _tmp85_;
 
4560
                                const gchar* _tmp86_ = NULL;
 
4561
                                guint64 _tmp87_;
 
4562
                                gchar* _tmp88_ = NULL;
 
4563
                                gchar* _tmp89_;
 
4564
                                UnityInfoHint* _tmp90_;
 
4565
                                UnityInfoHint* _tmp91_;
 
4566
                                const gchar* _tmp92_ = NULL;
 
4567
                                UnityPreviewAction* _tmp93_;
4393
4568
                                UnityPreviewAction* open_folder_action;
4394
 
                                UnityPreviewAction* _tmp90_;
4395
 
                                UnityGenericPreview* _tmp91_;
4396
 
                                UnityPreviewAction* _tmp92_;
4397
 
                                GAppInfo* _tmp93_;
4398
 
                                _tmp79_ = finfo;
4399
 
                                _tmp80_ = g_file_info_get_size (_tmp79_);
4400
 
                                total_size = _tmp80_;
4401
 
                                _tmp81_ = preview;
4402
 
                                _tmp82_ = _ ("Size");
4403
 
                                _tmp83_ = total_size;
4404
 
                                _tmp84_ = g_format_size_full ((guint64) _tmp83_, G_FORMAT_SIZE_DEFAULT);
4405
 
                                _tmp85_ = _tmp84_;
4406
 
                                _tmp86_ = unity_info_hint_new ("size", _tmp82_, NULL, _tmp85_);
4407
 
                                _tmp87_ = g_object_ref_sink (_tmp86_);
4408
 
                                unity_preview_add_info ((UnityPreview*) _tmp81_, _tmp87_);
4409
 
                                _g_object_unref0 (_tmp87_);
4410
 
                                _g_free0 (_tmp85_);
4411
 
                                _tmp88_ = _ ("Show in Folder");
4412
 
                                _tmp89_ = unity_preview_action_new ("open-dir", _tmp88_, NULL);
4413
 
                                open_folder_action = _tmp89_;
4414
 
                                _tmp90_ = open_folder_action;
4415
 
                                g_signal_connect_object (_tmp90_, "activated", (GCallback) _unity_files_lens_daemon_on_preview_open_folder_unity_preview_action_activated, self, 0);
4416
 
                                _tmp91_ = preview;
4417
 
                                _tmp92_ = open_folder_action;
4418
 
                                unity_preview_add_action ((UnityPreview*) _tmp91_, _tmp92_);
4419
 
                                _tmp93_ = email_app_info;
4420
 
                                if (_tmp93_ != NULL) {
4421
 
                                        const gchar* _tmp94_ = NULL;
4422
 
                                        UnityPreviewAction* _tmp95_;
 
4569
                                UnityPreviewAction* _tmp94_;
 
4570
                                UnityGenericPreview* _tmp95_;
 
4571
                                UnityPreviewAction* _tmp96_;
 
4572
                                GAppInfo* _tmp97_;
 
4573
                                _tmp83_ = finfo;
 
4574
                                _tmp84_ = g_file_info_get_size (_tmp83_);
 
4575
                                total_size = (guint64) _tmp84_;
 
4576
                                _tmp85_ = preview;
 
4577
                                _tmp86_ = _ ("Size");
 
4578
                                _tmp87_ = total_size;
 
4579
                                _tmp88_ = g_format_size_full (_tmp87_, G_FORMAT_SIZE_DEFAULT);
 
4580
                                _tmp89_ = _tmp88_;
 
4581
                                _tmp90_ = unity_info_hint_new ("size", _tmp86_, NULL, _tmp89_);
 
4582
                                _tmp91_ = g_object_ref_sink (_tmp90_);
 
4583
                                unity_preview_add_info ((UnityPreview*) _tmp85_, _tmp91_);
 
4584
                                _g_object_unref0 (_tmp91_);
 
4585
                                _g_free0 (_tmp89_);
 
4586
                                _tmp92_ = _ ("Show in Folder");
 
4587
                                _tmp93_ = unity_preview_action_new ("open-dir", _tmp92_, NULL);
 
4588
                                open_folder_action = _tmp93_;
 
4589
                                _tmp94_ = open_folder_action;
 
4590
                                g_signal_connect_object (_tmp94_, "activated", (GCallback) _unity_files_lens_daemon_on_preview_open_folder_unity_preview_action_activated, self, 0);
 
4591
                                _tmp95_ = preview;
 
4592
                                _tmp96_ = open_folder_action;
 
4593
                                unity_preview_add_action ((UnityPreview*) _tmp95_, _tmp96_);
 
4594
                                _tmp97_ = email_app_info;
 
4595
                                if (_tmp97_ != NULL) {
 
4596
                                        const gchar* _tmp98_ = NULL;
 
4597
                                        UnityPreviewAction* _tmp99_;
4423
4598
                                        UnityPreviewAction* email_action;
4424
 
                                        UnityPreviewAction* _tmp96_;
4425
 
                                        UnityGenericPreview* _tmp97_;
4426
 
                                        UnityPreviewAction* _tmp98_;
4427
 
                                        _tmp94_ = _ ("Email");
4428
 
                                        _tmp95_ = unity_preview_action_new ("email", _tmp94_, NULL);
4429
 
                                        email_action = _tmp95_;
4430
 
                                        _tmp96_ = email_action;
4431
 
                                        g_signal_connect_object (_tmp96_, "activated", (GCallback) _unity_files_lens_daemon_on_email_file_unity_preview_action_activated, self, 0);
4432
 
                                        _tmp97_ = preview;
4433
 
                                        _tmp98_ = email_action;
4434
 
                                        unity_preview_add_action ((UnityPreview*) _tmp97_, _tmp98_);
 
4599
                                        UnityPreviewAction* _tmp100_;
 
4600
                                        UnityGenericPreview* _tmp101_;
 
4601
                                        UnityPreviewAction* _tmp102_;
 
4602
                                        _tmp98_ = _ ("Email");
 
4603
                                        _tmp99_ = unity_preview_action_new ("email", _tmp98_, NULL);
 
4604
                                        email_action = _tmp99_;
 
4605
                                        _tmp100_ = email_action;
 
4606
                                        g_signal_connect_object (_tmp100_, "activated", (GCallback) _unity_files_lens_daemon_on_email_file_unity_preview_action_activated, self, 0);
 
4607
                                        _tmp101_ = preview;
 
4608
                                        _tmp102_ = email_action;
 
4609
                                        unity_preview_add_action ((UnityPreview*) _tmp101_, _tmp102_);
4435
4610
                                        _g_object_unref0 (email_action);
4436
4611
                                }
4437
4612
                                _g_object_unref0 (open_folder_action);
4441
4616
                        _g_object_unref0 (email_app_info);
4442
4617
                        _g_date_time_unref0 (date_time);
4443
4618
                } else {
4444
 
                        const gchar* _tmp99_;
4445
 
                        _tmp99_ = real_uri;
4446
 
                        g_warning ("daemon.vala:1001: Couldn't stat file: '%s'", _tmp99_);
 
4619
                        const gchar* _tmp103_;
 
4620
                        _tmp103_ = real_uri;
 
4621
                        g_warning ("daemon.vala:1049: Couldn't stat file: '%s'", _tmp103_);
4447
4622
                }
4448
4623
                _g_object_unref0 (finfo);
4449
4624
        } else {
4450
 
                const gchar* _tmp100_;
4451
 
                _tmp100_ = real_uri;
4452
 
                g_warning ("daemon.vala:1006: Couldn't access file: '%s'", _tmp100_);
 
4625
                const gchar* _tmp104_;
 
4626
                _tmp104_ = real_uri;
 
4627
                g_warning ("daemon.vala:1054: Couldn't access file: '%s'", _tmp104_);
4453
4628
        }
4454
4629
        result = (UnityPreview*) preview;
4455
4630
        _g_object_unref0 (file);
4458
4633
}
4459
4634
 
4460
4635
 
 
4636
static UnityGenericPreview* unity_files_lens_daemon_create_device_preview (UnityFilesLensDaemon* self, const gchar* uri) {
 
4637
        UnityGenericPreview* result = NULL;
 
4638
        UnityFilesLensDevices* _tmp0_;
 
4639
        const gchar* _tmp1_;
 
4640
        UnityFilesLensDevice* _tmp2_ = NULL;
 
4641
        UnityFilesLensDevice* device;
 
4642
        UnityFilesLensDevice* _tmp3_;
 
4643
        UnityFilesLensDevice* _tmp4_;
 
4644
        const gchar* _tmp5_;
 
4645
        const gchar* _tmp6_;
 
4646
        UnityFilesLensDevice* _tmp7_;
 
4647
        GIcon* _tmp8_;
 
4648
        GIcon* _tmp9_;
 
4649
        UnityGenericPreview* _tmp10_;
 
4650
        UnityGenericPreview* preview;
 
4651
        gint contents_count;
 
4652
        guint64 contents_size;
 
4653
        gchar* _tmp11_;
 
4654
        gchar* filesystem_type;
 
4655
        guint64 total_capacity;
 
4656
        guint64 free_capacity;
 
4657
        UnityGenericPreview* _tmp29_;
 
4658
        const gchar* _tmp30_ = NULL;
 
4659
        guint64 _tmp31_;
 
4660
        gchar* _tmp32_ = NULL;
 
4661
        gchar* _tmp33_;
 
4662
        gchar* _tmp34_ = NULL;
 
4663
        gchar* _tmp35_;
 
4664
        UnityGenericPreview* _tmp36_;
 
4665
        const gchar* _tmp37_ = NULL;
 
4666
        const gchar* _tmp38_;
 
4667
        UnityInfoHint* _tmp39_;
 
4668
        UnityInfoHint* _tmp40_;
 
4669
        UnityGenericPreview* _tmp41_;
 
4670
        const gchar* _tmp42_ = NULL;
 
4671
        const gchar* _tmp43_ = NULL;
 
4672
        guint64 _tmp44_;
 
4673
        gchar* _tmp45_ = NULL;
 
4674
        gchar* _tmp46_;
 
4675
        gint _tmp47_;
 
4676
        gchar* _tmp48_ = NULL;
 
4677
        gchar* _tmp49_;
 
4678
        UnityInfoHint* _tmp50_;
 
4679
        UnityInfoHint* _tmp51_;
 
4680
        const gchar* _tmp52_ = NULL;
 
4681
        UnityPreviewAction* _tmp53_;
 
4682
        UnityPreviewAction* open_action;
 
4683
        UnityPreviewAction* _tmp54_;
 
4684
        UnityGenericPreview* _tmp55_;
 
4685
        UnityPreviewAction* _tmp56_;
 
4686
        GError * _inner_error_ = NULL;
 
4687
        g_return_val_if_fail (self != NULL, NULL);
 
4688
        g_return_val_if_fail (uri != NULL, NULL);
 
4689
        _tmp0_ = self->priv->devices;
 
4690
        _tmp1_ = uri;
 
4691
        _tmp2_ = unity_files_lens_devices_get_device_from_uri (_tmp0_, _tmp1_);
 
4692
        device = _tmp2_;
 
4693
        _tmp3_ = device;
 
4694
        if (_tmp3_ == NULL) {
 
4695
                result = NULL;
 
4696
                _g_object_unref0 (device);
 
4697
                return result;
 
4698
        }
 
4699
        _tmp4_ = device;
 
4700
        _tmp5_ = unity_files_lens_device_get_display_name (_tmp4_);
 
4701
        _tmp6_ = _tmp5_;
 
4702
        _tmp7_ = device;
 
4703
        _tmp8_ = unity_files_lens_device_get_icon (_tmp7_);
 
4704
        _tmp9_ = _tmp8_;
 
4705
        _tmp10_ = unity_generic_preview_new (_tmp6_, "", _tmp9_);
 
4706
        preview = _tmp10_;
 
4707
        contents_count = 0;
 
4708
        contents_size = (guint64) 0;
 
4709
        _tmp11_ = g_strdup ("");
 
4710
        filesystem_type = _tmp11_;
 
4711
        total_capacity = (guint64) 0;
 
4712
        free_capacity = (guint64) 0;
 
4713
        {
 
4714
                UnityFilesLensDevice* _tmp12_;
 
4715
                GFile* _tmp13_ = NULL;
 
4716
                GFile* file;
 
4717
                GFile* _tmp14_;
 
4718
                GFileInfo* _tmp15_ = NULL;
 
4719
                GFileInfo* file_info;
 
4720
                GFile* _tmp16_;
 
4721
                gchar* _tmp17_ = NULL;
 
4722
                gchar* _tmp18_;
 
4723
                GFileInfo* _tmp19_;
 
4724
                gchar* _tmp20_ = NULL;
 
4725
                GFileInfo* _tmp21_;
 
4726
                guint64 _tmp22_ = 0ULL;
 
4727
                GFileInfo* _tmp23_;
 
4728
                guint64 _tmp24_ = 0ULL;
 
4729
                guint64 _tmp25_;
 
4730
                guint64 _tmp26_;
 
4731
                _tmp12_ = device;
 
4732
                _tmp13_ = unity_files_lens_device_get_root_file (_tmp12_);
 
4733
                file = _tmp13_;
 
4734
                _tmp14_ = file;
 
4735
                _tmp15_ = g_file_query_filesystem_info (_tmp14_, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE "," G_FILE_ATTRIBUTE_FILESYSTEM_TYPE "," G_FILE_ATTRIBUTE_FILESYSTEM_FREE, NULL, &_inner_error_);
 
4736
                file_info = _tmp15_;
 
4737
                if (_inner_error_ != NULL) {
 
4738
                        _g_object_unref0 (file);
 
4739
                        goto __catch5_g_error;
 
4740
                }
 
4741
                _tmp16_ = file;
 
4742
                _tmp17_ = g_file_get_path (_tmp16_);
 
4743
                _tmp18_ = _tmp17_;
 
4744
                unity_files_lens_daemon_count_directory_items (self, _tmp18_, &contents_count, &contents_size, FALSE, &_inner_error_);
 
4745
                _g_free0 (_tmp18_);
 
4746
                if (_inner_error_ != NULL) {
 
4747
                        _g_object_unref0 (file_info);
 
4748
                        _g_object_unref0 (file);
 
4749
                        goto __catch5_g_error;
 
4750
                }
 
4751
                _tmp19_ = file_info;
 
4752
                _tmp20_ = g_file_info_get_attribute_as_string (_tmp19_, G_FILE_ATTRIBUTE_FILESYSTEM_TYPE);
 
4753
                _g_free0 (filesystem_type);
 
4754
                filesystem_type = _tmp20_;
 
4755
                _tmp21_ = file_info;
 
4756
                _tmp22_ = g_file_info_get_attribute_uint64 (_tmp21_, G_FILE_ATTRIBUTE_FILESYSTEM_SIZE);
 
4757
                total_capacity = _tmp22_;
 
4758
                _tmp23_ = file_info;
 
4759
                _tmp24_ = g_file_info_get_attribute_uint64 (_tmp23_, G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
 
4760
                free_capacity = _tmp24_;
 
4761
                _tmp25_ = total_capacity;
 
4762
                _tmp26_ = free_capacity;
 
4763
                contents_size = _tmp25_ - _tmp26_;
 
4764
                _g_object_unref0 (file_info);
 
4765
                _g_object_unref0 (file);
 
4766
        }
 
4767
        goto __finally5;
 
4768
        __catch5_g_error:
 
4769
        {
 
4770
                GError* e = NULL;
 
4771
                GError* _tmp27_;
 
4772
                const gchar* _tmp28_;
 
4773
                e = _inner_error_;
 
4774
                _inner_error_ = NULL;
 
4775
                _tmp27_ = e;
 
4776
                _tmp28_ = _tmp27_->message;
 
4777
                g_warning ("daemon.vala:1090: Failed to query filesystem info: %s", _tmp28_);
 
4778
                _g_error_free0 (e);
 
4779
        }
 
4780
        __finally5:
 
4781
        if (_inner_error_ != NULL) {
 
4782
                _g_free0 (filesystem_type);
 
4783
                _g_object_unref0 (preview);
 
4784
                _g_object_unref0 (device);
 
4785
                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);
 
4786
                g_clear_error (&_inner_error_);
 
4787
                return NULL;
 
4788
        }
 
4789
        _tmp29_ = preview;
 
4790
        _tmp30_ = _ ("Total capacity %s");
 
4791
        _tmp31_ = total_capacity;
 
4792
        _tmp32_ = g_format_size_full (_tmp31_, G_FORMAT_SIZE_DEFAULT);
 
4793
        _tmp33_ = _tmp32_;
 
4794
        _tmp34_ = g_strdup_printf (_tmp30_, _tmp33_);
 
4795
        _tmp35_ = _tmp34_;
 
4796
        unity_preview_set_subtitle ((UnityPreview*) _tmp29_, _tmp35_);
 
4797
        _g_free0 (_tmp35_);
 
4798
        _g_free0 (_tmp33_);
 
4799
        _tmp36_ = preview;
 
4800
        _tmp37_ = _ ("Filesystem type");
 
4801
        _tmp38_ = filesystem_type;
 
4802
        _tmp39_ = unity_info_hint_new ("filesytem_type", _tmp37_, NULL, _tmp38_);
 
4803
        _tmp40_ = g_object_ref_sink (_tmp39_);
 
4804
        unity_preview_add_info ((UnityPreview*) _tmp36_, _tmp40_);
 
4805
        _g_object_unref0 (_tmp40_);
 
4806
        _tmp41_ = preview;
 
4807
        _tmp42_ = _ ("Contents");
 
4808
        _tmp43_ = _ ("%s, %u items");
 
4809
        _tmp44_ = contents_size;
 
4810
        _tmp45_ = g_format_size_full (_tmp44_, G_FORMAT_SIZE_DEFAULT);
 
4811
        _tmp46_ = _tmp45_;
 
4812
        _tmp47_ = contents_count;
 
4813
        _tmp48_ = g_strdup_printf (_tmp43_, _tmp46_, _tmp47_);
 
4814
        _tmp49_ = _tmp48_;
 
4815
        _tmp50_ = unity_info_hint_new ("contents", _tmp42_, NULL, _tmp49_);
 
4816
        _tmp51_ = g_object_ref_sink (_tmp50_);
 
4817
        unity_preview_add_info ((UnityPreview*) _tmp41_, _tmp51_);
 
4818
        _g_object_unref0 (_tmp51_);
 
4819
        _g_free0 (_tmp49_);
 
4820
        _g_free0 (_tmp46_);
 
4821
        _tmp52_ = _ ("Open");
 
4822
        _tmp53_ = unity_preview_action_new ("open", _tmp52_, NULL);
 
4823
        open_action = _tmp53_;
 
4824
        _tmp54_ = open_action;
 
4825
        g_signal_connect_object (_tmp54_, "activated", (GCallback) _unity_files_lens_daemon_on_preview_open_unity_preview_action_activated, self, 0);
 
4826
        _tmp55_ = preview;
 
4827
        _tmp56_ = open_action;
 
4828
        unity_preview_add_action ((UnityPreview*) _tmp55_, _tmp56_);
 
4829
        result = preview;
 
4830
        _g_object_unref0 (open_action);
 
4831
        _g_free0 (filesystem_type);
 
4832
        _g_object_unref0 (device);
 
4833
        return result;
 
4834
}
 
4835
 
 
4836
 
4461
4837
static const gchar* string_to_string (const gchar* self) {
4462
4838
        const gchar* result = NULL;
4463
4839
        g_return_val_if_fail (self != NULL, NULL);
4484
4860
        _tmp1_ = string_to_string (_tmp0_);
4485
4861
        _tmp2_ = g_strconcat ("Emailing file: ", _tmp1_, NULL);
4486
4862
        _tmp3_ = _tmp2_;
4487
 
        g_debug ("daemon.vala:1014: %s", _tmp3_);
 
4863
        g_debug ("daemon.vala:1106: %s", _tmp3_);
4488
4864
        _g_free0 (_tmp3_);
4489
4865
        _tmp4_ = g_app_info_get_default_for_uri_scheme ("mailto");
4490
4866
        email_app_info = _tmp4_;
4505
4881
                        g_app_info_launch (_tmp8_, _tmp9_, NULL, &_inner_error_);
4506
4882
                        if (_inner_error_ != NULL) {
4507
4883
                                __g_list_free__g_object_unref0_0 (files);
4508
 
                                goto __catch5_g_error;
 
4884
                                goto __catch6_g_error;
4509
4885
                        }
4510
4886
                        __g_list_free__g_object_unref0_0 (files);
4511
4887
                }
4512
 
                goto __finally5;
4513
 
                __catch5_g_error:
 
4888
                goto __finally6;
 
4889
                __catch6_g_error:
4514
4890
                {
4515
4891
                        GError* e = NULL;
4516
4892
                        GAppInfo* _tmp10_;
4523
4899
                        _tmp11_ = g_app_info_get_executable (_tmp10_);
4524
4900
                        _tmp12_ = e;
4525
4901
                        _tmp13_ = _tmp12_->message;
4526
 
                        g_warning ("daemon.vala:1025: Couldn't launch email application '%s': '%s'", _tmp11_, _tmp13_);
 
4902
                        g_warning ("daemon.vala:1117: Couldn't launch email application '%s': '%s'", _tmp11_, _tmp13_);
4527
4903
                        _g_error_free0 (e);
4528
4904
                }
4529
 
                __finally5:
 
4905
                __finally6:
4530
4906
                if (_inner_error_ != NULL) {
4531
4907
                        _g_object_unref0 (email_app_info);
4532
4908
                        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);
4544
4920
 
4545
4921
UnityActivationResponse* unity_files_lens_daemon_on_preview_open (UnityFilesLensDaemon* self, const gchar* uri) {
4546
4922
        UnityActivationResponse* result = NULL;
4547
 
        UnityActivationResponse* _tmp14_;
4548
 
        UnityActivationResponse* _tmp15_;
 
4923
        UnityActivationResponse* _tmp20_;
 
4924
        UnityActivationResponse* _tmp21_;
4549
4925
        GError * _inner_error_ = NULL;
4550
4926
        g_return_val_if_fail (self != NULL, NULL);
4551
4927
        g_return_val_if_fail (uri != NULL, NULL);
4552
4928
        {
4553
4929
                gboolean _tmp0_ = FALSE;
4554
 
                UnityFilesLensBookmarks* _tmp1_;
4555
 
                const gchar* _tmp2_;
4556
 
                gboolean _tmp3_ = FALSE;
4557
 
                gboolean _tmp4_;
4558
 
                gboolean _tmp8_;
4559
 
                _tmp1_ = self->priv->bookmarks;
4560
 
                _tmp2_ = uri;
4561
 
                _tmp3_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp1_, _tmp2_, &_inner_error_);
4562
 
                _tmp4_ = _tmp3_;
 
4930
                gboolean _tmp1_ = FALSE;
 
4931
                UnityFilesLensBookmarks* _tmp2_;
 
4932
                const gchar* _tmp3_;
 
4933
                gboolean _tmp4_ = FALSE;
 
4934
                gboolean _tmp5_;
 
4935
                gboolean _tmp10_;
 
4936
                gboolean _tmp14_;
 
4937
                _tmp2_ = self->priv->bookmarks;
 
4938
                _tmp3_ = uri;
 
4939
                _tmp4_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp2_, _tmp3_, &_inner_error_);
 
4940
                _tmp5_ = _tmp4_;
4563
4941
                if (_inner_error_ != NULL) {
4564
 
                        goto __catch6_g_error;
4565
 
                }
4566
 
                if (_tmp4_) {
 
4942
                        goto __catch7_g_error;
 
4943
                }
 
4944
                if (_tmp5_) {
 
4945
                        _tmp1_ = TRUE;
 
4946
                } else {
 
4947
                        UnityFilesLensDevices* _tmp6_;
 
4948
                        const gchar* _tmp7_;
 
4949
                        gboolean _tmp8_ = FALSE;
 
4950
                        gboolean _tmp9_;
 
4951
                        _tmp6_ = self->priv->devices;
 
4952
                        _tmp7_ = uri;
 
4953
                        _tmp8_ = unity_files_lens_devices_launch_if_device (_tmp6_, _tmp7_, &_inner_error_);
 
4954
                        _tmp9_ = _tmp8_;
 
4955
                        if (_inner_error_ != NULL) {
 
4956
                                goto __catch7_g_error;
 
4957
                        }
 
4958
                        _tmp1_ = _tmp9_;
 
4959
                }
 
4960
                _tmp10_ = _tmp1_;
 
4961
                if (_tmp10_) {
4567
4962
                        _tmp0_ = TRUE;
4568
4963
                } else {
4569
 
                        const gchar* _tmp5_;
4570
 
                        gboolean _tmp6_ = FALSE;
4571
 
                        gboolean _tmp7_;
4572
 
                        _tmp5_ = uri;
4573
 
                        _tmp6_ = g_app_info_launch_default_for_uri (_tmp5_, NULL, &_inner_error_);
4574
 
                        _tmp7_ = _tmp6_;
 
4964
                        const gchar* _tmp11_;
 
4965
                        gboolean _tmp12_ = FALSE;
 
4966
                        gboolean _tmp13_;
 
4967
                        _tmp11_ = uri;
 
4968
                        _tmp12_ = g_app_info_launch_default_for_uri (_tmp11_, NULL, &_inner_error_);
 
4969
                        _tmp13_ = _tmp12_;
4575
4970
                        if (_inner_error_ != NULL) {
4576
 
                                goto __catch6_g_error;
 
4971
                                goto __catch7_g_error;
4577
4972
                        }
4578
 
                        _tmp0_ = _tmp7_;
 
4973
                        _tmp0_ = _tmp13_;
4579
4974
                }
4580
 
                _tmp8_ = _tmp0_;
4581
 
                if (_tmp8_) {
4582
 
                        UnityActivationResponse* _tmp9_;
4583
 
                        UnityActivationResponse* _tmp10_;
4584
 
                        _tmp9_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4585
 
                        _tmp10_ = g_object_ref_sink (_tmp9_);
4586
 
                        result = _tmp10_;
 
4975
                _tmp14_ = _tmp0_;
 
4976
                if (_tmp14_) {
 
4977
                        UnityActivationResponse* _tmp15_;
 
4978
                        UnityActivationResponse* _tmp16_;
 
4979
                        _tmp15_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
 
4980
                        _tmp16_ = g_object_ref_sink (_tmp15_);
 
4981
                        result = _tmp16_;
4587
4982
                        return result;
4588
4983
                }
4589
4984
        }
4590
 
        goto __finally6;
4591
 
        __catch6_g_error:
 
4985
        goto __finally7;
 
4986
        __catch7_g_error:
4592
4987
        {
4593
4988
                GError* e = NULL;
4594
 
                const gchar* _tmp11_;
4595
 
                GError* _tmp12_;
4596
 
                const gchar* _tmp13_;
 
4989
                const gchar* _tmp17_;
 
4990
                GError* _tmp18_;
 
4991
                const gchar* _tmp19_;
4597
4992
                e = _inner_error_;
4598
4993
                _inner_error_ = NULL;
4599
 
                _tmp11_ = uri;
4600
 
                _tmp12_ = e;
4601
 
                _tmp13_ = _tmp12_->message;
4602
 
                g_warning ("daemon.vala:1042: Failed to launch default application for uri '%s': %" \
4603
 
"s", _tmp11_, _tmp13_);
 
4994
                _tmp17_ = uri;
 
4995
                _tmp18_ = e;
 
4996
                _tmp19_ = _tmp18_->message;
 
4997
                g_warning ("daemon.vala:1134: Failed to launch default application for uri '%s': %" \
 
4998
"s", _tmp17_, _tmp19_);
4604
4999
                _g_error_free0 (e);
4605
5000
        }
4606
 
        __finally6:
 
5001
        __finally7:
4607
5002
        if (_inner_error_ != NULL) {
4608
5003
                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);
4609
5004
                g_clear_error (&_inner_error_);
4610
5005
                return NULL;
4611
5006
        }
4612
 
        _tmp14_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4613
 
        _tmp15_ = g_object_ref_sink (_tmp14_);
4614
 
        result = _tmp15_;
 
5007
        _tmp20_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
 
5008
        _tmp21_ = g_object_ref_sink (_tmp20_);
 
5009
        result = _tmp21_;
4615
5010
        return result;
4616
5011
}
4617
5012
 
4637
5032
                _tmp3_ = g_app_info_launch_default_for_uri (_tmp2_, NULL, &_inner_error_);
4638
5033
                _tmp4_ = _tmp3_;
4639
5034
                if (_inner_error_ != NULL) {
4640
 
                        goto __catch7_g_error;
 
5035
                        goto __catch8_g_error;
4641
5036
                }
4642
5037
                if (_tmp4_) {
4643
5038
                        UnityActivationResponse* _tmp5_;
4649
5044
                        return result;
4650
5045
                }
4651
5046
        }
4652
 
        goto __finally7;
4653
 
        __catch7_g_error:
 
5047
        goto __finally8;
 
5048
        __catch8_g_error:
4654
5049
        {
4655
5050
                GError* e = NULL;
4656
5051
                const gchar* _tmp7_;
4661
5056
                _tmp7_ = uri;
4662
5057
                _tmp8_ = e;
4663
5058
                _tmp9_ = _tmp8_->message;
4664
 
                g_warning ("daemon.vala:1059: Failed to launch default application for uri '%s': %" \
 
5059
                g_warning ("daemon.vala:1151: Failed to launch default application for uri '%s': %" \
4665
5060
"s", _tmp7_, _tmp9_);
4666
5061
                _g_error_free0 (e);
4667
5062
        }
4668
 
        __finally7:
 
5063
        __finally8:
4669
5064
        if (_inner_error_ != NULL) {
4670
5065
                _g_free0 (path);
4671
5066
                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);
4692
5087
        const gchar* _tmp1_ = NULL;
4693
5088
        gchar* _tmp2_ = NULL;
4694
5089
        gchar* _tmp3_;
4695
 
        UnityActivationResponse* _tmp26_;
4696
 
        UnityActivationResponse* _tmp27_;
 
5090
        UnityActivationResponse* _tmp32_;
 
5091
        UnityActivationResponse* _tmp33_;
4697
5092
        GError * _inner_error_ = NULL;
4698
5093
        g_return_val_if_fail (self != NULL, NULL);
4699
5094
        g_return_val_if_fail (uri != NULL, NULL);
4701
5096
        _tmp1_ = string_to_string (_tmp0_);
4702
5097
        _tmp2_ = g_strconcat ("Activating: ", _tmp1_, NULL);
4703
5098
        _tmp3_ = _tmp2_;
4704
 
        g_debug ("daemon.vala:1066: %s", _tmp3_);
 
5099
        g_debug ("daemon.vala:1158: %s", _tmp3_);
4705
5100
        _g_free0 (_tmp3_);
4706
5101
        {
4707
 
                UnityFilesLensBookmarks* _tmp4_;
4708
 
                const gchar* _tmp5_;
4709
 
                gboolean _tmp6_ = FALSE;
4710
 
                gboolean _tmp7_;
 
5102
                gboolean _tmp4_ = FALSE;
 
5103
                UnityFilesLensBookmarks* _tmp5_;
 
5104
                const gchar* _tmp6_;
 
5105
                gboolean _tmp7_ = FALSE;
 
5106
                gboolean _tmp8_;
 
5107
                gboolean _tmp13_;
4711
5108
                UnityFilesLensUrlType url_type;
4712
 
                UnityFilesLensUrlChecker* _tmp10_;
4713
 
                const gchar* _tmp11_;
4714
 
                UnityFilesLensUrlType _tmp12_ = 0;
4715
 
                gchar* _tmp13_ = NULL;
 
5109
                UnityFilesLensUrlChecker* _tmp16_;
 
5110
                const gchar* _tmp17_;
 
5111
                UnityFilesLensUrlType _tmp18_ = 0;
 
5112
                gchar* _tmp19_ = NULL;
4716
5113
                gchar* checked_url;
4717
 
                gboolean _tmp14_ = FALSE;
4718
 
                const gchar* _tmp15_;
4719
 
                gboolean _tmp17_;
4720
 
                _tmp4_ = self->priv->bookmarks;
4721
 
                _tmp5_ = uri;
4722
 
                _tmp6_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp4_, _tmp5_, &_inner_error_);
4723
 
                _tmp7_ = _tmp6_;
 
5114
                gboolean _tmp20_ = FALSE;
 
5115
                const gchar* _tmp21_;
 
5116
                gboolean _tmp23_;
 
5117
                _tmp5_ = self->priv->bookmarks;
 
5118
                _tmp6_ = uri;
 
5119
                _tmp7_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp5_, _tmp6_, &_inner_error_);
 
5120
                _tmp8_ = _tmp7_;
4724
5121
                if (_inner_error_ != NULL) {
4725
 
                        goto __catch8_g_error;
4726
 
                }
4727
 
                if (_tmp7_) {
4728
 
                        UnityActivationResponse* _tmp8_;
4729
 
                        UnityActivationResponse* _tmp9_;
4730
 
                        _tmp8_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4731
 
                        _tmp9_ = g_object_ref_sink (_tmp8_);
4732
 
                        result = _tmp9_;
 
5122
                        goto __catch9_g_error;
 
5123
                }
 
5124
                if (_tmp8_) {
 
5125
                        _tmp4_ = TRUE;
 
5126
                } else {
 
5127
                        UnityFilesLensDevices* _tmp9_;
 
5128
                        const gchar* _tmp10_;
 
5129
                        gboolean _tmp11_ = FALSE;
 
5130
                        gboolean _tmp12_;
 
5131
                        _tmp9_ = self->priv->devices;
 
5132
                        _tmp10_ = uri;
 
5133
                        _tmp11_ = unity_files_lens_devices_launch_if_device (_tmp9_, _tmp10_, &_inner_error_);
 
5134
                        _tmp12_ = _tmp11_;
 
5135
                        if (_inner_error_ != NULL) {
 
5136
                                goto __catch9_g_error;
 
5137
                        }
 
5138
                        _tmp4_ = _tmp12_;
 
5139
                }
 
5140
                _tmp13_ = _tmp4_;
 
5141
                if (_tmp13_) {
 
5142
                        UnityActivationResponse* _tmp14_;
 
5143
                        UnityActivationResponse* _tmp15_;
 
5144
                        _tmp14_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
 
5145
                        _tmp15_ = g_object_ref_sink (_tmp14_);
 
5146
                        result = _tmp15_;
4733
5147
                        return result;
4734
5148
                }
4735
5149
                url_type = UNITY_FILES_LENS_URL_TYPE_UNKNOWN;
4736
 
                _tmp10_ = self->priv->urls;
4737
 
                _tmp11_ = uri;
4738
 
                _tmp13_ = unity_files_lens_url_checker_check_url (_tmp10_, _tmp11_, &_tmp12_);
4739
 
                url_type = _tmp12_;
4740
 
                checked_url = _tmp13_;
4741
 
                _tmp15_ = checked_url;
4742
 
                if (_tmp15_ != NULL) {
4743
 
                        UnityFilesLensUrlType _tmp16_;
4744
 
                        _tmp16_ = url_type;
4745
 
                        _tmp14_ = _tmp16_ == UNITY_FILES_LENS_URL_TYPE_MOUNTABLE;
 
5150
                _tmp16_ = self->priv->urls;
 
5151
                _tmp17_ = uri;
 
5152
                _tmp19_ = unity_files_lens_url_checker_check_url (_tmp16_, _tmp17_, &_tmp18_);
 
5153
                url_type = _tmp18_;
 
5154
                checked_url = _tmp19_;
 
5155
                _tmp21_ = checked_url;
 
5156
                if (_tmp21_ != NULL) {
 
5157
                        UnityFilesLensUrlType _tmp22_;
 
5158
                        _tmp22_ = url_type;
 
5159
                        _tmp20_ = _tmp22_ == UNITY_FILES_LENS_URL_TYPE_MOUNTABLE;
4746
5160
                } else {
4747
 
                        _tmp14_ = FALSE;
 
5161
                        _tmp20_ = FALSE;
4748
5162
                }
4749
 
                _tmp17_ = _tmp14_;
4750
 
                if (_tmp17_) {
 
5163
                _tmp23_ = _tmp20_;
 
5164
                if (_tmp23_) {
4751
5165
                        GList* muris;
4752
 
                        const gchar* _tmp18_;
4753
 
                        gchar* _tmp19_;
4754
 
                        GAppInfo* _tmp20_ = NULL;
 
5166
                        const gchar* _tmp24_;
 
5167
                        gchar* _tmp25_;
 
5168
                        GAppInfo* _tmp26_ = NULL;
4755
5169
                        GAppInfo* file_manager;
4756
 
                        GAppInfo* _tmp21_;
4757
 
                        GList* _tmp22_;
4758
 
                        UnityActivationResponse* _tmp23_;
4759
 
                        UnityActivationResponse* _tmp24_;
 
5170
                        GAppInfo* _tmp27_;
 
5171
                        GList* _tmp28_;
 
5172
                        UnityActivationResponse* _tmp29_;
 
5173
                        UnityActivationResponse* _tmp30_;
4760
5174
                        muris = NULL;
4761
 
                        _tmp18_ = uri;
4762
 
                        _tmp19_ = g_strdup (_tmp18_);
4763
 
                        muris = g_list_prepend (muris, _tmp19_);
4764
 
                        _tmp20_ = g_app_info_get_default_for_type ("inode/directory", TRUE);
4765
 
                        file_manager = _tmp20_;
4766
 
                        _tmp21_ = file_manager;
4767
 
                        _tmp22_ = muris;
4768
 
                        g_app_info_launch_uris (_tmp21_, _tmp22_, NULL, &_inner_error_);
 
5175
                        _tmp24_ = uri;
 
5176
                        _tmp25_ = g_strdup (_tmp24_);
 
5177
                        muris = g_list_prepend (muris, _tmp25_);
 
5178
                        _tmp26_ = g_app_info_get_default_for_type ("inode/directory", TRUE);
 
5179
                        file_manager = _tmp26_;
 
5180
                        _tmp27_ = file_manager;
 
5181
                        _tmp28_ = muris;
 
5182
                        g_app_info_launch_uris (_tmp27_, _tmp28_, NULL, &_inner_error_);
4769
5183
                        if (_inner_error_ != NULL) {
4770
5184
                                _g_object_unref0 (file_manager);
4771
5185
                                __g_list_free__g_free0_0 (muris);
4772
5186
                                _g_free0 (checked_url);
4773
 
                                goto __catch8_g_error;
 
5187
                                goto __catch9_g_error;
4774
5188
                        }
4775
 
                        _tmp23_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4776
 
                        _tmp24_ = g_object_ref_sink (_tmp23_);
4777
 
                        result = _tmp24_;
 
5189
                        _tmp29_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
 
5190
                        _tmp30_ = g_object_ref_sink (_tmp29_);
 
5191
                        result = _tmp30_;
4778
5192
                        _g_object_unref0 (file_manager);
4779
5193
                        __g_list_free__g_free0_0 (muris);
4780
5194
                        _g_free0 (checked_url);
4782
5196
                }
4783
5197
                _g_free0 (checked_url);
4784
5198
        }
4785
 
        goto __finally8;
4786
 
        __catch8_g_error:
 
5199
        goto __finally9;
 
5200
        __catch9_g_error:
4787
5201
        {
4788
5202
                GError* _error_ = NULL;
4789
 
                const gchar* _tmp25_;
 
5203
                const gchar* _tmp31_;
4790
5204
                _error_ = _inner_error_;
4791
5205
                _inner_error_ = NULL;
4792
 
                _tmp25_ = uri;
4793
 
                g_warning ("daemon.vala:1083: Failed to launch URI %s", _tmp25_);
 
5206
                _tmp31_ = uri;
 
5207
                g_warning ("daemon.vala:1175: Failed to launch URI %s", _tmp31_);
4794
5208
                _g_error_free0 (_error_);
4795
5209
        }
4796
 
        __finally8:
 
5210
        __finally9:
4797
5211
        if (_inner_error_ != NULL) {
4798
5212
                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);
4799
5213
                g_clear_error (&_inner_error_);
4800
5214
                return NULL;
4801
5215
        }
4802
 
        _tmp26_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4803
 
        _tmp27_ = g_object_ref_sink (_tmp26_);
4804
 
        result = _tmp27_;
 
5216
        _tmp32_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
 
5217
        _tmp33_ = g_object_ref_sink (_tmp32_);
 
5218
        result = _tmp33_;
4805
5219
        return result;
4806
5220
}
4807
5221
 
4883
5297
}
4884
5298
 
4885
5299
 
4886
 
static void _unity_files_lens_daemon___lambda5_ (UnityFilesLensDaemon* self) {
4887
 
        UnityScope* _tmp0_;
4888
 
        _tmp0_ = self->priv->scope;
4889
 
        unity_scope_queue_search_changed (_tmp0_, UNITY_SEARCH_TYPE_DEFAULT);
4890
 
}
4891
 
 
4892
 
 
4893
 
static void __unity_files_lens_daemon___lambda5__unity_scope_filters_changed (UnityScope* _sender, gpointer self) {
4894
 
        _unity_files_lens_daemon___lambda5_ (self);
4895
 
}
4896
 
 
4897
 
 
4898
 
static gchar* _unity_files_lens_daemon___lambda6_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search) {
 
5300
static void _unity_files_lens_daemon___lambda9_ (UnityFilesLensDaemon* self) {
 
5301
        UnityScope* _tmp0_;
 
5302
        UnityScope* _tmp1_;
 
5303
        _tmp0_ = self->priv->scope;
 
5304
        unity_scope_queue_search_changed (_tmp0_, UNITY_SEARCH_TYPE_DEFAULT);
 
5305
        _tmp1_ = self->priv->scope;
 
5306
        unity_scope_queue_search_changed (_tmp1_, UNITY_SEARCH_TYPE_GLOBAL);
 
5307
}
 
5308
 
 
5309
 
 
5310
static void __unity_files_lens_daemon___lambda9__unity_files_lens_devices_changed (UnityFilesLensDevices* _sender, gpointer self) {
 
5311
        _unity_files_lens_daemon___lambda9_ (self);
 
5312
}
 
5313
 
 
5314
 
 
5315
static void _unity_files_lens_daemon___lambda10_ (UnityFilesLensDaemon* self) {
 
5316
        UnityScope* _tmp0_;
 
5317
        _tmp0_ = self->priv->scope;
 
5318
        unity_scope_queue_search_changed (_tmp0_, UNITY_SEARCH_TYPE_DEFAULT);
 
5319
}
 
5320
 
 
5321
 
 
5322
static void __unity_files_lens_daemon___lambda10__unity_scope_filters_changed (UnityScope* _sender, gpointer self) {
 
5323
        _unity_files_lens_daemon___lambda10_ (self);
 
5324
}
 
5325
 
 
5326
 
 
5327
static gchar* _unity_files_lens_daemon___lambda11_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search) {
4899
5328
        gchar* result = NULL;
4900
5329
        UnityLensSearch* _tmp0_;
4901
5330
        const gchar* _tmp1_;
4911
5340
}
4912
5341
 
4913
5342
 
4914
 
static gchar* __unity_files_lens_daemon___lambda6__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self) {
 
5343
static gchar* __unity_files_lens_daemon___lambda11__unity_scope_generate_search_key (UnityScope* _sender, UnityLensSearch* search, gpointer self) {
4915
5344
        gchar* result;
4916
 
        result = _unity_files_lens_daemon___lambda6_ (self, search);
 
5345
        result = _unity_files_lens_daemon___lambda11_ (self, search);
4917
5346
        return result;
4918
5347
}
4919
5348
 
4920
5349
 
4921
 
static void _unity_files_lens_daemon___lambda7_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
 
5350
static void _unity_files_lens_daemon___lambda12_ (UnityFilesLensDaemon* self, UnityLensSearch* lens_search, UnitySearchType search_type, GCancellable* cancellable) {
4922
5351
        UnityLensSearch* _tmp0_;
4923
5352
        UnitySearchType _tmp1_;
4924
5353
        GCancellable* _tmp2_;
4931
5360
}
4932
5361
 
4933
5362
 
4934
 
static void __unity_files_lens_daemon___lambda7__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
4935
 
        _unity_files_lens_daemon___lambda7_ (self, search, search_type, cancellable);
 
5363
static void __unity_files_lens_daemon___lambda12__unity_scope_search_changed (UnityScope* _sender, UnityLensSearch* search, UnitySearchType search_type, GCancellable* cancellable, gpointer self) {
 
5364
        _unity_files_lens_daemon___lambda12_ (self, search, search_type, cancellable);
4936
5365
}
4937
5366
 
4938
5367
 
4946
5375
        UnityScope* _tmp5_;
4947
5376
        UnityScope* _tmp6_;
4948
5377
        UnityScope* _tmp7_;
4949
 
        UnityLens* _tmp8_;
 
5378
        UnityScope* _tmp8_;
4950
5379
        UnityLens* _tmp9_;
4951
5380
        UnityLens* _tmp10_;
4952
 
        const gchar* _tmp11_ = NULL;
4953
 
        UnityLens* _tmp12_;
 
5381
        UnityLens* _tmp11_;
 
5382
        const gchar* _tmp12_ = NULL;
4954
5383
        UnityLens* _tmp13_;
4955
 
        UnityScope* _tmp14_;
4956
 
        ZeitgeistLog* _tmp15_;
4957
 
        ZeitgeistIndex* _tmp16_;
4958
 
        GPtrArray* _tmp17_;
 
5384
        UnityLens* _tmp14_;
 
5385
        UnityScope* _tmp15_;
 
5386
        ZeitgeistLog* _tmp16_;
 
5387
        ZeitgeistIndex* _tmp17_;
 
5388
        GPtrArray* _tmp18_;
4959
5389
        GPtrArray* templates;
4960
 
        ZeitgeistEvent* _tmp18_;
4961
5390
        ZeitgeistEvent* _tmp19_;
 
5391
        ZeitgeistEvent* _tmp20_;
4962
5392
        ZeitgeistEvent* event;
4963
 
        ZeitgeistSubject* _tmp20_;
4964
5393
        ZeitgeistSubject* _tmp21_;
 
5394
        ZeitgeistSubject* _tmp22_;
4965
5395
        ZeitgeistSubject* subject;
4966
 
        ZeitgeistSubject* _tmp22_;
4967
 
        ZeitgeistEvent* _tmp23_;
4968
 
        ZeitgeistSubject* _tmp24_;
4969
 
        GPtrArray* _tmp25_;
4970
 
        ZeitgeistEvent* _tmp26_;
4971
 
        GObject* _tmp27_ = NULL;
4972
 
        ZeitgeistTimeRange* _tmp28_;
 
5396
        ZeitgeistSubject* _tmp23_;
 
5397
        ZeitgeistEvent* _tmp24_;
 
5398
        ZeitgeistSubject* _tmp25_;
 
5399
        GPtrArray* _tmp26_;
 
5400
        ZeitgeistEvent* _tmp27_;
 
5401
        GObject* _tmp28_ = NULL;
4973
5402
        ZeitgeistTimeRange* _tmp29_;
4974
 
        GPtrArray* _tmp30_;
4975
 
        ZeitgeistMonitor* _tmp31_;
 
5403
        ZeitgeistTimeRange* _tmp30_;
 
5404
        GPtrArray* _tmp31_;
4976
5405
        ZeitgeistMonitor* _tmp32_;
4977
5406
        ZeitgeistMonitor* _tmp33_;
4978
 
        ZeitgeistLog* _tmp34_;
4979
 
        ZeitgeistMonitor* _tmp35_;
4980
 
        UnityFilesLensBookmarks* _tmp36_;
4981
 
        UnityFilesLensUrlChecker* _tmp37_;
4982
 
        UnityScope* _tmp38_;
4983
 
        UnityScope* _tmp39_;
4984
 
        UnityScope* _tmp40_;
4985
 
        UnityLens* _tmp41_;
 
5407
        ZeitgeistMonitor* _tmp34_;
 
5408
        ZeitgeistLog* _tmp35_;
 
5409
        ZeitgeistMonitor* _tmp36_;
 
5410
        UnityFilesLensBookmarks* _tmp37_;
 
5411
        UnityFilesLensUrlChecker* _tmp38_;
 
5412
        UnityFilesLensDevices* _tmp39_;
 
5413
        UnityFilesLensDevices* _tmp40_;
 
5414
        UnityScope* _tmp41_;
 
5415
        UnityScope* _tmp42_;
 
5416
        UnityScope* _tmp43_;
 
5417
        UnityLens* _tmp44_;
4986
5418
        GError * _inner_error_ = NULL;
4987
5419
        parent_class = G_OBJECT_CLASS (unity_files_lens_daemon_parent_class);
4988
5420
        obj = parent_class->constructor (type, n_construct_properties, construct_properties);
5004
5436
        _tmp5_ = self->priv->scope;
5005
5437
        unity_scope_set_search_in_global (_tmp5_, TRUE);
5006
5438
        _tmp6_ = self->priv->scope;
5007
 
        g_signal_connect_object (_tmp6_, "activate-uri", (GCallback) _unity_files_lens_daemon_activate_unity_scope_activate_uri, self, 0);
 
5439
        unity_scope_set_provides_personal_content (_tmp6_, TRUE);
5008
5440
        _tmp7_ = self->priv->scope;
5009
 
        g_signal_connect_object (_tmp7_, "preview-uri", (GCallback) _unity_files_lens_daemon_preview_unity_scope_preview_uri, self, 0);
5010
 
        _tmp8_ = unity_lens_new ("/com/canonical/unity/lens/files", "files");
 
5441
        g_signal_connect_object (_tmp7_, "activate-uri", (GCallback) _unity_files_lens_daemon_activate_unity_scope_activate_uri, self, 0);
 
5442
        _tmp8_ = self->priv->scope;
 
5443
        g_signal_connect_object (_tmp8_, "preview-uri", (GCallback) _unity_files_lens_daemon_preview_unity_scope_preview_uri, self, 0);
 
5444
        _tmp9_ = unity_lens_new ("/com/canonical/unity/lens/files", "files");
5011
5445
        _g_object_unref0 (self->priv->lens);
5012
 
        self->priv->lens = _tmp8_;
5013
 
        _tmp9_ = self->priv->lens;
5014
 
        unity_lens_set_search_in_global (_tmp9_, TRUE);
 
5446
        self->priv->lens = _tmp9_;
5015
5447
        _tmp10_ = self->priv->lens;
5016
 
        _tmp11_ = _ ("Search Files & Folders");
5017
 
        unity_lens_set_search_hint (_tmp10_, _tmp11_);
5018
 
        _tmp12_ = self->priv->lens;
5019
 
        unity_lens_set_visible (_tmp12_, TRUE);
 
5448
        unity_lens_set_search_in_global (_tmp10_, TRUE);
 
5449
        _tmp11_ = self->priv->lens;
 
5450
        _tmp12_ = _ ("Search Files & Folders");
 
5451
        unity_lens_set_search_hint (_tmp11_, _tmp12_);
 
5452
        _tmp13_ = self->priv->lens;
 
5453
        unity_lens_set_visible (_tmp13_, TRUE);
5020
5454
        unity_files_lens_daemon_populate_categories (self);
5021
5455
        unity_files_lens_daemon_populate_filters (self);
5022
 
        _tmp13_ = self->priv->lens;
5023
 
        _tmp14_ = self->priv->scope;
5024
 
        unity_lens_add_local_scope (_tmp13_, _tmp14_);
5025
 
        _tmp15_ = zeitgeist_log_new ();
 
5456
        _tmp14_ = self->priv->lens;
 
5457
        _tmp15_ = self->priv->scope;
 
5458
        unity_lens_add_local_scope (_tmp14_, _tmp15_);
 
5459
        _tmp16_ = zeitgeist_log_new ();
5026
5460
        _g_object_unref0 (self->priv->log);
5027
 
        self->priv->log = _tmp15_;
5028
 
        _tmp16_ = zeitgeist_index_new ();
 
5461
        self->priv->log = _tmp16_;
 
5462
        _tmp17_ = zeitgeist_index_new ();
5029
5463
        _g_object_unref0 (self->priv->index);
5030
 
        self->priv->index = _tmp16_;
5031
 
        _tmp17_ = g_ptr_array_new ();
5032
 
        templates = _tmp17_;
5033
 
        _tmp18_ = zeitgeist_event_new ();
5034
 
        _tmp19_ = g_object_ref_sink (_tmp18_);
5035
 
        event = _tmp19_;
5036
 
        _tmp20_ = zeitgeist_subject_new ();
5037
 
        _tmp21_ = g_object_ref_sink (_tmp20_);
5038
 
        subject = _tmp21_;
5039
 
        _tmp22_ = subject;
5040
 
        zeitgeist_subject_set_uri (_tmp22_, "file://*");
5041
 
        _tmp23_ = event;
5042
 
        _tmp24_ = subject;
5043
 
        zeitgeist_event_add_subject (_tmp23_, _tmp24_);
5044
 
        _tmp25_ = templates;
5045
 
        _tmp26_ = event;
5046
 
        _tmp27_ = g_object_ref ((GObject*) _tmp26_);
5047
 
        g_ptr_array_add (_tmp25_, _tmp27_);
5048
 
        _tmp28_ = zeitgeist_time_range_new_from_now ();
5049
 
        _tmp29_ = g_object_ref_sink (_tmp28_);
5050
 
        _tmp30_ = templates;
 
5464
        self->priv->index = _tmp17_;
 
5465
        _tmp18_ = g_ptr_array_new ();
 
5466
        templates = _tmp18_;
 
5467
        _tmp19_ = zeitgeist_event_new ();
 
5468
        _tmp20_ = g_object_ref_sink (_tmp19_);
 
5469
        event = _tmp20_;
 
5470
        _tmp21_ = zeitgeist_subject_new ();
 
5471
        _tmp22_ = g_object_ref_sink (_tmp21_);
 
5472
        subject = _tmp22_;
 
5473
        _tmp23_ = subject;
 
5474
        zeitgeist_subject_set_uri (_tmp23_, "file://*");
 
5475
        _tmp24_ = event;
 
5476
        _tmp25_ = subject;
 
5477
        zeitgeist_event_add_subject (_tmp24_, _tmp25_);
 
5478
        _tmp26_ = templates;
 
5479
        _tmp27_ = event;
 
5480
        _tmp28_ = g_object_ref ((GObject*) _tmp27_);
 
5481
        g_ptr_array_add (_tmp26_, _tmp28_);
 
5482
        _tmp29_ = zeitgeist_time_range_new_from_now ();
 
5483
        _tmp30_ = g_object_ref_sink (_tmp29_);
 
5484
        _tmp31_ = templates;
5051
5485
        templates = NULL;
5052
 
        _tmp31_ = zeitgeist_monitor_new (_tmp29_, _tmp30_);
 
5486
        _tmp32_ = zeitgeist_monitor_new (_tmp30_, _tmp31_);
5053
5487
        _g_object_unref0 (self->priv->monitor);
5054
 
        self->priv->monitor = _tmp31_;
5055
 
        _g_object_unref0 (_tmp29_);
5056
 
        _tmp32_ = self->priv->monitor;
5057
 
        g_signal_connect_object (_tmp32_, "events-inserted", (GCallback) _unity_files_lens_daemon_on_zeitgeist_changed_zeitgeist_monitor_events_inserted, self, 0);
 
5488
        self->priv->monitor = _tmp32_;
 
5489
        _g_object_unref0 (_tmp30_);
5058
5490
        _tmp33_ = self->priv->monitor;
5059
 
        g_signal_connect_object (_tmp33_, "events-deleted", (GCallback) _unity_files_lens_daemon_on_zeitgeist_changed_zeitgeist_monitor_events_deleted, self, 0);
5060
 
        _tmp34_ = self->priv->log;
5061
 
        _tmp35_ = self->priv->monitor;
5062
 
        zeitgeist_log_install_monitor (_tmp34_, _tmp35_);
5063
 
        _tmp36_ = unity_files_lens_bookmarks_new ();
 
5491
        g_signal_connect_object (_tmp33_, "events-inserted", (GCallback) _unity_files_lens_daemon_on_zeitgeist_changed_zeitgeist_monitor_events_inserted, self, 0);
 
5492
        _tmp34_ = self->priv->monitor;
 
5493
        g_signal_connect_object (_tmp34_, "events-deleted", (GCallback) _unity_files_lens_daemon_on_zeitgeist_changed_zeitgeist_monitor_events_deleted, self, 0);
 
5494
        _tmp35_ = self->priv->log;
 
5495
        _tmp36_ = self->priv->monitor;
 
5496
        zeitgeist_log_install_monitor (_tmp35_, _tmp36_);
 
5497
        _tmp37_ = unity_files_lens_bookmarks_new ();
5064
5498
        _g_object_unref0 (self->priv->bookmarks);
5065
 
        self->priv->bookmarks = _tmp36_;
5066
 
        _tmp37_ = unity_files_lens_url_checker_new ();
 
5499
        self->priv->bookmarks = _tmp37_;
 
5500
        _tmp38_ = unity_files_lens_url_checker_new ();
5067
5501
        _g_object_unref0 (self->priv->urls);
5068
 
        self->priv->urls = _tmp37_;
5069
 
        _tmp38_ = self->priv->scope;
5070
 
        g_signal_connect_object (_tmp38_, "filters-changed", (GCallback) __unity_files_lens_daemon___lambda5__unity_scope_filters_changed, self, 0);
5071
 
        _tmp39_ = self->priv->scope;
5072
 
        g_signal_connect_object (_tmp39_, "generate-search-key", (GCallback) __unity_files_lens_daemon___lambda6__unity_scope_generate_search_key, self, 0);
5073
 
        _tmp40_ = self->priv->scope;
5074
 
        g_signal_connect_object (_tmp40_, "search-changed", (GCallback) __unity_files_lens_daemon___lambda7__unity_scope_search_changed, self, 0);
5075
 
        _tmp41_ = self->priv->lens;
5076
 
        unity_lens_export (_tmp41_, &_inner_error_);
 
5502
        self->priv->urls = _tmp38_;
 
5503
        _tmp39_ = unity_files_lens_devices_new ();
 
5504
        _g_object_unref0 (self->priv->devices);
 
5505
        self->priv->devices = _tmp39_;
 
5506
        _tmp40_ = self->priv->devices;
 
5507
        g_signal_connect_object (_tmp40_, "changed", (GCallback) __unity_files_lens_daemon___lambda9__unity_files_lens_devices_changed, self, 0);
 
5508
        _tmp41_ = self->priv->scope;
 
5509
        g_signal_connect_object (_tmp41_, "filters-changed", (GCallback) __unity_files_lens_daemon___lambda10__unity_scope_filters_changed, self, 0);
 
5510
        _tmp42_ = self->priv->scope;
 
5511
        g_signal_connect_object (_tmp42_, "generate-search-key", (GCallback) __unity_files_lens_daemon___lambda11__unity_scope_generate_search_key, self, 0);
 
5512
        _tmp43_ = self->priv->scope;
 
5513
        g_signal_connect_object (_tmp43_, "search-changed", (GCallback) __unity_files_lens_daemon___lambda12__unity_scope_search_changed, self, 0);
 
5514
        _tmp44_ = self->priv->lens;
 
5515
        unity_lens_export (_tmp44_, &_inner_error_);
5077
5516
        if (_inner_error_ != NULL) {
5078
5517
                _g_object_unref0 (subject);
5079
5518
                _g_object_unref0 (event);
5112
5551
        _g_object_unref0 (self->priv->index);
5113
5552
        _g_object_unref0 (self->priv->monitor);
5114
5553
        _g_object_unref0 (self->priv->bookmarks);
 
5554
        _g_object_unref0 (self->priv->devices);
5115
5555
        _g_object_unref0 (self->priv->urls);
5116
5556
        _g_object_unref0 (self->priv->lens);
5117
5557
        _g_object_unref0 (self->priv->scope);
5657
6097
                                                _tmp136_ = g_file_query_info (_tmp134_, _tmp135_, 0, NULL, &_inner_error_);
5658
6098
                                                info = _tmp136_;
5659
6099
                                                if (_inner_error_ != NULL) {
5660
 
                                                        goto __catch9_g_error;
 
6100
                                                        goto __catch10_g_error;
5661
6101
                                                }
5662
6102
                                                _tmp137_ = info;
5663
6103
                                                _tmp138_ = g_file_info_get_is_hidden (_tmp137_);
5711
6151
                                                file_type = _tmp151_;
5712
6152
                                                _g_object_unref0 (info);
5713
6153
                                        }
5714
 
                                        goto __finally9;
5715
 
                                        __catch9_g_error:
 
6154
                                        goto __finally10;
 
6155
                                        __catch10_g_error:
5716
6156
                                        {
5717
6157
                                                GError* e = NULL;
5718
6158
                                                e = _inner_error_;
5725
6165
                                                _g_object_unref0 (su);
5726
6166
                                                continue;
5727
6167
                                        }
5728
 
                                        __finally9:
 
6168
                                        __finally10:
5729
6169
                                        if (_inner_error_ != NULL) {
5730
6170
                                                _g_object_unref0 (file);
5731
6171
                                                _g_free0 (mimetype);