diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-04-09 04:03:47 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-04-09 04:03:47 +0800 |
commit | 4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3 (patch) | |
tree | ab7a50d08e50c0b205dcb57016e1b2c7e258dba2 | |
parent | 133d2d9b2c56be9beb374ffbb4db9cfc77df89ee (diff) | |
download | gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar.gz gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar.bz2 gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar.lz gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar.xz gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.tar.zst gsoc2013-epiphany-4a2e4ba29f26e2053a4f79cb43a7f7fdd047ecf3.zip |
More changes for 64bit downloads.
2005-04-08 Christian Persch <chpe@cvs.gnome.org>
* embed/downloader-view.c: (format_interval),
(update_download_row):
* embed/ephy-download.c: (update_remaining_time),
(ephy_download_get_remaining_time):
* embed/ephy-download.h:
* embed/mozilla/mozilla-download.cpp:
More changes for 64bit downloads.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | embed/downloader-view.c | 22 | ||||
-rw-r--r-- | embed/ephy-download.c | 12 | ||||
-rw-r--r-- | embed/ephy-download.h | 6 | ||||
-rw-r--r-- | embed/mozilla/mozilla-download.cpp | 2 |
5 files changed, 32 insertions, 21 deletions
@@ -1,5 +1,16 @@ 2005-04-08 Christian Persch <chpe@cvs.gnome.org> + * embed/downloader-view.c: (format_interval), + (update_download_row): + * embed/ephy-download.c: (update_remaining_time), + (ephy_download_get_remaining_time): + * embed/ephy-download.h: + * embed/mozilla/mozilla-download.cpp: + + More changes for 64bit downloads. + +2005-04-08 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/mozilla-download.h: Don't use G_BEGIN/END_DECLS here, and don't include MozDownload.h. diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 83ae90e09..4b518a39a 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -245,16 +245,17 @@ downloader_view_new (void) } static char * -format_interval (long interval) +format_interval (gint64 interval) { - int secs, hours, mins; - secs = (int)(interval + .5); - hours = secs / 3600; - secs -= hours * 3600; - mins = secs / 60; - secs -= mins * 60; - - if (hours) + int hours, mins, secs; + + hours = (int) interval / 3600; + interval -= hours * 3600; + mins = (int) interval / 60; + interval -= mins * 60; + secs = (int) interval; + + if (hours > 0) { return g_strdup_printf (_("%u:%02u.%02u"), hours, mins, secs); } @@ -321,8 +322,7 @@ update_download_row (DownloaderView *dv, EphyDownload *download) GtkTreePath *path; GtkTreeIter iter; EphyDownloadState state; - long remaining_secs = 0; - gint64 total, current; + gint64 remaining_secs = 0, total, current; char *remaining, *file, *cur_progress, *name; struct tm; int percent = 0; diff --git a/embed/ephy-download.c b/embed/ephy-download.c index cece472a5..a04d70eb6 100644 --- a/embed/ephy-download.c +++ b/embed/ephy-download.c @@ -41,8 +41,8 @@ enum struct _EphyDownloadPrivate { - long remaining_time_last_update; - long remaining_time; + gint64 remaining_time_last_update; + gint64 remaining_time; }; static GObjectClass *parent_class = NULL; @@ -140,7 +140,7 @@ ephy_download_get_name (EphyDownload *download) static void update_remaining_time (EphyDownload *download) { - long elapsed_time, total, cur; + gint64 elapsed_time, total, cur; total = ephy_download_get_total_progress (download); cur = ephy_download_get_current_progress (download); @@ -155,10 +155,10 @@ update_remaining_time (EphyDownload *download) } } -long +gint64 ephy_download_get_remaining_time (EphyDownload *download) { - long elapsed_time; + gint64 elapsed_time; elapsed_time = ephy_download_get_elapsed_time (download); if (elapsed_time - download->priv->remaining_time_last_update >= @@ -206,7 +206,7 @@ ephy_download_get_percent (EphyDownload *download) return klass->get_percent (download); } -long +gint64 ephy_download_get_elapsed_time (EphyDownload *download) { EphyDownloadClass *klass = EPHY_DOWNLOAD_GET_CLASS (download); diff --git a/embed/ephy-download.h b/embed/ephy-download.h index 4a3473e2b..d64fd50c6 100644 --- a/embed/ephy-download.h +++ b/embed/ephy-download.h @@ -64,7 +64,7 @@ struct _EphyDownloadClass int (* get_percent) (EphyDownload *download); gint64 (* get_current_progress) (EphyDownload *download); gint64 (* get_total_progress) (EphyDownload *download); - long (* get_elapsed_time) (EphyDownload *download); + gint64 (* get_elapsed_time) (EphyDownload *download); void (* cancel) (EphyDownload *download); void (* pause) (EphyDownload *download); void (* resume) (EphyDownload *download); @@ -96,9 +96,9 @@ gint64 ephy_download_get_current_progress (EphyDownload *download); gint64 ephy_download_get_total_progress (EphyDownload *download); -long ephy_download_get_elapsed_time (EphyDownload *download); +gint64 ephy_download_get_elapsed_time (EphyDownload *download); -long ephy_download_get_remaining_time (EphyDownload *download); +gint64 ephy_download_get_remaining_time (EphyDownload *download); void ephy_download_cancel (EphyDownload *download); diff --git a/embed/mozilla/mozilla-download.cpp b/embed/mozilla/mozilla-download.cpp index 73a26a40c..d89469ccd 100644 --- a/embed/mozilla/mozilla-download.cpp +++ b/embed/mozilla/mozilla-download.cpp @@ -161,7 +161,7 @@ impl_get_percent (EphyDownload *download) return percent; } -static long +static gint64 impl_get_elapsed_time (EphyDownload *download) { MozDownload *mozDownload; |