aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-09-22 17:42:02 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-09-22 17:42:02 +0200
commit49e3cd8c5efec25c87e2d8888990b58711723bfd (patch)
treeb7eb679e2d7167873b38bdcddf9a90c5fc0881a6 /src
parentSubWindow: add 'open last closed tab/tabs' actions (diff)
downloadsmolbote-49e3cd8c5efec25c87e2d8888990b58711723bfd.tar.xz
Add bookmark auto-save (5min)
Diffstat (limited to 'src')
-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)