Changeset 152155 in webkit


Ignore:
Timestamp:
Jun 28, 2013 1:28:54 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] MiniBrowser doesn't solve the saving location when there are no XDG settings
https://bugs.webkit.org/show_bug.cgi?id=117538

Patch by Andres Gomez <Andres Gomez> on 2013-06-28
Reviewed by Carlos Garcia Campos.

If the XDG specification is not working for the "Downloads"
directory, let's use HOME as fallback.

  • UIProcess/API/gtk/WebKitDownload.cpp:

(webkitDownloadDecideDestination):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r152153 r152155  
     12013-06-28  Andres Gomez  <agomez@igalia.com>
     2
     3        [GTK] MiniBrowser doesn't solve the saving location when there are no XDG settings
     4        https://bugs.webkit.org/show_bug.cgi?id=117538
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        If the XDG specification is not working for the "Downloads"
     9        directory, let's use HOME as fallback.
     10
     11        * UIProcess/API/gtk/WebKitDownload.cpp:
     12        (webkitDownloadDecideDestination):
     13
    1142013-06-28  Dariusz Frankiewicz  <d.frankiewic@samsung.com>
    215
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp

    r145244 r152155  
    115115
    116116    GOwnPtr<char> filename(g_strdelimit(g_strdup(suggestedFilename), G_DIR_SEPARATOR_S, '_'));
    117     GOwnPtr<char> destination(g_build_filename(g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD), filename.get(), NULL));
     117    const gchar *downloadsDir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
     118    if (!downloadsDir) {
     119        // If we don't have XDG user dirs info, set just to HOME.
     120        downloadsDir = g_get_home_dir();
     121    }
     122    GOwnPtr<char> destination(g_build_filename(downloadsDir, filename.get(), NULL));
    118123    GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
    119124    download->priv->destinationURI = destinationURI.get();
Note: See TracChangeset for help on using the changeset viewer.