Commit 406d231f authored by Tobias Hunger's avatar Tobias Hunger

Do not create a QFileInfo via Utils::FileName::toString()

Use Utils::FileName::toFileInfo() instead.

Change-Id: I63615b0e4ce1dd2e32d5f2b488710a55b8507d34
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 5d7f5a2a
......@@ -66,7 +66,7 @@ int AndroidQtVersionFactory::priority() const
QtSupport::BaseQtVersion *AndroidQtVersionFactory::create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator, bool isAutoDetected, const QString &autoDetectionSource)
{
QFileInfo fi(qmakePath.toString());
QFileInfo fi = qmakePath.toFileInfo();
if (!fi.exists() || !fi.isExecutable() || !fi.isFile())
return 0;
if (!evaluator->values(QLatin1String("CONFIG")).contains(QLatin1String("android"))
......
......@@ -296,7 +296,7 @@ void UpdateIncludeDependenciesVisitor::collectElementPaths(const ProjectExplorer
{
foreach (const ProjectExplorer::FileNode *fileNode, folderNode->fileNodes()) {
QString elementName = qmt::NameController::convertFileNameToElementName(fileNode->filePath().toString());
QFileInfo fileInfo(fileNode->filePath().toString());
QFileInfo fileInfo = fileNode->filePath().toFileInfo();
QString nodePath = fileInfo.path();
QStringList elementsPath = qmt::NameController::buildElementsPath(nodePath, false);
filePathsMap->insertMulti(elementName, Node(fileNode->filePath().toString(), elementsPath));
......
......@@ -76,7 +76,7 @@ QString PxNodeUtilities::calcRelativePath(const ProjectExplorer::Node *node,
switch (node->nodeType()) {
case ProjectExplorer::FileNodeType:
{
QFileInfo fileInfo(node->filePath().toString());
QFileInfo fileInfo = node->filePath().toFileInfo();
nodePath = fileInfo.path();
break;
}
......
......@@ -381,7 +381,7 @@ QIcon Kit::icon(const FileName &path)
if (path == FileName::fromLatin1(":///DESKTOP///"))
return qApp->style()->standardIcon(QStyle::SP_ComputerIcon);
QFileInfo fi(path.toString());
QFileInfo fi = path.toFileInfo();
if (fi.isFile() && fi.isReadable())
return QIcon(path.toString());
return QIcon();
......
......@@ -730,7 +730,7 @@ void QtOptionsPageWidget::addQtDir()
if (qtVersion.isNull())
return;
QFileInfo fi(qtVersion.toString());
QFileInfo fi = qtVersion.toFileInfo();
// should add all qt versions here ?
if (BuildableHelperLibrary::isQtChooser(fi))
qtVersion = FileName::fromString(BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment