diff options
author | adjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-06-02 22:41:57 +0000 |
---|---|---|
committer | adjam <adjam@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-06-02 22:41:57 +0000 |
commit | c9d8f10a2a361dd5dffa5d61b96bc96f0d50129d (patch) | |
tree | a2c949860fb01f2efb3dfd3b439a726a4e3ea753 /src/cookiejar.h | |
parent | Merge branch 'master' into local-svn (diff) | |
parent | new cookie management system. That (hopefully) works well..;) (diff) | |
download | rekonq-c9d8f10a2a361dd5dffa5d61b96bc96f0d50129d.tar.xz |
Merge branch 'master' into local-svn
git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/network/rekonq@976901 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/cookiejar.h')
-rw-r--r-- | src/cookiejar.h | 107 |
1 files changed, 4 insertions, 103 deletions
diff --git a/src/cookiejar.h b/src/cookiejar.h index 03802df1..08c65218 100644 --- a/src/cookiejar.h +++ b/src/cookiejar.h @@ -25,14 +25,10 @@ // Qt Includes -#include <QNetworkCookieJar> -#include <QAbstractItemModel> -#include <QStringList> -#include <QTableView> +#include <QtCore/QStringList> +#include <QtNetwork/QNetworkCookieJar> // Forward Declarations -class QSortFilterProxyModel; -class QKeyEvent; class AutoSaver; class QUrl; @@ -41,11 +37,13 @@ class CookieJar : public QNetworkCookieJar { friend class CookieModel; Q_OBJECT + Q_PROPERTY(AcceptPolicy acceptPolicy READ acceptPolicy WRITE setAcceptPolicy) Q_PROPERTY(KeepPolicy keepPolicy READ keepPolicy WRITE setKeepPolicy) Q_PROPERTY(QStringList blockedCookies READ blockedCookies WRITE setBlockedCookies) Q_PROPERTY(QStringList allowedCookies READ allowedCookies WRITE setAllowedCookies) Q_PROPERTY(QStringList allowForSessionCookies READ allowForSessionCookies WRITE setAllowForSessionCookies) + Q_ENUMS(KeepPolicy) Q_ENUMS(AcceptPolicy) @@ -96,9 +94,6 @@ private slots: private: void purgeOldCookies(); - void load(); - bool m_loaded; - AutoSaver *m_saveTimer; AcceptPolicy m_acceptCookies; KeepPolicy m_keepCookies; @@ -108,98 +103,4 @@ private: QStringList m_exceptions_allowForSession; }; - -// ------------------------------------------------------------------------------------------------------------- - - -class CookieModel : public QAbstractTableModel -{ - Q_OBJECT - -public: - explicit CookieModel(CookieJar *jar, QObject *parent = 0); - - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); - -private slots: - void cookiesChanged(); - -private: - CookieJar *m_cookieJar; -}; - - -// ---------------------------------------------------------------------------------------------------------------------- - - -#include "ui_cookies.h" - -class CookiesDialog : public QDialog, public Ui_CookiesDialog -{ - Q_OBJECT - -public: - explicit CookiesDialog(CookieJar *cookieJar, QWidget *parent = 0); - -private: - QSortFilterProxyModel *m_proxyModel; -}; - - -// ---------------------------------------------------------------------------------------------------------------------- - - -class CookieExceptionsModel : public QAbstractTableModel -{ - Q_OBJECT - friend class CookiesExceptionsDialog; - -public: - explicit CookieExceptionsModel(CookieJar *cookieJar, QObject *parent = 0); - - QVariant headerData(int section, Qt::Orientation orientation, int role) const; - QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - int rowCount(const QModelIndex &parent = QModelIndex()) const; - bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); - -private: - CookieJar *m_cookieJar; - - // Domains we allow, Domains we block, Domains we allow for this session - QStringList m_allowedCookies; - QStringList m_blockedCookies; - QStringList m_sessionCookies; -}; - - -// ----------------------------------------------------------------------------------------------------------------- - - -#include "ui_cookiesexceptions.h" - -class CookiesExceptionsDialog : public QDialog, public Ui_CookiesExceptionsDialog -{ - Q_OBJECT - -public: - explicit CookiesExceptionsDialog(CookieJar *cookieJar, QWidget *parent = 0); - -private slots: - void block(); - void allow(); - void allowForSession(); - void textChanged(const QString &text); - -private: - CookieExceptionsModel *m_exceptionsModel; - QSortFilterProxyModel *m_proxyModel; - CookieJar *m_cookieJar; -}; - #endif // COOKIEJAR_H - |