aboutsummaryrefslogtreecommitdiffstats
path: root/embed
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
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')
-rw-r--r--embed/downloader-view.c18
-rw-r--r--embed/mozilla/ContentHandler.cpp2
2 files changed, 14 insertions, 6 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);
diff --git a/embed/mozilla/ContentHandler.cpp b/embed/mozilla/ContentHandler.cpp
index 386c082c2..8f0267d33 100644
--- a/embed/mozilla/ContentHandler.cpp
+++ b/embed/mozilla/ContentHandler.cpp
@@ -28,7 +28,6 @@
#include "nsCOMPtr.h"
#include "nsString.h"
-#include "nsIURI.h"
#include "nsIURL.h"
#include "nsILocalFile.h"
#include "nsIMIMEInfo.h"
@@ -360,7 +359,6 @@ NS_METHOD GContentHandler::MIMEAskAction (void)
if (NS_FAILED (rv)) return rv;
rv = mContentHandler->FindHelperApp ();
if (NS_FAILED (rv)) return rv;
-
}
return NS_OK;