| 4522 | } |
| 4523 | |
| 4524 | void 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 | |
| 4550 | uint16 CPartFile::GetMaxSources() const |
no test coverage detected