WebView: Correctly define the cache path.
[GB.QT4.WEBKIT] * BUG: WebView: Correctly define the cache path. [GB.QT5.WEBKIT] * BUG: WebView: Correctly define the cache path.
This commit is contained in:
parent
6619f59263
commit
1f63103731
1 changed files with 5 additions and 3 deletions
|
@ -192,19 +192,21 @@ BEGIN_PROPERTY(WebSettingsCache_Path)
|
|||
GB.ReturnString(_cache_path);
|
||||
else
|
||||
{
|
||||
QString path = QString(GB.FileName(PSTRING(), PLENGTH()));
|
||||
char *path = GB.FileName(PSTRING(), PLENGTH());
|
||||
QString qpath = QString(path);
|
||||
QString root = QString(GB.System.Home());
|
||||
|
||||
if (root.at(root.length() - 1) != '/')
|
||||
root += '/';
|
||||
root += ".cache/";
|
||||
if (!path.startsWith(root))
|
||||
if (!qpath.startsWith(root))
|
||||
{
|
||||
GB.Error("Cache directory must be located inside ~/.cache");
|
||||
return;
|
||||
}
|
||||
|
||||
GB.StoreString(PROP(GB_STRING), &_cache_path);
|
||||
GB.FreeString(&_cache_path);
|
||||
_cache_path = GB.NewZeroString(path);
|
||||
set_cache(_cache_enabled);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue