diff options
author | yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76> | 2007-07-24 08:53:55 +0000 |
---|---|---|
committer | yorhel <yorhel@ce56bc8d-f834-0410-b703-f827bd498a76> | 2007-07-24 08:53:55 +0000 |
commit | 32a535d6d7d085eebc350dce8a1142df757c7f74 (patch) | |
tree | 349a62e1687724933ee239a6b322701981621db1 | |
parent | 2202762f0a44b57541e5c7a7c9d61e8aa4286538 (diff) |
* When changing sort order to size, automatically sort in descending order
* Removed unused and hidden feature to sort on number of files
* When sorting on size, and multiple items have the same size, sort them on filename
* Updated changelog
git-svn-id: svn://blicky.net/ncdu/trunk@8 ce56bc8d-f834-0410-b703-f827bd498a76
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | src/browser.c | 13 | ||||
-rw-r--r-- | src/ncdu.h | 1 |
4 files changed, 17 insertions, 9 deletions
@@ -1,6 +1,10 @@ -1.2 - ? +1.2 - 2007-07-24 - Fixed some bugs on cygwin - Added du-like exclude patterns + - Fixed bug #1758403: large directories work fine now + - Rewrote a large part of the code + - Fixed a bug with wide characters + - Performance improvements when browsing large dirs 1.1 - 2007-04-30 - Deleting files and directories is now possible from @@ -1,6 +1,10 @@ -1.2 - ? +1.2 - 2007-07-24 - Fixed some bugs on cygwin - Added du-like exclude patterns + - Fixed bug #1758403: large directories work fine now + - Rewrote a large part of the code + - Fixed a bug with wide characters + - Performance improvements when browsing large dirs 1.1 - 2007-04-30 - Deleting files and directories is now possible from diff --git a/src/browser.c b/src/browser.c index d4a04db..ee93404 100644 --- a/src/browser.c +++ b/src/browser.c @@ -48,15 +48,16 @@ int cmp(struct dir *x, struct dir *y) { b = y; a = x; } if(!(bflags & BF_NDIRF) && y->flags & FF_DIR && !(x->flags & FF_DIR)) - r = 1; - else if(!(bflags & BF_NDIRF) && !(y->flags & FF_DIR) && x->flags & FF_DIR) - r = -1; - else if(bflags & BF_NAME) + return(1); + if(!(bflags & BF_NDIRF) && !(y->flags & FF_DIR) && x->flags & FF_DIR) + return(-1); + + if(bflags & BF_NAME) r = strcmp(a->name, b->name); - else if(bflags & BF_FILES) - r = (a->files - b->files); if(r == 0) r = a->size > b->size ? 1 : (a->size == b->size ? 0 : -1); + if(r == 0) + r = strcmp(a->name, b->name); return(r); } @@ -101,7 +101,6 @@ /* Browse Flags (int bflags) */ #define BF_NAME 1 #define BF_SIZE 2 -#define BF_FILES 4 #define BF_NDIRF 32 /* Normally, dirs before files, setting this disables it */ #define BF_DESC 64 #define BF_HIDE 128 /* don't show hidden files... */ |