diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:39:47 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:40:08 +0900 |
| commit | b1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch) | |
| tree | 9ce465b42bf09372118335c7c619bb2b41869eaf /src/BtCheckIntegrityEntry.cc | |
| parent | 4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff) | |
make clang-format using clang-format-3.6
Diffstat (limited to 'src/BtCheckIntegrityEntry.cc')
| -rw-r--r-- | src/BtCheckIntegrityEntry.cc | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/BtCheckIntegrityEntry.cc b/src/BtCheckIntegrityEntry.cc index c1c93708..2bd8b7ec 100644 --- a/src/BtCheckIntegrityEntry.cc +++ b/src/BtCheckIntegrityEntry.cc @@ -46,55 +46,52 @@ namespace aria2 { -BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup): - PieceHashCheckIntegrityEntry(requestGroup, nullptr) {} +BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup) + : PieceHashCheckIntegrityEntry(requestGroup, nullptr) +{ +} BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {} -void BtCheckIntegrityEntry::onDownloadIncomplete -(std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) +void BtCheckIntegrityEntry::onDownloadIncomplete( + std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) { auto& ps = getRequestGroup()->getPieceStorage(); ps->onDownloadIncomplete(); - if(getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { + if (getRequestGroup()->getOption()->getAsBool(PREF_HASH_CHECK_ONLY)) { return; } const auto& diskAdaptor = ps->getDiskAdaptor(); - if(diskAdaptor->isReadOnlyEnabled()) { + if (diskAdaptor->isReadOnlyEnabled()) { // Now reopen DiskAdaptor with read only disabled. diskAdaptor->closeFile(); diskAdaptor->disableReadOnly(); diskAdaptor->openFile(); } - proceedFileAllocation(commands, - make_unique<BtFileAllocationEntry> - (getRequestGroup()), - e); + proceedFileAllocation( + commands, make_unique<BtFileAllocationEntry>(getRequestGroup()), e); } -void BtCheckIntegrityEntry::onDownloadFinished -(std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) +void BtCheckIntegrityEntry::onDownloadFinished( + std::vector<std::unique_ptr<Command>>& commands, DownloadEngine* e) { auto group = getRequestGroup(); const auto& option = group->getOption(); - if(option->getAsBool(PREF_BT_ENABLE_HOOK_AFTER_HASH_CHECK)) { + if (option->getAsBool(PREF_BT_ENABLE_HOOK_AFTER_HASH_CHECK)) { util::executeHookByOptName(group, option.get(), PREF_ON_BT_DOWNLOAD_COMPLETE); - SingletonHolder<Notifier>::instance()->notifyDownloadEvent - (EVENT_ON_BT_DOWNLOAD_COMPLETE, group); + SingletonHolder<Notifier>::instance()->notifyDownloadEvent( + EVENT_ON_BT_DOWNLOAD_COMPLETE, group); } // TODO Currently,when all the checksums // are valid, then aria2 goes to seeding mode. Sometimes it is better // to exit rather than doing seeding. So, it would be good to toggle this // behavior. - if(!option->getAsBool(PREF_HASH_CHECK_ONLY) && - option->getAsBool(PREF_BT_HASH_CHECK_SEED)) { - proceedFileAllocation(commands, - make_unique<BtFileAllocationEntry> - (getRequestGroup()), - e); + if (!option->getAsBool(PREF_HASH_CHECK_ONLY) && + option->getAsBool(PREF_BT_HASH_CHECK_SEED)) { + proceedFileAllocation( + commands, make_unique<BtFileAllocationEntry>(getRequestGroup()), e); } } - } // namespace aria2 |
