Utils: RemoveFileName::{size,count,length}

Use .toString().{size,count,length} instead.

Change-Id: Ib697155f441a8297fb179921bcd3397719a44073
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2019-05-10 11:48:14 +02:00
parent 555360c1d4
commit 88c495976c
3 changed files with 4 additions and 6 deletions

View File

@@ -96,11 +96,9 @@ public:
FileName &appendString(QChar str); FileName &appendString(QChar str);
using QString::clear; using QString::clear;
using QString::count;
using QString::isEmpty; using QString::isEmpty;
using QString::isNull; using QString::isNull;
using QString::length;
using QString::size;
private: private:
FileName(const QString &string); FileName(const QString &string);
}; };

View File

@@ -140,7 +140,7 @@ void CppcheckRunner::checkQueued()
m_currentFiles.clear(); m_currentFiles.clear();
int argumentsLength = arguments.length(); int argumentsLength = arguments.length();
while (!files.isEmpty()) { while (!files.isEmpty()) {
argumentsLength += files.first().length() + 1; // +1 for separator argumentsLength += files.first().toString().size() + 1; // +1 for separator
if (argumentsLength >= m_maxArgumentsLength) if (argumentsLength >= m_maxArgumentsLength)
break; break;
m_currentFiles.push_back(files.first()); m_currentFiles.push_back(files.first());

View File

@@ -655,9 +655,9 @@ int FolderNavigationWidget::bestRootForFile(const Utils::FileName &filePath)
int commonLength = 0; int commonLength = 0;
for (int i = 1; i < m_rootSelector->count(); ++i) { for (int i = 1; i < m_rootSelector->count(); ++i) {
const auto root = m_rootSelector->itemData(i).value<Utils::FileName>(); const auto root = m_rootSelector->itemData(i).value<Utils::FileName>();
if (filePath.isChildOf(root) && root.length() > commonLength) { if (filePath.isChildOf(root) && root.toString().size() > commonLength) {
index = i; index = i;
commonLength = root.length(); commonLength = root.toString().size();
} }
} }
return index; return index;