fix autosaver once more

This commit is contained in:
Martin Rotter 2023-01-18 11:03:24 +01:00
parent bf208fc9dd
commit e688e2e79f
2 changed files with 11 additions and 6 deletions

View File

@ -35,13 +35,16 @@ void AutoSaver::changeOccurred() {
saveIfNeccessary();
}
else {
m_timer.start(m_periodicSaveMsecs);
QMetaObject::invokeMethod(&m_timer,
"start",
Qt::ConnectionType::BlockingQueuedConnection,
Q_ARG(int, m_periodicSaveMsecs));
}
}
void AutoSaver::saveIfNeccessary() {
if (m_timer.isActive()) {
m_timer.stop();
QMetaObject::invokeMethod(&m_timer, "stop", Qt::ConnectionType::BlockingQueuedConnection);
m_firstChange.invalidate();
if (!QMetaObject::invokeMethod(parent(), qPrintable(m_savingSlot), Qt::ConnectionType::DirectConnection)) {

View File

@ -14,6 +14,8 @@ class QWebEngineCookieStore;
#endif
class CookieJar : public QNetworkCookieJar {
Q_OBJECT
public:
explicit CookieJar(QObject* parent = nullptr);
@ -29,15 +31,15 @@ class CookieJar : public QNetworkCookieJar {
public:
static QList<QNetworkCookie> extractCookiesFromUrl(const QString& url);
public slots:
void loadCookies();
void saveCookies();
private:
bool insertCookieInternal(const QNetworkCookie& cookie, bool notify_others, bool should_save);
bool updateCookieInternal(const QNetworkCookie& cookie, bool notify_others);
bool deleteCookieInternal(const QNetworkCookie& cookie, bool notify_others);
private slots:
void loadCookies();
void saveCookies();
private:
#if defined(USE_WEBENGINE)
QWebEngineCookieStore* m_webEngineCookies;