From fa1adf4d4001207902a5572b39da4f1cbc8752f1 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 21 Nov 2022 16:48:50 +0100 Subject: CPlusPlus: Proliferate FilePath use The starts with CppDocument::filePath(), plus a bit of the fallout This is one patch of potentially many. It is hard to draw the line where to stop this kind of chunk, this here converts a few additional functions for which including it in the patch looked like less churn than without. Converting is mostly fromString/toString, with a few exceptions for "already seem" like caches, that use cheaper "path()" to avoid likely performance regressions (on Windows FilePath comparison is currently case-insenstive, and more expensive). There should be no difference for local operation with this patch. Change-Id: I7b35f98a0a6f0bfed4ea0f8f987faf586f7a8f2b Reviewed-by: Christian Kandeler --- src/plugins/todo/cpptodoitemsscanner.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/todo') diff --git a/src/plugins/todo/cpptodoitemsscanner.cpp b/src/plugins/todo/cpptodoitemsscanner.cpp index 47a020ff4f..3a8db09456 100644 --- a/src/plugins/todo/cpptodoitemsscanner.cpp +++ b/src/plugins/todo/cpptodoitemsscanner.cpp @@ -46,7 +46,7 @@ void CppTodoItemsScanner::scannerParamsChanged() void CppTodoItemsScanner::documentUpdated(CPlusPlus::Document::Ptr doc) { CppEditor::CppModelManager *modelManager = CppEditor::CppModelManager::instance(); - if (!modelManager->projectPart(doc->fileName()).isEmpty()) + if (!modelManager->projectPart(doc->filePath()).isEmpty()) processDocument(doc); } @@ -84,13 +84,13 @@ void CppTodoItemsScanner::processDocument(CPlusPlus::Document::Ptr doc) const int length = end - start + 1; if (length > 0) { QString commentLine = QString::fromUtf8(start, length); - processCommentLine(doc->fileName(), commentLine, lineNumber, itemList); + processCommentLine(doc->filePath().toString(), commentLine, lineNumber, itemList); } from = to + 1; } } - emit itemsFetched(doc->fileName(), itemList); + emit itemsFetched(doc->filePath().toString(), itemList); } } -- cgit v1.2.1