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,7 +211,6 @@ void ClangModelManagerSupport::startLocalRenaming(const CppEditor::CursorInEdito
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClangModelManagerSupport::globalRename(const CppEditor::CursorInEditor &cursor,
|
void ClangModelManagerSupport::globalRename(const CppEditor::CursorInEditor &cursor,
|
||||||
CppEditor::UsagesCallback &&callback,
|
|
||||||
const QString &replacement)
|
const QString &replacement)
|
||||||
{
|
{
|
||||||
if (ClangdClient * const client = clientForFile(cursor.filePath());
|
if (ClangdClient * const client = clientForFile(cursor.filePath());
|
||||||
@@ -221,8 +220,7 @@ void ClangModelManagerSupport::globalRename(const CppEditor::CursorInEditor &cur
|
|||||||
client->findUsages(cursor.textDocument(), cursor.cursor(), replacement);
|
client->findUsages(cursor.textDocument(), cursor.cursor(), replacement);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CppModelManager::globalRename(cursor, std::move(callback), replacement,
|
CppModelManager::globalRename(cursor, replacement, CppModelManager::Backend::Builtin);
|
||||||
CppModelManager::Backend::Builtin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangModelManagerSupport::findUsages(const CppEditor::CursorInEditor &cursor,
|
void ClangModelManagerSupport::findUsages(const CppEditor::CursorInEditor &cursor,
|
||||||
|
@@ -90,8 +90,7 @@ private:
|
|||||||
void startLocalRenaming(const CppEditor::CursorInEditor &data,
|
void startLocalRenaming(const CppEditor::CursorInEditor &data,
|
||||||
const CppEditor::ProjectPart *projectPart,
|
const CppEditor::ProjectPart *projectPart,
|
||||||
CppEditor::RenameCallback &&renameSymbolsCallback) override;
|
CppEditor::RenameCallback &&renameSymbolsCallback) override;
|
||||||
void globalRename(const CppEditor::CursorInEditor &cursor, CppEditor::UsagesCallback &&callback,
|
void globalRename(const CppEditor::CursorInEditor &cursor, const QString &replacement) override;
|
||||||
const QString &replacement) override;
|
|
||||||
void findUsages(const CppEditor::CursorInEditor &cursor,
|
void findUsages(const CppEditor::CursorInEditor &cursor,
|
||||||
CppEditor::UsagesCallback &&callback) const override;
|
CppEditor::UsagesCallback &&callback) const override;
|
||||||
void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) 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,
|
void BuiltinModelManagerSupport::globalRename(const CursorInEditor &data,
|
||||||
UsagesCallback &&,
|
|
||||||
const QString &replacement)
|
const QString &replacement)
|
||||||
{
|
{
|
||||||
CppModelManager *modelManager = CppModelManager::instance();
|
CppModelManager *modelManager = CppModelManager::instance();
|
||||||
|
@@ -58,8 +58,7 @@ private:
|
|||||||
void startLocalRenaming(const CursorInEditor &data,
|
void startLocalRenaming(const CursorInEditor &data,
|
||||||
const ProjectPart *projectPart,
|
const ProjectPart *projectPart,
|
||||||
RenameCallback &&renameSymbolsCallback) override;
|
RenameCallback &&renameSymbolsCallback) override;
|
||||||
void globalRename(const CursorInEditor &data, UsagesCallback &&,
|
void globalRename(const CursorInEditor &data, const QString &replacement) override;
|
||||||
const QString &replacement) override;
|
|
||||||
void findUsages(const CursorInEditor &data, UsagesCallback &&) const override;
|
void findUsages(const CursorInEditor &data, UsagesCallback &&) const override;
|
||||||
void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) 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,
|
CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this,
|
||||||
textDocument()};
|
textDocument()};
|
||||||
QPointer<CppEditorWidget> cppEditorWidget = this;
|
QPointer<CppEditorWidget> cppEditorWidget = this;
|
||||||
d->m_modelManager->globalRename(cursorInEditor,
|
d->m_modelManager->globalRename(cursorInEditor, replacement);
|
||||||
[=](const Usages &usages) {
|
|
||||||
if (!cppEditorWidget)
|
|
||||||
return;
|
|
||||||
findRenameCallback(cppEditorWidget.data(), cursor, usages,
|
|
||||||
true, replacement);
|
|
||||||
},
|
|
||||||
replacement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CppEditorWidget::selectBlockUp()
|
bool CppEditorWidget::selectBlockUp()
|
||||||
|
@@ -316,11 +316,10 @@ void CppModelManager::startLocalRenaming(const CursorInEditor &data,
|
|||||||
->startLocalRenaming(data, projectPart, std::move(renameSymbolsCallback));
|
->startLocalRenaming(data, projectPart, std::move(renameSymbolsCallback));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppModelManager::globalRename(const CursorInEditor &data, UsagesCallback &&renameCallback,
|
void CppModelManager::globalRename(const CursorInEditor &data, const QString &replacement,
|
||||||
const QString &replacement, Backend backend)
|
Backend backend)
|
||||||
{
|
{
|
||||||
instance()->modelManagerSupport(backend)
|
instance()->modelManagerSupport(backend)->globalRename(data, replacement);
|
||||||
->globalRename(data, std::move(renameCallback), replacement);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppModelManager::findUsages(const CursorInEditor &data,
|
void CppModelManager::findUsages(const CursorInEditor &data,
|
||||||
|
@@ -179,8 +179,8 @@ public:
|
|||||||
static void startLocalRenaming(const CursorInEditor &data, const ProjectPart *projectPart,
|
static void startLocalRenaming(const CursorInEditor &data, const ProjectPart *projectPart,
|
||||||
RenameCallback &&renameSymbolsCallback,
|
RenameCallback &&renameSymbolsCallback,
|
||||||
Backend backend = Backend::Best);
|
Backend backend = Backend::Best);
|
||||||
static void globalRename(const CursorInEditor &data, UsagesCallback &&renameCallback,
|
static void globalRename(const CursorInEditor &data, const QString &replacement,
|
||||||
const QString &replacement, Backend backend = Backend::Best);
|
Backend backend = Backend::Best);
|
||||||
static void findUsages(const CursorInEditor &data, UsagesCallback &&showUsagesCallback,
|
static void findUsages(const CursorInEditor &data, UsagesCallback &&showUsagesCallback,
|
||||||
Backend backend = Backend::Best);
|
Backend backend = Backend::Best);
|
||||||
static void switchHeaderSource(bool inNextSplit, Backend backend = Backend::Best);
|
static void switchHeaderSource(bool inNextSplit, Backend backend = Backend::Best);
|
||||||
|
@@ -73,9 +73,7 @@ public:
|
|||||||
virtual void startLocalRenaming(const CursorInEditor &data,
|
virtual void startLocalRenaming(const CursorInEditor &data,
|
||||||
const ProjectPart *projectPart,
|
const ProjectPart *projectPart,
|
||||||
RenameCallback &&renameSymbolsCallback) = 0;
|
RenameCallback &&renameSymbolsCallback) = 0;
|
||||||
virtual void globalRename(const CursorInEditor &data,
|
virtual void globalRename(const CursorInEditor &data, const QString &replacement) = 0;
|
||||||
UsagesCallback &&renameCallback,
|
|
||||||
const QString &replacement) = 0;
|
|
||||||
virtual void findUsages(const CursorInEditor &data,
|
virtual void findUsages(const CursorInEditor &data,
|
||||||
UsagesCallback &&showUsagesCallback) const = 0;
|
UsagesCallback &&showUsagesCallback) const = 0;
|
||||||
virtual void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) = 0;
|
virtual void switchHeaderSource(const Utils::FilePath &filePath, bool inNextSplit) = 0;
|
||||||
|
Reference in New Issue
Block a user