From d5845731b98ddf9480c3e0179cadf749e3653057 Mon Sep 17 00:00:00 2001 From: cora48 Date: Fri, 27 Mar 2015 17:12:58 +0300 Subject: [PATCH] FileUpdater fixes --- FileUpdater.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/FileUpdater.cpp b/FileUpdater.cpp index 450fff1..32c80c6 100644 --- a/FileUpdater.cpp +++ b/FileUpdater.cpp @@ -114,7 +114,9 @@ void ReadUTF8(FILE* nFile, char *cp) { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("Negative list loaded (" + QString::number(GlobalNegativeSize) + " entries)"); + if(FileUpdater::oldNegLstSize == 0) stt->doEmitionGreenFoundData("Negative list loaded (" + QString::number(GlobalNegativeSize) + " entries)"); + else stt->doEmitionFoundData("Negative list updated (" + QString::number(GlobalNegativeSize) + " entries)"); + ZeroMemory(buffFG, sizeof(buffFG)); fclose(nFile); } @@ -197,7 +199,8 @@ void *updateLogin() { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("Login list loaded (" + QString::number(MaxLogin) + " entries)"); + if(FileUpdater::oldLoginLstSize == 0) stt->doEmitionGreenFoundData("Login list loaded (" + QString::number(MaxLogin) + " entries)"); + else stt->doEmitionFoundData("Login list updated (" + QString::number(MaxLogin) + " entries)"); fclose(loginList); } @@ -249,7 +252,8 @@ void *updatePass() { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("Password list loaded (" + QString::number(MaxPass) + " entries)"); + if(FileUpdater::oldPassLstSize == 0) stt->doEmitionGreenFoundData("Password list loaded (" + QString::number(MaxPass) + " entries)"); + else stt->doEmitionFoundData("Password list updated (" + QString::number(MaxPass) + " entries)"); fclose(passList); } @@ -302,7 +306,8 @@ void *updateSSH() { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("SSH Password list loaded (" + QString::number(MaxSSHPass) + " entries)"); + if(FileUpdater::oldSSHLstSize == 0) stt->doEmitionGreenFoundData("SSH Password list loaded (" + QString::number(MaxSSHPass) + " entries)"); + else stt->doEmitionFoundData("SSH list updated (" + QString::number(MaxSSHPass) + " entries)"); fclose(sshlpList); } @@ -355,7 +360,9 @@ void *updateWFLogin() { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("WFLogin list loaded (" + QString::number(MaxWFLogin) + " entries)"); + if(FileUpdater::oldWFLoginLstSize == 0) stt->doEmitionGreenFoundData("WFLogin list loaded (" + QString::number(MaxWFLogin) + " entries)"); + else stt->doEmitionFoundData("WFLogin list updated (" + QString::number(MaxWFLogin) + " entries)"); + fclose(wfLoginList); } } @@ -402,7 +409,9 @@ void *updateWFPass() { ZeroMemory(buffFG, sizeof(buffFG)); }; - stt->doEmitionGreenFoundData("WFPassword list loaded (" + QString::number(MaxWFPass) + " entries)"); + if(FileUpdater::oldWFPassLstSize == 0) stt->doEmitionGreenFoundData("WFPassword list loaded (" + QString::number(MaxWFPass) + " entries)"); + else stt->doEmitionFoundData("WFPassword list updated (" + QString::number(MaxWFPass) + " entries)"); + fclose(wfPassList); } } @@ -417,8 +426,8 @@ void updateList(const char *fileName, long *szPtr, void *funcPtr(void)) { if(sz != *szPtr) { FileUpdater::lk = std::unique_lock (FileUpdater::filesUpdatingMutex); - *szPtr = sz; funcPtr(); + *szPtr = sz; FileUpdater::lk.unlock(); FileUpdater::ready = true; FileUpdater::cv.notify_one();