[Xfce4-commits] <midori:master> Guard format_size in Midori.Download against GLib 2.30
Christian Dywan
noreply at xfce.org
Sun Nov 4 18:30:04 CET 2012
Updating branch refs/heads/master
to 6c1e74495a5d41a85c9cc60d468d82c0b63753d6 (commit)
from 12304f23e382b3690cf4a37ab8ccefab0f8ef569 (commit)
commit 6c1e74495a5d41a85c9cc60d468d82c0b63753d6
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Nov 4 18:13:15 2012 +0100
Guard format_size in Midori.Download against GLib 2.30
midori/midori-download.vala | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/midori/midori-download.vala b/midori/midori-download.vala
index 448b87e..86d3f2f 100644
--- a/midori/midori-download.vala
+++ b/midori/midori-download.vala
@@ -42,6 +42,12 @@ namespace Midori {
return download.progress;
}
+#if !HAVE_GLIB_2_30
+ private static string format_size (uint64 size) {
+ return format_size_for_display ((int64)size);
+ }
+#endif
+
public static string get_tooltip (WebKit.Download download) {
string filename = Path.get_basename (download.destination_uri);
/* i18n: Download tooltip (size): 4KB of 43MB */
@@ -82,7 +88,6 @@ namespace Midori {
}
string speed = "";
-#if HAVE_GLIB_2_30
uint64 last_size = download.get_data<uint64> ("last-size");
if (elapsed != last_time) {
speed = format_size ((uint64)(
@@ -93,7 +98,6 @@ namespace Midori {
speed = _("?B");
/* i18n: Download tooltip (transfer rate): (130KB/s) */
speed = _(" (%s/s)").printf (speed);
-#endif
if (elapsed - last_time > 5.0) {
download.set_data<int> ("last-time", (int)elapsed);
More information about the Xfce4-commits
mailing list