moved file hashing and download count to new notification system

This commit is contained in:
csoler 2020-01-30 23:02:23 +01:00
parent 10bee9f26b
commit 81c1eb227c
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
12 changed files with 163 additions and 24 deletions

View file

@ -136,7 +136,13 @@ void HashStorage::threadTick()
stopHashThread();
}
RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_FINISH, "") ;
if(rsEvents)
{
auto ev = std::make_shared<RsSharedDirectoriesEvent>();
ev->mEventCode = RsSharedDirectoriesEventCode::DIRECTORY_SWEEP_ENDED;
rsEvents->postEvent(ev);
}
//RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_FINISH, "") ;
}
else
{
@ -181,7 +187,14 @@ void HashStorage::threadTick()
else
rs_sprintf(tmpout, "%lu/%lu (%s - %d%%) : %s", (unsigned long int)mHashCounter+1, (unsigned long int)mTotalFilesToHash, friendlyUnit(mTotalHashedSize).c_str(), int(mTotalHashedSize/double(mTotalSizeToHash)*100.0), job.full_path.c_str()) ;
RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ;
//RsServer::notify()->notifyHashingInfo(NOTIFY_HASHTYPE_HASH_FILE, tmpout) ;
if(rsEvents)
{
auto ev = std::make_shared<RsSharedDirectoriesEvent>();
ev->mEventCode = RsSharedDirectoriesEventCode::HASHING_FILE;
ev->mMessage = tmpout;
rsEvents->postEvent(ev);
}
double seconds_origin = rstime::RsScopeTimer::currentTime() ;