diff options
author | Xan Lopez <xan@src.gnome.org> | 2009-03-05 15:37:16 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2009-03-05 15:37:16 +0800 |
commit | c2bde457bf24816a0b5be5a4ab46f3b999e2345f (patch) | |
tree | e13af1d35d86adb7bd3ff20207ac5454a2643c40 | |
parent | 7806d4c72e4c79cbdea93c388eb9319189f17047 (diff) | |
download | gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar.gz gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar.bz2 gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar.lz gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar.xz gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.tar.zst gsoc2013-epiphany-c2bde457bf24816a0b5be5a4ab46f3b999e2345f.zip |
Fix a few compiler warnings and coding style.
svn path=/trunk/; revision=8851
-rw-r--r-- | embed/downloader-view.c | 2 | ||||
-rw-r--r-- | embed/webkit/webkit-embed.c | 23 |
2 files changed, 14 insertions, 11 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c index b0380cfb7..8fb8d6d61 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -398,6 +398,7 @@ ephy_download_get_remaining_time (WebKitDownload *download) gint64 total, cur; gdouble elapsed_time; gdouble remaining_time; + gdouble per_byte_time; total = webkit_download_get_total_size (download); cur = webkit_download_get_current_size (download); @@ -408,7 +409,6 @@ ephy_download_get_remaining_time (WebKitDownload *download) return -1.0; } - gdouble per_byte_time; per_byte_time = elapsed_time / cur; remaining_time = per_byte_time * (total - cur); diff --git a/embed/webkit/webkit-embed.c b/embed/webkit/webkit-embed.c index 2202ad3f3..f112f40ea 100644 --- a/embed/webkit/webkit-embed.c +++ b/embed/webkit/webkit-embed.c @@ -389,34 +389,37 @@ download_requested_cb (WebKitWebView *web_view, WebKitEmbed *embed) { EphyFileChooser *dialog; - - GtkWindow *window; - + GtkWidget *window; gint dialog_result; gboolean handled = FALSE; - /* Try to get the toplevel window related to the WebView that caused the - * download, and use NULL otherwise; we don't want to pass the WebView - * or other widget as a parent window. + /* + * Try to get the toplevel window related to the WebView that caused + * the download, and use NULL otherwise; we don't want to pass the + * WebView or other widget as a parent window. */ window = gtk_widget_get_toplevel (GTK_WIDGET(web_view)); if (!GTK_WIDGET_TOPLEVEL (window)) window = NULL; dialog = ephy_file_chooser_new (_("Save"), - window ? GTK_WIDGET (window) : NULL, + window ? window : NULL, GTK_FILE_CHOOSER_ACTION_SAVE, CONF_STATE_SAVE_DIR, EPHY_FILE_FILTER_ALL_SUPPORTED); gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (dialog), TRUE); - gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), webkit_download_get_suggested_filename (download)); + /* + * FIXME: agh! gtk_dialog_run. By default the download is cancelled + * if we return FALSE, so I think we should just return TRUE always + * here and cancel the download ourselves if the user does click + * Cancel + */ dialog_result = gtk_dialog_run (GTK_DIALOG (dialog)); - if (dialog_result == GTK_RESPONSE_ACCEPT) - { + if (dialog_result == GTK_RESPONSE_ACCEPT) { DownloaderView *dview; char *uri; |