summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-01-14 23:04:08 +0200
committerMavridis Philippe <mavridisf@gmail.com>2021-01-14 23:04:08 +0200
commitc60236647e4c261f709de3b9ac47a7f296701335 (patch)
treecae411ca08249abdf4d42d9cf7acaebfe8a7fc32
parent08a972d228bd1376e7793481869c4b381de18afa (diff)
downloadklamav-c6023664.tar.gz
klamav-c6023664.zip
Freshklam: updated and enhanced notifications.
Notifications are now displayed for each updated definition database, as well as in the end of a (successful) update process (an entry to the log is now written at this stage, too). Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r--src/freshklam.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/freshklam.cpp b/src/freshklam.cpp
index f13a2cc..ce8d0ae 100644
--- a/src/freshklam.cpp
+++ b/src/freshklam.cpp
@@ -294,18 +294,36 @@ void Freshklam::processOutput()
errorMessage = item2.mid(pos,pos2);
}
- if ((pos = item2.find("Database updated")) != -1){
- CollectionDB::instance()->insertEvent("Updates","Database Updated",dir_combo->url());
- KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Virus Database Updated.");
+ // Notifications
+ // -> Database updated
+ if ((pos = item2.find("daily.cvd updated")) != -1 || (pos = item2.find("daily.cld updated")) != -1 ){
+ CollectionDB::instance()->insertEvent("Updates","Daily Database Updated",dir_combo->url());
+ KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Updated Daily DB (1 out of 3).");
updateMailClient();
}
- if ((pos = item2.find("daily.cvd is up to date")) != -1){
- CollectionDB::instance()->insertEvent("Updates","Database Already Up To Date",dir_combo->url());
- KNotifyClient::event(tdemain->_tray->winId(),"DatabaseUpToDate", "Virus Database Up To Date.");
+ if ((pos = item2.find("main.cvd updated")) != -1 || (pos = item2.find("main.cld updated")) != -1 ){
+ KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Updated Main DB (2 out of 3).");
+ }
+
+ if ((pos = item2.find("bytecode.cvd updated")) != -1 || (pos = item2.find("bytecode.cld updated")) != -1 ){
+ KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Updated Bytecode DB (3 out of 3).");
+ }
+
+ // -> Database already up to date
+ if ((pos = item2.find("daily.cvd database is up to date")) != -1 || (pos = item2.find("daily.cld database is up to date")) != -1){
+ KNotifyClient::event(tdemain->_tray->winId(),"DatabaseUpToDate", "Daily DB Up To Date (1 out of 3).");
updateMailClient();
}
+ if ((pos = item2.find("main.cvd database is up to date")) != -1 || (pos = item2.find("main.cld database is up to date")) != -1){
+ KNotifyClient::event(tdemain->_tray->winId(),"DatabaseUpToDate", "Main DB Up To Date (2 out of 3).");
+ }
+
+ if ((pos = item2.find("bytecode.cvd database is up to date")) != -1 || (pos = item2.find("bytecode.cld database is up to date")) != -1){
+ KNotifyClient::event(tdemain->_tray->winId(),"DatabaseUpToDate", "Bytecode DB Up To Date (3 out of 3).");
+ }
+
if ((pos = item2.find("Recommended version:")) != -1){
@@ -399,6 +417,9 @@ void Freshklam::finish()
if (!(tempFileName.isEmpty()))
TDEIO::NetAccess::del(tempFileName,NULL);
+ CollectionDB::instance()->insertEvent("Updates","Virus Database Updated",dir_combo->url());
+ KNotifyClient::event(tdemain->_tray->winId(),"UpdatedDatabase", "Virus Database updated successfully.");
+
tdemain->EnableFreshklam->setEnabled(TRUE);
tdemain->DisableFreshklam->setEnabled(FALSE);