~ubuntu-branches/ubuntu/trusty/unity-place-files/trusty

« back to all changes in this revision

Viewing changes to src/daemon.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-08-13 14:25:39 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20100813142539-s79xch3u5ec3vs1u
Tags: upstream-0.5.14
ImportĀ upstreamĀ versionĀ 0.5.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <glib.h>
24
24
#include <glib-object.h>
25
 
#include <unity.h>
26
25
#include <stdlib.h>
27
26
#include <string.h>
 
27
#include <unity.h>
28
28
#include <zeitgeist.h>
29
29
#include <dee.h>
30
30
#include <gee.h>
67
67
 
68
68
#define UNITY_FILES_PLACE_TYPE_GROUPS_COLUMN (unity_files_place_groups_column_get_type ())
69
69
#define _g_ptr_array_unref0(var) ((var == NULL) ? NULL : (var = (g_ptr_array_unref (var), NULL)))
 
70
 
 
71
#define UNITY_FILES_PLACE_TYPE_GROUP (unity_files_place_group_get_type ())
70
72
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
71
73
typedef struct _UnityFilesPlaceDaemonUpdateSearchAsyncData UnityFilesPlaceDaemonUpdateSearchAsyncData;
72
74
typedef struct _UnityFilesPlaceDaemonUpdateWithoutSearchAsyncData UnityFilesPlaceDaemonUpdateWithoutSearchAsyncData;
73
75
 
74
76
#define UNITY_FILES_PLACE_TYPE_RESULTS_COLUMN (unity_files_place_results_column_get_type ())
75
 
 
76
 
#define UNITY_FILES_PLACE_TYPE_GROUP (unity_files_place_group_get_type ())
77
77
typedef struct _UnityFilesPlaceDaemonUpdateFavoritesAsyncData UnityFilesPlaceDaemonUpdateFavoritesAsyncData;
78
78
#define __g_slist_free_g_object_unref0(var) ((var == NULL) ? NULL : (var = (_g_slist_free_g_object_unref (var), NULL)))
79
79
typedef struct _UnityFilesPlaceDaemonUpdateDownloadsAsyncData UnityFilesPlaceDaemonUpdateDownloadsAsyncData;
135
135
        UnityFilesPlaceSection browsing_root;
136
136
        GeeList* section_templates;
137
137
        GeeList* months;
 
138
        UnityPlaceSearch* previous_search;
 
139
        DeeIndex* entry_results_by_group;
 
140
        DeeIndex* global_results_by_group;
138
141
};
139
142
 
140
143
typedef enum  {
148
151
        UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT
149
152
} UnityFilesPlaceGroupsColumn;
150
153
 
 
154
typedef enum  {
 
155
        UNITY_FILES_PLACE_GROUP_TOP_RESULTS,
 
156
        UNITY_FILES_PLACE_GROUP_RECENT,
 
157
        UNITY_FILES_PLACE_GROUP_DOWNLOADS,
 
158
        UNITY_FILES_PLACE_GROUP_FAVORITE_FOLDERS,
 
159
        UNITY_FILES_PLACE_GROUP_FILES,
 
160
        UNITY_FILES_PLACE_GROUP_TODAY,
 
161
        UNITY_FILES_PLACE_GROUP_YESTERDAY,
 
162
        UNITY_FILES_PLACE_GROUP_THIS_WEEK,
 
163
        UNITY_FILES_PLACE_GROUP_LAST_WEEK,
 
164
        UNITY_FILES_PLACE_GROUP_THIS_MONTH,
 
165
        UNITY_FILES_PLACE_GROUP_PAST_SIX_MONTHS,
 
166
        UNITY_FILES_PLACE_GROUP_THIS_YEAR,
 
167
        UNITY_FILES_PLACE_GROUP_LAST_YEAR
 
168
} UnityFilesPlaceGroup;
 
169
 
151
170
struct _UnityFilesPlaceDaemonUpdateSearchAsyncData {
152
171
        int _state_;
153
172
        GAsyncResult* _res_;
157
176
        UnityFilesPlaceSection section;
158
177
        DeeModel* results_model;
159
178
        DeeModel* groups_model;
 
179
        gboolean is_filter_search;
 
180
        DeeIndex* results_by_group;
 
181
        gint group_override;
160
182
        char* search_string;
161
183
        GPtrArray* templates;
 
184
        ZeitgeistResultType _tmp0_;
 
185
        ZeitgeistResultType result_type;
 
186
        guint num_hits;
162
187
        ZeitgeistResultSet* results;
163
 
        ZeitgeistTimeRange* _tmp0_;
164
 
        ZeitgeistResultSet* _tmp1_;
165
 
        ZeitgeistResultSet* _tmp4_;
166
 
        ZeitgeistTimeRange* _tmp2_;
167
 
        ZeitgeistResultSet* _tmp3_;
168
 
        ZeitgeistResultSet* _tmp5_;
169
 
        char* _tmp6_;
 
188
        ZeitgeistTimeRange* _tmp1_;
 
189
        ZeitgeistResultSet* _tmp2_;
 
190
        guint group;
 
191
        GeeSet* uris;
 
192
        DeeResultSet* _tmp4_;
 
193
        char* _tmp3_;
 
194
        ZeitgeistResultSet* _tmp7_;
 
195
        ZeitgeistTimeRange* _tmp5_;
 
196
        ZeitgeistResultSet* _tmp6_;
 
197
        ZeitgeistResultSet* _tmp8_;
 
198
        GeeSet* uris_;
 
199
        guint n_groups;
 
200
        guint group_;
 
201
        gboolean _tmp9_;
 
202
        DeeResultSet* _tmp11_;
 
203
        char* _tmp10_;
 
204
        char* _tmp12_;
170
205
        GError * e;
171
206
        GError * _inner_error_;
172
207
};
179
214
        UnityFilesPlaceSection section;
180
215
        DeeModel* results_model;
181
216
        DeeModel* groups_model;
 
217
        gint group_override;
 
218
        gboolean active_section_hint_new;
182
219
        GFile* folder;
183
220
        char* _tmp0_;
 
221
        char* _tmp1_;
184
222
        GError * ee;
185
 
        char* _tmp1_;
 
223
        char* _tmp2_;
 
224
        GEnumValue* _tmp3_;
 
225
        gboolean _tmp4_;
 
226
        char* _tmp5_;
 
227
        gboolean _tmp6_;
186
228
        DeeModel* sections_model;
187
229
        GPtrArray* templates;
 
230
        ZeitgeistResultType _tmp7_;
 
231
        ZeitgeistResultType result_type;
188
232
        ZeitgeistResultSet* events;
189
 
        ZeitgeistTimeRange* _tmp2_;
190
 
        ZeitgeistResultSet* _tmp3_;
 
233
        ZeitgeistTimeRange* _tmp8_;
 
234
        ZeitgeistResultSet* _tmp9_;
191
235
        GError * e;
192
236
        GError * _inner_error_;
193
237
};
201
245
        UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT
202
246
} UnityFilesPlaceResultsColumn;
203
247
 
204
 
typedef enum  {
205
 
        UNITY_FILES_PLACE_GROUP_TOP_RESULTS,
206
 
        UNITY_FILES_PLACE_GROUP_RECENT,
207
 
        UNITY_FILES_PLACE_GROUP_DOWNLOADS,
208
 
        UNITY_FILES_PLACE_GROUP_FAVORITE_FOLDERS,
209
 
        UNITY_FILES_PLACE_GROUP_TODAY,
210
 
        UNITY_FILES_PLACE_GROUP_YESTERDAY,
211
 
        UNITY_FILES_PLACE_GROUP_THIS_WEEK,
212
 
        UNITY_FILES_PLACE_GROUP_LAST_WEEK,
213
 
        UNITY_FILES_PLACE_GROUP_THIS_MONTH,
214
 
        UNITY_FILES_PLACE_GROUP_PAST_SIX_MONTHS,
215
 
        UNITY_FILES_PLACE_GROUP_THIS_YEAR,
216
 
        UNITY_FILES_PLACE_GROUP_LAST_YEAR
217
 
} UnityFilesPlaceGroup;
218
 
 
219
248
struct _UnityFilesPlaceDaemonUpdateFavoritesAsyncData {
220
249
        int _state_;
221
250
        GAsyncResult* _res_;
233
262
        char** _tmp3_;
234
263
        gint _favorites_size_;
235
264
        gint favorites_length1;
236
 
        char* icon_string;
237
 
        GThemedIcon* _tmp4_;
238
 
        char* _tmp5_;
 
265
        char* mimetype;
239
266
        GFile* f;
240
 
        char* _tmp6_;
241
 
        char** fave_collection;
242
 
        int fave_collection_length1;
243
 
        int fave_it;
244
 
        char* fave;
 
267
        char* icon;
 
268
        char* _tmp4_;
 
269
        char** uri_collection;
 
270
        int uri_collection_length1;
 
271
        int uri_it;
 
272
        char* uri;
245
273
        GError * _inner_error_;
246
274
};
247
275
 
336
364
static gpointer unity_files_place_daemon_parent_class = NULL;
337
365
static UnityPlaceActivationIface* unity_files_place_daemon_unity_place_activation_parent_iface = NULL;
338
366
 
 
367
#define UNITY_FILES_PLACE_ACTIVE_SECTION_HINT "UnityActiveSection"
339
368
gpointer unity_files_place_browsing_state_ref (gpointer instance);
340
369
void unity_files_place_browsing_state_unref (gpointer instance);
341
370
GParamSpec* unity_files_place_param_spec_browsing_state (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
362
391
static void unity_files_place_daemon_populate_groups (UnityFilesPlaceDaemon* self);
363
392
static void unity_files_place_daemon_prepare_section_templates (UnityFilesPlaceDaemon* self);
364
393
static gboolean unity_files_place_daemon_search_is_invalid (UnityFilesPlaceDaemon* self, UnityPlaceSearch* search);
365
 
static void unity_files_place_daemon_update_without_search_async (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
394
static void unity_files_place_daemon_update_without_search_async (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, gint group_override, GAsyncReadyCallback _callback_, gpointer _user_data_);
366
395
static void unity_files_place_daemon_update_without_search_finish (UnityFilesPlaceDaemon* self, GAsyncResult* _res_);
367
396
static void unity_files_place_daemon_on_events_inserted (UnityFilesPlaceDaemon* self, ZeitgeistMonitor* mon, ZeitgeistTimeRange* time_range, ZeitgeistResultSet* events);
368
397
static void _unity_files_place_daemon_on_events_inserted_zeitgeist_monitor_events_inserted (ZeitgeistMonitor* _sender, ZeitgeistTimeRange* time_range, ZeitgeistResultSet* events, gpointer self);
371
400
static void unity_files_place_daemon_update_search_async_data_free (gpointer _data);
372
401
static void unity_files_place_daemon_update_search_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
373
402
void unity_files_place_append_top_results (ZeitgeistResultSet* events, DeeModel* results, DeeModel* groups);
374
 
void unity_files_place_append_events_sorted (ZeitgeistResultSet* events, DeeModel* results, DeeModel* groups);
375
 
static void unity_files_place_daemon_update_search_async (UnityFilesPlaceDaemon* self, UnityPlaceSearch* search, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
403
GType unity_files_place_group_get_type (void) G_GNUC_CONST;
 
404
GeeSet* unity_files_place_utils_get_uri_set (ZeitgeistResultSet* results);
 
405
void unity_files_place_utils_apply_uri_filter (GeeSet* valid_uris, DeeResultSet* filter_set);
 
406
void unity_files_place_append_events_sorted (ZeitgeistResultSet* events, DeeModel* results, DeeModel* groups, UnityFilesPlaceSection section, gint group_override);
 
407
static void unity_files_place_daemon_update_search_async (UnityFilesPlaceDaemon* self, UnityPlaceSearch* search, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, gboolean is_filter_search, DeeIndex* results_by_group, gint group_override, GAsyncReadyCallback _callback_, gpointer _user_data_);
376
408
static void unity_files_place_daemon_update_search_finish (UnityFilesPlaceDaemon* self, GAsyncResult* _res_);
377
409
static gboolean unity_files_place_daemon_update_search_async_co (UnityFilesPlaceDaemonUpdateSearchAsyncData* data);
378
410
static void unity_files_place_daemon_update_without_search_async_data_free (gpointer _data);
379
411
static void unity_files_place_daemon_update_without_search_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
380
412
static GFile* unity_files_place_daemon_get_folder_for_pathbar_section (UnityFilesPlaceDaemon* self, guint path_element);
381
 
static void unity_files_place_daemon_browse_folder (UnityFilesPlaceDaemon* self, GFile* folder, GAsyncReadyCallback _callback_, gpointer _user_data_);
382
 
static void unity_files_place_daemon_browse_folder_finish (UnityFilesPlaceDaemon* self, GAsyncResult* _res_);
383
 
static void unity_files_place_daemon_reset_state (UnityFilesPlaceDaemon* self);
 
413
static void unity_files_place_daemon_reset_state (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section);
384
414
static void unity_files_place_daemon_update_favorites_async (UnityFilesPlaceDaemon* self, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_);
385
415
static void unity_files_place_daemon_update_favorites_finish (UnityFilesPlaceDaemon* self, GAsyncResult* _res_);
386
416
static void unity_files_place_daemon_update_downloads_async (UnityFilesPlaceDaemon* self, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_);
388
418
static gboolean unity_files_place_daemon_update_without_search_async_co (UnityFilesPlaceDaemonUpdateWithoutSearchAsyncData* data);
389
419
static void unity_files_place_daemon_update_favorites_async_data_free (gpointer _data);
390
420
static void unity_files_place_daemon_update_favorites_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
421
char* unity_files_place_utils_get_icon_for_uri (const char* uri, const char* mimetype);
391
422
GType unity_files_place_results_column_get_type (void) G_GNUC_CONST;
392
 
GType unity_files_place_group_get_type (void) G_GNUC_CONST;
393
423
static gboolean unity_files_place_daemon_update_favorites_async_co (UnityFilesPlaceDaemonUpdateFavoritesAsyncData* data);
394
424
static void unity_files_place_daemon_update_downloads_async_data_free (gpointer _data);
395
425
static void unity_files_place_daemon_update_downloads_async_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
396
426
void unity_files_place_utils_list_dir (GFile* folder, GAsyncReadyCallback _callback_, gpointer _user_data_);
397
427
GSList* unity_files_place_utils_list_dir_finish (GAsyncResult* _res_, GError** error);
398
428
static void _g_slist_free_g_object_unref (GSList* self);
399
 
static gint _lambda0_ (void* info1, void* info2);
400
 
static gint __lambda0__gcompare_func (void* a, void* b);
 
429
gint unity_files_place_utils_cmp_file_info_by_mtime (GFileInfo* info1, GFileInfo* info2);
401
430
char* unity_files_place_utils_check_icon_string (const char* uri, const char* mimetype, GFileInfo* info);
402
431
static gboolean unity_files_place_daemon_update_downloads_async_co (UnityFilesPlaceDaemonUpdateDownloadsAsyncData* data);
403
 
char* unity_files_place_utils_get_icon_for_uri (const char* uri, const char* mimetype);
404
432
guint unity_files_place_utils_get_time_group (ZeitgeistEvent* event, DeeModel* groups_model);
405
433
static void unity_files_place_daemon_real_activate_data_free (gpointer _data);
406
434
static void unity_files_place_daemon_real_activate (UnityPlaceActivation* base, const char* uri, GAsyncReadyCallback _callback_, gpointer _user_data_);
407
435
static void unity_files_place_daemon_activate_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
436
static void unity_files_place_daemon_browse_folder (UnityFilesPlaceDaemon* self, GFile* folder, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
437
static void unity_files_place_daemon_browse_folder_finish (UnityFilesPlaceDaemon* self, GAsyncResult* _res_);
408
438
static gboolean unity_files_place_daemon_real_activate_co (UnityFilesPlaceDaemonActivateData* data);
409
439
static void unity_files_place_daemon_browse_folder_data_free (gpointer _data);
410
440
static void unity_files_place_daemon_browse_folder_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
418
448
UnityFilesPlaceDaemon* unity_files_place_daemon_new (void);
419
449
UnityFilesPlaceDaemon* unity_files_place_daemon_construct (GType object_type);
420
450
#define CONFIG_PREFIX "/usr"
 
451
static void _lambda0_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self);
 
452
static void __lambda0__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
 
453
gboolean unity_files_place_utils_check_is_filter_search (UnityPlaceSearch* new_search, UnityPlaceSearch* old_search);
421
454
static void _lambda1_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self);
422
455
static void __lambda1__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
423
456
static void _lambda2_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self);
424
457
static void __lambda2__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
425
458
static void _lambda3_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self);
426
459
static void __lambda3__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
427
 
static void _lambda4_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self);
428
 
static void __lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self);
429
460
static void _unity_files_place_daemon_on_results_model_ready_dee_shared_model_ready (DeeSharedModel* _sender, gpointer self);
 
461
static void _lambda4_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self);
 
462
static void __lambda4__unity_place_browser_back (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self);
430
463
static void _lambda5_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self);
431
 
static void __lambda5__unity_place_browser_back (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self);
432
 
static void _lambda6_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self);
433
 
static void __lambda6__unity_place_browser_forward (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self);
 
464
static void __lambda5__unity_place_browser_forward (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self);
434
465
static GObject * unity_files_place_daemon_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties);
435
466
static void _vala_dbus_register_object (DBusConnection* connection, const char* path, void* object);
436
467
static void _vala_dbus_unregister_object (gpointer connection, GObject* object);
631
662
        g_return_if_fail (self != NULL);
632
663
        sections = _g_object_ref0 (unity_place_entry_info_get_sections_model (self->priv->files));
633
664
        if (dee_model_get_n_rows (sections) != 0) {
634
 
                g_critical ("daemon.vala:228: The sections model should be empty before initial pop" \
 
665
                g_critical ("daemon.vala:272: The sections model should be empty before initial pop" \
635
666
"ulation");
636
667
                dee_model_clear (sections);
637
668
        }
653
684
        g_return_if_fail (self != NULL);
654
685
        groups = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
655
686
        if (dee_model_get_n_rows (groups) != 0) {
656
 
                g_critical ("daemon.vala:256: The groups model should be empty before initial popul" \
 
687
                g_critical ("daemon.vala:300: The groups model should be empty before initial popul" \
657
688
"ation");
658
689
                dee_model_clear (groups);
659
690
        }
661
692
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Recent", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
662
693
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Downloads", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
663
694
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Favorite Folders", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
 
695
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Files", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
664
696
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Today", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
665
697
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "Yesterday", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
666
698
        dee_model_append (groups, UNITY_FILES_PLACE_GROUPS_COLUMN_RENDERER, "UnityDefaultRenderer", UNITY_FILES_PLACE_GROUPS_COLUMN_DISPLAY_NAME, "This week", UNITY_FILES_PLACE_GROUPS_COLUMN_ICON_HINT, "", -1, NULL);
731
763
        ZeitgeistSubject* _tmp25_;
732
764
        ZeitgeistEvent* _tmp27_;
733
765
        GPtrArray* _tmp28_;
734
 
        ZeitgeistEvent* _tmp30_;
735
 
        ZeitgeistSubject* _tmp29_;
736
 
        ZeitgeistEvent* _tmp31_;
 
766
        ZeitgeistEvent* _tmp29_;
 
767
        ZeitgeistSubject* _tmp30_;
 
768
        ZeitgeistSubject* _tmp31_;
 
769
        ZeitgeistSubject* _tmp32_;
 
770
        ZeitgeistSubject* _tmp33_;
 
771
        ZeitgeistSubject* _tmp34_;
 
772
        ZeitgeistEvent* _tmp35_;
737
773
        g_return_if_fail (self != NULL);
738
774
        templates = NULL;
739
775
        event = NULL;
748
784
        g_ptr_array_add (templates, g_object_ref ((_tmp7_ = event, G_IS_OBJECT (_tmp7_) ? ((GObject*) _tmp7_) : NULL)));
749
785
        gee_collection_add ((GeeCollection*) self->priv->section_templates, templates);
750
786
        templates = (_tmp8_ = g_ptr_array_sized_new ((guint) 1), _g_ptr_array_unref0 (templates), _tmp8_);
751
 
        event = (_tmp10_ = g_object_ref_sink (zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "", _tmp9_ = g_object_ref_sink (zeitgeist_subject_new_full ("file:*", ZEITGEIST_NFO_FOLDER, ZEITGEIST_NFO_FILE_DATA_OBJECT, "", "", "", "")), NULL)), _g_object_unref0 (event), _tmp10_);
 
787
        event = (_tmp10_ = g_object_ref_sink (zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "", _tmp9_ = g_object_ref_sink (zeitgeist_subject_new_full ("file:*", "", ZEITGEIST_NFO_FILE_DATA_OBJECT, "", "", "", "")), NULL)), _g_object_unref0 (event), _tmp10_);
752
788
        _g_object_unref0 (_tmp9_);
753
789
        g_ptr_array_add (templates, g_object_ref ((_tmp11_ = event, G_IS_OBJECT (_tmp11_) ? ((GObject*) _tmp11_) : NULL)));
754
790
        gee_collection_add ((GeeCollection*) self->priv->section_templates, templates);
773
809
        g_ptr_array_add (templates, g_object_ref ((_tmp27_ = event, G_IS_OBJECT (_tmp27_) ? ((GObject*) _tmp27_) : NULL)));
774
810
        gee_collection_add ((GeeCollection*) self->priv->section_templates, templates);
775
811
        templates = (_tmp28_ = g_ptr_array_sized_new ((guint) 1), _g_ptr_array_unref0 (templates), _tmp28_);
776
 
        event = (_tmp30_ = g_object_ref_sink (zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "", _tmp29_ = g_object_ref_sink (zeitgeist_subject_new_full ("file:*", "", ZEITGEIST_NFO_FILE_DATA_OBJECT, "", "", "", "")), NULL)), _g_object_unref0 (event), _tmp30_);
777
 
        _g_object_unref0 (_tmp29_);
778
 
        g_ptr_array_add (templates, g_object_ref ((_tmp31_ = event, G_IS_OBJECT (_tmp31_) ? ((GObject*) _tmp31_) : NULL)));
 
812
        event = (_tmp29_ = g_object_ref_sink (zeitgeist_event_new_full ("", ZEITGEIST_ZG_USER_ACTIVITY, "", NULL)), _g_object_unref0 (event), _tmp29_);
 
813
        zeitgeist_event_add_subject (event, _tmp30_ = g_object_ref_sink (zeitgeist_subject_new_full ("file:*", "!" ZEITGEIST_NFO_DOCUMENT, ZEITGEIST_NFO_FILE_DATA_OBJECT, "", "", "", "")));
 
814
        _g_object_unref0 (_tmp30_);
 
815
        zeitgeist_event_add_subject (event, _tmp31_ = g_object_ref_sink (zeitgeist_subject_new_full ("", "!" ZEITGEIST_NFO_IMAGE, "", "", "", "", "")));
 
816
        _g_object_unref0 (_tmp31_);
 
817
        zeitgeist_event_add_subject (event, _tmp32_ = g_object_ref_sink (zeitgeist_subject_new_full ("", "!" ZEITGEIST_NFO_AUDIO, "", "", "", "", "")));
 
818
        _g_object_unref0 (_tmp32_);
 
819
        zeitgeist_event_add_subject (event, _tmp33_ = g_object_ref_sink (zeitgeist_subject_new_full ("", "!" ZEITGEIST_NFO_VIDEO, "", "", "", "", "")));
 
820
        _g_object_unref0 (_tmp33_);
 
821
        zeitgeist_event_add_subject (event, _tmp34_ = g_object_ref_sink (zeitgeist_subject_new_full ("", "!" ZEITGEIST_NFO_PRESENTATION, "", "", "", "", "")));
 
822
        _g_object_unref0 (_tmp34_);
 
823
        g_ptr_array_add (templates, g_object_ref ((_tmp35_ = event, G_IS_OBJECT (_tmp35_) ? ((GObject*) _tmp35_) : NULL)));
779
824
        gee_collection_add ((GeeCollection*) self->priv->section_templates, templates);
780
825
        _g_object_unref0 (event);
781
826
        _g_ptr_array_unref0 (templates);
820
865
        section = (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files);
821
866
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
822
867
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
823
 
        unity_files_place_daemon_update_without_search_async (self, section, _results_model, _groups_model, NULL, NULL);
 
868
        unity_files_place_daemon_update_without_search_async (self, section, _results_model, _groups_model, -1, NULL, NULL);
824
869
        g_signal_connect_object (self->priv->monitor, "events-inserted", (GCallback) _unity_files_place_daemon_on_events_inserted_zeitgeist_monitor_events_inserted, self, 0);
825
870
        _g_object_unref0 (_groups_model);
826
871
        _g_object_unref0 (_results_model);
862
907
        _g_object_unref0 (data->search);
863
908
        _g_object_unref0 (data->results_model);
864
909
        _g_object_unref0 (data->groups_model);
 
910
        _g_object_unref0 (data->results_by_group);
865
911
        g_object_unref (data->self);
866
912
        g_slice_free (UnityFilesPlaceDaemonUpdateSearchAsyncData, data);
867
913
}
868
914
 
869
915
 
870
 
static void unity_files_place_daemon_update_search_async (UnityFilesPlaceDaemon* self, UnityPlaceSearch* search, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
916
static void unity_files_place_daemon_update_search_async (UnityFilesPlaceDaemon* self, UnityPlaceSearch* search, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, gboolean is_filter_search, DeeIndex* results_by_group, gint group_override, GAsyncReadyCallback _callback_, gpointer _user_data_) {
871
917
        UnityFilesPlaceDaemonUpdateSearchAsyncData* _data_;
872
918
        _data_ = g_slice_new0 (UnityFilesPlaceDaemonUpdateSearchAsyncData);
873
919
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_files_place_daemon_update_search_async);
877
923
        _data_->section = section;
878
924
        _data_->results_model = _g_object_ref0 (results_model);
879
925
        _data_->groups_model = _g_object_ref0 (groups_model);
 
926
        _data_->is_filter_search = is_filter_search;
 
927
        _data_->results_by_group = _g_object_ref0 (results_by_group);
 
928
        _data_->group_override = group_override;
880
929
        unity_files_place_daemon_update_search_async_co (_data_);
881
930
}
882
931
 
913
962
        }
914
963
        _state_0:
915
964
        {
 
965
                data->is_filter_search = FALSE;
916
966
                if (unity_place_entry_info_get_browser (data->self->priv->files) != NULL) {
917
 
                        g_warning ("daemon.vala:455: In-folder searching not implemented yet");
 
967
                        g_warning ("daemon.vala:524: In-folder searching not implemented yet");
918
968
                        {
919
969
                                if (data->_state_ == 0) {
920
970
                                        g_simple_async_result_complete_in_idle (data->_async_result);
926
976
                        }
927
977
                }
928
978
                if (unity_files_place_daemon_search_is_invalid (data->self, data->search)) {
929
 
                        unity_files_place_daemon_update_without_search_async (data->self, data->section, data->results_model, data->groups_model, NULL, NULL);
 
979
                        unity_files_place_daemon_update_without_search_async (data->self, data->section, data->results_model, data->groups_model, -1, NULL, NULL);
930
980
                        {
931
981
                                if (data->_state_ == 0) {
932
982
                                        g_simple_async_result_complete_in_idle (data->_async_result);
939
989
                }
940
990
                data->search_string = unity_files_place_daemon_prepare_search_string (data->self, data->search);
941
991
                data->templates = (GPtrArray*) gee_list_get (data->self->priv->section_templates, (gint) data->section);
 
992
                if (data->section == UNITY_FILES_PLACE_SECTION_FOLDERS) {
 
993
                        data->_tmp0_ = ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN;
 
994
                } else {
 
995
                        data->_tmp0_ = ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS;
 
996
                }
 
997
                data->result_type = data->_tmp0_;
 
998
                data->num_hits = (guint) 20;
 
999
                if (data->is_filter_search) {
 
1000
                        data->num_hits = (guint) 1000;
 
1001
                }
942
1002
                {
943
1003
                        data->_state_ = 1;
944
 
                        zeitgeist_index_search (data->self->priv->index, data->search_string, data->_tmp0_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), (guint32) ZEITGEIST_STORAGE_STATE_ANY, (guint32) 100, ZEITGEIST_RESULT_TYPE_RELEVANCY, NULL, unity_files_place_daemon_update_search_async_ready, data);
 
1004
                        zeitgeist_index_search (data->self->priv->index, data->search_string, data->_tmp1_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), (guint32) ZEITGEIST_STORAGE_STATE_ANY, (guint32) data->num_hits, ZEITGEIST_RESULT_TYPE_RELEVANCY, NULL, unity_files_place_daemon_update_search_async_ready, data);
945
1005
                        return FALSE;
946
1006
                        _state_1:
947
 
                        data->results = (data->_tmp1_ = zeitgeist_index_search_finish (data->self->priv->index, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp0_), data->_tmp1_);
 
1007
                        data->results = (data->_tmp2_ = zeitgeist_index_search_finish (data->self->priv->index, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp1_), data->_tmp2_);
948
1008
                        if (data->_inner_error_ != NULL) {
949
1009
                                goto __catch0_g_error;
950
1010
                        }
951
 
                        dee_model_clear (data->results_model);
952
 
                        unity_files_place_append_top_results (data->results, data->results_model, data->groups_model);
953
 
                        g_debug ("daemon.vala:486: Found %u/%u matches for search '%s'", zeitgeist_result_set_size (data->results), zeitgeist_result_set_estimated_matches (data->results), data->search_string);
 
1011
                        if (!data->is_filter_search) {
 
1012
                                dee_model_clear (data->results_model);
 
1013
                                unity_files_place_append_top_results (data->results, data->results_model, data->groups_model);
 
1014
                        } else {
 
1015
                                data->group = (guint) UNITY_FILES_PLACE_GROUP_TOP_RESULTS;
 
1016
                                data->uris = unity_files_place_utils_get_uri_set (data->results);
 
1017
                                unity_files_place_utils_apply_uri_filter (data->uris, data->_tmp4_ = dee_index_lookup (data->results_by_group, data->_tmp3_ = g_strdup_printf ("%u", data->group), DEE_TERM_MATCH_EXACT));
 
1018
                                _g_object_unref0 (data->_tmp4_);
 
1019
                                _g_free0 (data->_tmp3_);
 
1020
                                _g_object_unref0 (data->uris);
 
1021
                        }
 
1022
                        g_debug ("daemon.vala:577: Found %u/%u matches for search '%s'", zeitgeist_result_set_size (data->results), zeitgeist_result_set_estimated_matches (data->results), data->search_string);
954
1023
                        data->_state_ = 2;
955
 
                        zeitgeist_index_search (data->self->priv->index, data->search_string, data->_tmp2_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), (guint32) ZEITGEIST_STORAGE_STATE_ANY, (guint32) 100, ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, NULL, unity_files_place_daemon_update_search_async_ready, data);
 
1024
                        zeitgeist_index_search (data->self->priv->index, data->search_string, data->_tmp5_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), (guint32) ZEITGEIST_STORAGE_STATE_ANY, (guint32) (data->num_hits * 5), data->result_type, NULL, unity_files_place_daemon_update_search_async_ready, data);
956
1025
                        return FALSE;
957
1026
                        _state_2:
958
 
                        data->_tmp4_ = (data->_tmp3_ = zeitgeist_index_search_finish (data->self->priv->index, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp2_), data->_tmp3_);
 
1027
                        data->_tmp7_ = (data->_tmp6_ = zeitgeist_index_search_finish (data->self->priv->index, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp5_), data->_tmp6_);
959
1028
                        if (data->_inner_error_ != NULL) {
960
1029
                                _g_object_unref0 (data->results);
961
1030
                                goto __catch0_g_error;
962
1031
                        }
963
 
                        data->results = (data->_tmp5_ = data->_tmp4_, _g_object_unref0 (data->results), data->_tmp5_);
964
 
                        unity_files_place_append_events_sorted (data->results, data->results_model, data->groups_model);
 
1032
                        data->results = (data->_tmp8_ = data->_tmp7_, _g_object_unref0 (data->results), data->_tmp8_);
 
1033
                        if (!data->is_filter_search) {
 
1034
                                unity_files_place_append_events_sorted (data->results, data->results_model, data->groups_model, data->section, data->group_override);
 
1035
                        } else {
 
1036
                                data->uris_ = unity_files_place_utils_get_uri_set (data->results);
 
1037
                                data->n_groups = dee_model_get_n_rows (data->groups_model);
 
1038
                                {
 
1039
                                        data->group_ = (guint) UNITY_FILES_PLACE_GROUP_RECENT;
 
1040
                                        {
 
1041
                                                data->_tmp9_ = TRUE;
 
1042
                                                while (TRUE) {
 
1043
                                                        if (!data->_tmp9_) {
 
1044
                                                                data->group_++;
 
1045
                                                        }
 
1046
                                                        data->_tmp9_ = FALSE;
 
1047
                                                        if (!(data->group_ < data->n_groups)) {
 
1048
                                                                break;
 
1049
                                                        }
 
1050
                                                        unity_files_place_utils_apply_uri_filter (data->uris_, data->_tmp11_ = dee_index_lookup (data->results_by_group, data->_tmp10_ = g_strdup_printf ("%u", data->group_), DEE_TERM_MATCH_EXACT));
 
1051
                                                        _g_object_unref0 (data->_tmp11_);
 
1052
                                                        _g_free0 (data->_tmp10_);
 
1053
                                                }
 
1054
                                        }
 
1055
                                }
 
1056
                                _g_object_unref0 (data->uris_);
 
1057
                        }
965
1058
                        _g_object_unref0 (data->results);
966
1059
                }
967
1060
                goto __finally0;
970
1063
                        data->e = data->_inner_error_;
971
1064
                        data->_inner_error_ = NULL;
972
1065
                        {
973
 
                                g_warning ("daemon.vala:500: Error performing search '%s': %s", data->_tmp6_ = unity_place_search_get_search_string (data->search), data->e->message);
974
 
                                _g_free0 (data->_tmp6_);
 
1066
                                g_warning ("daemon.vala:609: Error performing search '%s': %s", data->_tmp12_ = unity_place_search_get_search_string (data->search), data->e->message);
 
1067
                                _g_free0 (data->_tmp12_);
975
1068
                                _g_error_free0 (data->e);
976
1069
                        }
977
1070
                }
1008
1101
}
1009
1102
 
1010
1103
 
1011
 
static void unity_files_place_daemon_update_without_search_async (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1104
static void unity_files_place_daemon_update_without_search_async (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section, DeeModel* results_model, DeeModel* groups_model, gint group_override, GAsyncReadyCallback _callback_, gpointer _user_data_) {
1012
1105
        UnityFilesPlaceDaemonUpdateWithoutSearchAsyncData* _data_;
1013
1106
        _data_ = g_slice_new0 (UnityFilesPlaceDaemonUpdateWithoutSearchAsyncData);
1014
1107
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, unity_files_place_daemon_update_without_search_async);
1017
1110
        _data_->section = section;
1018
1111
        _data_->results_model = _g_object_ref0 (results_model);
1019
1112
        _data_->groups_model = _g_object_ref0 (groups_model);
 
1113
        _data_->group_override = group_override;
1020
1114
        unity_files_place_daemon_update_without_search_async_co (_data_);
1021
1115
}
1022
1116
 
1052
1146
        }
1053
1147
        _state_0:
1054
1148
        {
 
1149
                data->active_section_hint_new = FALSE;
1055
1150
                if (unity_place_entry_info_get_browser (data->self->priv->files) != NULL) {
1056
1151
                        if (data->section != 0) {
1057
1152
                                data->folder = unity_files_place_daemon_get_folder_for_pathbar_section (data->self, (guint) data->section);
1058
1153
                                {
1059
1154
                                        data->_state_ = 3;
1060
 
                                        unity_files_place_daemon_browse_folder (data->self, data->folder, unity_files_place_daemon_update_without_search_async_ready, data);
 
1155
                                        unity_place_activation_activate ((UnityPlaceActivation*) data->self, data->_tmp0_ = g_file_get_uri (data->folder), unity_files_place_daemon_update_without_search_async_ready, data);
1061
1156
                                        return FALSE;
1062
1157
                                        _state_3:
1063
 
                                        unity_files_place_daemon_browse_folder_finish (data->self, data->_res_);
 
1158
                                        unity_place_activation_activate_finish ((UnityPlaceActivation*) data->self, data->_res_, &data->_inner_error_);
 
1159
                                        _g_free0 (data->_tmp0_);
 
1160
                                        if (data->_inner_error_ != NULL) {
 
1161
                                                if (data->_inner_error_->domain == DBUS_GERROR) {
 
1162
                                                        goto __catch1_dbus_gerror;
 
1163
                                                }
 
1164
                                                _g_object_unref0 (data->folder);
 
1165
                                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, data->_inner_error_->message, g_quark_to_string (data->_inner_error_->domain), data->_inner_error_->code);
 
1166
                                                g_clear_error (&data->_inner_error_);
 
1167
                                                return FALSE;
 
1168
                                        }
1064
1169
                                }
1065
1170
                                goto __finally1;
1066
1171
                                __catch1_dbus_gerror:
1068
1173
                                        data->ee = data->_inner_error_;
1069
1174
                                        data->_inner_error_ = NULL;
1070
1175
                                        {
1071
 
                                                g_warning ("daemon.vala:517: Failed to activate URI '%s': %s", data->_tmp0_ = g_file_get_uri (data->folder), data->ee->message);
1072
 
                                                _g_free0 (data->_tmp0_);
 
1176
                                                g_warning ("daemon.vala:629: Failed to activate URI '%s': %s", data->_tmp1_ = g_file_get_uri (data->folder), data->ee->message);
 
1177
                                                _g_free0 (data->_tmp1_);
1073
1178
                                                _g_error_free0 (data->ee);
1074
1179
                                        }
1075
1180
                                }
1080
1185
                                        g_clear_error (&data->_inner_error_);
1081
1186
                                        return FALSE;
1082
1187
                                }
1083
 
                                g_debug ("daemon.vala:520: Browsed %s from path bar", data->_tmp1_ = g_file_get_uri (data->folder));
1084
 
                                _g_free0 (data->_tmp1_);
 
1188
                                g_debug ("daemon.vala:632: Browsed %s from path bar", data->_tmp2_ = g_file_get_uri (data->folder));
 
1189
                                _g_free0 (data->_tmp2_);
1085
1190
                                _g_object_unref0 (data->folder);
1086
1191
                                {
1087
1192
                                        if (data->_state_ == 0) {
1094
1199
                                }
1095
1200
                                _g_object_unref0 (data->folder);
1096
1201
                        } else {
1097
 
                                g_debug ("daemon.vala:527: Root section of pathbar activated. Leaving browsing m" \
 
1202
                                g_debug ("daemon.vala:639: Root section of pathbar activated. Leaving browsing m" \
1098
1203
"ode");
1099
 
                                unity_files_place_daemon_reset_state (data->self);
 
1204
                                unity_files_place_daemon_reset_state (data->self, data->self->priv->browsing_root);
 
1205
                                unity_place_entry_info_set_hint (data->self->priv->files, UNITY_FILES_PLACE_ACTIVE_SECTION_HINT, (data->_tmp3_ = g_enum_get_value (g_type_class_ref (UNITY_FILES_PLACE_TYPE_SECTION), (int) data->self->priv->browsing_root), (data->_tmp3_ != NULL) ? data->_tmp3_->value_name : NULL));
 
1206
                                data->section = data->self->priv->browsing_root;
 
1207
                                data->active_section_hint_new = TRUE;
1100
1208
                        }
1101
1209
                }
 
1210
                if ((data->_tmp6_ = (data->_tmp5_ = unity_place_entry_info_get_hint (data->self->priv->files, UNITY_FILES_PLACE_ACTIVE_SECTION_HINT)) != NULL, _g_free0 (data->_tmp5_), data->_tmp6_)) {
 
1211
                        data->_tmp4_ = !data->active_section_hint_new;
 
1212
                } else {
 
1213
                        data->_tmp4_ = FALSE;
 
1214
                }
 
1215
                if (data->_tmp4_) {
 
1216
                        unity_place_entry_info_clear_hint (data->self->priv->files, UNITY_FILES_PLACE_ACTIVE_SECTION_HINT);
 
1217
                        g_object_notify ((GObject*) data->self->priv->files, "active-section");
 
1218
                        g_debug ("daemon.vala:656: Clearing active section hint");
 
1219
                }
1102
1220
                data->sections_model = _g_object_ref0 (unity_place_entry_info_get_sections_model (data->self->priv->files));
1103
1221
                if (UNITY_FILES_PLACE_SECTION_LAST_SECTION != dee_model_get_n_rows (data->sections_model)) {
1104
 
                        g_critical ("daemon.vala:536: Section model malformed");
 
1222
                        g_critical ("daemon.vala:663: Section model malformed");
1105
1223
                        _g_object_unref0 (data->sections_model);
1106
1224
                        {
1107
1225
                                if (data->_state_ == 0) {
1114
1232
                        }
1115
1233
                }
1116
1234
                if (data->section > UNITY_FILES_PLACE_SECTION_LAST_SECTION) {
1117
 
                        g_critical ("daemon.vala:542: Active section out of bounds: %u", (guint) data->section);
 
1235
                        g_critical ("daemon.vala:669: Active section out of bounds: %u", (guint) data->section);
1118
1236
                        _g_object_unref0 (data->sections_model);
1119
1237
                        {
1120
1238
                                if (data->_state_ == 0) {
1127
1245
                        }
1128
1246
                }
1129
1247
                data->templates = (GPtrArray*) gee_list_get (data->self->priv->section_templates, (gint) data->section);
 
1248
                if (data->section == UNITY_FILES_PLACE_SECTION_FOLDERS) {
 
1249
                        data->_tmp7_ = ZEITGEIST_RESULT_TYPE_MOST_RECENT_ORIGIN;
 
1250
                } else {
 
1251
                        data->_tmp7_ = ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS;
 
1252
                }
 
1253
                data->result_type = data->_tmp7_;
1130
1254
                {
1131
1255
                        data->_state_ = 4;
1132
 
                        zeitgeist_log_find_events (data->self->priv->log, data->_tmp2_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), ZEITGEIST_STORAGE_STATE_ANY, (guint32) 100, ZEITGEIST_RESULT_TYPE_MOST_RECENT_SUBJECTS, NULL, unity_files_place_daemon_update_without_search_async_ready, data);
 
1256
                        zeitgeist_log_find_events (data->self->priv->log, data->_tmp8_ = g_object_ref_sink (zeitgeist_time_range_new_anytime ()), _g_ptr_array_ref0 (data->templates), ZEITGEIST_STORAGE_STATE_ANY, (guint32) 100, data->result_type, NULL, unity_files_place_daemon_update_without_search_async_ready, data);
1133
1257
                        return FALSE;
1134
1258
                        _state_4:
1135
 
                        data->events = (data->_tmp3_ = zeitgeist_log_find_events_finish (data->self->priv->log, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp2_), data->_tmp3_);
 
1259
                        data->events = (data->_tmp9_ = zeitgeist_log_find_events_finish (data->self->priv->log, data->_res_, &data->_inner_error_), _g_object_unref0 (data->_tmp8_), data->_tmp9_);
1136
1260
                        if (data->_inner_error_ != NULL) {
1137
1261
                                goto __catch2_g_error;
1138
1262
                        }
1139
 
                        g_debug ("daemon.vala:556: Got %u events for section %u", zeitgeist_result_set_size (data->events), (guint) data->section);
 
1263
                        g_debug ("daemon.vala:686: Got %u events for section %u", zeitgeist_result_set_size (data->events), (guint) data->section);
1140
1264
                        dee_model_clear (data->results_model);
1141
1265
                        if (data->section == UNITY_FILES_PLACE_SECTION_ALL_FILES) {
1142
1266
                                data->_state_ = 5;
1150
1274
                                _state_6:
1151
1275
                                unity_files_place_daemon_update_downloads_finish (data->self, data->_res_);
1152
1276
                        }
1153
 
                        unity_files_place_append_events_sorted (data->events, data->results_model, data->groups_model);
 
1277
                        unity_files_place_append_events_sorted (data->events, data->results_model, data->groups_model, data->section, data->group_override);
1154
1278
                        _g_object_unref0 (data->events);
1155
1279
                }
1156
1280
                goto __finally2;
1159
1283
                        data->e = data->_inner_error_;
1160
1284
                        data->_inner_error_ = NULL;
1161
1285
                        {
1162
 
                                g_warning ("daemon.vala:570: Error fetching recetnly used files: %s", data->e->message);
 
1286
                                g_warning ("daemon.vala:702: Error fetching recetnly used files: %s", data->e->message);
1163
1287
                                _g_error_free0 (data->e);
1164
1288
                        }
1165
1289
                }
1263
1387
                        data->e = data->_inner_error_;
1264
1388
                        data->_inner_error_ = NULL;
1265
1389
                        {
1266
 
                                g_warning ("daemon.vala:585: Failed to read favorites: %s", data->e->message);
 
1390
                                g_warning ("daemon.vala:717: Failed to read favorites: %s", data->e->message);
1267
1391
                                _g_error_free0 (data->e);
1268
1392
                                _g_free0 (data->contents);
1269
1393
                                {
1286
1410
                        return FALSE;
1287
1411
                }
1288
1412
                data->favorites = (data->_tmp3_ = data->_tmp2_ = g_strsplit (data->contents, "\n", 0), data->favorites_length1 = _vala_array_length (data->_tmp2_), data->_favorites_size_ = data->favorites_length1, data->_tmp3_);
1289
 
                data->icon_string = (data->_tmp5_ = g_strdup (g_icon_to_string ((GIcon*) (data->_tmp4_ = (GThemedIcon*) g_themed_icon_new ("folder")))), _g_object_unref0 (data->_tmp4_), data->_tmp5_);
 
1413
                data->mimetype = g_strdup ("inode/directory");
1290
1414
                {
1291
 
                        data->fave_collection = data->favorites;
1292
 
                        data->fave_collection_length1 = data->favorites_length1;
1293
 
                        for (data->fave_it = 0; data->fave_it < data->favorites_length1; data->fave_it = data->fave_it + 1) {
1294
 
                                data->fave = g_strdup (data->fave_collection[data->fave_it]);
 
1415
                        data->uri_collection = data->favorites;
 
1416
                        data->uri_collection_length1 = data->favorites_length1;
 
1417
                        for (data->uri_it = 0; data->uri_it < data->favorites_length1; data->uri_it = data->uri_it + 1) {
 
1418
                                data->uri = g_strdup (data->uri_collection[data->uri_it]);
1295
1419
                                {
1296
 
                                        data->f = g_file_new_for_uri (data->fave);
1297
 
                                        dee_model_append (data->results_model, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, data->fave, UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, data->icon_string, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, UNITY_FILES_PLACE_GROUP_FAVORITE_FOLDERS, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, "inode/directory", UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, data->_tmp6_ = g_file_get_basename (data->f), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, data->fave, -1, NULL);
1298
 
                                        _g_free0 (data->_tmp6_);
 
1420
                                        data->f = g_file_new_for_uri (data->uri);
 
1421
                                        data->icon = unity_files_place_utils_get_icon_for_uri (data->uri, data->mimetype);
 
1422
                                        dee_model_append (data->results_model, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, data->uri, UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, data->icon, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, UNITY_FILES_PLACE_GROUP_FAVORITE_FOLDERS, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, data->mimetype, UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, data->_tmp4_ = g_file_get_basename (data->f), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, data->uri, -1, NULL);
 
1423
                                        _g_free0 (data->_tmp4_);
 
1424
                                        _g_free0 (data->icon);
1299
1425
                                        _g_object_unref0 (data->f);
1300
 
                                        _g_free0 (data->fave);
 
1426
                                        _g_free0 (data->uri);
1301
1427
                                }
1302
1428
                        }
1303
1429
                }
1304
 
                _g_free0 (data->icon_string);
 
1430
                _g_free0 (data->mimetype);
1305
1431
                data->favorites = (_vala_array_free (data->favorites, data->favorites_length1, (GDestroyNotify) g_free), NULL);
1306
1432
                _g_free0 (data->contents);
1307
1433
        }
1359
1485
}
1360
1486
 
1361
1487
 
1362
 
static gint _lambda0_ (void* info1, void* info2) {
1363
 
        gint result = 0;
1364
 
        GTimeVal tv1 = {0};
1365
 
        GTimeVal tv2 = {0};
1366
 
        void* _tmp0_;
1367
 
        void* _tmp1_;
1368
 
        glong cmp;
1369
 
        gint _tmp2_ = 0;
1370
 
        g_file_info_get_modification_time ((_tmp0_ = info1, G_IS_FILE_INFO (_tmp0_) ? ((GFileInfo*) _tmp0_) : NULL), &tv1);
1371
 
        g_file_info_get_modification_time ((_tmp1_ = info2, G_IS_FILE_INFO (_tmp1_) ? ((GFileInfo*) _tmp1_) : NULL), &tv2);
1372
 
        cmp = tv1.tv_sec - tv2.tv_sec;
1373
 
        if (cmp < 0) {
1374
 
                _tmp2_ = 1;
1375
 
        } else {
1376
 
                gint _tmp3_ = 0;
1377
 
                if (cmp > 0) {
1378
 
                        _tmp3_ = -1;
1379
 
                } else {
1380
 
                        _tmp3_ = 0;
1381
 
                }
1382
 
                _tmp2_ = _tmp3_;
1383
 
        }
1384
 
        result = _tmp2_;
1385
 
        return result;
1386
 
}
1387
 
 
1388
 
 
1389
 
static gint __lambda0__gcompare_func (void* a, void* b) {
1390
 
        gint result;
1391
 
        result = _lambda0_ (a, b);
1392
 
        return result;
1393
 
}
1394
 
 
1395
 
 
1396
1488
static gboolean unity_files_place_daemon_update_downloads_async_co (UnityFilesPlaceDaemonUpdateDownloadsAsyncData* data) {
1397
1489
        switch (data->_state_) {
1398
1490
                case 0:
1423
1515
                        data->e = data->_inner_error_;
1424
1516
                        data->_inner_error_ = NULL;
1425
1517
                        {
1426
 
                                g_warning ("daemon.vala:617: Failed to list downloads from directory '%s': %s", data->download_path, data->e->message);
 
1518
                                g_warning ("daemon.vala:751: Failed to list downloads from directory '%s': %s", data->download_path, data->e->message);
1427
1519
                                _g_error_free0 (data->e);
1428
1520
                                __g_slist_free_g_object_unref0 (data->downloads);
1429
1521
                                _g_object_unref0 (data->download_dir);
1447
1539
                        g_clear_error (&data->_inner_error_);
1448
1540
                        return FALSE;
1449
1541
                }
1450
 
                data->downloads = g_slist_sort (data->downloads, __lambda0__gcompare_func);
 
1542
                data->downloads = g_slist_sort (data->downloads, (GCompareFunc) unity_files_place_utils_cmp_file_info_by_mtime);
1451
1543
                {
1452
1544
                        data->info_collection = data->downloads;
1453
1545
                        for (data->info_it = data->info_collection; data->info_it != NULL; data->info_it = data->info_it->next) {
1507
1599
                                        guint group_id;
1508
1600
                                        icon = unity_files_place_utils_get_icon_for_uri (zeitgeist_subject_get_uri (su), zeitgeist_subject_get_mimetype (su));
1509
1601
                                        group_id = unity_files_place_utils_get_time_group (ev, groups_model);
1510
 
                                        g_debug ("daemon.vala:671: Notify %s, %s, %u", zeitgeist_subject_get_uri (su), zeitgeist_subject_get_mimetype (su), group_id);
 
1602
                                        g_debug ("daemon.vala:798: Notify %s, %s, %u", zeitgeist_subject_get_uri (su), zeitgeist_subject_get_mimetype (su), group_id);
1511
1603
                                        dee_model_prepend (results_model, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, zeitgeist_subject_get_uri (su), UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, icon, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, group_id, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, zeitgeist_subject_get_mimetype (su), UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, zeitgeist_subject_get_text (su), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, zeitgeist_subject_get_uri (su), -1, NULL);
1512
1604
                                        _g_free0 (icon);
1513
1605
                                }
1521
1613
}
1522
1614
 
1523
1615
 
1524
 
static void unity_files_place_daemon_reset_state (UnityFilesPlaceDaemon* self) {
 
1616
static void unity_files_place_daemon_reset_state (UnityFilesPlaceDaemon* self, UnityFilesPlaceSection section) {
1525
1617
        g_return_if_fail (self != NULL);
1526
1618
        unity_place_entry_info_set_browser (self->priv->files, NULL);
1527
1619
        unity_place_entry_info_set_active_search (self->priv->files, NULL);
1528
 
        unity_place_entry_info_set_active_section (self->priv->files, (guint) UNITY_FILES_PLACE_SECTION_ALL_FILES);
 
1620
        unity_place_entry_info_set_active_section (self->priv->files, (guint) section);
1529
1621
        unity_place_entry_info_set_sections_model (self->priv->files, (DeeModel*) self->priv->sections_model);
 
1622
        unity_place_entry_info_clear_hints (self->priv->files);
1530
1623
}
1531
1624
 
1532
1625
 
1569
1662
}
1570
1663
 
1571
1664
 
 
1665
/**
 
1666
     * Override of the default activation handler. The files place daemon
 
1667
     * can handle activation of folders which puts it into "folder browsing mode"
 
1668
     */
1572
1669
static gboolean unity_files_place_daemon_real_activate_co (UnityFilesPlaceDaemonActivateData* data) {
1573
1670
        switch (data->_state_) {
1574
1671
                case 0:
1580
1677
        {
1581
1678
                data->f = g_file_new_for_uri (data->uri);
1582
1679
                if (g_file_query_file_type (data->f, 0, NULL) != G_FILE_TYPE_DIRECTORY) {
1583
 
                        g_debug ("daemon.vala:705: Declined activation of URI '%s': Not a directory", data->uri);
 
1680
                        g_debug ("daemon.vala:833: Declined activation of URI '%s': Not a directory", data->uri);
1584
1681
                        data->result = FALSE;
1585
1682
                        _g_object_unref0 (data->f);
1586
1683
                        {
1593
1690
                                return FALSE;
1594
1691
                        }
1595
1692
                }
1596
 
                g_debug ("daemon.vala:709: Browsing folder: %s", data->uri);
 
1693
                g_debug ("daemon.vala:837: Browsing folder: %s", data->uri);
1597
1694
                data->state = unity_files_place_browsing_state_new ();
1598
1695
                data->state->search = (data->_tmp0_ = _g_object_ref0 (unity_place_entry_info_get_active_search (data->self->priv->files)), _g_object_unref0 (data->state->search), data->_tmp0_);
1599
1696
                data->state->section = (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (data->self->priv->files);
1698
1795
                        data->err = data->_inner_error_;
1699
1796
                        data->_inner_error_ = NULL;
1700
1797
                        {
1701
 
                                g_warning ("daemon.vala:752: Failed to browse folder '%s': %s", data->_tmp2_ = g_file_get_uri (data->folder), data->err->message);
 
1798
                                g_warning ("daemon.vala:880: Failed to browse folder '%s': %s", data->_tmp2_ = g_file_get_uri (data->folder), data->err->message);
1702
1799
                                _g_free0 (data->_tmp2_);
1703
1800
                                _g_error_free0 (data->err);
1704
1801
                                __g_slist_free_g_object_unref0 (data->file_infos);
1741
1838
                                        data->uri = (data->_tmp5_ = g_file_get_uri (data->_tmp4_ = g_file_get_child (data->folder, g_file_info_get_name (data->info))), _g_object_unref0 (data->_tmp4_), data->_tmp5_);
1742
1839
                                        data->mimetype = g_strdup (g_file_info_get_content_type (data->info));
1743
1840
                                        data->icon_hint = unity_files_place_utils_check_icon_string (data->uri, data->mimetype, data->info);
1744
 
                                        g_debug ("daemon.vala:765: Found child: %s", data->uri);
 
1841
                                        g_debug ("daemon.vala:893: Found child: %s", data->uri);
1745
1842
                                        dee_model_append (data->results_model, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, data->uri, UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, data->icon_hint, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, 0, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, data->mimetype, UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, g_file_info_get_display_name (data->info), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, data->uri, -1, NULL);
1746
1843
                                        _g_free0 (data->icon_hint);
1747
1844
                                        _g_free0 (data->mimetype);
1841
1938
                                        data->e = data->_inner_error_;
1842
1939
                                        data->_inner_error_ = NULL;
1843
1940
                                        {
1844
 
                                                g_warning ("daemon.vala:795: Failed to compute breadcrumb path: %s", data->e->message);
 
1941
                                                g_warning ("daemon.vala:923: Failed to compute breadcrumb path: %s", data->e->message);
1845
1942
                                                _g_error_free0 (data->e);
1846
1943
                                                break;
1847
1944
                                        }
1886
1983
        g_return_val_if_fail (self != NULL, NULL);
1887
1984
        n_path_sections = dee_model_get_n_rows ((DeeModel*) self->priv->pathbar_model);
1888
1985
        if (path_element >= (n_path_sections - 1)) {
1889
 
                g_warning ("daemon.vala:811: Path section out of bounds: %u (of %u)", path_element, n_path_sections);
 
1986
                g_warning ("daemon.vala:939: Path section out of bounds: %u (of %u)", path_element, n_path_sections);
1890
1987
                result = g_file_new_for_path (g_get_home_dir ());
1891
1988
                return result;
1892
1989
        }
1900
1997
                uri = (_tmp0_ = g_file_get_parent (uri), _g_object_unref0 (uri), _tmp0_);
1901
1998
                to_remove--;
1902
1999
        }
1903
 
        g_debug ("daemon.vala:825: For section %u found: %s", path_element, _tmp1_ = g_file_get_uri (uri));
 
2000
        g_debug ("daemon.vala:953: For section %u found: %s", path_element, _tmp1_ = g_file_get_uri (uri));
1904
2001
        _g_free0 (_tmp1_);
1905
2002
        result = uri;
1906
2003
        return result;
1919
2016
}
1920
2017
 
1921
2018
 
 
2019
static void _lambda0_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self) {
 
2020
        UnityFilesPlaceSection section;
 
2021
        DeeModel* _results_model;
 
2022
        DeeModel* _groups_model;
 
2023
        g_return_if_fail (obj != NULL);
 
2024
        g_return_if_fail (pspec != NULL);
 
2025
        section = (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files);
 
2026
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
 
2027
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
 
2028
        if (unity_files_place_daemon_search_is_invalid (self, unity_place_entry_info_get_active_search (self->priv->files))) {
 
2029
                gint _tmp0_ = 0;
 
2030
                gint group_override;
 
2031
                if (section == UNITY_FILES_PLACE_SECTION_ALL_FILES) {
 
2032
                        _tmp0_ = (gint) UNITY_FILES_PLACE_GROUP_RECENT;
 
2033
                } else {
 
2034
                        _tmp0_ = -1;
 
2035
                }
 
2036
                group_override = _tmp0_;
 
2037
                unity_files_place_daemon_update_without_search_async (self, section, _results_model, _groups_model, group_override, NULL, NULL);
 
2038
        } else {
 
2039
                unity_files_place_daemon_update_search_async (self, unity_place_entry_info_get_active_search (self->priv->files), section, _results_model, _groups_model, FALSE, self->priv->entry_results_by_group, -1, NULL, NULL);
 
2040
        }
 
2041
        _g_object_unref0 (_groups_model);
 
2042
        _g_object_unref0 (_results_model);
 
2043
}
 
2044
 
 
2045
 
 
2046
static void __lambda0__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
 
2047
        _lambda0_ (_sender, pspec, self);
 
2048
}
 
2049
 
 
2050
 
1922
2051
static void _lambda1_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self) {
1923
 
        UnityFilesPlaceSection section;
1924
2052
        DeeModel* _results_model;
1925
2053
        DeeModel* _groups_model;
 
2054
        UnityPlaceSearch* search;
 
2055
        UnityFilesPlaceSection section;
 
2056
        UnityPlaceSearch* _tmp1_;
1926
2057
        g_return_if_fail (obj != NULL);
1927
2058
        g_return_if_fail (pspec != NULL);
1928
 
        section = (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files);
1929
2059
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
1930
2060
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
 
2061
        search = _g_object_ref0 (unity_place_entry_info_get_active_search (self->priv->files));
 
2062
        section = (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files);
1931
2063
        if (unity_files_place_daemon_search_is_invalid (self, unity_place_entry_info_get_active_search (self->priv->files))) {
1932
 
                unity_files_place_daemon_update_without_search_async (self, section, _results_model, _groups_model, NULL, NULL);
 
2064
                gint _tmp0_ = 0;
 
2065
                gint group_override;
 
2066
                if (section == UNITY_FILES_PLACE_SECTION_ALL_FILES) {
 
2067
                        _tmp0_ = (gint) UNITY_FILES_PLACE_GROUP_RECENT;
 
2068
                } else {
 
2069
                        _tmp0_ = -1;
 
2070
                }
 
2071
                group_override = _tmp0_;
 
2072
                unity_files_place_daemon_update_without_search_async (self, section, _results_model, _groups_model, group_override, NULL, NULL);
1933
2073
        } else {
1934
 
                unity_files_place_daemon_update_search_async (self, unity_place_entry_info_get_active_search (self->priv->files), section, _results_model, _groups_model, NULL, NULL);
 
2074
                unity_files_place_daemon_update_search_async (self, search, (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files), _results_model, _groups_model, unity_files_place_utils_check_is_filter_search (search, self->priv->previous_search), self->priv->entry_results_by_group, -1, NULL, NULL);
1935
2075
        }
 
2076
        self->priv->previous_search = (_tmp1_ = _g_object_ref0 (search), _g_object_unref0 (self->priv->previous_search), _tmp1_);
 
2077
        _g_object_unref0 (search);
1936
2078
        _g_object_unref0 (_groups_model);
1937
2079
        _g_object_unref0 (_results_model);
1938
2080
}
1946
2088
static void _lambda2_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self) {
1947
2089
        DeeModel* _results_model;
1948
2090
        DeeModel* _groups_model;
 
2091
        UnityPlaceSearch* search;
 
2092
        UnityPlaceSearch* _tmp0_;
1949
2093
        g_return_if_fail (obj != NULL);
1950
2094
        g_return_if_fail (pspec != NULL);
1951
 
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
1952
 
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_entry_renderer_info (self->priv->files)));
1953
 
        unity_files_place_daemon_update_search_async (self, unity_place_entry_info_get_active_search (self->priv->files), (UnityFilesPlaceSection) unity_place_entry_info_get_active_section (self->priv->files), _results_model, _groups_model, NULL, NULL);
 
2095
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_global_renderer_info (self->priv->files)));
 
2096
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_global_renderer_info (self->priv->files)));
 
2097
        search = _g_object_ref0 (unity_place_entry_info_get_active_global_search (self->priv->files));
 
2098
        unity_files_place_daemon_update_search_async (self, search, UNITY_FILES_PLACE_SECTION_ALL_FILES, _results_model, _groups_model, unity_files_place_utils_check_is_filter_search (search, self->priv->previous_search), self->priv->global_results_by_group, (gint) UNITY_FILES_PLACE_GROUP_FILES, NULL, NULL);
 
2099
        self->priv->previous_search = (_tmp0_ = _g_object_ref0 (search), _g_object_unref0 (self->priv->previous_search), _tmp0_);
 
2100
        _g_object_unref0 (search);
1954
2101
        _g_object_unref0 (_groups_model);
1955
2102
        _g_object_unref0 (_results_model);
1956
2103
}
1962
2109
 
1963
2110
 
1964
2111
static void _lambda3_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self) {
1965
 
        DeeModel* _results_model;
1966
 
        DeeModel* _groups_model;
1967
2112
        g_return_if_fail (obj != NULL);
1968
2113
        g_return_if_fail (pspec != NULL);
1969
 
        _results_model = _g_object_ref0 (unity_place_renderer_info_get_results_model (unity_place_entry_info_get_global_renderer_info (self->priv->files)));
1970
 
        _groups_model = _g_object_ref0 (unity_place_renderer_info_get_groups_model (unity_place_entry_info_get_global_renderer_info (self->priv->files)));
1971
 
        unity_files_place_daemon_update_search_async (self, unity_place_entry_info_get_active_global_search (self->priv->files), UNITY_FILES_PLACE_SECTION_ALL_FILES, _results_model, _groups_model, NULL, NULL);
1972
 
        _g_object_unref0 (_groups_model);
1973
 
        _g_object_unref0 (_results_model);
 
2114
        g_debug ("daemon.vala:212: Activated: %i", (gint) unity_place_entry_info_get_active (self->priv->files));
 
2115
        if (!unity_place_entry_info_get_active (self->priv->files)) {
 
2116
                unity_files_place_daemon_reset_state (self, UNITY_FILES_PLACE_SECTION_ALL_FILES);
 
2117
        }
1974
2118
}
1975
2119
 
1976
2120
 
1979
2123
}
1980
2124
 
1981
2125
 
1982
 
static void _lambda4_ (GObject* obj, GParamSpec* pspec, UnityFilesPlaceDaemon* self) {
1983
 
        g_return_if_fail (obj != NULL);
1984
 
        g_return_if_fail (pspec != NULL);
1985
 
        g_debug ("daemon.vala:168: Activated: %i", (gint) unity_place_entry_info_get_active (self->priv->files));
1986
 
        if (!unity_place_entry_info_get_active (self->priv->files)) {
1987
 
                unity_files_place_daemon_reset_state (self);
1988
 
        }
1989
 
}
1990
 
 
1991
 
 
1992
 
static void __lambda4__g_object_notify (GObject* _sender, GParamSpec* pspec, gpointer self) {
1993
 
        _lambda4_ (_sender, pspec, self);
1994
 
}
1995
 
 
1996
 
 
1997
2126
static void _unity_files_place_daemon_on_results_model_ready_dee_shared_model_ready (DeeSharedModel* _sender, gpointer self) {
1998
2127
        unity_files_place_daemon_on_results_model_ready (self, _sender);
1999
2128
}
2000
2129
 
2001
2130
 
 
2131
static void _lambda4_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self) {
 
2132
        gpointer _tmp0_;
 
2133
        gpointer _tmp1_;
 
2134
        GFile* f;
 
2135
        g_return_if_fail (browser != NULL);
 
2136
        g_return_if_fail (comment != NULL);
 
2137
        g_debug ("daemon.vala:251: Go back to: %s", (_tmp0_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp0_) ? ((UnityFilesPlaceBrowsingState*) _tmp0_) : NULL)->uri);
 
2138
        f = g_file_new_for_uri ((_tmp1_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp1_) ? ((UnityFilesPlaceBrowsingState*) _tmp1_) : NULL)->uri);
 
2139
        unity_files_place_daemon_browse_folder (self, f, NULL, NULL);
 
2140
        _g_object_unref0 (f);
 
2141
}
 
2142
 
 
2143
 
 
2144
static void __lambda4__unity_place_browser_back (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self) {
 
2145
        _lambda4_ (_sender, state, comment, self);
 
2146
}
 
2147
 
 
2148
 
2002
2149
static void _lambda5_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self) {
2003
2150
        gpointer _tmp0_;
2004
2151
        gpointer _tmp1_;
2005
2152
        GFile* f;
2006
2153
        g_return_if_fail (browser != NULL);
2007
2154
        g_return_if_fail (comment != NULL);
2008
 
        g_debug ("daemon.vala:207: Go back to: %s", (_tmp0_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp0_) ? ((UnityFilesPlaceBrowsingState*) _tmp0_) : NULL)->uri);
 
2155
        g_debug ("daemon.vala:259: Go forward to: %s", (_tmp0_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp0_) ? ((UnityFilesPlaceBrowsingState*) _tmp0_) : NULL)->uri);
2009
2156
        f = g_file_new_for_uri ((_tmp1_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp1_) ? ((UnityFilesPlaceBrowsingState*) _tmp1_) : NULL)->uri);
2010
2157
        unity_files_place_daemon_browse_folder (self, f, NULL, NULL);
2011
2158
        _g_object_unref0 (f);
2012
2159
}
2013
2160
 
2014
2161
 
2015
 
static void __lambda5__unity_place_browser_back (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self) {
 
2162
static void __lambda5__unity_place_browser_forward (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self) {
2016
2163
        _lambda5_ (_sender, state, comment, self);
2017
2164
}
2018
2165
 
2019
2166
 
2020
 
static void _lambda6_ (UnityPlaceBrowser* browser, gconstpointer state, const char* comment, UnityFilesPlaceDaemon* self) {
2021
 
        gpointer _tmp0_;
2022
 
        gpointer _tmp1_;
2023
 
        GFile* f;
2024
 
        g_return_if_fail (browser != NULL);
2025
 
        g_return_if_fail (comment != NULL);
2026
 
        g_debug ("daemon.vala:215: Go forward to: %s", (_tmp0_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp0_) ? ((UnityFilesPlaceBrowsingState*) _tmp0_) : NULL)->uri);
2027
 
        f = g_file_new_for_uri ((_tmp1_ = state, UNITY_FILES_PLACE_IS_BROWSING_STATE (_tmp1_) ? ((UnityFilesPlaceBrowsingState*) _tmp1_) : NULL)->uri);
2028
 
        unity_files_place_daemon_browse_folder (self, f, NULL, NULL);
2029
 
        _g_object_unref0 (f);
2030
 
}
2031
 
 
2032
 
 
2033
 
static void __lambda6__unity_place_browser_forward (UnityPlaceBrowser* _sender, gconstpointer state, const char* comment, gpointer self) {
2034
 
        _lambda6_ (_sender, state, comment, self);
2035
 
}
2036
 
 
2037
 
 
2038
2167
static GObject * unity_files_place_daemon_constructor (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
2039
2168
        GObject * obj;
2040
2169
        GObjectClass * parent_class;
2054
2183
                GeeList* _tmp2_;
2055
2184
                UnityPlaceEntryInfo* _tmp3_;
2056
2185
                char* _tmp4_;
 
2186
                UnityPlaceSearch* _tmp5_;
 
2187
                DeeAnalyzer* analyzer;
 
2188
                DeeIndex* _tmp6_;
 
2189
                DeeIndex* _tmp7_;
2057
2190
                GPtrArray* templates;
2058
2191
                ZeitgeistEvent* event;
2059
 
                ZeitgeistMonitor* _tmp7_;
2060
 
                GPtrArray* _tmp6_;
2061
 
                ZeitgeistTimeRange* _tmp5_;
2062
 
                ZeitgeistLog* _tmp8_;
2063
 
                ZeitgeistIndex* _tmp9_;
2064
 
                UnityPlaceController* _tmp10_;
2065
 
                UnityPlaceBrowser* _tmp11_;
 
2192
                ZeitgeistMonitor* _tmp10_;
 
2193
                GPtrArray* _tmp9_;
 
2194
                ZeitgeistTimeRange* _tmp8_;
 
2195
                ZeitgeistLog* _tmp11_;
 
2196
                ZeitgeistIndex* _tmp12_;
 
2197
                UnityPlaceController* _tmp13_;
 
2198
                UnityPlaceBrowser* _tmp14_;
2066
2199
                self->priv->sections_model = (_tmp0_ = (DeeSharedModel*) dee_shared_model_new ("com.canonical.Unity.FilesPlace.SectionsModel", (guint) 2, G_TYPE_STRING, G_TYPE_STRING, NULL), _g_object_unref0 (self->priv->sections_model), _tmp0_);
2067
2200
                self->priv->pathbar_model = (_tmp1_ = (DeeSharedModel*) dee_shared_model_new ("com.canonical.Unity.FilesPlace.PathBarModel", (guint) 2, G_TYPE_STRING, G_TYPE_STRING, NULL), _g_object_unref0 (self->priv->pathbar_model), _tmp1_);
2068
2201
                groups_model = (DeeSharedModel*) dee_shared_model_new ("com.canonical.Unity.FilesPlace.GroupsModel", (guint) 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, NULL);
2081
2214
                unity_files_place_daemon_populate_groups (self);
2082
2215
                unity_place_entry_info_set_icon (self->priv->files, _tmp4_ = g_strconcat (string_to_string (CONFIG_PREFIX), "/share/unity/files.png", NULL));
2083
2216
                _g_free0 (_tmp4_);
 
2217
                self->priv->previous_search = (_tmp5_ = NULL, _g_object_unref0 (self->priv->previous_search), _tmp5_);
 
2218
                analyzer = dee_analyzer_new_for_uint_column ((guint) UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID);
 
2219
                self->priv->entry_results_by_group = (_tmp6_ = (DeeIndex*) dee_hash_index_new ((DeeModel*) results_model, analyzer), _g_object_unref0 (self->priv->entry_results_by_group), _tmp6_);
 
2220
                self->priv->global_results_by_group = (_tmp7_ = (DeeIndex*) dee_hash_index_new ((DeeModel*) global_results_model, analyzer), _g_object_unref0 (self->priv->global_results_by_group), _tmp7_);
2084
2221
                templates = g_ptr_array_new ();
2085
2222
                event = g_object_ref_sink (zeitgeist_event_new ());
2086
2223
                g_ptr_array_add (templates, event);
2087
 
                self->priv->monitor = (_tmp7_ = zeitgeist_monitor_new (_tmp5_ = g_object_ref_sink (zeitgeist_time_range_new_from_now ()), (_tmp6_ = templates, templates = NULL, _tmp6_)), _g_object_unref0 (self->priv->monitor), _tmp7_);
2088
 
                _g_object_unref0 (_tmp5_);
2089
 
                self->priv->log = (_tmp8_ = zeitgeist_log_new (), _g_object_unref0 (self->priv->log), _tmp8_);
2090
 
                self->priv->index = (_tmp9_ = zeitgeist_index_new (), _g_object_unref0 (self->priv->index), _tmp9_);
2091
 
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-section", (GCallback) __lambda1__g_object_notify, self, 0);
2092
 
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-search", (GCallback) __lambda2__g_object_notify, self, 0);
2093
 
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-global-search", (GCallback) __lambda3__g_object_notify, self, 0);
2094
 
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active", (GCallback) __lambda4__g_object_notify, self, 0);
 
2224
                self->priv->monitor = (_tmp10_ = zeitgeist_monitor_new (_tmp8_ = g_object_ref_sink (zeitgeist_time_range_new_from_now ()), (_tmp9_ = templates, templates = NULL, _tmp9_)), _g_object_unref0 (self->priv->monitor), _tmp10_);
 
2225
                _g_object_unref0 (_tmp8_);
 
2226
                self->priv->log = (_tmp11_ = zeitgeist_log_new (), _g_object_unref0 (self->priv->log), _tmp11_);
 
2227
                self->priv->index = (_tmp12_ = zeitgeist_index_new (), _g_object_unref0 (self->priv->index), _tmp12_);
 
2228
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-section", (GCallback) __lambda0__g_object_notify, self, 0);
 
2229
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-search", (GCallback) __lambda1__g_object_notify, self, 0);
 
2230
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active-global-search", (GCallback) __lambda2__g_object_notify, self, 0);
 
2231
                g_signal_connect_object ((GObject*) self->priv->files, "notify::active", (GCallback) __lambda3__g_object_notify, self, 0);
2095
2232
                g_signal_connect_object (results_model, "ready", (GCallback) _unity_files_place_daemon_on_results_model_ready_dee_shared_model_ready, self, 0);
2096
2233
                dee_shared_model_connect (self->priv->sections_model);
2097
2234
                dee_shared_model_connect (self->priv->pathbar_model);
2099
2236
                dee_shared_model_connect (global_groups_model);
2100
2237
                dee_shared_model_connect (results_model);
2101
2238
                dee_shared_model_connect (global_results_model);
2102
 
                self->priv->control = (_tmp10_ = unity_place_controller_new ("/com/canonical/unity/filesplace"), _g_object_unref0 (self->priv->control), _tmp10_);
 
2239
                self->priv->control = (_tmp13_ = unity_place_controller_new ("/com/canonical/unity/filesplace"), _g_object_unref0 (self->priv->control), _tmp13_);
2103
2240
                unity_place_controller_add_entry (self->priv->control, self->priv->files);
2104
2241
                unity_place_controller_set_activation (self->priv->control, (UnityPlaceActivation*) self);
2105
2242
                {
2110
2247
                                }
2111
2248
                                _g_object_unref0 (event);
2112
2249
                                _g_ptr_array_unref0 (templates);
 
2250
                                _g_free0 (analyzer);
2113
2251
                                _g_object_unref0 (global_results_model);
2114
2252
                                _g_object_unref0 (results_model);
2115
2253
                                _g_object_unref0 (global_groups_model);
2125
2263
                        _error_ = _inner_error_;
2126
2264
                        _inner_error_ = NULL;
2127
2265
                        {
2128
 
                                g_critical ("daemon.vala:194: Failed to export DBus service for '%s': %s", unity_place_controller_get_dbus_path (self->priv->control), _error_->message);
 
2266
                                g_critical ("daemon.vala:238: Failed to export DBus service for '%s': %s", unity_place_controller_get_dbus_path (self->priv->control), _error_->message);
2129
2267
                                _g_error_free0 (_error_);
2130
2268
                        }
2131
2269
                }
2133
2271
                if (_inner_error_ != NULL) {
2134
2272
                        _g_object_unref0 (event);
2135
2273
                        _g_ptr_array_unref0 (templates);
 
2274
                        _g_free0 (analyzer);
2136
2275
                        _g_object_unref0 (global_results_model);
2137
2276
                        _g_object_unref0 (results_model);
2138
2277
                        _g_object_unref0 (global_groups_model);
2140
2279
                        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);
2141
2280
                        g_clear_error (&_inner_error_);
2142
2281
                }
2143
 
                self->priv->browser = (_tmp11_ = unity_place_browser_new (UNITY_FILES_PLACE_TYPE_BROWSING_STATE, (GBoxedCopyFunc) unity_files_place_browsing_state_ref, unity_files_place_browsing_state_unref, "/com/canonical/unity/filesplace/browser"), _g_object_unref0 (self->priv->browser), _tmp11_);
2144
 
                g_signal_connect_object (self->priv->browser, "back", (GCallback) __lambda5__unity_place_browser_back, self, 0);
2145
 
                g_signal_connect_object (self->priv->browser, "forward", (GCallback) __lambda6__unity_place_browser_forward, self, 0);
 
2282
                self->priv->browser = (_tmp14_ = unity_place_browser_new (UNITY_FILES_PLACE_TYPE_BROWSING_STATE, (GBoxedCopyFunc) unity_files_place_browsing_state_ref, unity_files_place_browsing_state_unref, "/com/canonical/unity/filesplace/browser"), _g_object_unref0 (self->priv->browser), _tmp14_);
 
2283
                g_signal_connect_object (self->priv->browser, "back", (GCallback) __lambda4__unity_place_browser_back, self, 0);
 
2284
                g_signal_connect_object (self->priv->browser, "forward", (GCallback) __lambda5__unity_place_browser_forward, self, 0);
2146
2285
                _g_object_unref0 (event);
2147
2286
                _g_ptr_array_unref0 (templates);
 
2287
                _g_free0 (analyzer);
2148
2288
                _g_object_unref0 (global_results_model);
2149
2289
                _g_object_unref0 (results_model);
2150
2290
                _g_object_unref0 (global_groups_model);
2267
2407
        _g_free0 (self->priv->browsing_uri);
2268
2408
        _g_object_unref0 (self->priv->section_templates);
2269
2409
        _g_object_unref0 (self->priv->months);
 
2410
        _g_object_unref0 (self->priv->previous_search);
 
2411
        _g_object_unref0 (self->priv->entry_results_by_group);
 
2412
        _g_object_unref0 (self->priv->global_results_by_group);
2270
2413
        G_OBJECT_CLASS (unity_files_place_daemon_parent_class)->finalize (obj);
2271
2414
}
2272
2415
 
2285
2428
}
2286
2429
 
2287
2430
 
2288
 
void unity_files_place_append_events_sorted (ZeitgeistResultSet* events, DeeModel* results, DeeModel* groups) {
 
2431
void unity_files_place_append_events_sorted (ZeitgeistResultSet* events, DeeModel* results, DeeModel* groups, UnityFilesPlaceSection section, gint group_override) {
 
2432
        GError * _inner_error_;
2289
2433
        g_return_if_fail (events != NULL);
2290
2434
        g_return_if_fail (results != NULL);
2291
2435
        g_return_if_fail (groups != NULL);
 
2436
        _inner_error_ = NULL;
2292
2437
        {
2293
2438
                ZeitgeistResultSet* _ev_it;
2294
2439
                ZeitgeistEvent* ev;
2304
2449
                                gboolean _tmp1_;
2305
2450
                                su = _g_object_ref0 (zeitgeist_event_get_subject (ev, 0));
2306
2451
                                if ((_tmp1_ = g_file_query_exists (_tmp0_ = g_file_new_for_uri (zeitgeist_subject_get_uri (su)), NULL) == TRUE, _g_object_unref0 (_tmp0_), _tmp1_)) {
 
2452
                                        char* uri;
 
2453
                                        char* display_name;
 
2454
                                        char* mimetype;
2307
2455
                                        char* icon;
2308
 
                                        guint group_id;
2309
 
                                        icon = unity_files_place_utils_get_icon_for_uri (zeitgeist_subject_get_uri (su), zeitgeist_subject_get_mimetype (su));
2310
 
                                        group_id = unity_files_place_utils_get_time_group (ev, groups);
2311
 
                                        dee_model_append (results, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, zeitgeist_subject_get_uri (su), UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, icon, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, group_id, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, zeitgeist_subject_get_mimetype (su), UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, zeitgeist_subject_get_text (su), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, zeitgeist_subject_get_uri (su), -1, NULL);
 
2456
                                        guint group_id = 0U;
 
2457
                                        uri = g_strdup (zeitgeist_subject_get_uri (su));
 
2458
                                        display_name = g_strdup (zeitgeist_subject_get_text (su));
 
2459
                                        mimetype = g_strdup (zeitgeist_subject_get_mimetype (su));
 
2460
                                        if (section == UNITY_FILES_PLACE_SECTION_FOLDERS) {
 
2461
                                                GFile* _tmp2_;
 
2462
                                                GFile* _tmp3_;
 
2463
                                                GFile* dir;
 
2464
                                                char* _tmp4_;
 
2465
                                                char* _tmp7_;
 
2466
                                                dir = (_tmp3_ = g_file_get_parent (_tmp2_ = g_file_new_for_uri (uri)), _g_object_unref0 (_tmp2_), _tmp3_);
 
2467
                                                uri = (_tmp4_ = g_file_get_uri (dir), _g_free0 (uri), _tmp4_);
 
2468
                                                {
 
2469
                                                        GFileInfo* info;
 
2470
                                                        char* _tmp5_;
 
2471
                                                        info = g_file_query_info (dir, G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, G_FILE_QUERY_INFO_NONE, NULL, &_inner_error_);
 
2472
                                                        if (_inner_error_ != NULL) {
 
2473
                                                                goto __catch8_g_error;
 
2474
                                                        }
 
2475
                                                        display_name = (_tmp5_ = g_strdup (g_file_info_get_display_name (info)), _g_free0 (display_name), _tmp5_);
 
2476
                                                        _g_object_unref0 (info);
 
2477
                                                }
 
2478
                                                goto __finally8;
 
2479
                                                __catch8_g_error:
 
2480
                                                {
 
2481
                                                        GError * e;
 
2482
                                                        e = _inner_error_;
 
2483
                                                        _inner_error_ = NULL;
 
2484
                                                        {
 
2485
                                                                char* _tmp6_;
 
2486
                                                                g_warning ("daemon.vala:991: Unable to get display name for %s", uri);
 
2487
                                                                display_name = (_tmp6_ = g_file_get_basename (dir), _g_free0 (display_name), _tmp6_);
 
2488
                                                                _g_error_free0 (e);
 
2489
                                                        }
 
2490
                                                }
 
2491
                                                __finally8:
 
2492
                                                if (_inner_error_ != NULL) {
 
2493
                                                        _g_object_unref0 (dir);
 
2494
                                                        _g_free0 (mimetype);
 
2495
                                                        _g_free0 (display_name);
 
2496
                                                        _g_free0 (uri);
 
2497
                                                        _g_object_unref0 (su);
 
2498
                                                        _g_object_unref0 (_ev_it);
 
2499
                                                        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);
 
2500
                                                        g_clear_error (&_inner_error_);
 
2501
                                                        return;
 
2502
                                                }
 
2503
                                                mimetype = (_tmp7_ = g_strdup ("inode/directory"), _g_free0 (mimetype), _tmp7_);
 
2504
                                                _g_object_unref0 (dir);
 
2505
                                        }
 
2506
                                        icon = unity_files_place_utils_get_icon_for_uri (uri, mimetype);
 
2507
                                        if (group_override >= 0) {
 
2508
                                                group_id = (guint) group_override;
 
2509
                                        } else {
 
2510
                                                group_id = unity_files_place_utils_get_time_group (ev, groups);
 
2511
                                        }
 
2512
                                        dee_model_append (results, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, uri, UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, icon, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, group_id, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, mimetype, UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, display_name, UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, uri, -1, NULL);
2312
2513
                                        _g_free0 (icon);
 
2514
                                        _g_free0 (mimetype);
 
2515
                                        _g_free0 (display_name);
 
2516
                                        _g_free0 (uri);
2313
2517
                                }
2314
2518
                                _g_object_unref0 (su);
2315
2519
                        }
2350
2554
                                        }
2351
2555
                                        gee_collection_add ((GeeCollection*) seen_uris, uri);
2352
2556
                                        icon = g_strdup ("");
2353
 
                                        g_debug ("daemon.vala:891: Got %s, %s, %u", uri, zeitgeist_subject_get_mimetype (su), (guint) UNITY_FILES_PLACE_GROUP_TOP_RESULTS);
 
2557
                                        g_debug ("daemon.vala:1046: Got %s, %s, %u", uri, zeitgeist_subject_get_mimetype (su), (guint) UNITY_FILES_PLACE_GROUP_TOP_RESULTS);
2354
2558
                                        dee_model_append (results, UNITY_FILES_PLACE_RESULTS_COLUMN_URI, uri, UNITY_FILES_PLACE_RESULTS_COLUMN_ICON_HINT, icon, UNITY_FILES_PLACE_RESULTS_COLUMN_GROUP_ID, UNITY_FILES_PLACE_GROUP_TOP_RESULTS, UNITY_FILES_PLACE_RESULTS_COLUMN_MIMETYPE, zeitgeist_subject_get_mimetype (su), UNITY_FILES_PLACE_RESULTS_COLUMN_DISPLAY_NAME, zeitgeist_subject_get_text (su), UNITY_FILES_PLACE_RESULTS_COLUMN_COMMENT, uri, -1, NULL);
2355
2559
                                        _g_free0 (icon);
2356
2560
                                }