MCPcopy Create free account
hub / github.com/amule-project/amule / SetFileName

Method SetFileName

src/PartFile.cpp:4524–4547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4522}
4523
4524void CPartFile::SetFileName(const CPath& fileName)
4525{
4526 CKnownFile* pFile = theApp->sharedfiles->GetFileByID(GetFileHash());
4527
4528 bool is_shared = (pFile && pFile == this);
4529
4530 if (is_shared) {
4531 // The file is shared, we must clear the search keywords so we don't
4532 // publish the old name anymore.
4533 theApp->sharedfiles->RemoveKeywords(this);
4534 }
4535
4536 if (GetFileName() != fileName) {
4537 MarkMetDirty();
4538 }
4539 CKnownFile::SetFileName(fileName);
4540
4541 if (is_shared) {
4542 // And of course, we must advertise the new name if the file is shared.
4543 theApp->sharedfiles->AddKeywords(this);
4544 }
4545
4546 UpdateDisplayedInfo(true);
4547}
4548
4549
4550uint16 CPartFile::GetMaxSources() const

Callers 5

AppendMethod · 0.45
PublishMethod · 0.45
RenameFileMethod · 0.45
ProcessItemUpdateMethod · 0.45
EntryMethod · 0.45

Calls 3

RemoveKeywordsMethod · 0.80
AddKeywordsMethod · 0.80
GetFileByIDMethod · 0.45

Tested by

no test coverage detected