]> spindle.queued.net Git - midori/commitdiff
Use g_format_size with GLib 2.30.0
authorChristian Dywan <christian@twotoasts.de>
Mon, 10 Oct 2011 19:53:00 +0000 (21:53 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 10 Oct 2011 19:53:00 +0000 (21:53 +0200)
midori/midori-browser.c
midori/sokoke.c
midori/sokoke.h
panels/midori-transfers.c

index aeed406246330e54c2ff555d1541b0f9a91dfdb9..695398a661b20b4b9115ac9e0faba44b0204eaed 100644 (file)
@@ -960,8 +960,8 @@ midori_browser_prepare_download (MidoriBrowser*  browser,
         }
         else if (free_space < total_size)
         {
-            gchar* total_size_string = g_format_size_for_display (total_size);
-            gchar* free_space_string = g_format_size_for_display (free_space);
+            gchar* total_size_string = g_format_size (total_size);
+            gchar* free_space_string = g_format_size (free_space);
             message = g_strdup_printf (
                 _("There is not enough free space to download \"%s\"."),
                   &uri[7]);
index d7b17058488f17b21b7f4549f345d6f090899e38..1ed09cc605480a3690d854deb4c9b0d6f28274ac 100644 (file)
@@ -2230,8 +2230,8 @@ midori_download_prepare_tooltip_text (WebKitDownload* download)
     minutes_str = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes_left), minutes_left);
     seconds_str = g_strdup_printf (ngettext ("%d second", "%d seconds", seconds_left), seconds_left);
 
-    current = g_format_size_for_display (current_size);
-    total = g_format_size_for_display (total_size);
+    current = g_format_size (current_size);
+    total = g_format_size (total_size);
     last_time = g_object_get_data (G_OBJECT (download), "last-time");
     last_size = g_object_get_data (G_OBJECT (download), "last-size");
 
@@ -2241,7 +2241,7 @@ midori_download_prepare_tooltip_text (WebKitDownload* download)
     g_free (total);
 
     if (time_elapsed != *last_time)
-        download_speed = g_format_size_for_display (
+        download_speed = g_format_size (
                 (current_size - *last_size) / (time_elapsed - *last_time));
     else
         /* i18n: Unknown number of bytes, used for transfer rate like ?B/s */
index b446982c6d252ce7f934db05a14cb961e387373a..20bb9dcab035ba0466fec658e5631d6b5f8772e3 100644 (file)
     #define g_content_type_from_mime_type(mtp) g_strdup (mtp)
 #endif
 
+#if !GLIB_CHECK_VERSION (2, 30, 0)
+    #define g_format_size(sz) g_format_size_for_display ((goffset)sz)
+#endif
+
 #if !GTK_CHECK_VERSION (2, 14, 0)
     #define gtk_dialog_get_content_area(dlg) dlg->vbox
     #define gtk_dialog_get_action_area(dlg) dlg->action_area
index fef9a0d90a3320d4530cbe861d277f4a966b074f..3309e6e09b4b1ea0a327481f325ab554fc3c4c6c 100644 (file)
@@ -263,8 +263,8 @@ midori_transfers_treeview_render_text_cb (GtkTreeViewColumn* column,
     gtk_tree_model_get (model, iter, 1, &download, -1);
 
     /* FIXME: Ellipsize filename */
-    current = g_format_size_for_display (webkit_download_get_current_size (download));
-    total = g_format_size_for_display (webkit_download_get_total_size (download));
+    current = g_format_size (webkit_download_get_current_size (download));
+    total = g_format_size (webkit_download_get_total_size (download));
     size_text = g_strdup_printf (_("%s of %s"), current, total);
     g_free (current);
     g_free (total);