From 34b76e16a93ada1c21369fba8dee4ce9e752848d Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 5 Jun 2003 07:41:18 +0000 Subject: Actually add the ask for dest pref, it was using the wrong key. 2003-06-05 Marco Pesenti Gritti * data/epiphany.schemas.in: * embed/ephy-embed-popup.c: (embed_popup_download_link_cmd): * embed/ephy-embed-utils.c: (ephy_embed_utils_save): Actually add the ask for dest pref, it was using the wrong key. * embed/mozilla/FilePicker.cpp: * embed/mozilla/mozilla-embed-single.cpp: Return directory also on cancel. * lib/ephy-prefs.h: * src/popup-commands.c: (popup_cmd_download_link): Persist directory also on cancel. --- embed/mozilla/FilePicker.cpp | 8 +++----- embed/mozilla/mozilla-embed-single.cpp | 27 ++++++++++++--------------- 2 files changed, 15 insertions(+), 20 deletions(-) (limited to 'embed/mozilla') diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp index e39419ac8..9e10c1d8f 100644 --- a/embed/mozilla/FilePicker.cpp +++ b/embed/mozilla/FilePicker.cpp @@ -280,11 +280,9 @@ NS_IMETHODIMP GFilePicker::Show(PRInt16 *_retval) gint retVal = gtk_dialog_run(GTK_DIALOG(mFileSelector)); - if (retVal == GTK_RESPONSE_OK) - { - HandleFilePickerResult(_retval); - } - else + HandleFilePickerResult(_retval); + + if (retVal != GTK_RESPONSE_OK) { *_retval = returnCancel; } diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 211d2eb30..d865c6881 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -1100,6 +1100,7 @@ impl_show_file_picker (EphyEmbedSingle *shell, int *ret_file_format) { gchar *expanded_directory; + gresult result; GFilePicker *filePicker = new GFilePicker (file_formats); @@ -1132,19 +1133,15 @@ impl_show_file_picker (EphyEmbedSingle *shell, *ret_file_format = filePicker->mSelectedFileFormat; } - if (retval == nsIFilePicker::returnCancel) - { - delete filePicker; - return G_FAILED; - } - else - { - nsCOMPtr file; - filePicker->GetFile (getter_AddRefs(file)); - nsCAutoString tempFullPathStr; - file->GetNativePath (tempFullPathStr); - *ret_fullpath = g_strdup (tempFullPathStr.get()); - delete filePicker; - return G_OK; - } + nsCOMPtr local_file; + filePicker->GetFile (getter_AddRefs(local_file)); + nsCAutoString tempFullPathStr; + local_file->GetNativePath (tempFullPathStr); + *ret_fullpath = g_strdup (tempFullPathStr.get()); + + result = (retval == nsIFilePicker::returnCancel) ? G_FAILED : G_OK; + + delete filePicker; + + return result; } -- cgit v1.2.3