changeset 446:1b0dabe4afa2

- Switched a_UIcmd_save() to take its URL from history (not location bar).
author jcid
date Sun, 09 Nov 2008 13:17:56 +0100
parents 92dd688aafce
children ba84335ff775
files ChangeLog src/uicmd.cc
diffstat 2 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 05 19:11:02 2008 +0100
+++ b/ChangeLog	Sun Nov 09 13:17:56 2008 +0100
@@ -13,6 +13,7 @@
  - Tuned input width a bit.
  - Cleaned up resource embedding (forms)
  - Made cookierc parsing more robust.
+ - Switched a_UIcmd_save() to take its URL from history (not location bar).
    Patches: place (AKA corvid)
 +- Switched SSL-enabled to configure.in (./configure --enable-ssl).
  - Standardised the installation of dpid/dpidrc with auto* tools.
--- a/src/uicmd.cc	Wed Nov 05 19:11:02 2008 +0100
+++ b/src/uicmd.cc	Sun Nov 09 13:17:56 2008 +0100
@@ -484,24 +484,21 @@
 void a_UIcmd_save(void *vbw)
 {
    const char *name;
-   char *SuggestedName, *urlstr;
-   DilloUrl *url;
-
-   a_UIcmd_set_save_dir(prefs.save_dir);
+   char *SuggestedName;
+   BrowserWindow *bw = (BrowserWindow *)vbw;
+   const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
 
-   urlstr = a_UIcmd_get_location_text((BrowserWindow*)vbw);
-   url = a_Url_new(urlstr, NULL);
-   SuggestedName = UIcmd_make_save_filename(URL_PATH(url));
-   name = a_Dialog_save_file("Save Page as File", NULL, SuggestedName);
-   MSG("a_UIcmd_save: %s\n", name);
-   dFree(SuggestedName);
-   dFree(urlstr);
+   if (url) {
+      a_UIcmd_set_save_dir(prefs.save_dir);
+      SuggestedName = UIcmd_make_save_filename(URL_PATH(url));
+      name = a_Dialog_save_file("Save Page as File", NULL, SuggestedName);
+      MSG("a_UIcmd_save: %s\n", name);
+      dFree(SuggestedName);
 
-   if (name) {
-      a_Nav_save_url((BrowserWindow*)vbw, url, name);
-   }
-
-   a_Url_free(url);
+      if (name) {
+         a_Nav_save_url(bw, url, name);
+      }
+   } 
 }
 
 /*