[gedit] Order hidden files after normal files (fixes bug #599949)
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Order hidden files after normal files (fixes bug #599949)
- Date: Sun, 15 Nov 2009 20:28:19 +0000 (UTC)
commit 1508a28c4e35bea3a0f7a8749e04a0ec663f75e2
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sun Nov 15 21:28:11 2009 +0100
Order hidden files after normal files (fixes bug #599949)
plugins/filebrowser/gedit-file-browser-store.c | 26 +++++++++++++++--------
1 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index 4a67c32..46d6e76 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -1051,20 +1051,28 @@ model_sort_default (FileBrowserNode * node1, FileBrowserNode * node2)
f2 = NODE_IS_DUMMY (node2);
if (f1 && f2)
+ {
return 0;
- else if (f1)
- return -1;
- else if (f2)
- return 1;
+ }
+ else if (f1 || f2)
+ {
+ return f1 ? -1 : 1;
+ }
f1 = NODE_IS_DIR (node1);
f2 = NODE_IS_DIR (node2);
- if (f1 != f2) {
- if (f1)
- return -1;
- else
- return 1;
+ if (f1 != f2)
+ {
+ return f1 ? -1 : 1;
+ }
+
+ f1 = NODE_IS_HIDDEN (node1);
+ f2 = NODE_IS_HIDDEN (node2);
+
+ if (f1 != f2)
+ {
+ return f2 ? -1 : 1;
}
return collate_nodes (node1, node2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]