added notification when new extra file is shared, so that shared files updates

This commit is contained in:
csoler 2020-12-04 16:33:12 +01:00
parent fd2eed8b24
commit 9533fc9c00
4 changed files with 53 additions and 3 deletions

View file

@ -129,6 +129,11 @@ void ftExtraList::hashAFile()
mHashedList[details.info.path] = details.info.hash;
IndicateConfigChanged();
auto ev = std::make_shared<RsSharedDirectoriesEvent>();
ev->mEventCode = RsSharedDirectoriesEventCode::EXTRA_LIST_FILE_ADDED;
if(rsEvents)
rsEvents->postEvent(ev);
}
}
@ -195,6 +200,12 @@ bool ftExtraList::removeExtraFile(const RsFileHash& hash)
IndicateConfigChanged();
if(rsEvents)
{
auto ev = std::make_shared<RsSharedDirectoriesEvent>();
ev->mEventCode = RsSharedDirectoriesEventCode::EXTRA_LIST_FILE_REMOVED;
rsEvents->postEvent(ev);
}
return true;
}

View file

@ -184,6 +184,8 @@ enum class RsSharedDirectoriesEventCode: uint8_t {
HASHING_FILE = 0x02, // mMessage: full path and hashing speed of the file being hashed
DIRECTORY_SWEEP_ENDED = 0x03, // (void)
SAVING_FILE_INDEX = 0x04, // (void)
EXTRA_LIST_FILE_ADDED = 0x05, // (void)
EXTRA_LIST_FILE_REMOVED = 0x06, // (void)
};
enum class RsFileTransferEventCode: uint8_t {