2006-03-09  Rodney Dawes  <dobey@novell.com>

	* gnome-volume-manager.schemas.in: Get rid of the percent_freed
	setting, as it really doesn't make sense to have it
	Change the percent_threshold default to 0.05
	Change the percent_used default to 0.01
	These changes are based on a 100GB disk drive metric, where 5% is still
	a fairly large value, being 5GB. This may still be an issue for smaller
	disk drives such as USB Flash keys, so it still needs some testing

	* src/gvm.h (struct gvm_configuration): Remove percent_freed

	* src/manager.c (gvm_statfs_check_space): Check that the the amount
	of space used since the last check is greater than the percent_used
	threshold properly
	Check if we passed the percent_threshold value regardless of whether
	we used up more than percent_used or not
	Remove the code to check for disk space being freed up, as it doesn't
	really make sense to have it here

	Fixes #332764
Index: gnome-volume-manager.schemas.in
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/gnome-volume-manager.schemas.in,v
retrieving revision 1.36
diff -u -p -r1.36 gnome-volume-manager.schemas.in
--- gnome-volume-manager.schemas.in	10 Feb 2006 22:08:25 -0000	1.36
+++ gnome-volume-manager.schemas.in	9 Mar 2006 22:12:01 -0000
@@ -457,7 +457,7 @@
         <key>/schemas/desktop/gnome/volume_manager/percent_threshold</key>
 	<applyto>/desktop/gnome/volume_manager/percent_threshold</applyto>
 	<type>float</type>
-	<default>0.20</default>
+	<default>0.05</default>
 	<locale name="C">
 	  <short>Low Disk Space notification threshold</short>
 	  <long>Threshold percentage for notifying the user of low disk space.</long>
@@ -465,21 +465,10 @@
       </schema>
 
       <schema>
-        <key>/schemas/desktop/gnome/volume_manager/percent_freed</key>
-	<applyto>/desktop/gnome/volume_manager/percent_freed</applyto>
-	<type>float</type>
-	<default>0.05</default>
-	<locale name="C">
-	  <short>Threshold for disk space being freed up, to toggle notification</short>
-	  <long>The threshold value for whether or not to toggle the notification off, based on the amount of space freed up by the user since the last check.</long>
-	</locale>
-      </schema>
-
-      <schema>
         <key>/schemas/desktop/gnome/volume_manager/percent_used</key>
 	<applyto>/desktop/gnome/volume_manager/percent_used</applyto>
 	<type>float</type>
-	<default>0.025</default>
+	<default>0.01</default>
 	<locale name="C">
 	  <short>Threshold for notification of increased disk usage</short>
 	  <long>The threshold value for whether or not to toggle the notification on, based on the amount of additional space used since the last check.</long>
Index: src/gvm.h
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/gvm.h,v
retrieving revision 1.18
diff -u -p -r1.18 gvm.h
--- src/gvm.h	10 Feb 2006 22:08:25 -0000	1.18
+++ src/gvm.h	9 Mar 2006 22:12:01 -0000
@@ -57,7 +57,6 @@ struct gvm_configuration {
 	char *autopocketpc_command;
         
         double percent_threshold;
-        double percent_freed;
         double percent_used;
 };
 
Index: src/manager.c
===================================================================
RCS file: /cvs/gnome/gnome-volume-manager/src/manager.c,v
retrieving revision 1.135
diff -u -p -r1.135 manager.c
--- src/manager.c	8 Mar 2006 18:54:01 -0000	1.135
+++ src/manager.c	9 Mar 2006 22:12:01 -0000
@@ -177,7 +177,6 @@ static struct {
 	{ GCONF_ROOT "autotablet",                TYPE_BOOL,   &config.autotablet                },
 	{ GCONF_ROOT "autotablet_command",        TYPE_STRING, &config.autotablet_command        },
 	{ GCONF_ROOT "percent_threshold",         TYPE_FLOAT,  &config.percent_threshold         },
-	{ GCONF_ROOT "percent_freed",             TYPE_FLOAT,  &config.percent_freed             },
 	{ GCONF_ROOT "percent_used",              TYPE_FLOAT,  &config.percent_used              },
 };
 
@@ -2819,11 +2818,13 @@ gvm_statfs_check_space (const char *udi,
 		double free_space;
 		
 		free_space = (double) buf.f_bavail / (double) buf.f_blocks;
-		
-		if ((free_space - info->last_notified) > config.percent_used)
+
+		/*
+		   If we continue using up more and more space or if we pass
+		   the threshold value while running, we want to notify again
+		*/
+		if ((info->last_notified - free_space) > config.percent_used || (free_space < config.percent_threshold && info->last_notified > config.percent_threshold))
 			info->notified = FALSE;
-		else if ((free_space - info->last_notified) < config.percent_freed)
-			info->notified = TRUE;
 		
 		if (!info->notified && free_space < config.percent_threshold) {
 			char *disk, *label, *msg;
