diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-12 06:11:18 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-05-19 03:43:23 +0200 |
commit | 5ceb169f1ec8ba58d00759c8591e898f3d8964bf (patch) | |
tree | 72f7bdc3821f25ed8ee8e5fa7752038e0fe123c8 | |
parent | b01dff505f2b3cf678c426a7de8a2a1ea21134b5 (diff) |
only check for updates once every 7 days
Change-Id: Ia2dc109ba80c346922c0236c3ca6ea09e18e9eb3
-rw-r--r-- | desktop/source/app/app.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index be2be3f0b5dc..871c28692899 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1239,7 +1239,17 @@ void restartOnMac(bool passArguments) { #if HAVE_FEATURE_UPDATE_MAR bool isTimeForUpdateCheck() { - return true; + sal_uInt64 nLastUpdate = officecfg::Office::Update::Update::LastUpdateTime::get(); + if (nLastUpdate == 0) + return true; + + sal_uInt64 nNow = tools::Time::GetSystemTicks(); + + sal_uInt64 n7DayInMS = 1000 * 60 * 60 * 24 * 7; // 7 days in ms + if (nNow - n7DayInMS >= nLastUpdate) + return true; + + return false; } #endif @@ -1485,7 +1495,11 @@ int Desktop::Main() } if (isTimeForUpdateCheck()) + { + sal_uInt64 nNow = tools::Time::GetSystemTicks(); + officecfg::Office::Update::Update::LastUpdateTime::set(nNow); m_aUpdateThread = std::thread(update_checker); + } } #endif |