aboutsummaryrefslogtreecommitdiffstats
path: root/embed/downloader-view.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-11-07 05:37:16 +0800
committerXan Lopez <xan@src.gnome.org>2003-11-07 05:37:16 +0800
commitbb65e1ca58bc3ba4c1062de7000d4677f09aefb2 (patch)
treedef4570f1cd1f47e9f62a814e1f7e863e2808963 /embed/downloader-view.c
parent0997291f66dbb820c534a9a5cbf85ca75488db89 (diff)
downloadgsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar.gz
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar.bz2
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar.lz
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar.xz
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.tar.zst
gsoc2013-epiphany-bb65e1ca58bc3ba4c1062de7000d4677f09aefb2.zip
Use kB, MB and GB for the total size of the files being downloaded. Fixes
* embed/downloader-view.c: (download_changed_cb): Use kB, MB and GB for the total size of the files being downloaded. Fixes #126387 * embed/mozilla/ContentHandler.cpp: Small cleanup.
Diffstat (limited to 'embed/downloader-view.c')
-rw-r--r--embed/downloader-view.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index ff5d03633..c4738f5f8 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -74,7 +74,6 @@ enum
PROP_TREEVIEW,
PROP_PAUSE_BUTTON,
PROP_ABORT_BUTTON,
- PROP_DETAILS_BUTTON
};
static const
@@ -221,8 +220,6 @@ download_changed_cb (EphyDownload *download, DownloaderView *dv)
row_ref = get_row_from_download (dv, download);
g_return_if_fail (row_ref != NULL);
- total = ephy_download_get_total_progress (download) / 1024;
-
/* State special casing */
state = ephy_download_get_state (download);
switch (state)
@@ -245,7 +242,20 @@ download_changed_cb (EphyDownload *download, DownloaderView *dv)
break;
}
- size = g_strdup_printf ("%ld kB", total);
+ total = ephy_download_get_total_progress (download)/1024;
+ if (total <= 1024)
+ {
+ size = g_strdup_printf ("%ld kB", total);
+ }
+ else if (total <= 1024*1024)
+ {
+ size = g_strdup_printf ("%ld MB", total/1024);
+ }
+ else
+ {
+ size = g_strdup_printf ("%ld GB", total/(1024*1024));
+ }
+
remaining = format_interval (remaining_secs);
path = gtk_tree_row_reference_get_path (row_ref);