From 12ba560fd6fa4326ddc5379942115813dabeff2e Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 10 Aug 2016 11:45:52 -0400 Subject: [PATCH] API CHANGE Add a new field in the output args for the sysadm/updates check for updates: "last_check":"" This returns the timestamp the last time a "full" check was performed (since some checks are flagged as quick/automatic and just re-use the previous check unless a significant amount of time has passed first - 12 hours is what it is set to right now). --- src/server/library/sysadm-update.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/library/sysadm-update.cpp b/src/server/library/sysadm-update.cpp index bed0ebd..e892dfc 100644 --- a/src/server/library/sysadm-update.cpp +++ b/src/server/library/sysadm-update.cpp @@ -59,6 +59,7 @@ QJsonObject Update::checkUpdates(bool fast) { General::writeTextFile(UP_UPFILE, output); //save this check for later "fast" updates } //qDebug() << "pc-updatemanager checks:" << output; + QString nameval; int pnum=1; for ( int i = 0; i < output.size(); i++) @@ -106,6 +107,7 @@ QJsonObject Update::checkUpdates(bool fast) { // Update status that we have updates retObject.insert("status", "updatesavailable"); } + retObject.insert("last_check",QFileInfo(UP_UPFILE).lastModified().toString(Qt::ISODate) ); return retObject; } @@ -276,4 +278,3 @@ QJsonObject Update::writeSettings(QJsonObject obj){ } return ret; } -