aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ProfileEditor/forms/profileview.cpp8
-rw-r--r--plugins/ProfileEditor/forms/profileview.ui35
2 files changed, 40 insertions, 3 deletions
diff --git a/plugins/ProfileEditor/forms/profileview.cpp b/plugins/ProfileEditor/forms/profileview.cpp
index 7ab8d39..6f61db1 100644
--- a/plugins/ProfileEditor/forms/profileview.cpp
+++ b/plugins/ProfileEditor/forms/profileview.cpp
@@ -132,13 +132,15 @@ void ProfileView::loadCookies(QWebEngineCookieStore *store)
});
connect(ui->cookies_delete, &QPushButton::clicked, store, [=]() {
- for(auto *item : ui->cookies->selectedItems()) {
- if(item->column() == 0) {
- auto cookie = item->data(Qt::UserRole).value<QNetworkCookie>();
+ for(auto &list : ui->cookies->selectedRanges()) {
+ for(int i = list.bottomRow(); i >= list.topRow(); --i) {
+ auto cookie = ui->cookies->item(i, 0)->data(Qt::UserRole).value<QNetworkCookie>();
store->deleteCookie(cookie);
}
}
});
+ connect(ui->cookies_deleteSession, &QPushButton::clicked, store, &QWebEngineCookieStore::deleteSessionCookies);
+ connect(ui->cookies_deleteAll, &QPushButton::clicked, store, &QWebEngineCookieStore::deleteAllCookies);
}
void ProfileView::cookieAdded(const QNetworkCookie &cookie)
diff --git a/plugins/ProfileEditor/forms/profileview.ui b/plugins/ProfileEditor/forms/profileview.ui
index c1507db..6c2edda 100644
--- a/plugins/ProfileEditor/forms/profileview.ui
+++ b/plugins/ProfileEditor/forms/profileview.ui
@@ -465,6 +465,27 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTableWidget" name="cookies">
+ <property name="sizeAdjustPolicy">
+ <enum>QAbstractScrollArea::AdjustToContents</enum>
+ </property>
+ <property name="editTriggers">
+ <set>QAbstractItemView::NoEditTriggers</set>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="cornerButtonEnabled">
+ <bool>false</bool>
+ </property>
+ <attribute name="horizontalHeaderHighlightSections">
+ <bool>false</bool>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
<column>
<property name="text">
<string>Name</string>
@@ -504,6 +525,20 @@
</widget>
</item>
<item>
+ <widget class="QPushButton" name="cookies_deleteSession">
+ <property name="text">
+ <string>Delete Session</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cookies_deleteAll">
+ <property name="text">
+ <string>Delete All</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>