summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2013-04-10 16:47:35 -0400
committerCosimo Cecchi <cosimoc@gnome.org>2013-04-10 16:47:35 -0400
commit569bf2150790b72d9cfaf7cabccf642ec85480c4 (patch)
tree778faf7e1adc3cf050bf6236d8d4ee76dea48343
parente0b864eed48c71b64e177507caa435df6ccba158 (diff)
downloadnautilus-569bf2150790b72d9cfaf7cabccf642ec85480c4.tar.gz
file: simplify logic to filter out foreign desktop files
We don't need to check if the file is in the desktop, since the desktop view will call in with show_foreign = FALSE already.
-rw-r--r--libnautilus-private/nautilus-file.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 35235e154..8974a8756 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -3334,8 +3334,9 @@ nautilus_file_is_hidden_file (NautilusFile *file)
/**
* nautilus_file_should_show:
- * @file: the file to check.
- * @show_hidden: whether we want to show hidden files or not.
+ * @file: the file to check
+ * @show_hidden: whether we want to show hidden files or not
+ * @show_foreign: whether we want to show foreign files or not
*
* Determines if a #NautilusFile should be shown. Note that when browsing
* a trash directory, this function will always return %TRUE.
@@ -3350,10 +3351,17 @@ nautilus_file_should_show (NautilusFile *file,
/* Never hide any files in trash. */
if (nautilus_file_is_in_trash (file)) {
return TRUE;
- } else {
- return (show_hidden || !nautilus_file_is_hidden_file (file)) &&
- (show_foreign || !(nautilus_file_is_in_desktop (file) && nautilus_file_is_foreign_link (file)));
}
+
+ if (!show_hidden && nautilus_file_is_hidden_file (file)) {
+ return FALSE;
+ }
+
+ if (!show_foreign && nautilus_file_is_foreign_link (file)) {
+ return FALSE;
+ }
+
+ return TRUE;
}
gboolean