summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libs/utils/buildablehelperlibrary.cpp2
-rw-r--r--src/libs/utils/fileutils.cpp4
-rw-r--r--src/libs/utils/fileutils.h6
-rw-r--r--src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp4
-rw-r--r--src/plugins/coreplugin/locator/basefilefilter.cpp2
-rw-r--r--src/plugins/debugger/debuggeritemmanager.cpp2
-rw-r--r--src/plugins/ios/iosprobe.cpp4
-rw-r--r--src/plugins/projectexplorer/gnumakeparser.cpp2
-rw-r--r--src/plugins/projectexplorer/selectablefilesmodel.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/makefileparse.cpp2
-rw-r--r--src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp2
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp6
-rw-r--r--src/plugins/updateinfo/updateinfoplugin.cpp2
13 files changed, 21 insertions, 19 deletions
diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp
index ab108fab8c..05c5deeaf4 100644
--- a/src/libs/utils/buildablehelperlibrary.cpp
+++ b/src/libs/utils/buildablehelperlibrary.cpp
@@ -94,7 +94,7 @@ static FileName findQmakeInDir(const FileName &path)
if (fi.fileName() == qmake)
continue;
if (isQmake(fi.absoluteFilePath()))
- return FileName(fi);
+ return FileName::fromFileInfo(fi);
}
return FileName();
}
diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp
index fbc8134df4..ab2782a68d 100644
--- a/src/libs/utils/fileutils.cpp
+++ b/src/libs/utils/fileutils.cpp
@@ -641,9 +641,9 @@ FileName::FileName()
}
/// Constructs a FileName from \a info
-FileName::FileName(const QFileInfo &info)
- : QString(info.absoluteFilePath())
+FileName FileName::fromFileInfo(const QFileInfo &info)
{
+ return FileName::fromString(info.absoluteFilePath());
}
/// \returns a QFileInfo
diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h
index 29067714ee..8964443310 100644
--- a/src/libs/utils/fileutils.h
+++ b/src/libs/utils/fileutils.h
@@ -64,14 +64,16 @@ class QTCREATOR_UTILS_EXPORT FileName : private QString
{
public:
FileName();
- explicit FileName(const QFileInfo &info);
- QFileInfo toFileInfo() const;
+
static FileName fromString(const QString &filename);
+ static FileName fromFileInfo(const QFileInfo &info);
static FileName fromStringWithExtension(const QString &filename, const QString &defaultExtension);
static FileName fromLatin1(const QByteArray &filename);
static FileName fromUserInput(const QString &filename);
static FileName fromUtf8(const char *filename, int filenameSize = -1);
+
const QString &toString() const;
+ QFileInfo toFileInfo() const;
QString toUserOutput() const;
QString fileName(int pathComponents = 0) const;
bool exists() const;
diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
index 7392eb5905..8d1447b07b 100644
--- a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp
@@ -283,7 +283,7 @@ int ReadOnlyFilesDialog::exec()
result = static_cast<ReadOnlyResult>(buttongroup.group->checkedId());
switch (result) {
case RO_MakeWritable:
- if (!Utils::FileUtils::makeWritable(Utils::FileName(QFileInfo(buttongroup.fileName)))) {
+ if (!Utils::FileUtils::makeWritable(Utils::FileName::fromFileInfo(buttongroup.fileName))) {
failedToMakeWritable << buttongroup.fileName;
continue;
}
@@ -403,7 +403,7 @@ void ReadOnlyFilesDialogPrivate::initDialog(const QStringList &fileNames)
auto item = new QTreeWidgetItem(ui.treeWidget);
item->setText(FileName, visibleName);
item->setIcon(FileName, FileIconProvider::icon(fileName));
- item->setText(Folder, Utils::FileUtils::shortNativePath(Utils::FileName(QFileInfo(directory))));
+ item->setText(Folder, Utils::FileUtils::shortNativePath(Utils::FileName::fromFileInfo(directory)));
auto radioButtonGroup = new QButtonGroup;
// Add a button for opening the file with a version control system
diff --git a/src/plugins/coreplugin/locator/basefilefilter.cpp b/src/plugins/coreplugin/locator/basefilefilter.cpp
index 220f6ff782..d64a2e5d2f 100644
--- a/src/plugins/coreplugin/locator/basefilefilter.cpp
+++ b/src/plugins/coreplugin/locator/basefilefilter.cpp
@@ -153,7 +153,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
QFileInfo fi(path);
LocatorFilterEntry filterEntry(this, fi.fileName(), QString(path + fp.postfix));
filterEntry.fileName = path;
- filterEntry.extraInfo = FileUtils::shortNativePath(FileName(fi));
+ filterEntry.extraInfo = FileUtils::shortNativePath(FileName::fromFileInfo(fi));
const int matchLevel = matchLevelFor(match, matchText);
if (hasPathSeparator) {
diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp
index f2b3869f9b..3b3eed3dd6 100644
--- a/src/plugins/debugger/debuggeritemmanager.cpp
+++ b/src/plugins/debugger/debuggeritemmanager.cpp
@@ -653,7 +653,7 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
// Pre Windows SDK 8: Check 'Debugging Tools for Windows'
for (const QFileInfo &fi : dir.entryInfoList({"Debugging Tools for Windows*"},
QDir::Dirs | QDir::NoDotAndDotDot)) {
- FileName filePath(fi);
+ FileName filePath = FileName::fromFileInfo(fi);
filePath.appendPath("cdb.exe");
if (!cdbs.contains(filePath))
cdbs.append(filePath);
diff --git a/src/plugins/ios/iosprobe.cpp b/src/plugins/ios/iosprobe.cpp
index 35bcaff544..b67bfd4f78 100644
--- a/src/plugins/ios/iosprobe.cpp
+++ b/src/plugins/ios/iosprobe.cpp
@@ -91,11 +91,11 @@ void XcodeProbe::setupDefaultToolchains(const QString &devPath)
const QFileInfo clangCInfo = getClangInfo("clang");
if (clangCInfo.exists())
- clangProfile.cCompilerPath = Utils::FileName(clangCInfo);
+ clangProfile.cCompilerPath = Utils::FileName::fromFileInfo(clangCInfo);
const QFileInfo clangCppInfo = getClangInfo("clang++");
if (clangCppInfo.exists())
- clangProfile.cxxCompilerPath = Utils::FileName(clangCppInfo);
+ clangProfile.cxxCompilerPath = Utils::FileName::fromFileInfo(clangCppInfo);
QSet<QString> allArchitectures;
static const std::map<QString, QStringList> sdkConfigs {
diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp
index e7748608ae..f7ce1144bc 100644
--- a/src/plugins/projectexplorer/gnumakeparser.cpp
+++ b/src/plugins/projectexplorer/gnumakeparser.cpp
@@ -190,7 +190,7 @@ void GnuMakeParser::taskAdded(const Task &task, int linkedLines, int skippedLine
}
}
if (possibleFiles.size() == 1)
- editable.file = Utils::FileName(possibleFiles.first());
+ editable.file = Utils::FileName::fromFileInfo(possibleFiles.first());
// Let the Makestep apply additional heuristics (based on
// files in ther project) if we cannot uniquely
// identify the file!
diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp
index 80a9363dc9..2a0dff0933 100644
--- a/src/plugins/projectexplorer/selectablefilesmodel.cpp
+++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp
@@ -128,7 +128,7 @@ void SelectableFilesFromDirModel::buildTree(const Utils::FileName &baseDir, Tree
bool allChecked = true;
bool allUnchecked = true;
for (const QFileInfo &fileInfo : fileInfoList) {
- Utils::FileName fn = Utils::FileName(fileInfo);
+ Utils::FileName fn = Utils::FileName::fromFileInfo(fileInfo);
if (m_futureCount % 100) {
emit parsingProgress(fn);
if (fi.isCanceled())
diff --git a/src/plugins/qmakeprojectmanager/makefileparse.cpp b/src/plugins/qmakeprojectmanager/makefileparse.cpp
index b73c75244e..19a3a02f34 100644
--- a/src/plugins/qmakeprojectmanager/makefileparse.cpp
+++ b/src/plugins/qmakeprojectmanager/makefileparse.cpp
@@ -260,7 +260,7 @@ static FileName findQMakeBinaryFromMakefile(const QString &makefile)
// Is qmake still installed?
QFileInfo fi(qmakePath);
if (fi.exists())
- return FileName(fi);
+ return FileName::fromFileInfo(fi);
}
}
}
diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
index 0b55a76e2c..b6790642a5 100644
--- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp
@@ -280,7 +280,7 @@ QSet<FileName> QmakePriFile::recursiveEnumerate(const QString &folder)
if (file.isDir() && !file.isSymLink())
result += recursiveEnumerate(file.absoluteFilePath());
else if (!Core::EditorManager::isAutoSaveFile(file.fileName()))
- result += FileName(file);
+ result += FileName::fromFileInfo(file);
}
return result;
}
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index 25b382287b..e2e6263416 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -1819,7 +1819,7 @@ FileNameList BaseQtVersion::qtCorePaths() const
&& file.startsWith("QtCore")
&& file.endsWith(".framework")) {
// handle Framework
- FileName lib(info);
+ FileName lib = FileName::fromFileInfo(info);
dynamicLibs.append(lib.appendPath(file.left(file.lastIndexOf('.'))));
} else if (info.isReadable()) {
if (file.startsWith("libQtCore")
@@ -1827,12 +1827,12 @@ FileNameList BaseQtVersion::qtCorePaths() const
|| file.startsWith("QtCore")
|| file.startsWith("Qt5Core")) {
if (file.endsWith(".a") || file.endsWith(".lib"))
- staticLibs.append(FileName(info));
+ staticLibs.append(FileName::fromFileInfo(info));
else if (file.endsWith(".dll")
|| file.endsWith(QString::fromLatin1(".so.") + versionString)
|| file.endsWith(".so")
|| file.endsWith(QLatin1Char('.') + versionString + ".dylib"))
- dynamicLibs.append(FileName(info));
+ dynamicLibs.append(FileName::fromFileInfo(info));
}
}
}
diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp
index 0a9f13a814..8d9d0813da 100644
--- a/src/plugins/updateinfo/updateinfoplugin.cpp
+++ b/src/plugins/updateinfo/updateinfoplugin.cpp
@@ -128,7 +128,7 @@ void UpdateInfoPlugin::startCheckForUpdates()
d->m_checkUpdatesCommand->setDisplayName(tr("Checking for Updates"));
connect(d->m_checkUpdatesCommand, &ShellCommand::stdOutText, this, &UpdateInfoPlugin::collectCheckForUpdatesOutput);
connect(d->m_checkUpdatesCommand, &ShellCommand::finished, this, &UpdateInfoPlugin::checkForUpdatesFinished);
- d->m_checkUpdatesCommand->addJob(Utils::FileName(QFileInfo(d->m_maintenanceTool)), QStringList(QLatin1String("--checkupdates")),
+ d->m_checkUpdatesCommand->addJob(Utils::FileName::fromFileInfo(d->m_maintenanceTool), {"--checkupdates"},
60 * 3, // 3 minutes timeout
/*workingDirectory=*/QString(),
[](int /*exitCode*/) { return Utils::SynchronousProcessResponse::Finished; });