Merge lp:~timo-jyrinki/unity-lens-files/precise.sru.hiddenfiles into lp:ubuntu/precise/unity-lens-files

Proposed by Timo Jyrinki on 2013-05-07
Status: Merged
Merge reported by: St├ęphane Graber
Merged at revision: not available
Proposed branch: lp:~timo-jyrinki/unity-lens-files/precise.sru.hiddenfiles
Merge into: lp:ubuntu/precise/unity-lens-files
Diff against target: 1225 lines (+503/-419) 4 files modified
To merge this branch: bzr merge lp:~timo-jyrinki/unity-lens-files/precise.sru.hiddenfiles
Reviewer Review Type Date Requested Status
Didier Roche Approve on 2013-06-12
Ubuntu branches 2013-05-07 Pending
Review via email: mp+162780@code.launchpad.net

Commit Message

* Cherry-pick a fix from upstream:
  - Check paths for "/." substring to exclude hidden files (LP: #878052)

Description of the Change

For didrocks.

To post a comment you must log in.
Didier Roche (didrocks) wrote :

pushing to ~ubuntu-desktop/unity-lens-files/precise

review: Approve

Preview Diff

1=== modified file 'debian/changelog'
2--- debian/changelog 2012-04-12 11:46:22 +0000
3+++ debian/changelog 2013-05-07 13:15:37 +0000
4@@ -1,3 +1,10 @@
5+unity-lens-files (5.10.0-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * Cherry-pick a fix from upstream:
8+ - Check paths for "/." substring to exclude hidden files (LP: #878052)
9+
10+ -- Timo Jyrinki <timo-jyrinki@ubuntu.com> Wed, 27 Feb 2013 12:05:24 +0200
11+
12 unity-lens-files (5.10.0-0ubuntu1) precise; urgency=low
13
14 * New upstream release.
15
16=== modified file 'src/daemon.c'
17--- src/daemon.c 2012-04-12 11:46:22 +0000
18+++ src/daemon.c 2013-05-07 13:15:37 +0000
19@@ -4374,12 +4374,25 @@
20 }
21
22
23+static gboolean string_contains (const gchar* self, const gchar* needle) {
24+ gboolean result = FALSE;
25+ const gchar* _tmp0_;
26+ gchar* _tmp1_ = NULL;
27+ g_return_val_if_fail (self != NULL, FALSE);
28+ g_return_val_if_fail (needle != NULL, FALSE);
29+ _tmp0_ = needle;
30+ _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_);
31+ result = _tmp1_ != NULL;
32+ return result;
33+}
34+
35+
36 void unity_files_lens_append_events_sorted (const gchar* search_string, ZeitgeistResultSet* events, DeeModel* results, gint64 min_size, gint64 max_size, UnityFilesLensResultFlags flags, GeeSet* excluded_uris, gint category_override) {
37 ZeitgeistResultSet* _tmp0_;
38 guint category_id = 0U;
39 GeeSet* extracted_directories;
40 UnityFilesLensResultFlags _tmp1_;
41- GeeSet* _tmp175_;
42+ GeeSet* _tmp187_;
43 GError * _inner_error_ = NULL;
44 g_return_if_fail (search_string != NULL);
45 g_return_if_fail (results != NULL);
46@@ -4395,8 +4408,8 @@
47 gchar* folded_search;
48 GeeHashSet* _tmp4_;
49 GeeHashSet* origins;
50- ZeitgeistResultSet* _tmp71_;
51- guint _tmp72_ = 0U;
52+ ZeitgeistResultSet* _tmp78_;
53+ guint _tmp79_ = 0U;
54 _tmp2_ = search_string;
55 _tmp3_ = g_utf8_casefold (_tmp2_, (gssize) (-1));
56 folded_search = _tmp3_;
57@@ -4518,90 +4531,117 @@
58 if (_tmp40_) {
59 GFile* _tmp41_;
60 gchar* _tmp42_ = NULL;
61- gchar* _tmp43_;
62- gchar* _tmp44_ = NULL;
63- gchar* _tmp45_;
64+ gchar* path;
65+ gboolean _tmp43_ = FALSE;
66+ const gchar* _tmp44_;
67+ gboolean _tmp47_;
68+ GFile* _tmp48_;
69+ gchar* _tmp49_ = NULL;
70+ gchar* _tmp50_;
71+ gchar* _tmp51_ = NULL;
72+ gchar* _tmp52_;
73 gchar* display_name;
74- const gchar* _tmp46_;
75- gchar* _tmp47_ = NULL;
76- gchar* _tmp48_;
77- const gchar* _tmp49_;
78- gboolean _tmp50_ = FALSE;
79- gboolean _tmp51_;
80- GeeHashSet* _tmp69_;
81- const gchar* _tmp70_;
82+ const gchar* _tmp53_;
83+ gchar* _tmp54_ = NULL;
84+ gchar* _tmp55_;
85+ const gchar* _tmp56_;
86+ gboolean _tmp57_ = FALSE;
87+ gboolean _tmp58_;
88+ GeeHashSet* _tmp76_;
89+ const gchar* _tmp77_;
90 _tmp41_ = f;
91- _tmp42_ = g_file_get_parse_name (_tmp41_);
92- _tmp43_ = _tmp42_;
93- _tmp44_ = g_path_get_basename (_tmp43_);
94- _tmp45_ = _tmp44_;
95- _g_free0 (_tmp43_);
96- display_name = _tmp45_;
97- _tmp46_ = display_name;
98- _tmp47_ = g_utf8_casefold (_tmp46_, (gssize) (-1));
99- _tmp48_ = _tmp47_;
100- _tmp49_ = folded_search;
101- _tmp50_ = g_str_has_prefix (_tmp48_, _tmp49_);
102- _tmp51_ = _tmp50_;
103- _g_free0 (_tmp48_);
104- if (_tmp51_) {
105- gchar* _tmp52_;
106+ _tmp42_ = g_file_get_path (_tmp41_);
107+ path = _tmp42_;
108+ _tmp44_ = path;
109+ if (_tmp44_ != NULL) {
110+ const gchar* _tmp45_;
111+ gboolean _tmp46_ = FALSE;
112+ _tmp45_ = path;
113+ _tmp46_ = string_contains (_tmp45_, "/.");
114+ _tmp43_ = _tmp46_;
115+ } else {
116+ _tmp43_ = FALSE;
117+ }
118+ _tmp47_ = _tmp43_;
119+ if (_tmp47_) {
120+ _g_free0 (path);
121+ _g_object_unref0 (f);
122+ _g_free0 (origin);
123+ continue;
124+ }
125+ _tmp48_ = f;
126+ _tmp49_ = g_file_get_parse_name (_tmp48_);
127+ _tmp50_ = _tmp49_;
128+ _tmp51_ = g_path_get_basename (_tmp50_);
129+ _tmp52_ = _tmp51_;
130+ _g_free0 (_tmp50_);
131+ display_name = _tmp52_;
132+ _tmp53_ = display_name;
133+ _tmp54_ = g_utf8_casefold (_tmp53_, (gssize) (-1));
134+ _tmp55_ = _tmp54_;
135+ _tmp56_ = folded_search;
136+ _tmp57_ = g_str_has_prefix (_tmp55_, _tmp56_);
137+ _tmp58_ = _tmp57_;
138+ _g_free0 (_tmp55_);
139+ if (_tmp58_) {
140+ gchar* _tmp59_;
141 gchar* mimetype;
142- const gchar* _tmp53_;
143- const gchar* _tmp54_;
144- gchar* _tmp55_ = NULL;
145+ const gchar* _tmp60_;
146+ const gchar* _tmp61_;
147+ gchar* _tmp62_ = NULL;
148 gchar* icon;
149- gint _tmp56_;
150- DeeModel* _tmp58_;
151- const gchar* _tmp59_;
152- const gchar* _tmp60_;
153- guint _tmp61_;
154- const gchar* _tmp62_;
155- const gchar* _tmp63_;
156- const gchar* _tmp64_;
157- _tmp52_ = g_strdup ("inode/directory");
158- mimetype = _tmp52_;
159- _tmp53_ = origin;
160- _tmp54_ = mimetype;
161- _tmp55_ = unity_files_lens_utils_get_icon_for_uri (_tmp53_, _tmp54_);
162- icon = _tmp55_;
163- _tmp56_ = category_override;
164- if (_tmp56_ >= 0) {
165- gint _tmp57_;
166- _tmp57_ = category_override;
167- category_id = (guint) _tmp57_;
168+ gint _tmp63_;
169+ DeeModel* _tmp65_;
170+ const gchar* _tmp66_;
171+ const gchar* _tmp67_;
172+ guint _tmp68_;
173+ const gchar* _tmp69_;
174+ const gchar* _tmp70_;
175+ const gchar* _tmp71_;
176+ _tmp59_ = g_strdup ("inode/directory");
177+ mimetype = _tmp59_;
178+ _tmp60_ = origin;
179+ _tmp61_ = mimetype;
180+ _tmp62_ = unity_files_lens_utils_get_icon_for_uri (_tmp60_, _tmp61_);
181+ icon = _tmp62_;
182+ _tmp63_ = category_override;
183+ if (_tmp63_ >= 0) {
184+ gint _tmp64_;
185+ _tmp64_ = category_override;
186+ category_id = (guint) _tmp64_;
187 } else {
188 category_id = (guint) UNITY_FILES_LENS_CATEGORIES_FOLDERS;
189 }
190- _tmp58_ = results;
191- _tmp59_ = origin;
192- _tmp60_ = icon;
193- _tmp61_ = category_id;
194- _tmp62_ = mimetype;
195- _tmp63_ = display_name;
196- _tmp64_ = origin;
197- dee_model_append (_tmp58_, _tmp59_, _tmp60_, _tmp61_, _tmp62_, _tmp63_, "", _tmp64_, NULL);
198+ _tmp65_ = results;
199+ _tmp66_ = origin;
200+ _tmp67_ = icon;
201+ _tmp68_ = category_id;
202+ _tmp69_ = mimetype;
203+ _tmp70_ = display_name;
204+ _tmp71_ = origin;
205+ dee_model_append (_tmp65_, _tmp66_, _tmp67_, _tmp68_, _tmp69_, _tmp70_, "", _tmp71_, NULL);
206 _g_free0 (icon);
207 _g_free0 (mimetype);
208 } else {
209- GeeSet* _tmp65_;
210- GeeSet* _tmp67_;
211- const gchar* _tmp68_;
212- _tmp65_ = extracted_directories;
213- if (_tmp65_ == NULL) {
214- GeeHashSet* _tmp66_;
215- _tmp66_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
216+ GeeSet* _tmp72_;
217+ GeeSet* _tmp74_;
218+ const gchar* _tmp75_;
219+ _tmp72_ = extracted_directories;
220+ if (_tmp72_ == NULL) {
221+ GeeHashSet* _tmp73_;
222+ _tmp73_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
223 _g_object_unref0 (extracted_directories);
224- extracted_directories = (GeeSet*) _tmp66_;
225+ extracted_directories = (GeeSet*) _tmp73_;
226 }
227- _tmp67_ = extracted_directories;
228- _tmp68_ = origin;
229- gee_collection_add ((GeeCollection*) _tmp67_, _tmp68_);
230+ _tmp74_ = extracted_directories;
231+ _tmp75_ = origin;
232+ gee_collection_add ((GeeCollection*) _tmp74_, _tmp75_);
233 }
234- _tmp69_ = origins;
235- _tmp70_ = origin;
236- gee_abstract_collection_add ((GeeAbstractCollection*) _tmp69_, _tmp70_);
237+ _tmp76_ = origins;
238+ _tmp77_ = origin;
239+ gee_abstract_collection_add ((GeeAbstractCollection*) _tmp76_, _tmp77_);
240 _g_free0 (display_name);
241+ _g_free0 (path);
242 }
243 _g_object_unref0 (f);
244 _g_free0 (origin);
245@@ -4609,184 +4649,184 @@
246 }
247 _g_object_unref0 (_ev_it);
248 }
249- _tmp71_ = events;
250- _tmp72_ = zeitgeist_result_set_size (_tmp71_);
251- if (_tmp72_ > ((guint) 0)) {
252- ZeitgeistResultSet* _tmp73_;
253- _tmp73_ = events;
254- zeitgeist_result_set_seek (_tmp73_, (guint) 0);
255+ _tmp78_ = events;
256+ _tmp79_ = zeitgeist_result_set_size (_tmp78_);
257+ if (_tmp79_ > ((guint) 0)) {
258+ ZeitgeistResultSet* _tmp80_;
259+ _tmp80_ = events;
260+ zeitgeist_result_set_seek (_tmp80_, (guint) 0);
261 }
262 _g_object_unref0 (origins);
263 _g_free0 (folded_search);
264 }
265 {
266- ZeitgeistResultSet* _tmp74_;
267- ZeitgeistResultSet* _tmp75_ = NULL;
268+ ZeitgeistResultSet* _tmp81_;
269+ ZeitgeistResultSet* _tmp82_ = NULL;
270 ZeitgeistResultSet* _ev_it;
271 ZeitgeistEvent* ev = NULL;
272- _tmp74_ = events;
273- _tmp75_ = _vala_zeitgeist_result_set_iterator (_tmp74_);
274- _ev_it = _tmp75_;
275+ _tmp81_ = events;
276+ _tmp82_ = _vala_zeitgeist_result_set_iterator (_tmp81_);
277+ _ev_it = _tmp82_;
278 while (TRUE) {
279- ZeitgeistResultSet* _tmp76_;
280- ZeitgeistEvent* _tmp77_ = NULL;
281- ZeitgeistEvent* _tmp78_;
282- ZeitgeistEvent* _tmp79_;
283- gint _tmp80_ = 0;
284- _tmp76_ = _ev_it;
285- _tmp77_ = _vala_zeitgeist_result_set_next_value (_tmp76_);
286- ev = _tmp77_;
287- _tmp78_ = ev;
288- if (!(_tmp78_ != NULL)) {
289+ ZeitgeistResultSet* _tmp83_;
290+ ZeitgeistEvent* _tmp84_ = NULL;
291+ ZeitgeistEvent* _tmp85_;
292+ ZeitgeistEvent* _tmp86_;
293+ gint _tmp87_ = 0;
294+ _tmp83_ = _ev_it;
295+ _tmp84_ = _vala_zeitgeist_result_set_next_value (_tmp83_);
296+ ev = _tmp84_;
297+ _tmp85_ = ev;
298+ if (!(_tmp85_ != NULL)) {
299 break;
300 }
301- _tmp79_ = ev;
302- _tmp80_ = zeitgeist_event_num_subjects (_tmp79_);
303- if (_tmp80_ > 0) {
304- ZeitgeistEvent* _tmp81_;
305- ZeitgeistSubject* _tmp82_ = NULL;
306- ZeitgeistSubject* _tmp83_;
307+ _tmp86_ = ev;
308+ _tmp87_ = zeitgeist_event_num_subjects (_tmp86_);
309+ if (_tmp87_ > 0) {
310+ ZeitgeistEvent* _tmp88_;
311+ ZeitgeistSubject* _tmp89_ = NULL;
312+ ZeitgeistSubject* _tmp90_;
313 ZeitgeistSubject* su;
314 gchar* uri = NULL;
315 gchar* display_name = NULL;
316 gchar* mimetype = NULL;
317- UnityFilesLensResultFlags _tmp84_;
318- const gchar* _tmp106_;
319- const gchar* _tmp107_;
320- GFile* _tmp108_ = NULL;
321+ UnityFilesLensResultFlags _tmp91_;
322+ const gchar* _tmp113_;
323+ const gchar* _tmp114_;
324+ GFile* _tmp115_ = NULL;
325 GFile* file;
326- gboolean _tmp109_ = FALSE;
327- GeeSet* _tmp110_;
328- gboolean _tmp116_;
329- gboolean _tmp117_ = FALSE;
330- const gchar* _tmp118_;
331- gboolean _tmp120_;
332- gboolean _tmp125_ = FALSE;
333- gint64 _tmp126_;
334- gboolean _tmp129_;
335+ gboolean _tmp116_ = FALSE;
336+ GeeSet* _tmp117_;
337+ gboolean _tmp123_;
338+ gboolean _tmp124_ = FALSE;
339+ const gchar* _tmp125_;
340+ gboolean _tmp127_;
341+ gboolean _tmp132_ = FALSE;
342+ gint64 _tmp133_;
343+ gboolean _tmp136_;
344 gboolean check_size;
345 GFileType file_type;
346- GFile* _tmp130_;
347- gboolean _tmp131_ = FALSE;
348- const gchar* _tmp152_;
349- const gchar* _tmp153_;
350- gchar* _tmp154_ = NULL;
351+ GFile* _tmp137_;
352+ gboolean _tmp138_ = FALSE;
353+ const gchar* _tmp164_;
354+ const gchar* _tmp165_;
355+ gchar* _tmp166_ = NULL;
356 gchar* icon;
357- GFile* _tmp155_;
358- gchar* _tmp156_ = NULL;
359+ GFile* _tmp167_;
360+ gchar* _tmp168_ = NULL;
361 gchar* comment;
362- GFileType _tmp157_;
363+ GFileType _tmp169_;
364 gboolean is_dir;
365- gboolean _tmp158_ = FALSE;
366- gboolean _tmp159_;
367- gboolean _tmp161_;
368- gint _tmp162_;
369- DeeModel* _tmp167_;
370- const gchar* _tmp168_;
371- const gchar* _tmp169_;
372- guint _tmp170_;
373- const gchar* _tmp171_;
374- const gchar* _tmp172_;
375- const gchar* _tmp173_;
376- const gchar* _tmp174_;
377- _tmp81_ = ev;
378- _tmp82_ = zeitgeist_event_get_subject (_tmp81_, 0);
379- _tmp83_ = _g_object_ref0 (_tmp82_);
380- su = _tmp83_;
381- _tmp84_ = flags;
382- if ((_tmp84_ & UNITY_FILES_LENS_RESULT_FLAGS_USE_ORIGIN) == UNITY_FILES_LENS_RESULT_FLAGS_USE_ORIGIN) {
383- ZeitgeistSubject* _tmp85_;
384- const gchar* _tmp86_ = NULL;
385- gchar* _tmp87_;
386- gchar* _tmp88_;
387- gchar* _tmp89_;
388- _tmp85_ = su;
389- _tmp86_ = zeitgeist_subject_get_origin (_tmp85_);
390- _tmp87_ = g_strdup (_tmp86_);
391- _g_free0 (uri);
392- uri = _tmp87_;
393- _tmp88_ = g_strdup ("");
394- _g_free0 (display_name);
395- display_name = _tmp88_;
396- _tmp89_ = g_strdup ("inode/directory");
397- _g_free0 (mimetype);
398- mimetype = _tmp89_;
399- } else {
400- ZeitgeistSubject* _tmp90_;
401- const gchar* _tmp91_ = NULL;
402- gchar* _tmp92_;
403- ZeitgeistSubject* _tmp93_;
404- const gchar* _tmp94_ = NULL;
405+ gboolean _tmp170_ = FALSE;
406+ gboolean _tmp171_;
407+ gboolean _tmp173_;
408+ gint _tmp174_;
409+ DeeModel* _tmp179_;
410+ const gchar* _tmp180_;
411+ const gchar* _tmp181_;
412+ guint _tmp182_;
413+ const gchar* _tmp183_;
414+ const gchar* _tmp184_;
415+ const gchar* _tmp185_;
416+ const gchar* _tmp186_;
417+ _tmp88_ = ev;
418+ _tmp89_ = zeitgeist_event_get_subject (_tmp88_, 0);
419+ _tmp90_ = _g_object_ref0 (_tmp89_);
420+ su = _tmp90_;
421+ _tmp91_ = flags;
422+ if ((_tmp91_ & UNITY_FILES_LENS_RESULT_FLAGS_USE_ORIGIN) == UNITY_FILES_LENS_RESULT_FLAGS_USE_ORIGIN) {
423+ ZeitgeistSubject* _tmp92_;
424+ const gchar* _tmp93_ = NULL;
425+ gchar* _tmp94_;
426 gchar* _tmp95_;
427- ZeitgeistSubject* _tmp96_;
428- const gchar* _tmp97_ = NULL;
429- gchar* _tmp98_;
430- const gchar* _tmp99_ = NULL;
431+ gchar* _tmp96_;
432+ _tmp92_ = su;
433+ _tmp93_ = zeitgeist_subject_get_origin (_tmp92_);
434+ _tmp94_ = g_strdup (_tmp93_);
435+ _g_free0 (uri);
436+ uri = _tmp94_;
437+ _tmp95_ = g_strdup ("");
438+ _g_free0 (display_name);
439+ display_name = _tmp95_;
440+ _tmp96_ = g_strdup ("inode/directory");
441+ _g_free0 (mimetype);
442+ mimetype = _tmp96_;
443+ } else {
444+ ZeitgeistSubject* _tmp97_;
445+ const gchar* _tmp98_ = NULL;
446+ gchar* _tmp99_;
447 ZeitgeistSubject* _tmp100_;
448 const gchar* _tmp101_ = NULL;
449- const gchar* _tmp104_;
450+ gchar* _tmp102_;
451+ ZeitgeistSubject* _tmp103_;
452+ const gchar* _tmp104_ = NULL;
453 gchar* _tmp105_;
454- _tmp90_ = su;
455- _tmp91_ = zeitgeist_subject_get_current_uri (_tmp90_);
456- _tmp92_ = g_strdup (_tmp91_);
457+ const gchar* _tmp106_ = NULL;
458+ ZeitgeistSubject* _tmp107_;
459+ const gchar* _tmp108_ = NULL;
460+ const gchar* _tmp111_;
461+ gchar* _tmp112_;
462+ _tmp97_ = su;
463+ _tmp98_ = zeitgeist_subject_get_current_uri (_tmp97_);
464+ _tmp99_ = g_strdup (_tmp98_);
465 _g_free0 (uri);
466- uri = _tmp92_;
467- _tmp93_ = su;
468- _tmp94_ = zeitgeist_subject_get_text (_tmp93_);
469- _tmp95_ = g_strdup (_tmp94_);
470- _g_free0 (display_name);
471- display_name = _tmp95_;
472- _tmp96_ = su;
473- _tmp97_ = zeitgeist_subject_get_mimetype (_tmp96_);
474- _tmp98_ = g_strdup (_tmp97_);
475- _g_free0 (mimetype);
476- mimetype = _tmp98_;
477+ uri = _tmp99_;
478 _tmp100_ = su;
479- _tmp101_ = zeitgeist_subject_get_mimetype (_tmp100_);
480- if (_tmp101_ != NULL) {
481- ZeitgeistSubject* _tmp102_;
482- const gchar* _tmp103_ = NULL;
483- _tmp102_ = su;
484- _tmp103_ = zeitgeist_subject_get_mimetype (_tmp102_);
485- _tmp99_ = _tmp103_;
486- } else {
487- _tmp99_ = "application/octet-stream";
488- }
489- _tmp104_ = _tmp99_;
490+ _tmp101_ = zeitgeist_subject_get_text (_tmp100_);
491+ _tmp102_ = g_strdup (_tmp101_);
492+ _g_free0 (display_name);
493+ display_name = _tmp102_;
494+ _tmp103_ = su;
495+ _tmp104_ = zeitgeist_subject_get_mimetype (_tmp103_);
496 _tmp105_ = g_strdup (_tmp104_);
497 _g_free0 (mimetype);
498 mimetype = _tmp105_;
499+ _tmp107_ = su;
500+ _tmp108_ = zeitgeist_subject_get_mimetype (_tmp107_);
501+ if (_tmp108_ != NULL) {
502+ ZeitgeistSubject* _tmp109_;
503+ const gchar* _tmp110_ = NULL;
504+ _tmp109_ = su;
505+ _tmp110_ = zeitgeist_subject_get_mimetype (_tmp109_);
506+ _tmp106_ = _tmp110_;
507+ } else {
508+ _tmp106_ = "application/octet-stream";
509+ }
510+ _tmp111_ = _tmp106_;
511+ _tmp112_ = g_strdup (_tmp111_);
512+ _g_free0 (mimetype);
513+ mimetype = _tmp112_;
514 }
515- _tmp106_ = uri;
516- if (_tmp106_ == NULL) {
517+ _tmp113_ = uri;
518+ if (_tmp113_ == NULL) {
519 _g_free0 (mimetype);
520 _g_free0 (display_name);
521 _g_free0 (uri);
522 _g_object_unref0 (su);
523 continue;
524 }
525- _tmp107_ = uri;
526- _tmp108_ = g_file_new_for_uri (_tmp107_);
527- file = _tmp108_;
528- _tmp110_ = excluded_uris;
529- if (_tmp110_ != NULL) {
530- GeeSet* _tmp111_;
531- GFile* _tmp112_;
532- gchar* _tmp113_ = NULL;
533- gchar* _tmp114_;
534- gboolean _tmp115_ = FALSE;
535- _tmp111_ = excluded_uris;
536- _tmp112_ = file;
537- _tmp113_ = g_file_get_uri (_tmp112_);
538- _tmp114_ = _tmp113_;
539- _tmp115_ = gee_collection_contains ((GeeCollection*) _tmp111_, _tmp114_);
540- _tmp109_ = _tmp115_;
541- _g_free0 (_tmp114_);
542+ _tmp114_ = uri;
543+ _tmp115_ = g_file_new_for_uri (_tmp114_);
544+ file = _tmp115_;
545+ _tmp117_ = excluded_uris;
546+ if (_tmp117_ != NULL) {
547+ GeeSet* _tmp118_;
548+ GFile* _tmp119_;
549+ gchar* _tmp120_ = NULL;
550+ gchar* _tmp121_;
551+ gboolean _tmp122_ = FALSE;
552+ _tmp118_ = excluded_uris;
553+ _tmp119_ = file;
554+ _tmp120_ = g_file_get_uri (_tmp119_);
555+ _tmp121_ = _tmp120_;
556+ _tmp122_ = gee_collection_contains ((GeeCollection*) _tmp118_, _tmp121_);
557+ _tmp116_ = _tmp122_;
558+ _g_free0 (_tmp121_);
559 } else {
560- _tmp109_ = FALSE;
561+ _tmp116_ = FALSE;
562 }
563- _tmp116_ = _tmp109_;
564- if (_tmp116_) {
565+ _tmp123_ = _tmp116_;
566+ if (_tmp123_) {
567 _g_object_unref0 (file);
568 _g_free0 (mimetype);
569 _g_free0 (display_name);
570@@ -4794,74 +4834,91 @@
571 _g_object_unref0 (su);
572 continue;
573 }
574- _tmp118_ = display_name;
575- if (_tmp118_ == NULL) {
576- _tmp117_ = TRUE;
577+ _tmp125_ = display_name;
578+ if (_tmp125_ == NULL) {
579+ _tmp124_ = TRUE;
580 } else {
581- const gchar* _tmp119_;
582- _tmp119_ = display_name;
583- _tmp117_ = g_strcmp0 (_tmp119_, "") == 0;
584+ const gchar* _tmp126_;
585+ _tmp126_ = display_name;
586+ _tmp124_ = g_strcmp0 (_tmp126_, "") == 0;
587 }
588- _tmp120_ = _tmp117_;
589- if (_tmp120_) {
590- GFile* _tmp121_;
591- gchar* _tmp122_ = NULL;
592- gchar* _tmp123_;
593- gchar* _tmp124_ = NULL;
594- _tmp121_ = file;
595- _tmp122_ = g_file_get_parse_name (_tmp121_);
596- _tmp123_ = _tmp122_;
597- _tmp124_ = g_path_get_basename (_tmp123_);
598+ _tmp127_ = _tmp124_;
599+ if (_tmp127_) {
600+ GFile* _tmp128_;
601+ gchar* _tmp129_ = NULL;
602+ gchar* _tmp130_;
603+ gchar* _tmp131_ = NULL;
604+ _tmp128_ = file;
605+ _tmp129_ = g_file_get_parse_name (_tmp128_);
606+ _tmp130_ = _tmp129_;
607+ _tmp131_ = g_path_get_basename (_tmp130_);
608 _g_free0 (display_name);
609- display_name = _tmp124_;
610- _g_free0 (_tmp123_);
611+ display_name = _tmp131_;
612+ _g_free0 (_tmp130_);
613 }
614- _tmp126_ = min_size;
615- if (_tmp126_ > ((gint64) 0)) {
616- _tmp125_ = TRUE;
617+ _tmp133_ = min_size;
618+ if (_tmp133_ > ((gint64) 0)) {
619+ _tmp132_ = TRUE;
620 } else {
621- gint64 _tmp127_;
622- gint64 _tmp128_;
623- _tmp127_ = max_size;
624- _tmp128_ = G_MAXINT64;
625- _tmp125_ = _tmp127_ < _tmp128_;
626+ gint64 _tmp134_;
627+ gint64 _tmp135_;
628+ _tmp134_ = max_size;
629+ _tmp135_ = G_MAXINT64;
630+ _tmp132_ = _tmp134_ < _tmp135_;
631 }
632- _tmp129_ = _tmp125_;
633- check_size = _tmp129_;
634+ _tmp136_ = _tmp132_;
635+ check_size = _tmp136_;
636 file_type = G_FILE_TYPE_UNKNOWN;
637- _tmp130_ = file;
638- _tmp131_ = g_file_is_native (_tmp130_);
639- if (_tmp131_) {
640+ _tmp137_ = file;
641+ _tmp138_ = g_file_is_native (_tmp137_);
642+ if (_tmp138_) {
643 {
644- const gchar* _tmp132_ = NULL;
645- gboolean _tmp133_;
646- GFile* _tmp134_;
647- const gchar* _tmp135_;
648- GFileInfo* _tmp136_ = NULL;
649+ const gchar* _tmp139_ = NULL;
650+ gboolean _tmp140_;
651+ GFile* _tmp141_;
652+ const gchar* _tmp142_;
653+ GFileInfo* _tmp143_ = NULL;
654 GFileInfo* info;
655- GFileInfo* _tmp137_;
656- gboolean _tmp138_ = FALSE;
657- gboolean _tmp139_ = FALSE;
658- gboolean _tmp140_;
659- gboolean _tmp149_;
660- GFileInfo* _tmp150_;
661- GFileType _tmp151_ = 0;
662- _tmp133_ = check_size;
663- if (_tmp133_) {
664- _tmp132_ = UNITY_FILES_LENS_ATTRS_TYPE_SIZE_HIDDEN;
665+ GFile* _tmp144_;
666+ gchar* _tmp145_ = NULL;
667+ gchar* path;
668+ gboolean _tmp146_ = FALSE;
669+ const gchar* _tmp147_;
670+ gboolean _tmp150_;
671+ gboolean _tmp151_ = FALSE;
672+ gboolean _tmp152_;
673+ gboolean _tmp161_;
674+ GFileInfo* _tmp162_;
675+ GFileType _tmp163_ = 0;
676+ _tmp140_ = check_size;
677+ if (_tmp140_) {
678+ _tmp139_ = UNITY_FILES_LENS_ATTRS_TYPE_SIZE_HIDDEN;
679 } else {
680- _tmp132_ = UNITY_FILES_LENS_ATTRS_TYPE_HIDDEN;
681+ _tmp139_ = UNITY_FILES_LENS_ATTRS_TYPE_HIDDEN;
682 }
683- _tmp134_ = file;
684- _tmp135_ = _tmp132_;
685- _tmp136_ = g_file_query_info (_tmp134_, _tmp135_, 0, NULL, &_inner_error_);
686- info = _tmp136_;
687+ _tmp141_ = file;
688+ _tmp142_ = _tmp139_;
689+ _tmp143_ = g_file_query_info (_tmp141_, _tmp142_, 0, NULL, &_inner_error_);
690+ info = _tmp143_;
691 if (_inner_error_ != NULL) {
692 goto __catch4_g_error;
693 }
694- _tmp137_ = info;
695- _tmp138_ = g_file_info_get_is_hidden (_tmp137_);
696- if (_tmp138_) {
697+ _tmp144_ = file;
698+ _tmp145_ = g_file_get_path (_tmp144_);
699+ path = _tmp145_;
700+ _tmp147_ = path;
701+ if (_tmp147_ != NULL) {
702+ const gchar* _tmp148_;
703+ gboolean _tmp149_ = FALSE;
704+ _tmp148_ = path;
705+ _tmp149_ = string_contains (_tmp148_, "/.");
706+ _tmp146_ = _tmp149_;
707+ } else {
708+ _tmp146_ = FALSE;
709+ }
710+ _tmp150_ = _tmp146_;
711+ if (_tmp150_) {
712+ _g_free0 (path);
713 _g_object_unref0 (info);
714 _g_object_unref0 (file);
715 _g_free0 (mimetype);
716@@ -4870,34 +4927,35 @@
717 _g_object_unref0 (su);
718 continue;
719 }
720- _tmp140_ = check_size;
721- if (_tmp140_) {
722- gboolean _tmp141_ = FALSE;
723- GFileInfo* _tmp142_;
724- gint64 _tmp143_ = 0LL;
725- gint64 _tmp144_;
726- gboolean _tmp148_;
727- _tmp142_ = info;
728- _tmp143_ = g_file_info_get_size (_tmp142_);
729- _tmp144_ = min_size;
730- if (_tmp143_ < _tmp144_) {
731- _tmp141_ = TRUE;
732+ _tmp152_ = check_size;
733+ if (_tmp152_) {
734+ gboolean _tmp153_ = FALSE;
735+ GFileInfo* _tmp154_;
736+ gint64 _tmp155_ = 0LL;
737+ gint64 _tmp156_;
738+ gboolean _tmp160_;
739+ _tmp154_ = info;
740+ _tmp155_ = g_file_info_get_size (_tmp154_);
741+ _tmp156_ = min_size;
742+ if (_tmp155_ < _tmp156_) {
743+ _tmp153_ = TRUE;
744 } else {
745- GFileInfo* _tmp145_;
746- gint64 _tmp146_ = 0LL;
747- gint64 _tmp147_;
748- _tmp145_ = info;
749- _tmp146_ = g_file_info_get_size (_tmp145_);
750- _tmp147_ = max_size;
751- _tmp141_ = _tmp146_ > _tmp147_;
752+ GFileInfo* _tmp157_;
753+ gint64 _tmp158_ = 0LL;
754+ gint64 _tmp159_;
755+ _tmp157_ = info;
756+ _tmp158_ = g_file_info_get_size (_tmp157_);
757+ _tmp159_ = max_size;
758+ _tmp153_ = _tmp158_ > _tmp159_;
759 }
760- _tmp148_ = _tmp141_;
761- _tmp139_ = _tmp148_;
762+ _tmp160_ = _tmp153_;
763+ _tmp151_ = _tmp160_;
764 } else {
765- _tmp139_ = FALSE;
766+ _tmp151_ = FALSE;
767 }
768- _tmp149_ = _tmp139_;
769- if (_tmp149_) {
770+ _tmp161_ = _tmp151_;
771+ if (_tmp161_) {
772+ _g_free0 (path);
773 _g_object_unref0 (info);
774 _g_object_unref0 (file);
775 _g_free0 (mimetype);
776@@ -4906,9 +4964,10 @@
777 _g_object_unref0 (su);
778 continue;
779 }
780- _tmp150_ = info;
781- _tmp151_ = g_file_info_get_file_type (_tmp150_);
782- file_type = _tmp151_;
783+ _tmp162_ = info;
784+ _tmp163_ = g_file_info_get_file_type (_tmp162_);
785+ file_type = _tmp163_;
786+ _g_free0 (path);
787 _g_object_unref0 (info);
788 }
789 goto __finally4;
790@@ -4939,25 +4998,25 @@
791 return;
792 }
793 }
794- _tmp152_ = uri;
795- _tmp153_ = mimetype;
796- _tmp154_ = unity_files_lens_utils_get_icon_for_uri (_tmp152_, _tmp153_);
797- icon = _tmp154_;
798- _tmp155_ = file;
799- _tmp156_ = g_file_get_parse_name (_tmp155_);
800- comment = _tmp156_;
801- _tmp157_ = file_type;
802- is_dir = _tmp157_ == G_FILE_TYPE_DIRECTORY;
803- _tmp159_ = is_dir;
804- if (_tmp159_) {
805- UnityFilesLensResultFlags _tmp160_;
806- _tmp160_ = flags;
807- _tmp158_ = (_tmp160_ & UNITY_FILES_LENS_RESULT_FLAGS_SKIP_FOLDERS) == UNITY_FILES_LENS_RESULT_FLAGS_SKIP_FOLDERS;
808+ _tmp164_ = uri;
809+ _tmp165_ = mimetype;
810+ _tmp166_ = unity_files_lens_utils_get_icon_for_uri (_tmp164_, _tmp165_);
811+ icon = _tmp166_;
812+ _tmp167_ = file;
813+ _tmp168_ = g_file_get_parse_name (_tmp167_);
814+ comment = _tmp168_;
815+ _tmp169_ = file_type;
816+ is_dir = _tmp169_ == G_FILE_TYPE_DIRECTORY;
817+ _tmp171_ = is_dir;
818+ if (_tmp171_) {
819+ UnityFilesLensResultFlags _tmp172_;
820+ _tmp172_ = flags;
821+ _tmp170_ = (_tmp172_ & UNITY_FILES_LENS_RESULT_FLAGS_SKIP_FOLDERS) == UNITY_FILES_LENS_RESULT_FLAGS_SKIP_FOLDERS;
822 } else {
823- _tmp158_ = FALSE;
824+ _tmp170_ = FALSE;
825 }
826- _tmp161_ = _tmp158_;
827- if (_tmp161_) {
828+ _tmp173_ = _tmp170_;
829+ if (_tmp173_) {
830 _g_free0 (comment);
831 _g_free0 (icon);
832 _g_object_unref0 (file);
833@@ -4967,33 +5026,33 @@
834 _g_object_unref0 (su);
835 continue;
836 }
837- _tmp162_ = category_override;
838- if (_tmp162_ >= 0) {
839- gint _tmp163_;
840- _tmp163_ = category_override;
841- category_id = (guint) _tmp163_;
842+ _tmp174_ = category_override;
843+ if (_tmp174_ >= 0) {
844+ gint _tmp175_;
845+ _tmp175_ = category_override;
846+ category_id = (guint) _tmp175_;
847 } else {
848- UnityFilesLensCategories _tmp164_ = 0;
849- gboolean _tmp165_;
850- UnityFilesLensCategories _tmp166_;
851- _tmp165_ = is_dir;
852- if (_tmp165_) {
853- _tmp164_ = UNITY_FILES_LENS_CATEGORIES_FOLDERS;
854+ UnityFilesLensCategories _tmp176_ = 0;
855+ gboolean _tmp177_;
856+ UnityFilesLensCategories _tmp178_;
857+ _tmp177_ = is_dir;
858+ if (_tmp177_) {
859+ _tmp176_ = UNITY_FILES_LENS_CATEGORIES_FOLDERS;
860 } else {
861- _tmp164_ = UNITY_FILES_LENS_CATEGORIES_RECENT;
862+ _tmp176_ = UNITY_FILES_LENS_CATEGORIES_RECENT;
863 }
864- _tmp166_ = _tmp164_;
865- category_id = (guint) _tmp166_;
866+ _tmp178_ = _tmp176_;
867+ category_id = (guint) _tmp178_;
868 }
869- _tmp167_ = results;
870- _tmp168_ = uri;
871- _tmp169_ = icon;
872- _tmp170_ = category_id;
873- _tmp171_ = mimetype;
874- _tmp172_ = display_name;
875- _tmp173_ = comment;
876- _tmp174_ = uri;
877- dee_model_append (_tmp167_, _tmp168_, _tmp169_, _tmp170_, _tmp171_, _tmp172_, _tmp173_, _tmp174_, NULL);
878+ _tmp179_ = results;
879+ _tmp180_ = uri;
880+ _tmp181_ = icon;
881+ _tmp182_ = category_id;
882+ _tmp183_ = mimetype;
883+ _tmp184_ = display_name;
884+ _tmp185_ = comment;
885+ _tmp186_ = uri;
886+ dee_model_append (_tmp179_, _tmp180_, _tmp181_, _tmp182_, _tmp183_, _tmp184_, _tmp185_, _tmp186_, NULL);
887 _g_free0 (comment);
888 _g_free0 (icon);
889 _g_object_unref0 (file);
890@@ -5005,84 +5064,84 @@
891 }
892 _g_object_unref0 (_ev_it);
893 }
894- _tmp175_ = extracted_directories;
895- if (_tmp175_ != NULL) {
896+ _tmp187_ = extracted_directories;
897+ if (_tmp187_ != NULL) {
898 {
899- GeeSet* _tmp176_;
900- GeeIterator* _tmp177_ = NULL;
901+ GeeSet* _tmp188_;
902+ GeeIterator* _tmp189_ = NULL;
903 GeeIterator* _dir_uri_it;
904- _tmp176_ = extracted_directories;
905- _tmp177_ = gee_iterable_iterator ((GeeIterable*) _tmp176_);
906- _dir_uri_it = _tmp177_;
907+ _tmp188_ = extracted_directories;
908+ _tmp189_ = gee_iterable_iterator ((GeeIterable*) _tmp188_);
909+ _dir_uri_it = _tmp189_;
910 while (TRUE) {
911- GeeIterator* _tmp178_;
912- gboolean _tmp179_ = FALSE;
913- GeeIterator* _tmp180_;
914- gpointer _tmp181_ = NULL;
915+ GeeIterator* _tmp190_;
916+ gboolean _tmp191_ = FALSE;
917+ GeeIterator* _tmp192_;
918+ gpointer _tmp193_ = NULL;
919 gchar* dir_uri;
920- const gchar* _tmp182_;
921- GFile* _tmp183_ = NULL;
922+ const gchar* _tmp194_;
923+ GFile* _tmp195_ = NULL;
924 GFile* f;
925- GFile* _tmp184_;
926- gchar* _tmp185_ = NULL;
927- gchar* _tmp186_;
928- gchar* _tmp187_ = NULL;
929- gchar* _tmp188_;
930+ GFile* _tmp196_;
931+ gchar* _tmp197_ = NULL;
932+ gchar* _tmp198_;
933+ gchar* _tmp199_ = NULL;
934+ gchar* _tmp200_;
935 gchar* display_name;
936- gchar* _tmp189_;
937+ gchar* _tmp201_;
938 gchar* mimetype;
939- const gchar* _tmp190_;
940- const gchar* _tmp191_;
941- gchar* _tmp192_ = NULL;
942+ const gchar* _tmp202_;
943+ const gchar* _tmp203_;
944+ gchar* _tmp204_ = NULL;
945 gchar* icon;
946- gint _tmp193_;
947- DeeModel* _tmp195_;
948- const gchar* _tmp196_;
949- const gchar* _tmp197_;
950- guint _tmp198_;
951- const gchar* _tmp199_;
952- const gchar* _tmp200_;
953- const gchar* _tmp201_;
954- _tmp178_ = _dir_uri_it;
955- _tmp179_ = gee_iterator_next (_tmp178_);
956- if (!_tmp179_) {
957+ gint _tmp205_;
958+ DeeModel* _tmp207_;
959+ const gchar* _tmp208_;
960+ const gchar* _tmp209_;
961+ guint _tmp210_;
962+ const gchar* _tmp211_;
963+ const gchar* _tmp212_;
964+ const gchar* _tmp213_;
965+ _tmp190_ = _dir_uri_it;
966+ _tmp191_ = gee_iterator_next (_tmp190_);
967+ if (!_tmp191_) {
968 break;
969 }
970- _tmp180_ = _dir_uri_it;
971- _tmp181_ = gee_iterator_get (_tmp180_);
972- dir_uri = (gchar*) _tmp181_;
973- _tmp182_ = dir_uri;
974- _tmp183_ = g_file_new_for_uri (_tmp182_);
975- f = _tmp183_;
976- _tmp184_ = f;
977- _tmp185_ = g_file_get_parse_name (_tmp184_);
978- _tmp186_ = _tmp185_;
979- _tmp187_ = g_path_get_basename (_tmp186_);
980- _tmp188_ = _tmp187_;
981- _g_free0 (_tmp186_);
982- display_name = _tmp188_;
983- _tmp189_ = g_strdup ("inode/directory");
984- mimetype = _tmp189_;
985- _tmp190_ = dir_uri;
986- _tmp191_ = mimetype;
987- _tmp192_ = unity_files_lens_utils_get_icon_for_uri (_tmp190_, _tmp191_);
988- icon = _tmp192_;
989- _tmp193_ = category_override;
990- if (_tmp193_ >= 0) {
991- gint _tmp194_;
992- _tmp194_ = category_override;
993- category_id = (guint) _tmp194_;
994+ _tmp192_ = _dir_uri_it;
995+ _tmp193_ = gee_iterator_get (_tmp192_);
996+ dir_uri = (gchar*) _tmp193_;
997+ _tmp194_ = dir_uri;
998+ _tmp195_ = g_file_new_for_uri (_tmp194_);
999+ f = _tmp195_;
1000+ _tmp196_ = f;
1001+ _tmp197_ = g_file_get_parse_name (_tmp196_);
1002+ _tmp198_ = _tmp197_;
1003+ _tmp199_ = g_path_get_basename (_tmp198_);
1004+ _tmp200_ = _tmp199_;
1005+ _g_free0 (_tmp198_);
1006+ display_name = _tmp200_;
1007+ _tmp201_ = g_strdup ("inode/directory");
1008+ mimetype = _tmp201_;
1009+ _tmp202_ = dir_uri;
1010+ _tmp203_ = mimetype;
1011+ _tmp204_ = unity_files_lens_utils_get_icon_for_uri (_tmp202_, _tmp203_);
1012+ icon = _tmp204_;
1013+ _tmp205_ = category_override;
1014+ if (_tmp205_ >= 0) {
1015+ gint _tmp206_;
1016+ _tmp206_ = category_override;
1017+ category_id = (guint) _tmp206_;
1018 } else {
1019 category_id = (guint) UNITY_FILES_LENS_CATEGORIES_FOLDERS;
1020 }
1021- _tmp195_ = results;
1022- _tmp196_ = dir_uri;
1023- _tmp197_ = icon;
1024- _tmp198_ = category_id;
1025- _tmp199_ = mimetype;
1026- _tmp200_ = display_name;
1027- _tmp201_ = dir_uri;
1028- dee_model_append (_tmp195_, _tmp196_, _tmp197_, _tmp198_, _tmp199_, _tmp200_, "", _tmp201_, NULL);
1029+ _tmp207_ = results;
1030+ _tmp208_ = dir_uri;
1031+ _tmp209_ = icon;
1032+ _tmp210_ = category_id;
1033+ _tmp211_ = mimetype;
1034+ _tmp212_ = display_name;
1035+ _tmp213_ = dir_uri;
1036+ dee_model_append (_tmp207_, _tmp208_, _tmp209_, _tmp210_, _tmp211_, _tmp212_, "", _tmp213_, NULL);
1037 _g_free0 (icon);
1038 _g_free0 (mimetype);
1039 _g_free0 (display_name);
1040
1041=== modified file 'src/daemon.vala'
1042--- src/daemon.vala 2012-04-12 11:46:22 +0000
1043+++ src/daemon.vala 2013-05-07 13:15:37 +0000
1044@@ -24,9 +24,9 @@
1045 using Gee;
1046
1047 namespace Unity.FilesLens {
1048-
1049+
1050 const string ICON_PATH = Config.DATADIR + "/icons/unity-icon-theme/places/svg/";
1051-
1052+
1053 public class Daemon : GLib.Object
1054 {
1055 private Zeitgeist.Log log;
1056@@ -72,11 +72,11 @@
1057 populate_categories ();
1058 populate_filters ();
1059 lens.add_local_scope (scope);
1060-
1061+
1062 /* Bring up Zeitgeist interfaces */
1063 log = new Zeitgeist.Log ();
1064 index = new Zeitgeist.Index ();
1065-
1066+
1067 /* Listen for all file:// related events from Zeitgeist */
1068 var templates = new PtrArray ();
1069 var event = new Zeitgeist.Event ();
1070@@ -194,7 +194,7 @@
1071 var cat = new Unity.Category (_("Recent"),
1072 new FileIcon (icon_dir.get_child ("group-recent.svg")));
1073 categories.append (cat);
1074-
1075+
1076 cat = new Unity.Category (_("Recent Files"),
1077 new FileIcon (icon_dir.get_child ("group-recent.svg")));
1078 categories.append (cat);
1079@@ -224,7 +224,7 @@
1080 new Subject.full (uri_prefix,
1081 "", "", "", "", "", ""));
1082 templates["all"] = event;
1083-
1084+
1085 /* Section.DOCUMENTS */
1086 event = new Event.full("", manifestation, "",
1087 new Subject.full (uri_prefix,
1088@@ -247,7 +247,7 @@
1089 new Subject.full (uri_prefix,
1090 NFO_IMAGE, "", "", "", "", ""));
1091 templates["images"] = event;
1092-
1093+
1094 /* Section.AUDIO */
1095 event = new Event.full("", manifestation, "",
1096 new Subject.full (uri_prefix,
1097@@ -269,7 +269,7 @@
1098 NFO_PRESENTATION, "", "", "", "", ""));
1099 templates["presentations"] = event;
1100
1101- /* Section.OTHER
1102+ /* Section.OTHER
1103 * Note that subject templates are joined with logical AND */
1104 event = new Event.full("", manifestation, "");
1105 event.add_subject (new Subject.full (uri_prefix,
1106@@ -367,7 +367,7 @@
1107 private bool is_search_empty (LensSearch search)
1108 {
1109 if (search.search_string == null) return true;
1110-
1111+
1112 return search.search_string.strip () == "";
1113 }
1114
1115@@ -390,7 +390,7 @@
1116
1117 return s;
1118 }
1119-
1120+
1121 private async void update_global_search_async (LensSearch search,
1122 Cancellable cancellable)
1123 {
1124@@ -413,7 +413,7 @@
1125
1126 results_model.clear ();
1127
1128- /* check if the thing typed isn't a url (like facebook.com)
1129+ /* check if the thing typed isn't a url (like facebook.com)
1130 * or isn't a remote mountable url (like ftp://ftp.ubuntu.com)*/
1131 var url_type = UrlType.UNKNOWN;
1132 var checked_url = urls.check_url (search.search_string, out url_type);
1133@@ -483,7 +483,7 @@
1134 search.search_string, e.message);
1135 }
1136 }
1137-
1138+
1139 private async void update_search_async (LensSearch search,
1140 Cancellable cancellable)
1141 {
1142@@ -514,13 +514,13 @@
1143
1144 txn.clear ();
1145
1146- /* check if the thing typed isn't a url (like facebook.com)
1147+ /* check if the thing typed isn't a url (like facebook.com)
1148 * or isn't a remote mountable url (like ftp://ftp.ubuntu.com)*/
1149- var url_type = UrlType.UNKNOWN;
1150+ var url_type = UrlType.UNKNOWN;
1151 var checked_url = urls.check_url (search.search_string, out url_type);
1152 if (checked_url != null)
1153 {
1154- txn.append (checked_url, urls.get_icon_for_type(url_type),
1155+ txn.append (checked_url, urls.get_icon_for_type(url_type),
1156 Categories.RECENT,
1157 "text/html", search.search_string,
1158 checked_url, checked_url);
1159@@ -677,7 +677,7 @@
1160 return;
1161 }
1162
1163- int64[] sizes =
1164+ int64[] sizes =
1165 {
1166 0,
1167 1024,
1168@@ -863,9 +863,9 @@
1169 {
1170 debug (@"Activating: $uri");
1171 try {
1172- if (bookmarks.launch_if_bookmark (uri))
1173+ if (bookmarks.launch_if_bookmark (uri))
1174 return new Unity.ActivationResponse(Unity.HandledType.HIDE_DASH);
1175-
1176+
1177 /* this code ensures that a file manager will be used
1178 * * if uri it's a remote location that should be mounted */
1179 var url_type = UrlType.UNKNOWN;
1180@@ -940,6 +940,10 @@
1181 if (excluded_uris != null && origin in excluded_uris) continue;
1182 if (!(origin in origins) && f.is_native () && f.query_exists ())
1183 {
1184+ string? path = f.get_path ();
1185+ if (path != null && path.contains ("/."))
1186+ continue;
1187+
1188 var display_name = Path.get_basename (f.get_parse_name ());
1189 if (display_name.casefold ().has_prefix (folded_search))
1190 {
1191@@ -1012,7 +1016,8 @@
1192 {
1193 FileInfo info = file.query_info (check_size ?
1194 ATTRS_TYPE_SIZE_HIDDEN : ATTRS_TYPE_HIDDEN, 0, null);
1195- if (info.get_is_hidden())
1196+ string? path = file.get_path ();
1197+ if (path != null && path.contains ("/."))
1198 continue;
1199 if (check_size &&
1200 (info.get_size () < min_size || info.get_size () > max_size))
1201@@ -1062,4 +1067,3 @@
1202 }
1203 }
1204 } /* namespace */
1205-
1206
1207=== added directory 'tests/manual'
1208=== added file 'tests/manual/misc.txt'
1209--- tests/manual/misc.txt 1970-01-01 00:00:00 +0000
1210+++ tests/manual/misc.txt 2013-05-07 13:15:37 +0000
1211@@ -0,0 +1,14 @@
1212+Hidden files / dirs are not displayed
1213+-------------------------------------
1214+Test that hidden files, hidden folders, or normal files in hidden folders are not displayed in search results.
1215+
1216+Setup:
1217+Create a few combinations of hidden files/folders using nautilus (CTRL+H in nautilus to view hidden files), e.g. ~/.Foo/bar.txt, ~/.foo.txt, ~/.Foo/bar/baz.txt.
1218+Update locatedb (e.g. sudo /etc/cron.daily/mlocate).
1219+
1220+Actions:
1221+Type search queries such as "Foo", "bar", "baz" in the dash search query.
1222+
1223+Expected Result:
1224+Verify none of the newly created hidden files are displayed in the Dash home view with empty search.
1225+Verify none of the hidden files are displayed after entering a search query.

Subscribers

People subscribed via source and target branches

to all changes: