]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/blobdiff - src/dialogs/CookiesDialog.h
Add a default folder icon to the edit folder dialog. https://redmine.stoutner.com...
[PrivacyBrowserPC.git] / src / dialogs / CookiesDialog.h
index 770a84681bfcd7b3c5bd9af7ce6203f1bafa8da3..5319897e68bd5a2cb77c91d52873941961347347 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+ * Copyright 2022-2024 Soren Stoutner <soren@stoutner.com>.
  *
  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
  *
@@ -28,7 +28,7 @@
 #include <QTreeView>
 
 // C++ headers.
-#include <forward_list>
+#include <list>
 
 class CookiesDialog : public QDialog
 {
@@ -37,7 +37,7 @@ class CookiesDialog : public QDialog
 
 public:
     // The primary constructor.
-    explicit CookiesDialog(std::forward_list<QNetworkCookie> *cookieListPointer);
+    explicit CookiesDialog(std::list<QNetworkCookie> *cookieListPointer);
 
 signals:
     // The signals.
@@ -47,26 +47,30 @@ signals:
 
 private Q_SLOTS:
     // The private slots.
-    void addCookieFromDialog(const QNetworkCookie &cookie) const;
+    void addCookieFromDialog(const QNetworkCookie &cookie, const bool &isDurable) const;
+    void deleteCookieFromDatabase(const QNetworkCookie &cookie) const;
     void deleteCookieFromDialog(const QNetworkCookie &cookie) const;
-    void showAddCookieDialog() const;
+    void showAddCookieDialog();
     void showDeleteAllMessageBox() const;
     void showDeleteCookieMessageBox() const;
-    void showEditCookieDialog() const;
+    void showDurableCookiesDialog();
+    void showEditCookieDialog();
     void updateUi() const;
 
 private:
     // The private variables.
-    QItemSelectionModel *treeViewSelectionModelPointer;
     QPushButton *addCookieButtonPointer;
-    std::forward_list<QNetworkCookie> *cookieListPointer;
+    std::list<QNetworkCookie> *cookieListPointer;
     QPushButton *deleteAllButtonPointer;
     QPushButton *deleteCookieButtonPointer;
+    QPushButton *durableCookiesButtonPointer;
     QPushButton *editCookieButtonPointer;
-    QStandardItemModel *standardItemModelPointer;
+    QStandardItemModel *treeModelPointer;
+    QItemSelectionModel *treeSelectionModelPointer;
     QTreeView *treeViewPointer;
 
     // The private functions.
-    void deleteCookie(const QModelIndex &modelIndex) const;
+    void deleteCookie(const QModelIndex &modelIndex, const bool &deleteDurableCookies) const;
+    void deleteDomain(const QModelIndex &modelIndex, const bool &deleteDurableCookies) const;
 };
 #endif