From 49e3cd8c5efec25c87e2d8888990b58711723bfd Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 22 Sep 2018 17:42:02 +0200 Subject: Add bookmark auto-save (5min) --- src/browser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 #include #include +#include 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) -- cgit v1.2.1