Merge lp:~lore-mattei/unity-lens-files/unity-lens-files-lp878052 into lp:unity-lens-files

Proposed by Lorenzo Mattei on 2012-04-28
Status: Rejected
Rejected by: Ɓukasz Zemczak on 2013-02-27
Proposed branch: lp:~lore-mattei/unity-lens-files/unity-lens-files-lp878052
Merge into: lp:unity-lens-files
Diff against target: 21 lines (+5/-2)
1 file modified
src/daemon.vala (+5/-2)
To merge this branch: bzr merge lp:~lore-mattei/unity-lens-files/unity-lens-files-lp878052
Reviewer Review Type Date Requested Status
Bernhard Kaindl (community) Approve on 2012-09-01
Michal Hruby 2012-06-09 Pending
Mikkel Kamstrup Erlandsen 2012-06-09 Pending
Unity Team 2012-04-28 Pending
Review via email: mp+104008@code.launchpad.net

Description of the change

For local files only, gets the folder name from uri and checks if it is hidden. If so, skips the file.

To post a comment you must log in.
Bernhard Kaindl (benkai) wrote :

I think merging this should be a clear cut, I wonder why it takes so long.

review: Approve
Omer Akram (om26er) wrote :

I will try to ping someone on Monday.

Technically it only solves this partially, since it only checks the
state of the immediate parent dir. ~/.foo/bar/secret.txt would still
show up. Recursively stat()ing the parent dirs is not very fun either.

I suggested some point in the past that we do a simple heuristic that
I think is "good enough" - simply checking if the path string contains
a "/." pattern.

Unmerged revisions

229. By Lorenzo Mattei on 2012-04-28

Skip files in hidden folders.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/daemon.vala'
2--- src/daemon.vala 2012-04-05 16:11:45 +0000
3+++ src/daemon.vala 2012-04-28 20:45:25 +0000
4@@ -1007,12 +1007,15 @@
5 FileType file_type = FileType.UNKNOWN;
6 if (file.is_native ())
7 {
8- // hidden files should be ignored
9+ // hidden files and folders should be ignored
10 try
11 {
12+ File directory = File.new_for_uri (Path.get_dirname(uri));
13+ FileInfo dir_info = directory.query_info (check_size ?
14+ ATTRS_TYPE_SIZE_HIDDEN : ATTRS_TYPE_HIDDEN, 0, null);
15 FileInfo info = file.query_info (check_size ?
16 ATTRS_TYPE_SIZE_HIDDEN : ATTRS_TYPE_HIDDEN, 0, null);
17- if (info.get_is_hidden())
18+ if (info.get_is_hidden() || dir_info.get_is_hidden())
19 continue;
20 if (check_size &&
21 (info.get_size () < min_size || info.get_size () > max_size))

Subscribers

People subscribed via source and target branches