diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-17 19:50:56 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-06-17 19:50:56 +0200 |
commit | d340be4b27b9067c0057b20f6bd0228f03c994c6 (patch) | |
tree | 2cfe95ccf9d83cf14ecd0a154f6cd05d2b04745b /plugins | |
parent | Sort .profile by time (diff) | |
download | smolbote-d340be4b27b9067c0057b20f6bd0228f03c994c6.tar.xz |
WebProfile: cache a list of cookies
ProfileView: delete selected items rather than current item
Browser: store profiles in QMap instead of QHash
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ProfileEditor/forms/profileview.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/ProfileEditor/forms/profileview.cpp b/plugins/ProfileEditor/forms/profileview.cpp index f2e74ad..7ab8d39 100644 --- a/plugins/ProfileEditor/forms/profileview.cpp +++ b/plugins/ProfileEditor/forms/profileview.cpp @@ -71,6 +71,9 @@ ProfileView::ProfileView(WebProfile *profile, QWidget *parent) // cookies tab loadCookies(profile->cookieStore()); + for(const auto &c : profile->cookies()) { + cookieAdded(c); + } } ProfileView::~ProfileView() @@ -129,11 +132,13 @@ void ProfileView::loadCookies(QWebEngineCookieStore *store) }); connect(ui->cookies_delete, &QPushButton::clicked, store, [=]() { - auto index = ui->cookies->currentRow(); - auto cookie = ui->cookies->item(index, 0)->data(Qt::UserRole).value<QNetworkCookie>(); - store->deleteCookie(cookie); + for(auto *item : ui->cookies->selectedItems()) { + if(item->column() == 0) { + auto cookie = item->data(Qt::UserRole).value<QNetworkCookie>(); + store->deleteCookie(cookie); + } + } }); - } void ProfileView::cookieAdded(const QNetworkCookie &cookie) |