aboutsummaryrefslogtreecommitdiff
path: root/src/browser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/browser.cpp')
-rw-r--r--src/browser.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/browser.cpp b/src/browser.cpp
index b5c98b0..ff78d0d 100644
--- a/src/browser.cpp
+++ b/src/browser.cpp
@@ -25,6 +25,7 @@
#include <web/webprofile.h>
#include <web/profilemanager.h>
#include <QJsonDocument>
+#include <QTimer>
Browser::Browser(int &argc, char *argv[], bool allowSecondary)
: SingleApplication(argc, argv, allowSecondary, SingleApplication::User | SingleApplication::SecondaryNotification | SingleApplication::ExcludeAppVersion)
@@ -137,6 +138,11 @@ void Browser::setup(const QString &defaultProfile)
connect(m_bookmarks.get(), &BookmarksWidget::openUrl, this, [this](const QUrl &url) {
m_windows.last()->createTab(url);
});
+
+ auto *timer = new QTimer(this);
+ connect(timer, &QTimer::timeout, m_bookmarks.get(), &BookmarksWidget::save);
+ // 5min * 60sec * 1000ms
+ timer->start(5*60*1000);
}
void Browser::createSession(const QJsonObject &object)