summaryrefslogtreecommitdiff
path: root/desktop/source/app/app.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/app/app.cxx')
-rw-r--r--desktop/source/app/app.cxx16
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