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 | |
parent | a4d1cf67a9a6b841b41c5ee28809bdcbc2ff44f3 (diff) | |
download | mate-utils-266894647388df80ab6bc6d3b38201db863a9488.tar.bz2 mate-utils-266894647388df80ab6bc6d3b38201db863a9488.tar.xz |
Fixed g_format_size_for_display deprecations. Closes #5.
-rw-r--r-- | baobab/src/baobab-prefs.c | 11 | ||||
-rw-r--r-- | baobab/src/baobab-utils.c | 18 | ||||
-rw-r--r-- | baobab/src/baobab.c | 49 | ||||
-rw-r--r-- | logview/logview-window.c | 7 |
4 files changed, 67 insertions, 18 deletions
diff --git a/baobab/src/baobab-prefs.c b/baobab/src/baobab-prefs.c index c440aa7f..48a75b9c 100644 --- a/baobab/src/baobab-prefs.c +++ b/baobab/src/baobab-prefs.c @@ -259,8 +259,15 @@ fill_props_model (GtkListStore *store) glibtop_get_fsusage (&fsusage, mountentry->mountdir); fstotal = fsusage.blocks * fsusage.block_size; fsavail = fsusage.bfree * fsusage.block_size; - total = g_format_size_for_display(fstotal); - avail = g_format_size_for_display(fsavail); + + #if GLIB_CHECK_VERSION (2, 30, 0) + total = g_format_size(fstotal); + avail = g_format_size(fsavail); + #else + total = g_format_size_for_display(fstotal); + avail = g_format_size_for_display(fsavail); + #endif + file = g_file_new_for_path (mountentry->mountdir); uri = g_file_get_uri (file); excluded = baobab_is_excluded_location (file); diff --git a/baobab/src/baobab-utils.c b/baobab/src/baobab-utils.c index 12fbcbfb..5b3a0b46 100644 --- a/baobab/src/baobab-utils.c +++ b/baobab/src/baobab-utils.c @@ -195,8 +195,13 @@ show_bars (GtkTreeModel *mdl, &readelements, -1); gtk_tree_model_get (mdl, iter, size_col, &size, -1); - sizecstr = g_format_size_for_display (size); - + + #if GLIB_CHECK_VERSION (2, 30, 0) + sizecstr = g_format_size (size); + #else + sizecstr = g_format_size_for_display (size); + #endif + if (readelements == -1) { gtk_tree_store_set (GTK_TREE_STORE (mdl), iter, COL_DIR_SIZE, sizecstr, -1); @@ -220,8 +225,13 @@ show_bars (GtkTreeModel *mdl, if (readelements != -1) { gtk_tree_model_get (mdl, iter, size_col, &size, -1); - sizecstr = g_format_size_for_display (size); - + + #if GLIB_CHECK_VERSION (2, 30, 0) + sizecstr = g_format_size (size); + #else + sizecstr = g_format_size_for_display (size); + #endif + gtk_tree_store_set (GTK_TREE_STORE (mdl), iter, COL_H_PERC, 100.0, COL_DIR_SIZE, sizecstr, -1); 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, diff --git a/logview/logview-window.c b/logview/logview-window.c index 11bb4fbe..54a48430 100644 --- a/logview/logview-window.c +++ b/logview/logview-window.c @@ -209,7 +209,12 @@ logview_update_statusbar (LogviewWindow *logview, LogviewLog *active) modified = g_strdup_printf (_("last update: %s"), timestring_utf8); - size = g_format_size_for_display (logview_log_get_file_size (active)); + #if GLIB_CHECK_VERSION (2, 30, 0) + size = g_format_size (logview_log_get_file_size (active)); + #else + size = g_format_size_for_display (logview_log_get_file_size (active)); + #endif + statusbar_text = g_strdup_printf (_("%d lines (%s) - %s"), logview_log_get_cached_lines_number (active), size, modified); |