bool HistoryCoordinator::EditList(DownloadQueue* downloadQueue, IdList* idList, DownloadQueue::EEditAction action, int offset, const char* text) { bool ok = false; PrepareEdit(downloadQueue, idList, action); for (int id : *idList) { for (HistoryList::iterator itHistory = downloadQueue->GetHistory()->begin(); itHistory != downloadQueue->GetHistory()->end(); itHistory++) { HistoryInfo* historyInfo = (*itHistory).get(); if (historyInfo->GetId() == id) { ok = true; switch (action) { case DownloadQueue::eaHistoryDelete: case DownloadQueue::eaHistoryFinalDelete: HistoryDelete(downloadQueue, itHistory, historyInfo, action == DownloadQueue::eaHistoryFinalDelete); break; case DownloadQueue::eaHistoryReturn: HistoryReturn(downloadQueue, itHistory, historyInfo); break; case DownloadQueue::eaHistoryProcess: HistoryProcess(downloadQueue, itHistory, historyInfo); break; case DownloadQueue::eaHistoryRedownload: HistoryRedownload(downloadQueue, itHistory, historyInfo, false); break; case DownloadQueue::eaHistoryRetryFailed: HistoryRetry(downloadQueue, itHistory, historyInfo, true, false); break; case DownloadQueue::eaHistorySetParameter: ok = HistorySetParameter(historyInfo, text); break; case DownloadQueue::eaHistorySetCategory: ok = HistorySetCategory(historyInfo, text); break; case DownloadQueue::eaHistorySetName: ok = HistorySetName(historyInfo, text); break; case DownloadQueue::eaHistorySetDupeKey: case DownloadQueue::eaHistorySetDupeScore: case DownloadQueue::eaHistorySetDupeMode: case DownloadQueue::eaHistorySetDupeBackup: HistorySetDupeParam(historyInfo, action, text); break; case DownloadQueue::eaHistoryMarkBad: g_DupeCoordinator->HistoryMark(downloadQueue, historyInfo, NzbInfo::ksBad); break; case DownloadQueue::eaHistoryMarkGood: g_DupeCoordinator->HistoryMark(downloadQueue, historyInfo, NzbInfo::ksGood); break; case DownloadQueue::eaHistoryMarkSuccess: g_DupeCoordinator->HistoryMark(downloadQueue, historyInfo, NzbInfo::ksSuccess); break; default: // nothing, just to avoid compiler warning break; } break; } } } if (ok) { downloadQueue->HistoryChanged(); downloadQueue->Save(); } return ok; }