Title: [152155] trunk/Source/WebKit2
Revision
152155
Author
commit-qu...@webkit.org
Date
2013-06-28 01:28:54 -0700 (Fri, 28 Jun 2013)

Log 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 <ago...@igalia.com> 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):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (152154 => 152155)


--- trunk/Source/WebKit2/ChangeLog	2013-06-28 08:20:19 UTC (rev 152154)
+++ trunk/Source/WebKit2/ChangeLog	2013-06-28 08:28:54 UTC (rev 152155)
@@ -1,3 +1,16 @@
+2013-06-28  Andres Gomez  <ago...@igalia.com>
+
+        [GTK] MiniBrowser doesn't solve the saving location when there are no XDG settings
+        https://bugs.webkit.org/show_bug.cgi?id=117538
+
+        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):
+
 2013-06-28  Dariusz Frankiewicz  <d.frankie...@samsung.com>
 
         [EFL][WK2] Add spellcheck API tests in unit tests.

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp (152154 => 152155)


--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp	2013-06-28 08:20:19 UTC (rev 152154)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitDownload.cpp	2013-06-28 08:28:54 UTC (rev 152155)
@@ -114,7 +114,12 @@
         return FALSE;
 
     GOwnPtr<char> filename(g_strdelimit(g_strdup(suggestedFilename), G_DIR_SEPARATOR_S, '_'));
-    GOwnPtr<char> destination(g_build_filename(g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD), filename.get(), NULL));
+    const gchar *downloadsDir = g_get_user_special_dir(G_USER_DIRECTORY_DOWNLOAD);
+    if (!downloadsDir) {
+        // If we don't have XDG user dirs info, set just to HOME.
+        downloadsDir = g_get_home_dir();
+    }
+    GOwnPtr<char> destination(g_build_filename(downloadsDir, filename.get(), NULL));
     GOwnPtr<char> destinationURI(g_filename_to_uri(destination.get(), 0, 0));
     download->priv->destinationURI = destinationURI.get();
     g_object_notify(G_OBJECT(download), "destination");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to