From 88c495976c08ba6dc7fb3ab4dcf848791187ce64 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 10 May 2019 11:48:14 +0200 Subject: [PATCH] Utils: RemoveFileName::{size,count,length} Use .toString().{size,count,length} instead. Change-Id: Ib697155f441a8297fb179921bcd3397719a44073 Reviewed-by: Eike Ziller --- src/libs/utils/fileutils.h | 4 +--- src/plugins/cppcheck/cppcheckrunner.cpp | 2 +- src/plugins/projectexplorer/foldernavigationwidget.cpp | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 50e69c2fc44..492c0b636b6 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -96,11 +96,9 @@ public: FileName &appendString(QChar str); using QString::clear; - using QString::count; using QString::isEmpty; using QString::isNull; - using QString::length; - using QString::size; + private: FileName(const QString &string); }; diff --git a/src/plugins/cppcheck/cppcheckrunner.cpp b/src/plugins/cppcheck/cppcheckrunner.cpp index f67044cb678..55f7472ef60 100644 --- a/src/plugins/cppcheck/cppcheckrunner.cpp +++ b/src/plugins/cppcheck/cppcheckrunner.cpp @@ -140,7 +140,7 @@ void CppcheckRunner::checkQueued() m_currentFiles.clear(); int argumentsLength = arguments.length(); while (!files.isEmpty()) { - argumentsLength += files.first().length() + 1; // +1 for separator + argumentsLength += files.first().toString().size() + 1; // +1 for separator if (argumentsLength >= m_maxArgumentsLength) break; m_currentFiles.push_back(files.first()); diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index b41ae6b0f9a..1da235b7fa9 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -655,9 +655,9 @@ int FolderNavigationWidget::bestRootForFile(const Utils::FileName &filePath) int commonLength = 0; for (int i = 1; i < m_rootSelector->count(); ++i) { const auto root = m_rootSelector->itemData(i).value(); - if (filePath.isChildOf(root) && root.length() > commonLength) { + if (filePath.isChildOf(root) && root.toString().size() > commonLength) { index = i; - commonLength = root.length(); + commonLength = root.toString().size(); } } return index;