Merge lp:~optimisme/pantheon-files/1067061 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Albert
Status: Merged
Merged at revision: 1178
Proposed branch: lp:~optimisme/pantheon-files/1067061
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 48 lines (+13/-11)
2 files modified
libcore/gof-file.c (+10/-9)
src/marlin-thumbnailer.c (+3/-2)
To merge this branch: bzr merge lp:~optimisme/pantheon-files/1067061
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+164572@code.launchpad.net

Description of the change

Check if a file is remote before asking for a thumbnail, and improved/modified remote scheme test

To post a comment you must log in.
lp:~optimisme/pantheon-files/1067061 updated
1173. By Albert

added smb scheme to the list of remote schemes

Revision history for this message
Victor Martinez (victored) wrote :

Looks good Albert!

Generally, we prefer:

> if (condition_a
> || condition_b
> || condition_c)
> {
> // do something
> }

Over:

> if (condition_a) {
> // do something
> }
>
> if (condition_b) {
> // do something
> }
>
> if (condition_c) {
> // do something
> }

so that the code in "do something" is not repeated

We also encourage:

> if (condition_a && condition_b)
> // do something

instead of:

> if (condition_a)
> if (condition_b)
> // do something

lp:~optimisme/pantheon-files/1067061 updated
1174. By Albert

fixed source style

Revision history for this message
Cody Garver (codygarver) wrote :

Great!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libcore/gof-file.c'
--- libcore/gof-file.c 2013-03-07 04:19:41 +0000
+++ libcore/gof-file.c 2013-05-18 08:59:28 +0000
@@ -180,18 +180,19 @@
180 /* try to determinate what appear to be remote. This is quite hazardous but gio doesn't offer any better option */180 /* try to determinate what appear to be remote. This is quite hazardous but gio doesn't offer any better option */
181 char *scheme = g_file_get_uri_scheme (file->location);181 char *scheme = g_file_get_uri_scheme (file->location);
182182
183 //g_message ("%s %s", G_STRFUNC, scheme);183 /* g_vfs does not have a function to know if a supported protocol is remote */
184 if (!strcmp (scheme, "trash")) {184 if (!strcmp (scheme, "afp")
185 g_free (scheme);185 || !strcmp (scheme, "dav")
186 return FALSE;186 || !strcmp (scheme, "davs")
187 }187 || !strcmp (scheme, "ftp")
188 if (!strcmp (scheme, "archive")) {188 || !strcmp (scheme, "sftp")
189 g_free (scheme);189 || !strcmp (scheme, "smb")) {
190 return FALSE;190 g_free (scheme);
191 return TRUE;
191 }192 }
192193
193 g_free (scheme);194 g_free (scheme);
194 return TRUE;195 return FALSE;
195}196}
196197
197void gof_file_get_folder_icon_from_uri_or_path (GOFFile *file) 198void gof_file_get_folder_icon_from_uri_or_path (GOFFile *file)
198199
=== modified file 'src/marlin-thumbnailer.c'
--- src/marlin-thumbnailer.c 2012-05-30 18:28:41 +0000
+++ src/marlin-thumbnailer.c 2013-05-18 08:59:28 +0000
@@ -846,8 +846,9 @@
846 * processed (and awaiting to be refreshed) */846 * processed (and awaiting to be refreshed) */
847 for (lp = g_list_last (files); lp != NULL; lp = lp->prev)847 for (lp = g_list_last (files); lp != NULL; lp = lp->prev)
848 {848 {
849 if (marlin_thumbnailer_file_is_supported (thumbnailer, lp->data))849 /* 1067061 - Do not thumbnail network files */
850 supported_files = g_list_prepend (supported_files, lp->data);850 if (!gof_file_is_remote_uri_scheme(lp->data) && marlin_thumbnailer_file_is_supported (thumbnailer, lp->data))
851 supported_files = g_list_prepend (supported_files, lp->data);
851 }852 }
852853
853 /* determine how many URIs are in the wait queue */854 /* determine how many URIs are in the wait queue */

Subscribers

People subscribed via source and target branches

to all changes: