Re: [RFE][PATCH] Display free space on device in panels



Hello Jindrich,

On Wed, 1 Feb 2006, Jindrich Novy wrote:

On Mon, 2006-01-02 at 14:41 +0100, Jindrich Novy wrote:
thanks for your comments, attaching the patch better matching the mc
coding style.

I modified the patch so that it can be switched on/off in the
Options/Layout dialog to display free space on device.

I red the patch more carefully and I have several questions:

1)

--- mc-4.6.1a/src/screen.c.showfree	2006-01-31 21:59:12.000000000 +0100
+++ mc-4.6.1a/src/screen.c	2006-01-31 21:59:12.000000000 +0100
@@ -49,6 +49,7 @@
+static void
+show_free_space(WPanel *panel)
+{
+    struct stat st;
+
+    /* Don't try to stat non-local fs */
+    if (!vfs_file_is_local(panel->cwd))
+	return;
+
+    if (old_cwd == NULL || strcmp(old_cwd, panel->cwd) == 0) {
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Is this made on purpose ? Maybe you meant '!=' ?

2) Do you think that retrieving the free space information once per
directory read would diminish the effect of this patch. Currently
my_statfs () is called each time the screen changes i.e. move up,
move down, etc - this seems a bit too much ...

Pavel "The Prick" Tsekov




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]