aboutsummaryrefslogtreecommitdiffstats
path: root/embed/webkit/webkit-embed.c
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2009-03-05 15:37:16 +0800
committerXan Lopez <xan@src.gnome.org>2009-03-05 15:37:16 +0800
commitc2bde457bf24816a0b5be5a4ab46f3b999e2345f (patch)
treee13af1d35d86adb7bd3ff20207ac5454a2643c40 /embed/webkit/webkit-embed.c
parent7806d4c72e4c79cbdea93c388eb9319189f17047 (diff)
downloadgsoc2013-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
Diffstat (limited to 'embed/webkit/webkit-embed.c')
-rw-r--r--embed/webkit/webkit-embed.c23
1 files changed, 13 insertions, 10 deletions
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;