Changeset 42672 in webkit


Ignore:
Timestamp:
Apr 20, 2009 10:16:20 AM (15 years ago)
Author:
kov@webkit.org
Message:

2009-04-20 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>

Reviewed by Xan Lopez.

https://bugs.webkit.org/show_bug.cgi?id=24786
WebKitDownload sometimes suggests peculiar filenames

Remove query and ref from the URI that is to be downloaded when
using it to provide a file name suggestion.

  • webkit/webkitdownload.cpp: (_WebKitDownloadPrivate::webkit_download_set_property):
Location:
trunk/WebKit/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/gtk/ChangeLog

    r42670 r42672  
     12009-04-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
     2
     3        Reviewed by Xan Lopez.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=24786
     6        WebKitDownload sometimes suggests peculiar filenames
     7
     8        Remove query and ref from the URI that is to be downloaded when
     9        using it to provide a file name suggestion.
     10
     11        * webkit/webkitdownload.cpp:
     12        (_WebKitDownloadPrivate::webkit_download_set_property):
     13
    1142009-04-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
    215
  • trunk/WebKit/gtk/webkit/webkitdownload.cpp

    r42391 r42672  
    187187    WebKitDownload* download = WEBKIT_DOWNLOAD(object);
    188188    WebKitDownloadPrivate* priv = download->priv;
     189    KURL url;
    189190
    190191    switch(prop_id) {
     
    193194        // This is safe as network-request is a construct only property and
    194195        // suggestedFilename is initially null.
    195         priv->suggestedFilename = g_path_get_basename(webkit_network_request_get_uri(priv->networkRequest));
     196        url = KURL(KURL(), webkit_network_request_get_uri(priv->networkRequest));
     197        url.setQuery(String());
     198        url.removeRef();
     199        priv->suggestedFilename = g_strdup(decodeURLEscapeSequences(url.lastPathComponent()).utf8().data());
    196200        break;
    197201    case PROP_DESTINATION_URI:
Note: See TracChangeset for help on using the changeset viewer.