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_;
271
UnityLensSearch* _tmp80_;
272
const gchar* _tmp81_;
275
GList* matching_devices;
277
UnityFilesLensDevices* _tmp64_;
278
UnityLensSearch* _tmp65_;
279
const gchar* _tmp66_;
280
const gchar* _tmp67_;
282
UnityFilesLensDevices* _tmp69_;
285
DeeSerializableModel* _tmp72_;
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_;
304
UnityLensSearch* _tmp91_;
305
const gchar* _tmp92_;
306
const gchar* _tmp93_;
307
UnityLensSearch* _tmp94_;
308
DeeSerializableModel* _tmp95_;
309
DeeSerializableModel* _tmp96_;
310
GCancellable* _tmp97_;
280
UnityLensSearch* _tmp87_;
281
const gchar* _tmp88_;
282
const gchar* _tmp89_;
284
const gchar* _tmp91_;
313
UnityLensSearch* _tmp98_;
314
const gchar* _tmp99_;
315
const gchar* _tmp100_;
317
const gchar* _tmp102_;
285
318
GError * _inner_error_;
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_;
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_;
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);
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_);
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;
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);
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_;
2054
_data_->_tmp76_ = FALSE;
2141
_data_->_tmp87_ = FALSE;
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_);
2069
2156
unity_files_lens_daemon_perform_locate_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
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_;
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_;
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);
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);
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_;
2556
_data_->_tmp129_ = FALSE;
2664
_data_->_tmp139_ = FALSE;
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_);
2571
2679
unity_files_lens_daemon_perform_locate_finish (_data_->self, _data_->_res_, &_data_->_inner_error_);
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;
4179
4354
g_clear_error (&_inner_error_);
4183
if (_tmp16_ != NULL) {
4185
const gchar* _tmp18_ = NULL;
4186
UnityGenericPreview* _tmp19_;
4187
const gchar* _tmp20_;
4188
gboolean _tmp21_ = FALSE;
4190
GTimeVal _tmp29_ = {0};
4358
if (_tmp20_ != NULL) {
4360
const gchar* _tmp22_ = NULL;
4361
UnityGenericPreview* _tmp23_;
4362
const gchar* _tmp24_;
4363
gboolean _tmp25_ = FALSE;
4365
GTimeVal _tmp33_ = {0};
4191
4366
GTimeVal mtime;
4194
4369
GDateTime* date_time;
4196
GAppInfo* _tmp37_ = NULL;
4371
GAppInfo* _tmp41_ = NULL;
4197
4372
GAppInfo* email_app_info;
4199
const gchar* _tmp39_ = NULL;
4374
const gchar* _tmp43_ = NULL;
4201
4376
gchar* mime_type;
4202
UnityGenericPreview* _tmp41_;
4203
const gchar* _tmp42_ = NULL;
4204
const gchar* _tmp43_;
4205
gchar* _tmp44_ = NULL;
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;
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_;
4217
GFileType _tmp54_ = 0;
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_;
4392
GFileType _tmp58_ = 0;
4394
_tmp22_ = g_file_info_get_name (_tmp21_);
4395
_tmp23_ = unity_generic_preview_new (_tmp22_, "", NULL);
4221
4396
_g_object_unref0 (preview);
4224
_tmp21_ = unity_files_lens_bookmark_is_bookmark_uri (_tmp20_);
4226
UnityGenericPreview* _tmp22_;
4227
const gchar* _tmp23_;
4228
gchar* _tmp24_ = NULL;
4232
_tmp24_ = unity_files_lens_bookmark_uri_from_bookmark (_tmp23_);
4234
unity_preview_set_image_source_uri ((UnityPreview*) _tmp22_, _tmp25_);
4399
_tmp25_ = unity_files_lens_bookmark_is_bookmark_uri (_tmp24_);
4237
4401
UnityGenericPreview* _tmp26_;
4238
4402
const gchar* _tmp27_;
4403
gchar* _tmp28_ = NULL;
4239
4405
_tmp26_ = preview;
4241
unity_preview_set_image_source_uri ((UnityPreview*) _tmp26_, _tmp27_);
4244
g_file_info_get_modification_time (_tmp28_, &_tmp29_);
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_;
4253
gchar* _tmp35_ = NULL;
4256
_tmp34_ = date_time;
4257
_tmp35_ = g_date_time_format (_tmp34_, "%x, %X");
4259
unity_preview_set_subtitle ((UnityPreview*) _tmp33_, _tmp36_);
4262
_tmp37_ = g_app_info_get_default_for_uri_scheme ("mailto");
4263
email_app_info = _tmp37_;
4265
_tmp39_ = g_file_info_get_content_type (_tmp38_);
4266
_tmp40_ = g_strdup (_tmp39_);
4267
mime_type = _tmp40_;
4269
_tmp42_ = _ ("Format");
4270
_tmp43_ = mime_type;
4271
_tmp44_ = g_content_type_get_description (_tmp43_);
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_);
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);
4284
_tmp52_ = open_action;
4285
unity_preview_add_action ((UnityPreview*) _tmp51_, _tmp52_);
4286
total_size = (gint64) 0;
4288
_tmp54_ = g_file_info_get_file_type (_tmp53_);
4289
if (_tmp54_ == G_FILE_TYPE_DIRECTORY) {
4291
gchar* _tmp56_ = NULL;
4295
_tmp56_ = g_file_get_path (_tmp55_);
4297
_tmp58_ = _tmp57_ != NULL;
4407
_tmp28_ = unity_files_lens_bookmark_uri_from_bookmark (_tmp27_);
4409
unity_preview_set_image_source_uri ((UnityPreview*) _tmp26_, _tmp29_);
4412
UnityGenericPreview* _tmp30_;
4413
const gchar* _tmp31_;
4416
unity_preview_set_image_source_uri ((UnityPreview*) _tmp30_, _tmp31_);
4419
g_file_info_get_modification_time (_tmp32_, &_tmp33_);
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_;
4428
gchar* _tmp39_ = NULL;
4431
_tmp38_ = date_time;
4432
_tmp39_ = g_date_time_format (_tmp38_, "%x, %X");
4434
unity_preview_set_subtitle ((UnityPreview*) _tmp37_, _tmp40_);
4437
_tmp41_ = g_app_info_get_default_for_uri_scheme ("mailto");
4438
email_app_info = _tmp41_;
4440
_tmp43_ = g_file_info_get_content_type (_tmp42_);
4441
_tmp44_ = g_strdup (_tmp43_);
4442
mime_type = _tmp44_;
4444
_tmp46_ = _ ("Format");
4445
_tmp47_ = mime_type;
4446
_tmp48_ = g_content_type_get_description (_tmp47_);
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_);
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);
4459
_tmp56_ = open_action;
4460
unity_preview_add_action ((UnityPreview*) _tmp55_, _tmp56_);
4461
total_size = (guint64) 0;
4463
_tmp58_ = g_file_info_get_file_type (_tmp57_);
4464
if (_tmp58_ == G_FILE_TYPE_DIRECTORY) {
4466
gchar* _tmp60_ = NULL;
4470
_tmp60_ = g_file_get_path (_tmp59_);
4472
_tmp62_ = _tmp61_ != NULL;
4301
UnityGenericPreview* _tmp67_;
4302
const gchar* _tmp68_ = NULL;
4303
const gchar* _tmp69_ = NULL;
4305
gchar* _tmp71_ = NULL;
4308
gchar* _tmp74_ = NULL;
4310
UnityInfoHint* _tmp76_;
4311
UnityInfoHint* _tmp77_;
4476
UnityGenericPreview* _tmp71_;
4477
const gchar* _tmp72_ = NULL;
4478
const gchar* _tmp73_ = NULL;
4480
gchar* _tmp75_ = NULL;
4483
gchar* _tmp78_ = NULL;
4485
UnityInfoHint* _tmp80_;
4486
UnityInfoHint* _tmp81_;
4315
gchar* _tmp60_ = NULL;
4318
_tmp60_ = g_file_get_path (_tmp59_);
4320
unity_files_lens_daemon_count_directory_items (self, _tmp61_, &count, &total_size, FALSE, &_inner_error_);
4490
gchar* _tmp64_ = NULL;
4493
_tmp64_ = g_file_get_path (_tmp63_);
4495
unity_files_lens_daemon_count_directory_items (self, _tmp65_, &count, &total_size, FALSE, &_inner_error_);
4322
4497
if (_inner_error_ != NULL) {
4323
4498
goto __catch4_g_error;
4358
4533
g_clear_error (&_inner_error_);
4362
_tmp68_ = _ ("Size");
4363
_tmp69_ = _ ("%s, %u items");
4364
_tmp70_ = total_size;
4365
_tmp71_ = g_format_size_full ((guint64) _tmp70_, G_FORMAT_SIZE_DEFAULT);
4368
_tmp74_ = g_strdup_printf (_tmp69_, _tmp72_, _tmp73_);
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_);
4537
_tmp72_ = _ ("Size");
4538
_tmp73_ = _ ("%s, %u items");
4539
_tmp74_ = total_size;
4540
_tmp75_ = g_format_size_full (_tmp74_, G_FORMAT_SIZE_DEFAULT);
4543
_tmp78_ = g_strdup_printf (_tmp73_, _tmp76_, _tmp77_);
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_);
4377
const gchar* _tmp78_;
4379
g_warning ("daemon.vala:979: No such uri '%s'\n", _tmp78_);
4552
const gchar* _tmp82_;
4554
g_warning ("daemon.vala:1027: No such uri '%s'\n", _tmp82_);
4383
gint64 _tmp80_ = 0LL;
4384
UnityGenericPreview* _tmp81_;
4385
const gchar* _tmp82_ = NULL;
4387
gchar* _tmp84_ = NULL;
4389
UnityInfoHint* _tmp86_;
4390
UnityInfoHint* _tmp87_;
4391
const gchar* _tmp88_ = NULL;
4392
UnityPreviewAction* _tmp89_;
4558
gint64 _tmp84_ = 0LL;
4559
UnityGenericPreview* _tmp85_;
4560
const gchar* _tmp86_ = NULL;
4562
gchar* _tmp88_ = NULL;
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_;
4399
_tmp80_ = g_file_info_get_size (_tmp79_);
4400
total_size = _tmp80_;
4402
_tmp82_ = _ ("Size");
4403
_tmp83_ = total_size;
4404
_tmp84_ = g_format_size_full ((guint64) _tmp83_, G_FORMAT_SIZE_DEFAULT);
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_);
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);
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_;
4574
_tmp84_ = g_file_info_get_size (_tmp83_);
4575
total_size = (guint64) _tmp84_;
4577
_tmp86_ = _ ("Size");
4578
_tmp87_ = total_size;
4579
_tmp88_ = g_format_size_full (_tmp87_, G_FORMAT_SIZE_DEFAULT);
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_);
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);
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);
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);
4608
_tmp102_ = email_action;
4609
unity_preview_add_action ((UnityPreview*) _tmp101_, _tmp102_);
4435
4610
_g_object_unref0 (email_action);
4437
4612
_g_object_unref0 (open_folder_action);
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_;
4649
UnityGenericPreview* _tmp10_;
4650
UnityGenericPreview* preview;
4651
gint contents_count;
4652
guint64 contents_size;
4654
gchar* filesystem_type;
4655
guint64 total_capacity;
4656
guint64 free_capacity;
4657
UnityGenericPreview* _tmp29_;
4658
const gchar* _tmp30_ = NULL;
4660
gchar* _tmp32_ = NULL;
4662
gchar* _tmp34_ = NULL;
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;
4673
gchar* _tmp45_ = NULL;
4676
gchar* _tmp48_ = NULL;
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;
4691
_tmp2_ = unity_files_lens_devices_get_device_from_uri (_tmp0_, _tmp1_);
4694
if (_tmp3_ == NULL) {
4696
_g_object_unref0 (device);
4700
_tmp5_ = unity_files_lens_device_get_display_name (_tmp4_);
4703
_tmp8_ = unity_files_lens_device_get_icon (_tmp7_);
4705
_tmp10_ = unity_generic_preview_new (_tmp6_, "", _tmp9_);
4708
contents_size = (guint64) 0;
4709
_tmp11_ = g_strdup ("");
4710
filesystem_type = _tmp11_;
4711
total_capacity = (guint64) 0;
4712
free_capacity = (guint64) 0;
4714
UnityFilesLensDevice* _tmp12_;
4715
GFile* _tmp13_ = NULL;
4718
GFileInfo* _tmp15_ = NULL;
4719
GFileInfo* file_info;
4721
gchar* _tmp17_ = NULL;
4724
gchar* _tmp20_ = NULL;
4726
guint64 _tmp22_ = 0ULL;
4728
guint64 _tmp24_ = 0ULL;
4732
_tmp13_ = unity_files_lens_device_get_root_file (_tmp12_);
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;
4742
_tmp17_ = g_file_get_path (_tmp16_);
4744
unity_files_lens_daemon_count_directory_items (self, _tmp18_, &contents_count, &contents_size, FALSE, &_inner_error_);
4746
if (_inner_error_ != NULL) {
4747
_g_object_unref0 (file_info);
4748
_g_object_unref0 (file);
4749
goto __catch5_g_error;
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);
4772
const gchar* _tmp28_;
4774
_inner_error_ = NULL;
4776
_tmp28_ = _tmp27_->message;
4777
g_warning ("daemon.vala:1090: Failed to query filesystem info: %s", _tmp28_);
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_);
4790
_tmp30_ = _ ("Total capacity %s");
4791
_tmp31_ = total_capacity;
4792
_tmp32_ = g_format_size_full (_tmp31_, G_FORMAT_SIZE_DEFAULT);
4794
_tmp34_ = g_strdup_printf (_tmp30_, _tmp33_);
4796
unity_preview_set_subtitle ((UnityPreview*) _tmp29_, _tmp35_);
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_);
4807
_tmp42_ = _ ("Contents");
4808
_tmp43_ = _ ("%s, %u items");
4809
_tmp44_ = contents_size;
4810
_tmp45_ = g_format_size_full (_tmp44_, G_FORMAT_SIZE_DEFAULT);
4812
_tmp47_ = contents_count;
4813
_tmp48_ = g_strdup_printf (_tmp43_, _tmp46_, _tmp47_);
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_);
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);
4827
_tmp56_ = open_action;
4828
unity_preview_add_action ((UnityPreview*) _tmp55_, _tmp56_);
4830
_g_object_unref0 (open_action);
4831
_g_free0 (filesystem_type);
4832
_g_object_unref0 (device);
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);
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);
4553
4929
gboolean _tmp0_ = FALSE;
4554
UnityFilesLensBookmarks* _tmp1_;
4555
const gchar* _tmp2_;
4556
gboolean _tmp3_ = FALSE;
4559
_tmp1_ = self->priv->bookmarks;
4561
_tmp3_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp1_, _tmp2_, &_inner_error_);
4930
gboolean _tmp1_ = FALSE;
4931
UnityFilesLensBookmarks* _tmp2_;
4932
const gchar* _tmp3_;
4933
gboolean _tmp4_ = FALSE;
4937
_tmp2_ = self->priv->bookmarks;
4939
_tmp4_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp2_, _tmp3_, &_inner_error_);
4563
4941
if (_inner_error_ != NULL) {
4564
goto __catch6_g_error;
4942
goto __catch7_g_error;
4947
UnityFilesLensDevices* _tmp6_;
4948
const gchar* _tmp7_;
4949
gboolean _tmp8_ = FALSE;
4951
_tmp6_ = self->priv->devices;
4953
_tmp8_ = unity_files_lens_devices_launch_if_device (_tmp6_, _tmp7_, &_inner_error_);
4955
if (_inner_error_ != NULL) {
4956
goto __catch7_g_error;
4569
const gchar* _tmp5_;
4570
gboolean _tmp6_ = FALSE;
4573
_tmp6_ = g_app_info_launch_default_for_uri (_tmp5_, NULL, &_inner_error_);
4964
const gchar* _tmp11_;
4965
gboolean _tmp12_ = FALSE;
4968
_tmp12_ = g_app_info_launch_default_for_uri (_tmp11_, NULL, &_inner_error_);
4575
4970
if (_inner_error_ != NULL) {
4576
goto __catch6_g_error;
4971
goto __catch7_g_error;
4582
UnityActivationResponse* _tmp9_;
4583
UnityActivationResponse* _tmp10_;
4584
_tmp9_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4585
_tmp10_ = g_object_ref_sink (_tmp9_);
4977
UnityActivationResponse* _tmp15_;
4978
UnityActivationResponse* _tmp16_;
4979
_tmp15_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4980
_tmp16_ = g_object_ref_sink (_tmp15_);
4593
4988
GError* e = NULL;
4594
const gchar* _tmp11_;
4596
const gchar* _tmp13_;
4989
const gchar* _tmp17_;
4991
const gchar* _tmp19_;
4597
4992
e = _inner_error_;
4598
4993
_inner_error_ = NULL;
4601
_tmp13_ = _tmp12_->message;
4602
g_warning ("daemon.vala:1042: Failed to launch default application for uri '%s': %" \
4603
"s", _tmp11_, _tmp13_);
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);
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_);
4612
_tmp14_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
4613
_tmp15_ = g_object_ref_sink (_tmp14_);
5007
_tmp20_ = unity_activation_response_new (UNITY_HANDLED_TYPE_NOT_HANDLED, "");
5008
_tmp21_ = g_object_ref_sink (_tmp20_);
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_);
4707
UnityFilesLensBookmarks* _tmp4_;
4708
const gchar* _tmp5_;
4709
gboolean _tmp6_ = FALSE;
5102
gboolean _tmp4_ = FALSE;
5103
UnityFilesLensBookmarks* _tmp5_;
5104
const gchar* _tmp6_;
5105
gboolean _tmp7_ = FALSE;
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_;
4720
_tmp4_ = self->priv->bookmarks;
4722
_tmp6_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp4_, _tmp5_, &_inner_error_);
5114
gboolean _tmp20_ = FALSE;
5115
const gchar* _tmp21_;
5117
_tmp5_ = self->priv->bookmarks;
5119
_tmp7_ = unity_files_lens_bookmarks_launch_if_bookmark (_tmp5_, _tmp6_, &_inner_error_);
4724
5121
if (_inner_error_ != NULL) {
4725
goto __catch8_g_error;
4728
UnityActivationResponse* _tmp8_;
4729
UnityActivationResponse* _tmp9_;
4730
_tmp8_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4731
_tmp9_ = g_object_ref_sink (_tmp8_);
5122
goto __catch9_g_error;
5127
UnityFilesLensDevices* _tmp9_;
5128
const gchar* _tmp10_;
5129
gboolean _tmp11_ = FALSE;
5131
_tmp9_ = self->priv->devices;
5133
_tmp11_ = unity_files_lens_devices_launch_if_device (_tmp9_, _tmp10_, &_inner_error_);
5135
if (_inner_error_ != NULL) {
5136
goto __catch9_g_error;
5142
UnityActivationResponse* _tmp14_;
5143
UnityActivationResponse* _tmp15_;
5144
_tmp14_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
5145
_tmp15_ = g_object_ref_sink (_tmp14_);
4735
5149
url_type = UNITY_FILES_LENS_URL_TYPE_UNKNOWN;
4736
_tmp10_ = self->priv->urls;
4738
_tmp13_ = unity_files_lens_url_checker_check_url (_tmp10_, _tmp11_, &_tmp12_);
4740
checked_url = _tmp13_;
4741
_tmp15_ = checked_url;
4742
if (_tmp15_ != NULL) {
4743
UnityFilesLensUrlType _tmp16_;
4745
_tmp14_ = _tmp16_ == UNITY_FILES_LENS_URL_TYPE_MOUNTABLE;
5150
_tmp16_ = self->priv->urls;
5152
_tmp19_ = unity_files_lens_url_checker_check_url (_tmp16_, _tmp17_, &_tmp18_);
5154
checked_url = _tmp19_;
5155
_tmp21_ = checked_url;
5156
if (_tmp21_ != NULL) {
5157
UnityFilesLensUrlType _tmp22_;
5159
_tmp20_ = _tmp22_ == UNITY_FILES_LENS_URL_TYPE_MOUNTABLE;
4752
const gchar* _tmp18_;
4754
GAppInfo* _tmp20_ = NULL;
5166
const gchar* _tmp24_;
5168
GAppInfo* _tmp26_ = NULL;
4755
5169
GAppInfo* file_manager;
4758
UnityActivationResponse* _tmp23_;
4759
UnityActivationResponse* _tmp24_;
5172
UnityActivationResponse* _tmp29_;
5173
UnityActivationResponse* _tmp30_;
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;
4768
g_app_info_launch_uris (_tmp21_, _tmp22_, NULL, &_inner_error_);
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;
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;
4775
_tmp23_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
4776
_tmp24_ = g_object_ref_sink (_tmp23_);
5189
_tmp29_ = unity_activation_response_new (UNITY_HANDLED_TYPE_HIDE_DASH, "");
5190
_tmp30_ = g_object_ref_sink (_tmp29_);
4778
5192
_g_object_unref0 (file_manager);
4779
5193
__g_list_free__g_free0_0 (muris);
4780
5194
_g_free0 (checked_url);
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_);
5036
_tmp20_ = zeitgeist_subject_new ();
5037
_tmp21_ = g_object_ref_sink (_tmp20_);
5040
zeitgeist_subject_set_uri (_tmp22_, "file://*");
5043
zeitgeist_event_add_subject (_tmp23_, _tmp24_);
5044
_tmp25_ = templates;
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_);
5470
_tmp21_ = zeitgeist_subject_new ();
5471
_tmp22_ = g_object_ref_sink (_tmp21_);
5474
zeitgeist_subject_set_uri (_tmp23_, "file://*");
5477
zeitgeist_event_add_subject (_tmp24_, _tmp25_);
5478
_tmp26_ = templates;
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);