Merge lp:~jeremywootten/pantheon-files/fix-folder-no-execute into lp:~elementary-apps/pantheon-files/trunk

Proposed by Jeremy Wootten
Status: Merged
Approved by: Zisu Andrei
Approved revision: 2303
Merged at revision: 2363
Proposed branch: lp:~jeremywootten/pantheon-files/fix-folder-no-execute
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 48 lines (+19/-3)
1 file modified
libcore/gof-file.c (+19/-3)
To merge this branch: bzr merge lp:~jeremywootten/pantheon-files/fix-folder-no-execute
Reviewer Review Type Date Requested Status
Zisu Andrei (community) code and functionality Approve
Review via email: mp+304200@code.launchpad.net

Commit message

Handle no execute permissions gracefully

Description of the change

For folders with no execute permission, show the "readonly" emblem (since it is possible to list the contents).

Show "Unknown" for size, type, and modified of files where the relevant attribute is not obtainable (e.g. within a folder with no execute permission).

To post a comment you must log in.
Revision history for this message
Zisu Andrei (matzipan) wrote :

As argumented before, I personally don't think "Unknown" is a good descriptive string, which means we have to wait until the string freeze is over to merge this in.

Also, some comments inline.

review: Needs Fixing
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Suggestions for a more suitable string are welcome but it has to be short (in all languages). "Hidden"? "Inaccessible"?

Revision history for this message
Zisu Andrei (matzipan) wrote :

"Inaccessible" might actually be a good one, since we are literally describing something that cannot be accessed.

2302. By Jeremy Wootten

Use 'Inaccessible' for size and modified if no info

2303. By Jeremy Wootten

Merge trunk, resolve conflict

Revision history for this message
Zisu Andrei (matzipan) :
review: Approve (code and functionality)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libcore/gof-file.c'
2--- libcore/gof-file.c 2016-08-29 17:49:53 +0000
3+++ libcore/gof-file.c 2016-09-03 16:29:09 +0000
4@@ -343,10 +343,14 @@
5 gof_file_update_size (GOFFile *file)
6 {
7 g_free (file->format_size);
8- if (gof_file_is_folder (file) || gof_file_is_root_network_folder (file))
9+
10+ if (gof_file_is_folder (file) || gof_file_is_root_network_folder (file)) {
11 file->format_size = g_strdup ("—");
12- else
13+ } else if (g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_STANDARD_SIZE)) {
14 file->format_size = g_format_size (file->size);
15+ } else {
16+ file->format_size = g_strdup (_("Inaccessible"));
17+ }
18 }
19
20 static void
21@@ -524,7 +528,11 @@
22 /* sizes */
23 gof_file_update_size (file);
24 /* modified date */
25- file->formated_modified = gof_file_get_formated_time (file, G_FILE_ATTRIBUTE_TIME_MODIFIED);
26+ if (g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_TIME_MODIFIED)) {
27+ file->formated_modified = gof_file_get_formated_time (file, G_FILE_ATTRIBUTE_TIME_MODIFIED);
28+ } else {
29+ file->formated_modified = g_strdup (_("Inaccessible"));
30+ }
31 /* icon */
32 if (file->is_directory) {
33 gof_file_get_folder_icon_from_uri_or_path (file);
34@@ -1333,6 +1341,14 @@
35 } else {
36 return TRUE; /* We will just have to assume we can write to the file */
37 }
38+
39+ gboolean can_write = g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE);
40+
41+ if (file->directory && g_file_info_has_attribute (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE)) {
42+ return can_write && g_file_info_get_attribute_boolean (file->info, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE);
43+ }
44+
45+ return can_write;
46 }
47
48 gboolean

Subscribers

People subscribed via source and target branches

to all changes: