From 74920b54c4d2c1e612050cd6c90778798c5e6509 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 28 Nov 2013 01:40:44 +0100 Subject: [PATCH] Minor performance improvement --- src/plugins/volumes.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/volumes.c b/src/plugins/volumes.c index 5be4851..c98688e 100644 --- a/src/plugins/volumes.c +++ b/src/plugins/volumes.c @@ -263,9 +263,14 @@ static void _refresh_add(Volumes * volumes, char const * name, fraction = fraction / total; snprintf(buf, sizeof(buf), "%.1lf%%", fraction * 100.0); } +#if GTK_CHECK_VERSION(2, 6, 0) + gtk_list_store_insert_with_values(volumes->store, &iter, -1, +#else gtk_list_store_append(volumes->store, &iter); - gtk_list_store_set(volumes->store, &iter, DC_PIXBUF, volumes->icons[dp], - DC_NAME, name, DC_MOUNTPOINT, mountpoint, + gtk_list_store_set(volumes->store, &iter, +#endif + DC_PIXBUF, volumes->icons[dp], DC_NAME, name, + DC_MOUNTPOINT, mountpoint, DC_FREE, (int)(fraction * 100), DC_FREE_DISPLAY, buf, -1); }