1
1
Граф коммитов

79 Коммитов

Автор SHA1 Сообщение Дата
Yorhel
44e63ce2e7 Added -u option to change the scan UI
This allows scanning stuff without initializing ncurses. Not too useful
at this point since ncdu will switch to an ncurses environment when it's
done anyway, but this will become more useful when the export-to-file
feature has been implemented.
2012-08-27 14:17:40 +02:00
Yorhel
e380805990 Fixed some compiler warnings and a (rather nonexistent) memory leak
This silences clang and gcc with -O2 -Wall -Wextra
2012-08-26 18:12:13 +02:00
Yorhel
0fd7dec7b0 Split calc.c into separate components (dir_(mem|scan|common).c)
The architecture is explained in dir.h. The reasons for these changes is
two-fold:
- calc.c was too complex, it simply did too many things. 399ccdeb is a
  nice example of that: Should have been an easy fix, but it introduced
  a segfault (fixed in 0b49021a), and added a small memory leak.
- This architecture features a pluggable input/output system, which
  should make a file export/import feature relatively simple.

The current commit does not feature any user interface, so there's no
feedback yet when scanning a directory. I'll get to that in a bit.

I've also not tested the new scanning code very well yet, so I might
have introduced some bugs.
2012-08-26 15:29:55 +02:00
Yorhel
7fcae11d4d Copyright year bump
Damn, it's 2012 already.
2012-01-18 11:40:50 +01:00
Yorhel
5243e2daf4 Code cleanup: Use `static' where applicable.
This should also allow compilers to generate better code.
2011-10-31 15:09:49 +01:00
Yorhel
00bd015d79 Belated copyright year bump 2011-10-31 14:47:15 +01:00
Yorhel
53e3bcbd2b browser.c: Added [read-only] indication to title bar 2011-10-31 13:10:36 +01:00
Rodolfo Borges
57164c8ca6 read-only flag 2011-09-09 08:47:41 +02:00
Yorhel
3860ba217b Display size graph by default
This used to be the default before 1.5, but for some reason the default
changed in 1.5 and 1.6. Changing it back now, because the graph really
is useful, and there's still enough space for the filename even in
smaller terminals.
2010-08-13 11:38:27 +02:00
Yorhel
791612dc4d browser.c: Got rid of the 'line' format string
This solution is far cleaner. Thanks to Ben North for pointing me to the
*-width-specifier that has apparently been built into the printf-family
functions for, well, quite a while, it seems.
2010-07-18 18:58:22 +02:00
Yorhel
d942a0ebc6 Only create the line format once when drawing the browser window
The memory for this format is now statically allocated as well. I
was under the impression its size would depend on wincols, but this is
the format we're talking about, the string does not have to hold the
actual line contents. I must have been sleeping again...

Oh well, this is a slight performance improvement, although it doesn't
seem the be the cause of the browing slowness when running under
valgrind. (Obviously running ncdu with valgrind is supposed to be
slower, but the current performance is rather bad...)
2010-04-28 17:15:46 +02:00
Yorhel
d7d782be1c Reset descending/ascending order when changing sort column
This changes the behaviour back to it was before the dirlist
abstraction, which is the behaviour I prefer.
2010-04-28 15:39:45 +02:00
Yorhel
b7ccf78b90 More intuitive multi-page browsing
Here is the new multi-page listing functionality I promised in
5db9c2aea1.

It may look very easy, but getting this to work right wasn't,
unfortunately.
2010-04-28 13:32:30 +02:00
Yorhel
79733f7d64 Determine which item to select after deletion in browser.c
Rather than the ugly hack in delete.c.
2010-04-27 17:58:17 +02:00
Yorhel
c84e70b627 Properly fixed crash on browsing dirs with a small window size
I was overseeing a stupid mistake in
  a7b7841ac0
Obviously, you need to check against wincols and not winrows...
2010-04-27 13:27:57 +02:00
Yorhel
a7b7841ac0 Fixed crash on browsing dirs with a small window size
Fixes bug #2991787
2010-04-27 12:41:01 +02:00
Yorhel
5db9c2aea1 Abstracted dir list handling from browser.c into dirlist.c
This optimizes a few actions (though not all), and makes the code easier
to understand and expand.

The behaviour of the browser has changed a bit with regards to
multi-page listings. Personally I don't like this change much, so I'd
probably fix that later on.
2010-03-07 11:10:00 +01:00
Yorhel
82ec5b9fa8 Misc. minor fixes 2010-02-28 10:13:12 +01:00
Yorhel
93a97381bd List detected links in a separate tab in info window 2010-02-27 15:21:25 +01:00
Yorhel
88cd199d94 Link hard linked files together with a circular linked list
The directory sizes are now incorrect as hard links will be counted
twice again (as if there wasn't any detection in the first place), but
this will get fixed by adding a shared size field.

This method of keeping track of hard links is a lot faster and allows
adding an interface which lists the found links.
2010-02-27 15:21:25 +01:00
Yorhel
101731ed13 Copyright year bump 2010-02-27 15:20:57 +01:00
Yorhel
06cab8cc30 Added some keybindings and changed 'h' to 'e' in browser 2009-10-18 12:52:00 +02:00
Yorhel
b7d59bee5b Properly display MiB units instead of MB
Fixes bug #2831412 (debian #539553)
2009-08-03 14:26:10 +02:00
Yorhel
fd984e754c Added hard link indicator in browser and help window 2009-05-05 19:25:52 +02:00
Yorhel
d571c080b5 Fixed a browsing bug related to hiding items
Reproducable with the following steps:
- Make sure the first item in the list is a directory starting with a dot
- Make sure the next item is a normal directory
- Select first item
- Press 'h' to hide it, next item will properly be selected
- Open selected directory (right arrow), and see how the first (hidden)
  directory was opened.

It's amazing how I've even found this bug, considering that really is the
only way to reproduce it...
2009-05-02 13:01:12 +02:00
Yorhel
0fe0d11e3b Don't divide by zero when size of parent dir = 0
It's a floating point division, so won't really cause any real problems
on most systems. Still, a percentage of 'nan' isn't really useful.
2009-05-01 09:07:28 +02:00
Yorhel
95b314de73 Fixed line width when displaying 100%
Which would happen if there's only one file is in a directory
2009-05-01 09:00:59 +02:00
Yorhel
ceecccc3ae Move cursor to the correct line in browse_draw() 2009-04-26 11:22:24 +02:00
Yorhel
43fec63281 Removed last occurence of PATH_MAX
And it wasn't even used for a path, but for a row on the screen...
2009-04-26 11:18:45 +02:00
Yorhel
290c7a7d70 Renamed ncdu.h to global.h and #included all other header files into that
So we're actually back to having one header file for everything,
except it's now maintainable.
2009-04-26 11:08:40 +02:00
Yorhel
f6e34e520e Don't re-sort when pressing the browse keys without affecting the dir 2009-04-26 09:55:23 +02:00
Yorhel
ba243df042 Centralized screen update delay into input_handle() 2009-04-26 09:49:51 +02:00
Yorhel
027c0c2eba Don't segfault when browsing an empty dir... 2009-04-25 15:46:00 +02:00
Yorhel
1f341f8b4c Fixed segfault on specifying an empty dir 2009-04-25 12:11:53 +02:00
Yorhel
5c6f057840 Fixed a few occurences of wrong arguments for getpath()
That's what you get when you change the way a function works...
2009-04-23 22:03:24 +02:00
Yorhel
4bb7d6b7c2 Removed reliance on PATH_MAX on most places
ncdu already does seem to handle longer paths now, though there are
still a few places where the code still relies on PATH_MAX. Will fix
those later.
2009-04-23 21:15:11 +02:00
Yorhel
a71bc36860 Select next item after deleting
This makes deleting multiple files a -lot- easier...
2009-04-19 13:16:31 +02:00
Yorhel
ba4d06e09e (partly) rewrote delete.c for the new framework and re-added the deletion feature 2009-04-19 11:38:35 +02:00
Yorhel
daba2128fc Don't quit ncdu when pressing 'q' while the info window is shown
Just hide the info window in that case.
2009-04-19 10:06:33 +02:00
Yorhel
6568a962bc Converted help.c to the new framework and re-added help window 2009-04-19 10:03:42 +02:00
Yorhel
8daeeea1d9 Re-added file information window in browser.c 2009-04-18 16:02:46 +02:00
Yorhel
ddd8a639b7 Only sort directory when necessary 2009-04-18 15:45:58 +02:00
Yorhel
42ca499730 Allow drawing the browser frame when there's no directory structure 2009-04-18 15:34:47 +02:00
Yorhel
e079026ac8 Kept internal variables internal in browser.c and added browse_init()
Looks much better this way!
2009-04-18 15:23:33 +02:00
Yorhel
b24c3dee40 Got rid of SF_SI
It was a totally useless feature, anyway.
2009-04-18 14:05:45 +02:00
Yorhel
34ba5348c8 Made stcalc static within calc.c and abstracted access to it with calc_init()
This actually makes the struct itself obsolete, as all information is now only
useful within calc.c itself and other files don't have to do anything with it.
2009-04-16 18:26:39 +02:00
Yorhel
5790b817f9 Re-added recalculating (sub)directories 2009-04-13 19:32:40 +02:00
Yorhel
7a0730f5d2 (Partly) rewrote browser.c to the new system
Not fully finished yet with this one, though.
2009-04-13 17:25:46 +02:00
Yorhel
f392bf3ee1 Rewrote calc.c in the new style & framework
ncdu is currently pretty much in a non-working state, but things will
get fixed eventually after porting the other source files to the new
framework.
2009-04-10 18:16:33 +02:00
yorhel
e7fb90fc67 Year bump
git-svn-id: svn://blicky.net/ncdu/trunk@48 ce56bc8d-f834-0410-b703-f827bd498a76
2009-01-11 09:34:19 +00:00