From 2a696a57abafb25978aef1af5758fe75b706d1f0 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Wed, 16 Jan 2019 16:52:07 +0100 Subject: Rewrite lib/web to lib/webprofile - libweb was supposed to be a general QtWebEngine wrapper, but only turned out to do profiles and profile management. The new name should make this more obvious. - Renamed ProfileManager to WebProfileManager, and cut out duplicate code. - Temporary profiles: temporary profiles are not kept after closing the browser. --- lib/web/webprofile.h | 94 ---------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 lib/web/webprofile.h (limited to 'lib/web/webprofile.h') diff --git a/lib/web/webprofile.h b/lib/web/webprofile.h deleted file mode 100644 index a3b5b12..0000000 --- a/lib/web/webprofile.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of smolbote. It's copyrighted by the contributors recorded - * in the version control history of the file, available from its original - * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote - * - * SPDX-License-Identifier: GPL-3.0 - */ - -#ifndef SMOLBOTE_WEBENGINEPROFILE_H -#define SMOLBOTE_WEBENGINEPROFILE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class WebProfile : public Profile -{ - Q_OBJECT - -public: - // off-the-record constructor - explicit WebProfile(const QString &name, QObject *parent = nullptr); - // default constructor - explicit WebProfile(const QString &storageName, const QString &name, QObject *parent = nullptr); - - ~WebProfile() = default; - - static void setDefaultProfile(WebProfile *profile) - { - Q_CHECK_PTR(profile); - WebProfile::profile = profile; - } - static WebProfile *defaultProfile() - { - Q_CHECK_PTR(WebProfile::profile); - return WebProfile::profile; - } - - const QString name() const; - void setName(const QString &name); - - const QVector cookies() const - { - return qAsConst(m_cookies); - } - const QMap headers() const - { - return qAsConst(m_headers); - } - - // search url - QString search() const; - void setSearch(const QString &url); - - // homepage url - QUrl homepage() const; - void setHomepage(const QUrl &url); - - // new tab url - QUrl newtab() const; - void setNewtab(const QUrl &url); - - void setCachePath(const QString &path); - void setPersistentStoragePath(const QString &path); - void setPersistentCookiesPolicy(int policy); - - void setHttpAcceptLanguage(const QString &httpAcceptLanguage); - void setHttpCacheMaximumSize(int maxSize); - void setHttpCacheType(int type); - void setHttpUserAgent(const QString &userAgent); - void setHttpHeader(const QString &name, const QString &value); - void removeHttpHeader(const QString &name); - - void setSpellCheckEnabled(bool enable); - -private: - static WebProfile *profile; - - QString m_name; - QString m_search = QString("about:blank"); - QUrl m_homepage = QUrl("about:blank"); - QUrl m_newtab = QUrl("about:blank"); - - QVector m_cookies; - QMap m_headers; -}; - -#endif // SMOLBOTE_WEBENGINEPROFILE_H -- cgit v1.2.1