Commit graph

29 commits

Author SHA1 Message Date
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
e5dccc1719 Don't call link_del() on free'd memory 2009-06-06 20:43:52 +02:00
Sebastian Kayser
3d8751b495 Fixed non-void return in void delete_process()
Fixes bug #2789781.
2009-05-16 10:36:03 +02:00
Yorhel
06a5f5215f Properly select the next item after deletion
Setting FF_BSEL after calling browse_init() causes two items to be
selected, as browse_init() makes sure something will be selected,
while calc_process() assumes nothing is, because the previously
selected item had just been deleted.
2009-05-11 20:14:52 +02:00
Yorhel
6de0a8ec00 Use correct hard link information after partial recalculation or deletion
Hard link detection is now done in a separate pass on the in-memory tree,
and duplicates can be 'removed' and 're-added' on the fly. When making any
changes in the tree, all hard links are re-added before the operation and
removed again afterwards.

While this guarantees that all hard link information is correct, it does
have a few drawbacks. I can currently think of two:

 1. It's not the most efficient way to do it, and may be quite slow on
    large trees. Will have to do some benchmarks later to see whether
    it is anything to be concerned about.

 2. The first encountered item is considered as 'counted' and all items
    encountered after that are considered as 'duplicate'. Because the
    order in which we traverse the tree doesn't always have to be the
    same, the items that will be considered as 'duplicate' can vary with
    each deletion or re-calculation. This might cause confusion for
    people who aren't aware of how hard links work.
2009-05-11 20:02:46 +02:00
Yorhel
3610121dab Don't try to delete a directory that's not empty 2009-04-28 11:07:24 +02:00
Yorhel
eb3310060f Fixed display bug on deletion error 2009-04-26 14:57:20 +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
4b6456d0b9 Improved deletion performance 2009-04-26 10:54:14 +02:00
Yorhel
ba243df042 Centralized screen update delay into input_handle() 2009-04-26 09:49:51 +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
d75cc8fb72 Replace 'suseconds_t' with 'long'
suseconds_t isn't always defined on some systems, but all possible
values are guaranteed to fit into a long, so use that.
2009-04-19 14:29:49 +02:00
Yorhel
97fefbaffb Disabled blocking wait for user input while deleting
...that was for debugging, which isn't necessary anymore.
2009-04-19 13:17:21 +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
44f64cf3d3 Go the correct directory after a deletion 2009-04-19 13:02:02 +02:00
Yorhel
d8058362ec Actually delete parents as well when deleting directories 2009-04-19 12:43:25 +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
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
yorhel
c306d3fe3b Updated copyright year to cover 2008 as well
git-svn-id: svn://blicky.net/ncdu/trunk@36 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 13:59:58 +00:00
yorhel
9e2eb51ef4 Moved cursor to selected items in browser and deletion dialog for improved accessibility
git-svn-id: svn://blicky.net/ncdu/trunk@34 ce56bc8d-f834-0410-b703-f827bd498a76
2008-08-02 13:31:21 +00:00
yorhel
db920f8dab * Added error handling for the import feature
* Created own window-functions and removed ncurses window usage
* Rewrote fullsize


git-svn-id: svn://blicky.net/ncdu/trunk@27 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-16 08:36:58 +00:00
yorhel
96d0ffffa2 The "reference to parent directory" hack is now only used in drawBrowser in browser.c, and is not included in the main dir structure anymore. (less code, easier, faster, less memory usage)
git-svn-id: svn://blicky.net/ncdu/trunk@26 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-12 09:52:24 +00:00
yorhel
4654bb93c4 Two small bug fixes: interface bug in the delete progress, and getpath returned double slash on root
git-svn-id: svn://blicky.net/ncdu/trunk@22 ce56bc8d-f834-0410-b703-f827bd498a76
2007-08-05 11:12:40 +00:00
yorhel
c96bf1636a Changed struct dir from a doubly to a singly linked list (less memory usage, faster, and easier)
git-svn-id: svn://blicky.net/ncdu/trunk@13 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-26 16:37:33 +00:00
yorhel
ce6785124c Rewrote calc.c to be more flexible and clarifying, and changed the global 'dir' to a pointer
git-svn-id: svn://blicky.net/ncdu/trunk@10 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-25 18:38:49 +00:00
yorhel
87a7925b99 * Rewrote the file browser, help window, and delete windows
* Split browser.c into delete.c and help.c
* Added "reference to parent directory"-hack
* File browser doesn't use the ncurses menu lib anymore
* Fixed bug #1758403: large directories work fine now
* Fixed bug with wide characters in the browser
* Performance improvements when browsing large directories
* Required (instead of recommended) gettimeofday()


git-svn-id: svn://blicky.net/ncdu/trunk@6 ce56bc8d-f834-0410-b703-f827bd498a76
2007-07-24 07:58:22 +00:00