diff options
author | Steve Zesch <[email protected]> | 2012-11-15 21:41:46 -0500 |
---|---|---|
committer | Steve Zesch <[email protected]> | 2012-11-15 21:41:46 -0500 |
commit | 266894647388df80ab6bc6d3b38201db863a9488 (patch) | |
tree | ca04bb43cb782ef8ec83500b3ef91cc82981f0a5 /baobab/src/baobab.c | |
parent | a4d1cf67a9a6b841b41c5ee28809bdcbc2ff44f3 (diff) | |
download | mate-utils-266894647388df80ab6bc6d3b38201db863a9488.tar.bz2 mate-utils-266894647388df80ab6bc6d3b38201db863a9488.tar.xz |
Fixed g_format_size_for_display deprecations. Closes #5.
Diffstat (limited to 'baobab/src/baobab.c')
-rw-r--r-- | baobab/src/baobab.c | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c index 063731d2..433628b4 100644 --- a/baobab/src/baobab.c +++ b/baobab/src/baobab.c @@ -171,10 +171,16 @@ update_scan_label (void) gchar *available; GtkWidget *label; - total = g_format_size_for_display (baobab.fs.total); - used = g_format_size_for_display (baobab.fs.used); - available = g_format_size_for_display (baobab.fs.avail); - + #if GLIB_CHECK_VERSION (2, 30, 0) + total = g_format_size (baobab.fs.total); + used = g_format_size (baobab.fs.used); + available = g_format_size (baobab.fs.avail); + #else + total = g_format_size_for_display (baobab.fs.total); + used = g_format_size_for_display (baobab.fs.used); + available = g_format_size_for_display (baobab.fs.avail); + #endif + /* Translators: these are labels for disk space */ markup = g_markup_printf_escaped ("<small>%s <b>%s</b> (%s %s %s %s )</small>", _("Total filesystem capacity:"), total, @@ -381,8 +387,13 @@ first_row (void) gchar *capacity_label, *capacity_size; gtk_tree_store_append (baobab.model, &root_iter, NULL); - capacity_size = g_format_size_for_display (baobab.fs.total); - + + #if GLIB_CHECK_VERSION (2, 30, 0) + capacity_size = g_format_size (baobab.fs.total); + #else + capacity_size = g_format_size_for_display (baobab.fs.total); + #endif + capacity_label = g_strdup (_("Total filesystem capacity")); gtk_tree_store_set (baobab.model, &root_iter, COL_DIR_NAME, capacity_label, @@ -397,7 +408,13 @@ first_row (void) gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (baobab.tree_view), FALSE); gtk_tree_store_append (baobab.model, &firstiter, &root_iter); - size = g_format_size_for_display (baobab.fs.used); + + #if GLIB_CHECK_VERSION (2, 30, 0) + size = g_format_size (baobab.fs.used); + #else + size = g_format_size_for_display (baobab.fs.used); + #endif + if (baobab.fs.total == 0 && baobab.fs.used == 0) { perc = 100.0; } else { @@ -444,7 +461,12 @@ baobab_fill_model (struct chan_data *data) hardlinks = g_string_new (""); if (data->tempHLsize > 0) { - size = g_format_size_for_display (data->tempHLsize); + #if GLIB_CHECK_VERSION (2, 30, 0) + size = g_format_size (data->tempHLsize); + #else + size = g_format_size_for_display (data->tempHLsize); + #endif + g_string_assign (hardlinks, "<i>("); g_string_append (hardlinks, _("contains hardlinks for:")); g_string_append (hardlinks, " "); @@ -458,9 +480,14 @@ baobab_fill_model (struct chan_data *data) ngettext ("%5d item", "%5d items", data->elements), data->elements); - size = g_format_size_for_display (data->size); - alloc_size = g_format_size_for_display (data->alloc_size); - + #if GLIB_CHECK_VERSION (2, 30, 0) + size = g_format_size (data->size); + alloc_size = g_format_size (data->alloc_size); + #else + size = g_format_size_for_display (data->size); + alloc_size = g_format_size_for_display (data->alloc_size); + #endif + gtk_tree_store_set (baobab.model, &iter, COL_DIR_NAME, name, COL_H_PARSENAME, data->parse_name, |