forked from qt-creator/qt-creator
ModelManagerSupport: Get rid of UsagesCallback from globalRename()
It's not used currently. Change-Id: Id859251f69abf33de3431d1e8b561aedefbb4651 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -211,8 +211,7 @@ void ClangModelManagerSupport::startLocalRenaming(const CppEditor::CursorInEdito
|
||||
}
|
||||
|
||||
void ClangModelManagerSupport::globalRename(const CppEditor::CursorInEditor &cursor,
|
||||
CppEditor::UsagesCallback &&callback,
|
||||
const QString &replacement)
|
||||
const QString &replacement)
|
||||
{
|
||||
if (ClangdClient * const client = clientForFile(cursor.filePath());
|
||||
client && client->isFullyIndexed()) {
|
||||
@@ -221,8 +220,7 @@ void ClangModelManagerSupport::globalRename(const CppEditor::CursorInEditor &cur
|
||||
client->findUsages(cursor.textDocument(), cursor.cursor(), replacement);
|
||||
return;
|
||||
}
|
||||
CppModelManager::globalRename(cursor, std::move(callback), replacement,
|
||||
CppModelManager::Backend::Builtin);
|
||||
CppModelManager::globalRename(cursor, replacement, CppModelManager::Backend::Builtin);
|
||||
}
|
||||
|
||||
void ClangModelManagerSupport::findUsages(const CppEditor::CursorInEditor &cursor,
|
||||
|
@@ -90,8 +90,7 @@ private:
|
||||
void startLocalRenaming(const CppEditor::CursorInEditor &data,
|
||||
const CppEditor::ProjectPart *projectPart,
|
||||
CppEditor::RenameCallback &&renameSymbolsCallback) override;
|
||||
void globalRename(const CppEditor::CursorInEditor &cursor, CppEditor::UsagesCallback &&callback,
|
||||
const QString &replacement) override;
|
||||
void globalRename(const CppEditor::CursorInEditor &cursor, const QString &replacement) override;
|
||||
void findUsages(const CppEditor::CursorInEditor &cursor,
|
||||
CppEditor::UsagesCallback &&callback) const override;
|
||||
void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) override;
|
||||
|
@@ -170,7 +170,6 @@ void BuiltinModelManagerSupport::startLocalRenaming(const CursorInEditor &data,
|
||||
}
|
||||
|
||||
void BuiltinModelManagerSupport::globalRename(const CursorInEditor &data,
|
||||
UsagesCallback &&,
|
||||
const QString &replacement)
|
||||
{
|
||||
CppModelManager *modelManager = CppModelManager::instance();
|
||||
|
@@ -58,8 +58,7 @@ private:
|
||||
void startLocalRenaming(const CursorInEditor &data,
|
||||
const ProjectPart *projectPart,
|
||||
RenameCallback &&renameSymbolsCallback) override;
|
||||
void globalRename(const CursorInEditor &data, UsagesCallback &&,
|
||||
const QString &replacement) override;
|
||||
void globalRename(const CursorInEditor &data, const QString &replacement) override;
|
||||
void findUsages(const CursorInEditor &data, UsagesCallback &&) const override;
|
||||
void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) override;
|
||||
|
||||
|
@@ -810,14 +810,7 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso
|
||||
CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this,
|
||||
textDocument()};
|
||||
QPointer<CppEditorWidget> cppEditorWidget = this;
|
||||
d->m_modelManager->globalRename(cursorInEditor,
|
||||
[=](const Usages &usages) {
|
||||
if (!cppEditorWidget)
|
||||
return;
|
||||
findRenameCallback(cppEditorWidget.data(), cursor, usages,
|
||||
true, replacement);
|
||||
},
|
||||
replacement);
|
||||
d->m_modelManager->globalRename(cursorInEditor, replacement);
|
||||
}
|
||||
|
||||
bool CppEditorWidget::selectBlockUp()
|
||||
|
@@ -316,11 +316,10 @@ void CppModelManager::startLocalRenaming(const CursorInEditor &data,
|
||||
->startLocalRenaming(data, projectPart, std::move(renameSymbolsCallback));
|
||||
}
|
||||
|
||||
void CppModelManager::globalRename(const CursorInEditor &data, UsagesCallback &&renameCallback,
|
||||
const QString &replacement, Backend backend)
|
||||
void CppModelManager::globalRename(const CursorInEditor &data, const QString &replacement,
|
||||
Backend backend)
|
||||
{
|
||||
instance()->modelManagerSupport(backend)
|
||||
->globalRename(data, std::move(renameCallback), replacement);
|
||||
instance()->modelManagerSupport(backend)->globalRename(data, replacement);
|
||||
}
|
||||
|
||||
void CppModelManager::findUsages(const CursorInEditor &data,
|
||||
|
@@ -179,8 +179,8 @@ public:
|
||||
static void startLocalRenaming(const CursorInEditor &data, const ProjectPart *projectPart,
|
||||
RenameCallback &&renameSymbolsCallback,
|
||||
Backend backend = Backend::Best);
|
||||
static void globalRename(const CursorInEditor &data, UsagesCallback &&renameCallback,
|
||||
const QString &replacement, Backend backend = Backend::Best);
|
||||
static void globalRename(const CursorInEditor &data, const QString &replacement,
|
||||
Backend backend = Backend::Best);
|
||||
static void findUsages(const CursorInEditor &data, UsagesCallback &&showUsagesCallback,
|
||||
Backend backend = Backend::Best);
|
||||
static void switchHeaderSource(bool inNextSplit, Backend backend = Backend::Best);
|
||||
|
@@ -73,9 +73,7 @@ public:
|
||||
virtual void startLocalRenaming(const CursorInEditor &data,
|
||||
const ProjectPart *projectPart,
|
||||
RenameCallback &&renameSymbolsCallback) = 0;
|
||||
virtual void globalRename(const CursorInEditor &data,
|
||||
UsagesCallback &&renameCallback,
|
||||
const QString &replacement) = 0;
|
||||
virtual void globalRename(const CursorInEditor &data, const QString &replacement) = 0;
|
||||
virtual void findUsages(const CursorInEditor &data,
|
||||
UsagesCallback &&showUsagesCallback) const = 0;
|
||||
virtual void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) = 0;
|
||||
|
Reference in New Issue
Block a user