diff --git a/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp b/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp index c189e148ec9..2d6bf6410b7 100644 --- a/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp +++ b/src/tools/clangpchmanagerbackend/clangpchmanagerbackendmain.cpp @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) const QString connection = processArguments(application); - StringCache filePathCache; + StringCache filePathCache; ClangPathWatcher includeWatcher(filePathCache); ApplicationEnvironment environment; PchGenerator pchGenerator(environment); diff --git a/src/tools/clangpchmanagerbackend/source/changedfilepathcompressor.h b/src/tools/clangpchmanagerbackend/source/changedfilepathcompressor.h index 32fa539379d..20634488f3b 100644 --- a/src/tools/clangpchmanagerbackend/source/changedfilepathcompressor.h +++ b/src/tools/clangpchmanagerbackend/source/changedfilepathcompressor.h @@ -55,12 +55,12 @@ public: restartTimer(); } - Utils::SmallStringVector takeFilePaths() + Utils::PathStringVector takeFilePaths() { return std::move(m_filePaths); } - virtual void setCallback(std::function &&callback) + virtual void setCallback(std::function &&callback) { QObject::connect(&m_timer, &Timer::timeout, @@ -79,7 +79,7 @@ unitttest_public: } private: - Utils::SmallStringVector m_filePaths; + Utils::PathStringVector m_filePaths; Timer m_timer; }; diff --git a/src/tools/clangpchmanagerbackend/source/clangpathwatcher.h b/src/tools/clangpchmanagerbackend/source/clangpathwatcher.h index fc7187bb9e7..0aadc7bf2a3 100644 --- a/src/tools/clangpchmanagerbackend/source/clangpathwatcher.h +++ b/src/tools/clangpchmanagerbackend/source/clangpathwatcher.h @@ -68,7 +68,7 @@ template &pathCache, + ClangPathWatcher(StringCache &pathCache, ClangPathWatcherNotifier *notifier=nullptr) : m_pathCache(pathCache), m_notifier(notifier) @@ -77,14 +77,14 @@ public: &FileSystemWatcher::fileChanged, [&] (const QString &filePath) { compressChangedFilePath(filePath); }); - m_changedFilePathCompressor.setCallback([&] (Utils::SmallStringVector &&filePaths) { + m_changedFilePathCompressor.setCallback([&] (Utils::PathStringVector &&filePaths) { addChangedPathForFilePath(std::move(filePaths)); }); } ~ClangPathWatcher() { - m_changedFilePathCompressor.setCallback([&] (Utils::SmallStringVector &&) {}); + m_changedFilePathCompressor.setCallback([&] (Utils::PathStringVector &&) {}); } void updateIdPaths(const std::vector &idPaths) override @@ -366,7 +366,7 @@ unitttest_public: m_changedFilePathCompressor.addFilePath(filePath); } - WatcherEntries watchedEntriesForPaths(Utils::SmallStringVector &&filePaths) + WatcherEntries watchedEntriesForPaths(Utils::PathStringVector &&filePaths) { std::vector pathIds = m_pathCache.stringIds(filePaths); @@ -403,7 +403,7 @@ unitttest_public: return std::move(ids); } - void addChangedPathForFilePath(Utils::SmallStringVector &&filePaths) + void addChangedPathForFilePath(Utils::PathStringVector &&filePaths) { if (m_notifier) { WatcherEntries foundEntries = watchedEntriesForPaths(std::move(filePaths)); @@ -414,7 +414,7 @@ unitttest_public: } } - StringCache &pathCache() + StringCache &pathCache() { return m_pathCache; } @@ -429,7 +429,7 @@ private: WatcherEntries m_watchedEntries; ChangedFilePathCompressor m_changedFilePathCompressor; FileSystemWatcher m_fileSystemWatcher; - StringCache &m_pathCache; + StringCache &m_pathCache; ClangPathWatcherNotifier *m_notifier; }; diff --git a/src/tools/clangpchmanagerbackend/source/pchmanagerserver.cpp b/src/tools/clangpchmanagerbackend/source/pchmanagerserver.cpp index 2d443dd7149..f22458c8b3d 100644 --- a/src/tools/clangpchmanagerbackend/source/pchmanagerserver.cpp +++ b/src/tools/clangpchmanagerbackend/source/pchmanagerserver.cpp @@ -36,7 +36,7 @@ namespace ClangBackEnd { -PchManagerServer::PchManagerServer(StringCache &filePathCache, +PchManagerServer::PchManagerServer(StringCache &filePathCache, ClangPathWatcherInterface &fileSystemWatcher, PchCreatorInterface &pchCreator, ProjectPartsInterface &projectParts) diff --git a/src/tools/clangpchmanagerbackend/source/pchmanagerserver.h b/src/tools/clangpchmanagerbackend/source/pchmanagerserver.h index 2e504dfe8ed..e28a3658e27 100644 --- a/src/tools/clangpchmanagerbackend/source/pchmanagerserver.h +++ b/src/tools/clangpchmanagerbackend/source/pchmanagerserver.h @@ -42,7 +42,7 @@ class PchManagerServer : public PchManagerServerInterface, public PchGeneratorNotifierInterface { public: - PchManagerServer(StringCache &filePathCache, + PchManagerServer(StringCache &filePathCache, ClangPathWatcherInterface &fileSystemWatcher, PchCreatorInterface &pchCreator, ProjectPartsInterface &projectParts); @@ -56,7 +56,7 @@ public: void taskFinished(TaskFinishStatus status, const ProjectPartPch &projectPartPch) override; private: - StringCache &m_filePathCache; + StringCache &m_filePathCache; ClangPathWatcherInterface &m_fileSystemWatcher; PchCreatorInterface &m_pchCreator; ProjectPartsInterface &m_projectParts; diff --git a/tests/unit/unittest/changedfilepathcompressor-test.cpp b/tests/unit/unittest/changedfilepathcompressor-test.cpp index 2aa28b7cc05..9080e3f0f86 100644 --- a/tests/unit/unittest/changedfilepathcompressor-test.cpp +++ b/tests/unit/unittest/changedfilepathcompressor-test.cpp @@ -79,7 +79,7 @@ TEST_F(ChangedFilePathCompressor, CallTimeOutAfterAddingPath) void ChangedFilePathCompressor::SetUp() { - compressor.setCallback([&] (Utils::SmallStringVector &&filePaths) { + compressor.setCallback([&] (Utils::PathStringVector &&filePaths) { mockCompressor.callbackCalled(filePaths); }); } diff --git a/tests/unit/unittest/clangpathwatcher-test.cpp b/tests/unit/unittest/clangpathwatcher-test.cpp index 62baf6befa1..7f2c4b7e613 100644 --- a/tests/unit/unittest/clangpathwatcher-test.cpp +++ b/tests/unit/unittest/clangpathwatcher-test.cpp @@ -46,15 +46,15 @@ using ClangBackEnd::WatcherEntry; class ClangPathWatcher : public testing::Test { protected: - ClangBackEnd::StringCache pathCache; + ClangBackEnd::StringCache pathCache; NiceMock notifier; Watcher watcher{pathCache, ¬ifier}; NiceMock &mockQFileSytemWatcher = watcher.fileSystemWatcher(); Utils::SmallString id1{"id4"}; Utils::SmallString id2{"id2"}; Utils::SmallString id3{"id3"}; - Utils::SmallString path1{"/path/path1"}; - Utils::SmallString path2{"/path/path2"}; + Utils::PathString path1{"/path/path1"}; + Utils::PathString path2{"/path/path2"}; std::vector paths = watcher.pathCache().stringIds({path1, path2}); std::vector ids = watcher.idCache().stringIds({id1, id2, id3}); WatcherEntry watcherEntry1{ids[0], paths[0]}; diff --git a/tests/unit/unittest/mockchangedfilepathcompressor.h b/tests/unit/unittest/mockchangedfilepathcompressor.h index 69ce485eeb9..d7988d99207 100644 --- a/tests/unit/unittest/mockchangedfilepathcompressor.h +++ b/tests/unit/unittest/mockchangedfilepathcompressor.h @@ -38,6 +38,6 @@ public: void ()); MOCK_METHOD1(callbackCalled, - void (const Utils::SmallStringVector &filePaths)); + void (const Utils::PathStringVector &filePaths)); }; diff --git a/tests/unit/unittest/pchmanagerserver-test.cpp b/tests/unit/unittest/pchmanagerserver-test.cpp index f90347e4881..8ac039b16ab 100644 --- a/tests/unit/unittest/pchmanagerserver-test.cpp +++ b/tests/unit/unittest/pchmanagerserver-test.cpp @@ -59,7 +59,7 @@ protected: NiceMock mockPchCreator; NiceMock mockClangPathWatcher; NiceMock mockProjectParts; - ClangBackEnd::StringCache filePathCache; + ClangBackEnd::StringCache filePathCache; ClangBackEnd::PchManagerServer server{filePathCache, mockClangPathWatcher, mockPchCreator, mockProjectParts}; NiceMock mockPchManagerClient; SmallString projectPartId1 = "project1";