summaryrefslogtreecommitdiff
path: root/src/plugins/clangrefactoring/refactoringengine.cpp
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-09-21 11:43:59 +0200
committerTim Jenssen <tim.jenssen@qt.io>2017-10-05 17:36:37 +0000
commitd2e15e5f1efa1ef160a2d4f40ab61180477d1f14 (patch)
treeb35eeec94b895a48e9c7ce6ea00c245935d1ea38 /src/plugins/clangrefactoring/refactoringengine.cpp
parent0be824000262882023b2b48b5eab0786f3db379b (diff)
downloadqt-creator-d2e15e5f1efa1ef160a2d4f40ab61180477d1f14.tar.gz
Clang: Add file cache
The database is using file path integer ids to handle file paths because otherwise we would save many redundant data. This patch is improving it further with the introduction of a database based file path cache. The entries are now divided in a directory path and file name. This is quite handy for directory based file watching. Change-Id: I03f2e388e43f3d521d6bf8e39dfb95eb2309dc73 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring/refactoringengine.cpp')
-rw-r--r--src/plugins/clangrefactoring/refactoringengine.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/clangrefactoring/refactoringengine.cpp b/src/plugins/clangrefactoring/refactoringengine.cpp
index 696e38c468..bc9ec9ab68 100644
--- a/src/plugins/clangrefactoring/refactoringengine.cpp
+++ b/src/plugins/clangrefactoring/refactoringengine.cpp
@@ -46,9 +46,11 @@ namespace ClangRefactoring {
using ClangBackEnd::RequestSourceLocationsForRenamingMessage;
RefactoringEngine::RefactoringEngine(ClangBackEnd::RefactoringServerInterface &server,
- ClangBackEnd::RefactoringClientInterface &client)
- : server(server),
- client(client)
+ ClangBackEnd::RefactoringClientInterface &client,
+ ClangBackEnd::FilePathCachingInterface &filePathCache)
+ : m_server(server),
+ m_client(client),
+ m_filePathCache(filePathCache)
{
}
@@ -60,7 +62,7 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
setUsable(false);
- client.setLocalRenamingCallback(std::move(renameSymbolsCallback));
+ m_client.setLocalRenamingCallback(std::move(renameSymbolsCallback));
QString filePath = data.filePath().toString();
QTextCursor textCursor = data.cursor();
@@ -79,7 +81,7 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
textCursor.document()->revision());
- server.requestSourceLocationsForRenamingMessage(std::move(message));
+ m_server.requestSourceLocationsForRenamingMessage(std::move(message));
}
void RefactoringEngine::startGlobalRenaming(const CppTools::CursorInEditor &)
@@ -89,12 +91,12 @@ void RefactoringEngine::startGlobalRenaming(const CppTools::CursorInEditor &)
bool RefactoringEngine::isUsable() const
{
- return server.isUsable();
+ return m_server.isUsable();
}
void RefactoringEngine::setUsable(bool isUsable)
{
- server.setUsable(isUsable);
+ m_server.setUsable(isUsable);
}
} // namespace ClangRefactoring