Bug 69111 - [Qt][WK2] Default directories and paths are missing for LocalStorage, Database and IconDatabase.
Summary: [Qt][WK2] Default directories and paths are missing for LocalStorage, Databas...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Qt (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexis Menard (darktears)
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks:
 
Reported: 2011-09-29 16:22 PDT by Alexis Menard (darktears)
Modified: 2011-10-05 07:19 PDT (History)
6 users (show)

See Also:


Attachments
Patch (4.90 KB, patch)
2011-09-29 16:44 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (5.25 KB, patch)
2011-10-04 10:34 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (5.44 KB, patch)
2011-10-05 05:15 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff
Patch (5.46 KB, patch)
2011-10-05 05:59 PDT, Alexis Menard (darktears)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Menard (darktears) 2011-09-29 16:22:29 PDT
[Qt][WK2] Default directories and paths are missing for LocalStorage, Database and IconDatabase.
Comment 1 Alexis Menard (darktears) 2011-09-29 16:44:59 PDT
Created attachment 109220 [details]
Patch
Comment 2 Kenneth Rohde Christiansen 2011-09-29 18:03:59 PDT
Comment on attachment 109220 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109220&action=review

> Source/WebKit2/UIProcess/qt/WebContextQt.cpp:41
> +    QDir().mkpath(s_dataLocation);

What if this fails?
Comment 3 Alexis Menard (darktears) 2011-09-30 05:27:17 PDT
(In reply to comment #2)
> (From update of attachment 109220 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=109220&action=review
> 
> > Source/WebKit2/UIProcess/qt/WebContextQt.cpp:41
> > +    QDir().mkpath(s_dataLocation);
> 
> What if this fails?

We could just return empty paths then. Will update the patch on monday.
Comment 4 Alexis Menard (darktears) 2011-10-04 10:34:07 PDT
Created attachment 109641 [details]
Patch
Comment 5 Alexis Menard (darktears) 2011-10-04 10:38:30 PDT
(In reply to comment #4)
> Created an attachment (id=109641) [details]
> Patch

The new patch as a fallback to a sensible path if there is no DataLocation from QDesktopServices (it writes into home so the mkdir should work).
Comment 6 Simon Hausmann 2011-10-05 02:00:13 PDT
Comment on attachment 109641 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109641&action=review

> Source/WebKit2/UIProcess/qt/WebContextQt.cpp:85
> +    QDir().mkpath(defaultLocalStorageDirectory);

Hm, this calls mkpath() every time, which for a given path /foo/bar/baz will stat() /foo, /foo/bar and /foo/bar/baz every time.

Maybe that could be avoided :)
Comment 7 Alexis Menard (darktears) 2011-10-05 05:15:26 PDT
Created attachment 109775 [details]
Patch
Comment 8 Kenneth Rohde Christiansen 2011-10-05 05:18:49 PDT
Comment on attachment 109775 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109775&action=review

> Source/WebKit2/UIProcess/qt/WebContextQt.cpp:78
> +    s_defaultDatabaseDirectory = defaultDataLocation() + QLatin1String("Databases");

Are you sure that defaultDataLocation always ends with a / ? It is user configurable right via QDesktopServies
Comment 9 Alexis Menard (darktears) 2011-10-05 05:59:11 PDT
Created attachment 109779 [details]
Patch
Comment 10 WebKit Review Bot 2011-10-05 07:19:33 PDT
Comment on attachment 109779 [details]
Patch

Clearing flags on attachment: 109779

Committed r96702: <http://trac.webkit.org/changeset/96702>
Comment 11 WebKit Review Bot 2011-10-05 07:19:38 PDT
All reviewed patches have been landed.  Closing bug.