diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2022-05-17 11:47:01 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2023-07-09 17:20:40 +0200 |
| commit | d13f6bb870cdda71257f665367be8ef9fca86255 (patch) | |
| tree | 52e214718478f1e52856572f5aa1a2ac58537f9f /src/shared/fileregister.cpp | |
| parent | 86bb01ba9eac879d3685c439ac9da0028bc4bc80 (diff) | |
Apply clang-format.
Diffstat (limited to 'src/shared/fileregister.cpp')
| -rw-r--r-- | src/shared/fileregister.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/shared/fileregister.cpp b/src/shared/fileregister.cpp index 98e49452..ab94367f 100644 --- a/src/shared/fileregister.cpp +++ b/src/shared/fileregister.cpp @@ -1,8 +1,8 @@ #include "fileregister.h" -#include "fileentry.h" #include "directoryentry.h" -#include "originconnection.h" +#include "fileentry.h" #include "filesorigin.h" +#include "originconnection.h" #include <log.h> namespace MOShared @@ -11,9 +11,8 @@ namespace MOShared using namespace MOBase; FileRegister::FileRegister(boost::shared_ptr<OriginConnection> originConnection) - : m_OriginConnection(originConnection), m_NextIndex(0) -{ -} + : m_OriginConnection(originConnection), m_NextIndex(0) +{} bool FileRegister::indexValid(FileIndex index) const { @@ -26,11 +25,11 @@ bool FileRegister::indexValid(FileIndex index) const return false; } -FileEntryPtr FileRegister::createFile( - std::wstring name, DirectoryEntry *parent, DirectoryStats& stats) +FileEntryPtr FileRegister::createFile(std::wstring name, DirectoryEntry* parent, + DirectoryStats& stats) { const auto index = generateIndex(); - auto p = FileEntryPtr(new FileEntry(index, std::move(name), parent)); + auto p = FileEntryPtr(new FileEntry(index, std::move(name), parent)); { std::scoped_lock lock(m_Mutex); @@ -96,18 +95,19 @@ void FileRegister::removeOrigin(FileIndex index, OriginID originID) } } - log::error(QObject::tr("invalid file index for remove (for origin): {}").toStdString(), index); + log::error( + QObject::tr("invalid file index for remove (for origin): {}").toStdString(), + index); } -void FileRegister::removeOriginMulti( - std::set<FileIndex> indices, OriginID originID) +void FileRegister::removeOriginMulti(std::set<FileIndex> indices, OriginID originID) { std::vector<FileEntryPtr> removedFiles; { std::scoped_lock lock(m_Mutex); - for (auto iter = indices.begin(); iter != indices.end(); ) { + for (auto iter = indices.begin(); iter != indices.end();) { const auto index = *iter; if (index < m_Files.size()) { @@ -140,13 +140,13 @@ void FileRegister::removeOriginMulti( // frequently the case std::set<DirectoryEntry*> parents; - for (const FileEntryPtr &file : removedFiles) { + for (const FileEntryPtr& file : removedFiles) { if (file->getParent() != nullptr) { parents.insert(file->getParent()); } } - for (DirectoryEntry *parent : parents) { + for (DirectoryEntry* parent : parents) { parent->removeFiles(indices); } } @@ -181,4 +181,4 @@ void FileRegister::unregisterFile(FileEntryPtr file) } } -} // namespace +} // namespace MOShared |
