Commit 29ff23a8 authored by Andreas Traczyk's avatar Andreas Traczyk

webengine: force AppData/Local/jami for GPU caching

Change-Id: Ib57f2071ef02be7803c1152ea295dafc622ca60a
parent 4ce383a6
......@@ -16,18 +16,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#include <QDesktopServices>
#include "messagewebpage.h"
MessageWebPage::MessageWebPage(QWidget *parent)
: QWebEnginePage(parent)
{
}
#include <QDesktopServices>
MessageWebPage::MessageWebPage(QWebEngineProfile *profile, QWidget *parent)
: QWebEnginePage(profile, parent)
{}
MessageWebPage::~MessageWebPage()
{
}
{}
bool
MessageWebPage::acceptNavigationRequest(const QUrl & url, QWebEnginePage::NavigationType type, bool isMainFrame)
......
......@@ -24,7 +24,7 @@ class MessageWebPage : public QWebEnginePage
{
Q_OBJECT
public:
explicit MessageWebPage(QWidget* parent = nullptr);
explicit MessageWebPage(QWebEngineProfile *profile, QWidget* parent = nullptr);
~MessageWebPage();
protected:
......
......@@ -31,6 +31,7 @@
#include <QWebEngineScript>
#include <QWebEngineScriptCollection>
#include <QWebEngineSettings>
#include <QWebEngineProfile>
#include <QWebChannel>
#include <QTimer>
......@@ -45,7 +46,17 @@
MessageWebView::MessageWebView(QWidget *parent)
: QWebEngineView(parent)
{
setPage(new MessageWebPage());
QWebEngineProfile* profile = QWebEngineProfile::defaultProfile();
QDir dataDir(QStandardPaths::writableLocation(
QStandardPaths::AppLocalDataLocation));
dataDir.cdUp();
auto cachePath = dataDir.absolutePath() + "/jami";
profile->setCachePath(cachePath);
profile->setPersistentStoragePath(cachePath);
profile->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
profile->setHttpCacheType(QWebEngineProfile::NoCache);
setPage(new MessageWebPage(profile, this));
settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true);
settings()->setAttribute(QWebEngineSettings::JavascriptCanOpenWindows, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment