gnome-system-monitor r2414 - trunk/src



Author: bdejean
Date: Thu May  1 09:09:20 2008
New Revision: 2414
URL: http://svn.gnome.org/viewvc/gnome-system-monitor?rev=2414&view=rev

Log:
Also hide fs with 0 blocks when not show_all_fs

Modified:
   trunk/src/disks.cpp

Modified: trunk/src/disks.cpp
==============================================================================
--- trunk/src/disks.cpp	(original)
+++ trunk/src/disks.cpp	Thu May  1 09:09:20 2008
@@ -174,7 +174,7 @@
 
 
 static void
-add_disk(GtkListStore *list, const glibtop_mountentry *entry)
+add_disk(GtkListStore *list, const glibtop_mountentry *entry, bool show_all_fs)
 {
 	Glib::RefPtr<Gdk::Pixbuf> pixbuf;
 	GtkTreeIter iter;
@@ -182,10 +182,13 @@
 	guint64 bused, bfree, bavail, btotal;
 	gint percentage;
 
-	pixbuf = get_icon_for_device(entry->mountdir);
-
 	glibtop_get_fsusage(&usage, entry->mountdir);
+
+	if (not show_all_fs and usage.blocks == 0)
+		return;
+
 	fsusage_stats(&usage, &bused, &bfree, &bavail, &btotal, &percentage);
+	pixbuf = get_icon_for_device(entry->mountdir);
 
 	/* if we can find a row with the same mountpoint, we get it but we
 	   still need to update all the fields.
@@ -226,7 +229,7 @@
 	remove_old_disks(GTK_TREE_MODEL(list), entries, mountlist.number);
 
 	for (i = 0; i < mountlist.number; i++)
-		add_disk(list, &entries[i]);
+		add_disk(list, &entries[i], procdata->config.show_all_fs);
 
 	g_free(entries);
 



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