fix: clear cookies when click the Reset button

This commit is contained in:
Kevin Yue 2022-06-12 13:52:36 +08:00
parent 6cf909e34f
commit bf03d375e0
2 changed files with 5 additions and 1 deletions

View File

@ -112,7 +112,7 @@ void GPClient::initSystemTrayIcon()
connectAction = contextMenu->addAction(QIcon::fromTheme("preferences-system-network"), "Connect", this, &GPClient::doConnect); connectAction = contextMenu->addAction(QIcon::fromTheme("preferences-system-network"), "Connect", this, &GPClient::doConnect);
contextMenu->addMenu(gatewaySwitchMenu); contextMenu->addMenu(gatewaySwitchMenu);
contextMenu->addSeparator(); contextMenu->addSeparator();
clearAction = contextMenu->addAction(QIcon::fromTheme("edit-clear"), "Reset Settings", this, &GPClient::clearSettings); clearAction = contextMenu->addAction(QIcon::fromTheme("edit-clear"), "Reset", this, &GPClient::clearSettings);
quitAction = contextMenu->addAction(QIcon::fromTheme("application-exit"), "Quit", this, &GPClient::quit); quitAction = contextMenu->addAction(QIcon::fromTheme("application-exit"), "Quit", this, &GPClient::quit);
systemTrayIcon->show(); systemTrayIcon->show();

View File

@ -7,6 +7,8 @@
#include <QtNetwork/QSslConfiguration> #include <QtNetwork/QSslConfiguration>
#include <QtNetwork/QSslSocket> #include <QtNetwork/QSslSocket>
#include <plog/Log.h> #include <plog/Log.h>
#include <QWebEngineProfile>
#include <QWebEngineCookieStore>
#include "gphelper.h" #include "gphelper.h"
@ -127,4 +129,6 @@ void gpclient::helper::settings::clear()
_settings->remove(key); _settings->remove(key);
} }
} }
QWebEngineProfile::defaultProfile()->cookieStore()->deleteAllCookies();
} }