forked from qt-creator/qt-creator
CppEditor: Remove unused functions
Change-Id: I392930920b536813c9f8fb4969e7f486960aa0cb Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -663,57 +663,6 @@ void CppEditorWidget::onIfdefedOutBlocksUpdated(unsigned revision,
|
|||||||
textDocument()->setIfdefedOutBlocks(ifdefedOutBlocks);
|
textDocument()->setIfdefedOutBlocks(ifdefedOutBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString getDocumentLine(QTextDocument *document, int line)
|
|
||||||
{
|
|
||||||
if (document)
|
|
||||||
return document->findBlockByNumber(line - 1).text();
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
static std::unique_ptr<QTextDocument> getCurrentDocument(const QString &path)
|
|
||||||
{
|
|
||||||
const QTextCodec *defaultCodec = Core::EditorManager::defaultTextCodec();
|
|
||||||
QString contents;
|
|
||||||
Utils::TextFileFormat format;
|
|
||||||
QString error;
|
|
||||||
if (Utils::TextFileFormat::readFile(Utils::FilePath::fromString(path),
|
|
||||||
defaultCodec,
|
|
||||||
&contents,
|
|
||||||
&format,
|
|
||||||
&error)
|
|
||||||
!= Utils::TextFileFormat::ReadSuccess) {
|
|
||||||
qWarning() << "Error reading file " << path << " : " << error;
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
return std::make_unique<QTextDocument>(contents);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void onReplaceUsagesClicked(const QString &text,
|
|
||||||
const QList<SearchResultItem> &items,
|
|
||||||
bool preserveCase)
|
|
||||||
{
|
|
||||||
CppModelManager *modelManager = CppModelManager::instance();
|
|
||||||
if (!modelManager)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const FilePaths filePaths = TextEditor::BaseFileFind::replaceAll(text, items, preserveCase);
|
|
||||||
if (!filePaths.isEmpty()) {
|
|
||||||
modelManager->updateSourceFiles(Utils::transform<QSet>(filePaths, &FilePath::toString));
|
|
||||||
SearchResultWindow::instance()->hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static QTextDocument *getOpenDocument(const QString &path)
|
|
||||||
{
|
|
||||||
const IDocument *document = DocumentModel::documentForFilePath(FilePath::fromString(path));
|
|
||||||
if (document)
|
|
||||||
return qobject_cast<const TextDocument *>(document)->document();
|
|
||||||
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
void CppEditorWidget::findUsages()
|
void CppEditorWidget::findUsages()
|
||||||
{
|
{
|
||||||
findUsages(textCursor());
|
findUsages(textCursor());
|
||||||
|
Reference in New Issue
Block a user