diff options
author | hjk <hjk@qt.io> | 2019-05-28 13:49:26 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-05-28 12:23:26 +0000 |
commit | 473a741c9fcf09febba312464fab8385e2351181 (patch) | |
tree | 2d328a090993cb5c5fd34b43e9468bcbf7e4d4d0 /src | |
parent | 4704f49fbb1201ebf10ab9dbaed0275ff25faba8 (diff) | |
download | qt-creator-473a741c9fcf09febba312464fab8385e2351181.tar.gz |
Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.
Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src')
677 files changed, 3444 insertions, 3441 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index a531543c7e..e1756b2b95 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -196,7 +196,7 @@ static bool copyRecursively(const QString &srcFilePath, if (srcFileInfo.isDir()) { QDir targetDir(tgtFilePath); targetDir.cdUp(); - if (!targetDir.mkdir(Utils::FileName::fromString(tgtFilePath).fileName())) + if (!targetDir.mkdir(Utils::FilePath::fromString(tgtFilePath).fileName())) return false; QDir sourceDir(srcFilePath); QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System); diff --git a/src/libs/cplusplus/CppDocument.cpp b/src/libs/cplusplus/CppDocument.cpp index d892948468..c029c60dca 100644 --- a/src/libs/cplusplus/CppDocument.cpp +++ b/src/libs/cplusplus/CppDocument.cpp @@ -756,17 +756,17 @@ bool Snapshot::isEmpty() const return _documents.isEmpty(); } -Snapshot::const_iterator Snapshot::find(const Utils::FileName &fileName) const +Snapshot::const_iterator Snapshot::find(const Utils::FilePath &fileName) const { return _documents.find(fileName); } -void Snapshot::remove(const Utils::FileName &fileName) +void Snapshot::remove(const Utils::FilePath &fileName) { _documents.remove(fileName); } -bool Snapshot::contains(const Utils::FileName &fileName) const +bool Snapshot::contains(const Utils::FilePath &fileName) const { return _documents.contains(fileName); } @@ -774,7 +774,7 @@ bool Snapshot::contains(const Utils::FileName &fileName) const void Snapshot::insert(Document::Ptr doc) { if (doc) { - _documents.insert(Utils::FileName::fromString(doc->fileName()), doc); + _documents.insert(Utils::FilePath::fromString(doc->fileName()), doc); m_deps.files.clear(); // Will trigger re-build when accessed. } } @@ -794,7 +794,7 @@ static QList<Macro> macrosDefinedUntilLine(const QList<Macro> ¯os, int line) } Document::Ptr Snapshot::preprocessedDocument(const QByteArray &source, - const Utils::FileName &fileName, + const Utils::FilePath &fileName, int withDefinedMacrosFromDocumentUntilLine) const { Document::Ptr newDoc = Document::create(fileName.toString()); @@ -858,7 +858,7 @@ QList<Snapshot::IncludeLocation> Snapshot::includeLocationsOfDocument(const QStr return result; } -Utils::FileNameList Snapshot::filesDependingOn(const Utils::FileName &fileName) const +Utils::FilePathList Snapshot::filesDependingOn(const Utils::FilePath &fileName) const { updateDependencyTable(); return m_deps.filesDependingOn(fileName); @@ -887,7 +887,7 @@ void Snapshot::allIncludesForDocument_helper(const QString &fileName, QSet<QStri } } -Document::Ptr Snapshot::document(const Utils::FileName &fileName) const +Document::Ptr Snapshot::document(const Utils::FilePath &fileName) const { return _documents.value(fileName); } diff --git a/src/libs/cplusplus/CppDocument.h b/src/libs/cplusplus/CppDocument.h index 006f17aba6..74205f1625 100644 --- a/src/libs/cplusplus/CppDocument.h +++ b/src/libs/cplusplus/CppDocument.h @@ -389,7 +389,7 @@ private: class CPLUSPLUS_EXPORT Snapshot { - typedef QHash<Utils::FileName, Document::Ptr> Base; + typedef QHash<Utils::FilePath, Document::Ptr> Base; public: Snapshot(); @@ -403,36 +403,36 @@ public: bool isEmpty() const; void insert(Document::Ptr doc); // ### remove - void remove(const Utils::FileName &fileName); // ### remove + void remove(const Utils::FilePath &fileName); // ### remove void remove(const QString &fileName) - { remove(Utils::FileName::fromString(fileName)); } + { remove(Utils::FilePath::fromString(fileName)); } const_iterator begin() const { return _documents.begin(); } const_iterator end() const { return _documents.end(); } - bool contains(const Utils::FileName &fileName) const; + bool contains(const Utils::FilePath &fileName) const; bool contains(const QString &fileName) const - { return contains(Utils::FileName::fromString(fileName)); } + { return contains(Utils::FilePath::fromString(fileName)); } - Document::Ptr document(const Utils::FileName &fileName) const; + Document::Ptr document(const Utils::FilePath &fileName) const; Document::Ptr document(const QString &fileName) const - { return document(Utils::FileName::fromString(fileName)); } + { return document(Utils::FilePath::fromString(fileName)); } - const_iterator find(const Utils::FileName &fileName) const; + const_iterator find(const Utils::FilePath &fileName) const; const_iterator find(const QString &fileName) const - { return find(Utils::FileName::fromString(fileName)); } + { return find(Utils::FilePath::fromString(fileName)); } Snapshot simplified(Document::Ptr doc) const; Document::Ptr preprocessedDocument(const QByteArray &source, - const Utils::FileName &fileName, + const Utils::FilePath &fileName, int withDefinedMacrosFromDocumentUntilLine = -1) const; Document::Ptr preprocessedDocument(const QByteArray &source, const QString &fileName, int withDefinedMacrosFromDocumentUntilLine = -1) const { return preprocessedDocument(source, - Utils::FileName::fromString(fileName), + Utils::FilePath::fromString(fileName), withDefinedMacrosFromDocumentUntilLine); } @@ -442,9 +442,9 @@ public: QSet<QString> allIncludesForDocument(const QString &fileName) const; QList<IncludeLocation> includeLocationsOfDocument(const QString &fileName) const; - Utils::FileNameList filesDependingOn(const Utils::FileName &fileName) const; - Utils::FileNameList filesDependingOn(const QString &fileName) const - { return filesDependingOn(Utils::FileName::fromString(fileName)); } + Utils::FilePathList filesDependingOn(const Utils::FilePath &fileName) const; + Utils::FilePathList filesDependingOn(const QString &fileName) const + { return filesDependingOn(Utils::FilePath::fromString(fileName)); } void updateDependencyTable() const; bool operator==(const Snapshot &other) const; diff --git a/src/libs/cplusplus/DependencyTable.cpp b/src/libs/cplusplus/DependencyTable.cpp index f9c17c0b61..8ddc9801d0 100644 --- a/src/libs/cplusplus/DependencyTable.cpp +++ b/src/libs/cplusplus/DependencyTable.cpp @@ -29,9 +29,9 @@ using namespace CPlusPlus; -Utils::FileNameList DependencyTable::filesDependingOn(const Utils::FileName &fileName) const +Utils::FilePathList DependencyTable::filesDependingOn(const Utils::FilePath &fileName) const { - Utils::FileNameList deps; + Utils::FilePathList deps; int index = fileIndex.value(fileName, -1); if (index == -1) @@ -66,14 +66,14 @@ void DependencyTable::build(const Snapshot &snapshot) } for (int i = 0; i < files.size(); ++i) { - const Utils::FileName &fileName = files.at(i); + const Utils::FilePath &fileName = files.at(i); if (Document::Ptr doc = snapshot.document(fileName)) { QBitArray bitmap(files.size()); QList<int> directIncludes; const QStringList documentIncludes = doc->includedFiles(); foreach (const QString &includedFile, documentIncludes) { - int index = fileIndex.value(Utils::FileName::fromString(includedFile)); + int index = fileIndex.value(Utils::FilePath::fromString(includedFile)); if (index == -1) continue; diff --git a/src/libs/cplusplus/DependencyTable.h b/src/libs/cplusplus/DependencyTable.h index 508ae297c5..3e888c59db 100644 --- a/src/libs/cplusplus/DependencyTable.h +++ b/src/libs/cplusplus/DependencyTable.h @@ -44,10 +44,10 @@ class CPLUSPLUS_EXPORT DependencyTable private: friend class Snapshot; void build(const Snapshot &snapshot); - Utils::FileNameList filesDependingOn(const Utils::FileName &fileName) const; + Utils::FilePathList filesDependingOn(const Utils::FilePath &fileName) const; - QVector<Utils::FileName> files; - QHash<Utils::FileName, int> fileIndex; + QVector<Utils::FilePath> files; + QHash<Utils::FilePath, int> fileIndex; QHash<int, QList<int> > includes; QVector<QBitArray> includeMap; }; diff --git a/src/libs/cplusplus/FindUsages.cpp b/src/libs/cplusplus/FindUsages.cpp index 173a6e2a5e..638fba451b 100644 --- a/src/libs/cplusplus/FindUsages.cpp +++ b/src/libs/cplusplus/FindUsages.cpp @@ -170,7 +170,7 @@ void FindUsages::reportResult(unsigned tokenIndex) const int len = tk.utf16chars(); - const Usage u(Utils::FileName::fromString(_doc->fileName()), lineText, line, col, len); + const Usage u(Utils::FilePath::fromString(_doc->fileName()), lineText, line, col, len); _usages.append(u); _references.append(tokenIndex); } diff --git a/src/libs/cplusplus/FindUsages.h b/src/libs/cplusplus/FindUsages.h index deed69276a..2b6880a55c 100644 --- a/src/libs/cplusplus/FindUsages.h +++ b/src/libs/cplusplus/FindUsages.h @@ -40,11 +40,11 @@ class CPLUSPLUS_EXPORT Usage { public: Usage() = default; - Usage(const Utils::FileName &path, const QString &lineText, int line, int col, int len) + Usage(const Utils::FilePath &path, const QString &lineText, int line, int col, int len) : path(path), lineText(lineText), line(line), col(col), len(len) {} public: - Utils::FileName path; + Utils::FilePath path; QString lineText; int line = 0; int col = 0; diff --git a/src/libs/languageserverprotocol/lsptypes.cpp b/src/libs/languageserverprotocol/lsptypes.cpp index 257e6a13a3..8aa1ecf81c 100644 --- a/src/libs/languageserverprotocol/lsptypes.cpp +++ b/src/libs/languageserverprotocol/lsptypes.cpp @@ -362,7 +362,7 @@ bool Range::overlaps(const Range &range) const return contains(range.start()) || contains(range.end()); } -bool DocumentFilter::applies(const Utils::FileName &fileName, const Utils::MimeType &mimeType) const +bool DocumentFilter::applies(const Utils::FilePath &fileName, const Utils::MimeType &mimeType) const { if (Utils::optional<QString> _scheme = scheme()) { if (_scheme.value() == fileName.toString()) @@ -406,14 +406,14 @@ DocumentUri::DocumentUri(const QString &other) : QUrl(QUrl::fromPercentEncoding(other.toLocal8Bit())) { } -DocumentUri::DocumentUri(const Utils::FileName &other) +DocumentUri::DocumentUri(const Utils::FilePath &other) : QUrl(QUrl::fromLocalFile(other.toString())) { } -Utils::FileName DocumentUri::toFileName() const +Utils::FilePath DocumentUri::toFileName() const { - return isLocalFile() ? Utils::FileName::fromUserInput(QUrl(*this).toLocalFile()) - : Utils::FileName(); + return isLocalFile() ? Utils::FilePath::fromUserInput(QUrl(*this).toLocalFile()) + : Utils::FilePath(); } MarkupKind::MarkupKind(const QJsonValue &value) diff --git a/src/libs/languageserverprotocol/lsptypes.h b/src/libs/languageserverprotocol/lsptypes.h index 80c9a8cb61..ade3ac7ccf 100644 --- a/src/libs/languageserverprotocol/lsptypes.h +++ b/src/libs/languageserverprotocol/lsptypes.h @@ -45,16 +45,16 @@ class LANGUAGESERVERPROTOCOL_EXPORT DocumentUri : public QUrl { public: DocumentUri() = default; - Utils::FileName toFileName() const; + Utils::FilePath toFileName() const; static DocumentUri fromProtocol(const QString &uri) { return DocumentUri(uri); } - static DocumentUri fromFileName(const Utils::FileName &file) { return DocumentUri(file); } + static DocumentUri fromFileName(const Utils::FilePath &file) { return DocumentUri(file); } operator QJsonValue() const { return QJsonValue(toString()); } private: DocumentUri(const QString &other); - DocumentUri(const Utils::FileName &other); + DocumentUri(const Utils::FilePath &other); friend class LanguageClientValue<QString>; }; @@ -372,7 +372,7 @@ public: void setPattern(const QString &pattern) { insert(patternKey, pattern); } void clearPattern() { remove(patternKey); } - bool applies(const Utils::FileName &fileName, + bool applies(const Utils::FilePath &fileName, const Utils::MimeType &mimeType = Utils::MimeType()) const; bool isValid(QStringList *error) const override; diff --git a/src/libs/languageserverprotocol/servercapabilities.cpp b/src/libs/languageserverprotocol/servercapabilities.cpp index fcd1fadeac..6ebf4f431f 100644 --- a/src/libs/languageserverprotocol/servercapabilities.cpp +++ b/src/libs/languageserverprotocol/servercapabilities.cpp @@ -161,7 +161,7 @@ bool ServerCapabilities::WorkspaceServerCapabilities::WorkspaceFoldersCapabiliti && checkOptional<QString, bool>(error, changeNotificationsKey); } -bool TextDocumentRegistrationOptions::filterApplies(const Utils::FileName &fileName, +bool TextDocumentRegistrationOptions::filterApplies(const Utils::FilePath &fileName, const Utils::MimeType &mimeType) const { const LanguageClientArray<DocumentFilter> &selector = documentSelector(); diff --git a/src/libs/languageserverprotocol/servercapabilities.h b/src/libs/languageserverprotocol/servercapabilities.h index 0e31821b17..71d3e4a496 100644 --- a/src/libs/languageserverprotocol/servercapabilities.h +++ b/src/libs/languageserverprotocol/servercapabilities.h @@ -52,7 +52,7 @@ public: void setDocumentSelector(const LanguageClientArray<DocumentFilter> &documentSelector) { insert(documentSelectorKey, documentSelector.toJson()); } - bool filterApplies(const Utils::FileName &fileName, + bool filterApplies(const Utils::FilePath &fileName, const Utils::MimeType &mimeType = Utils::MimeType()) const; bool isValid(QStringList *error) const override @@ -268,7 +268,7 @@ public: void setDocumentSelector(const LanguageClientArray<DocumentFilter> &documentSelector) { insert(documentSelectorKey, documentSelector.toJson()); } - bool filterApplies(const Utils::FileName &fileName, + bool filterApplies(const Utils::FilePath &fileName, const Utils::MimeType &mimeType = Utils::MimeType()) const; // The id used to register the request. The id can be used to deregister diff --git a/src/libs/qmljs/qmljsdialect.cpp b/src/libs/qmljs/qmljsdialect.cpp index f460b44056..cfe71b2265 100644 --- a/src/libs/qmljs/qmljsdialect.cpp +++ b/src/libs/qmljs/qmljsdialect.cpp @@ -232,7 +232,7 @@ QDebug operator << (QDebug &dbg, const Dialect &dialect) return dbg; } -PathAndLanguage::PathAndLanguage(const Utils::FileName &path, Dialect language) +PathAndLanguage::PathAndLanguage(const Utils::FilePath &path, Dialect language) : m_path(path), m_language(language) { } @@ -293,11 +293,11 @@ void PathsAndLanguages::compact() return; int oldCompactionPlace = 0; - Utils::FileName oldPath = m_list.first().path(); + Utils::FilePath oldPath = m_list.first().path(); QList<PathAndLanguage> compactedList; bool restrictFailed = false; for (int i = 1; i < m_list.length(); ++i) { - Utils::FileName newPath = m_list.at(i).path(); + Utils::FilePath newPath = m_list.at(i).path(); if (newPath == oldPath) { int newCompactionPlace = i - 1; compactedList << m_list.mid(oldCompactionPlace, newCompactionPlace - oldCompactionPlace); diff --git a/src/libs/qmljs/qmljsdialect.h b/src/libs/qmljs/qmljsdialect.h index 2832eca341..230642e145 100644 --- a/src/libs/qmljs/qmljsdialect.h +++ b/src/libs/qmljs/qmljsdialect.h @@ -78,8 +78,8 @@ QMLJS_EXPORT QDebug operator << (QDebug &dbg, const Dialect &dialect); class QMLJS_EXPORT PathAndLanguage { public: - PathAndLanguage(const Utils::FileName &path = Utils::FileName(), Dialect language = Dialect::AnyLanguage); - Utils::FileName path() const { + PathAndLanguage(const Utils::FilePath &path = Utils::FilePath(), Dialect language = Dialect::AnyLanguage); + Utils::FilePath path() const { return m_path; } Dialect language() const { @@ -88,7 +88,7 @@ public: bool operator ==(const PathAndLanguage &other) const; bool operator < (const PathAndLanguage &other) const; private: - Utils::FileName m_path; + Utils::FilePath m_path; Dialect m_language; }; @@ -128,7 +128,7 @@ public: : m_list(list) { } - bool maybeInsert(const Utils::FileName &path, Dialect language = Dialect::AnyLanguage) { + bool maybeInsert(const Utils::FilePath &path, Dialect language = Dialect::AnyLanguage) { return maybeInsert(PathAndLanguage(path, language)); } diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index 8f079c9a8d..6bb1bc8ff9 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -1100,14 +1100,14 @@ void ModelManagerInterface::updateImportPaths() PathAndLanguage pAndL = iPaths.at(i); const QString canonicalPath = pAndL.path().toFileInfo().canonicalFilePath(); if (!canonicalPath.isEmpty()) - allImportPaths.maybeInsert(Utils::FileName::fromString(canonicalPath), + allImportPaths.maybeInsert(Utils::FilePath::fromString(canonicalPath), pAndL.language()); } } while (vCtxsIter.hasNext()) { vCtxsIter.next(); foreach (const QString &path, vCtxsIter.value().paths) - allImportPaths.maybeInsert(Utils::FileName::fromString(path), vCtxsIter.value().language); + allImportPaths.maybeInsert(Utils::FilePath::fromString(path), vCtxsIter.value().language); } pInfoIter.toFront(); while (pInfoIter.hasNext()) { @@ -1118,7 +1118,7 @@ void ModelManagerInterface::updateImportPaths() .searchPaths().stringList()) { const QString canonicalPath = QFileInfo(path).canonicalFilePath(); if (!canonicalPath.isEmpty()) - allImportPaths.maybeInsert(Utils::FileName::fromString(canonicalPath), l); + allImportPaths.maybeInsert(Utils::FilePath::fromString(canonicalPath), l); } } } @@ -1127,16 +1127,16 @@ void ModelManagerInterface::updateImportPaths() pInfoIter.next(); QString pathAtt = pInfoIter.value().qtQmlPath; if (!pathAtt.isEmpty()) - allImportPaths.maybeInsert(Utils::FileName::fromString(pathAtt), Dialect::QmlQtQuick2); + allImportPaths.maybeInsert(Utils::FilePath::fromString(pathAtt), Dialect::QmlQtQuick2); } { QString pathAtt = defaultProjectInfo().qtQmlPath; if (!pathAtt.isEmpty()) - allImportPaths.maybeInsert(Utils::FileName::fromString(pathAtt), Dialect::QmlQtQuick2); + allImportPaths.maybeInsert(Utils::FilePath::fromString(pathAtt), Dialect::QmlQtQuick2); } foreach (const QString &path, m_defaultImportPaths) - allImportPaths.maybeInsert(Utils::FileName::fromString(path), Dialect::Qml); + allImportPaths.maybeInsert(Utils::FilePath::fromString(path), Dialect::Qml); allImportPaths.compact(); { diff --git a/src/libs/ssh/sftpsession.cpp b/src/libs/ssh/sftpsession.cpp index 0119bea266..efced580c9 100644 --- a/src/libs/ssh/sftpsession.cpp +++ b/src/libs/ssh/sftpsession.cpp @@ -138,7 +138,7 @@ void SftpSession::doStart() { if (d->state != State::Starting) return; - const FileName sftpBinary = SshSettings::sftpFilePath(); + const FilePath sftpBinary = SshSettings::sftpFilePath(); if (!sftpBinary.exists()) { d->state = State::Inactive; emit done(tr("Cannot establish SFTP session: sftp binary \"%1\" does not exist.") diff --git a/src/libs/ssh/sftptransfer.cpp b/src/libs/ssh/sftptransfer.cpp index 887d8f36fa..52b821bc39 100644 --- a/src/libs/ssh/sftptransfer.cpp +++ b/src/libs/ssh/sftptransfer.cpp @@ -132,7 +132,7 @@ SftpTransfer::SftpTransfer(const FilesToTransfer &files, Internal::FileTransferT void SftpTransfer::doStart() { - const FileName sftpBinary = SshSettings::sftpFilePath(); + const FilePath sftpBinary = SshSettings::sftpFilePath(); if (!sftpBinary.exists()) { emitError(tr("sftp binary \"%1\" does not exist.").arg(sftpBinary.toUserOutput())); return; diff --git a/src/libs/ssh/sshconnection.cpp b/src/libs/ssh/sshconnection.cpp index fbacad8842..011a5f546f 100644 --- a/src/libs/ssh/sshconnection.cpp +++ b/src/libs/ssh/sshconnection.cpp @@ -342,7 +342,7 @@ void SshConnection::doConnectToHost() { if (d->state != Connecting) return; - const FileName sshBinary = SshSettings::sshFilePath(); + const FilePath sshBinary = SshSettings::sshFilePath(); if (!sshBinary.exists()) { emitError(tr("Cannot establish SSH connection: ssh binary \"%1\" does not exist.") .arg(sshBinary.toUserOutput())); diff --git a/src/libs/ssh/sshsettings.cpp b/src/libs/ssh/sshsettings.cpp index 12f17bbade..0086d05376 100644 --- a/src/libs/ssh/sshsettings.cpp +++ b/src/libs/ssh/sshsettings.cpp @@ -39,11 +39,11 @@ struct SshSettings { bool useConnectionSharing = !HostOsInfo::isWindowsHost(); int connectionSharingTimeOutInMinutes = 10; - FileName sshFilePath; - FileName sftpFilePath; - FileName askpassFilePath; - FileName keygenFilePath; - QSsh::SshSettings::SearchPathRetriever searchPathRetriever = [] { return FileNameList(); }; + FilePath sshFilePath; + FilePath sftpFilePath; + FilePath askpassFilePath; + FilePath keygenFilePath; + QSsh::SshSettings::SearchPathRetriever searchPathRetriever = [] { return FilePathList(); }; }; } // namespace Internal @@ -79,11 +79,11 @@ void SshSettings::loadSettings(QSettings *settings) value = settings->value(connectionSharingTimeoutKey()); if (value.isValid()) sshSettings->connectionSharingTimeOutInMinutes = value.toInt(); - sshSettings->sshFilePath = FileName::fromString(settings->value(sshFilePathKey()).toString()); - sshSettings->sftpFilePath = FileName::fromString(settings->value(sftpFilePathKey()).toString()); - sshSettings->askpassFilePath = FileName::fromString( + sshSettings->sshFilePath = FilePath::fromString(settings->value(sshFilePathKey()).toString()); + sshSettings->sftpFilePath = FilePath::fromString(settings->value(sftpFilePathKey()).toString()); + sshSettings->askpassFilePath = FilePath::fromString( settings->value(askPassFilePathKey()).toString()); - sshSettings->keygenFilePath = FileName::fromString( + sshSettings->keygenFilePath = FilePath::fromString( settings->value(keygenFilePathKey()).toString()); } @@ -114,51 +114,51 @@ int SshSettings::connectionSharingTimeout() return sshSettings->connectionSharingTimeOutInMinutes; } -static FileName filePathValue(const FileName &value, const QStringList &candidateFileNames) +static FilePath filePathValue(const FilePath &value, const QStringList &candidateFileNames) { if (!value.isEmpty()) return value; - const QList<FileName> additionalSearchPaths = sshSettings->searchPathRetriever(); + const QList<FilePath> additionalSearchPaths = sshSettings->searchPathRetriever(); for (const QString &candidate : candidateFileNames) { - const FileName filePath = Environment::systemEnvironment() + const FilePath filePath = Environment::systemEnvironment() .searchInPath(candidate, additionalSearchPaths); if (!filePath.isEmpty()) return filePath; } - return FileName(); + return FilePath(); } -static FileName filePathValue(const FileName &value, const QString &candidateFileName) +static FilePath filePathValue(const FilePath &value, const QString &candidateFileName) { return filePathValue(value, QStringList(candidateFileName)); } -void SshSettings::setSshFilePath(const FileName &ssh) { sshSettings->sshFilePath = ssh; } -FileName SshSettings::sshFilePath() { return filePathValue(sshSettings->sshFilePath, "ssh"); } +void SshSettings::setSshFilePath(const FilePath &ssh) { sshSettings->sshFilePath = ssh; } +FilePath SshSettings::sshFilePath() { return filePathValue(sshSettings->sshFilePath, "ssh"); } -void SshSettings::setSftpFilePath(const FileName &sftp) { sshSettings->sftpFilePath = sftp; } -FileName SshSettings::sftpFilePath() { return filePathValue(sshSettings->sftpFilePath, "sftp"); } +void SshSettings::setSftpFilePath(const FilePath &sftp) { sshSettings->sftpFilePath = sftp; } +FilePath SshSettings::sftpFilePath() { return filePathValue(sshSettings->sftpFilePath, "sftp"); } -void SshSettings::setAskpassFilePath(const FileName &askPass) +void SshSettings::setAskpassFilePath(const FilePath &askPass) { sshSettings->askpassFilePath = askPass; } -FileName SshSettings::askpassFilePath() +FilePath SshSettings::askpassFilePath() { - FileName candidate; + FilePath candidate; candidate = sshSettings->askpassFilePath; if (candidate.isEmpty()) - candidate = FileName::fromString(Environment::systemEnvironment().value("SSH_ASKPASS")); + candidate = FilePath::fromString(Environment::systemEnvironment().value("SSH_ASKPASS")); return filePathValue(candidate, QStringList{"qtc-askpass", "ssh-askpass"}); } -void SshSettings::setKeygenFilePath(const FileName &keygen) +void SshSettings::setKeygenFilePath(const FilePath &keygen) { sshSettings->keygenFilePath = keygen; } -FileName SshSettings::keygenFilePath() +FilePath SshSettings::keygenFilePath() { return filePathValue(sshSettings->keygenFilePath, "ssh-keygen"); } diff --git a/src/libs/ssh/sshsettings.h b/src/libs/ssh/sshsettings.h index dc29ead606..08692b6e8c 100644 --- a/src/libs/ssh/sshsettings.h +++ b/src/libs/ssh/sshsettings.h @@ -49,19 +49,19 @@ public: static void setConnectionSharingTimeout(int timeInMinutes); static int connectionSharingTimeout(); - static void setSshFilePath(const Utils::FileName &ssh); - static Utils::FileName sshFilePath(); + static void setSshFilePath(const Utils::FilePath &ssh); + static Utils::FilePath sshFilePath(); - static void setSftpFilePath(const Utils::FileName &sftp); - static Utils::FileName sftpFilePath(); + static void setSftpFilePath(const Utils::FilePath &sftp); + static Utils::FilePath sftpFilePath(); - static void setAskpassFilePath(const Utils::FileName &askPass); - static Utils::FileName askpassFilePath(); + static void setAskpassFilePath(const Utils::FilePath &askPass); + static Utils::FilePath askpassFilePath(); - static void setKeygenFilePath(const Utils::FileName &keygen); - static Utils::FileName keygenFilePath(); + static void setKeygenFilePath(const Utils::FilePath &keygen); + static Utils::FilePath keygenFilePath(); - using SearchPathRetriever = std::function<Utils::FileNameList()>; + using SearchPathRetriever = std::function<Utils::FilePathList()>; static void setExtraSearchPathRetriever(const SearchPathRetriever &pathRetriever); }; diff --git a/src/libs/utils/buildablehelperlibrary.cpp b/src/libs/utils/buildablehelperlibrary.cpp index 05c5deeaf4..33ba624dc4 100644 --- a/src/libs/utils/buildablehelperlibrary.cpp +++ b/src/libs/utils/buildablehelperlibrary.cpp @@ -73,17 +73,17 @@ static bool isQmake(const QString &path) return !BuildableHelperLibrary::qtVersionForQMake(fi.absoluteFilePath()).isEmpty(); } -static FileName findQmakeInDir(const FileName &path) +static FilePath findQmakeInDir(const FilePath &path) { if (path.isEmpty()) - return FileName(); + return FilePath(); const QString qmake = "qmake"; QDir dir(path.toString()); if (dir.exists(qmake)) { const QString qmakePath = dir.absoluteFilePath(qmake); if (isQmake(qmakePath)) - return FileName::fromString(qmakePath); + return FilePath::fromString(qmakePath); } // Prefer qmake-qt5 to qmake-qt4 by sorting the filenames in reverse order. @@ -94,26 +94,26 @@ static FileName findQmakeInDir(const FileName &path) if (fi.fileName() == qmake) continue; if (isQmake(fi.absoluteFilePath())) - return FileName::fromFileInfo(fi); + return FilePath::fromFileInfo(fi); } - return FileName(); + return FilePath(); } -FileName BuildableHelperLibrary::findSystemQt(const Environment &env) +FilePath BuildableHelperLibrary::findSystemQt(const Environment &env) { - const FileNameList list = findQtsInEnvironment(env, 1); - return list.size() == 1 ? list.first() : FileName(); + const FilePathList list = findQtsInEnvironment(env, 1); + return list.size() == 1 ? list.first() : FilePath(); } -FileNameList BuildableHelperLibrary::findQtsInEnvironment(const Environment &env, int maxCount) +FilePathList BuildableHelperLibrary::findQtsInEnvironment(const Environment &env, int maxCount) { - FileNameList qmakeList; + FilePathList qmakeList; std::set<QString> canonicalEnvPaths; - const FileNameList paths = env.path(); - for (const FileName &path : paths) { + const FilePathList paths = env.path(); + for (const FilePath &path : paths) { if (!canonicalEnvPaths.insert(path.toFileInfo().canonicalFilePath()).second) continue; - const FileName qmake = findQmakeInDir(path); + const FilePath qmake = findQmakeInDir(path); if (qmake.isEmpty()) continue; qmakeList << qmake; @@ -189,7 +189,7 @@ bool BuildableHelperLibrary::copyFiles(const QString &sourcePath, QString *errorMessage) { // try remove the directory - if (!FileUtils::removeRecursively(FileName::fromString(targetDirectory), errorMessage)) + if (!FileUtils::removeRecursively(FilePath::fromString(targetDirectory), errorMessage)) return false; if (!QDir().mkpath(targetDirectory)) { *errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", "The target directory %1 could not be created.").arg(targetDirectory); @@ -220,7 +220,7 @@ bool BuildableHelperLibrary::copyFiles(const QString &sourcePath, // Helper: Run a build process with merged stdout/stderr static inline bool runBuildProcessI(QProcess &proc, - const FileName &binary, + const FilePath &binary, const QStringList &args, int timeoutS, bool ignoreNonNullExitCode, @@ -261,7 +261,7 @@ static inline bool runBuildProcessI(QProcess &proc, // Run a build process with merged stdout/stderr and qWarn about errors. static bool runBuildProcess(QProcess &proc, - const FileName &binary, + const FilePath &binary, const QStringList &args, int timeoutS, bool ignoreNonNullExitCode, @@ -300,7 +300,7 @@ bool BuildableHelperLibrary::buildHelper(const BuildHelperArguments &arguments, arguments.directory)); log->append(newline); - const FileName makeFullPath = arguments.environment.searchInPath(arguments.makeCommand); + const FilePath makeFullPath = arguments.environment.searchInPath(arguments.makeCommand); if (QFileInfo::exists(arguments.directory + QLatin1String("/Makefile"))) { if (makeFullPath.isEmpty()) { *errorMessage = QCoreApplication::translate("ProjectExplorer::DebuggingHelperLibrary", diff --git a/src/libs/utils/buildablehelperlibrary.h b/src/libs/utils/buildablehelperlibrary.h index f2ec366863..45d37d65c4 100644 --- a/src/libs/utils/buildablehelperlibrary.h +++ b/src/libs/utils/buildablehelperlibrary.h @@ -37,8 +37,8 @@ class QTCREATOR_UTILS_EXPORT BuildableHelperLibrary public: // returns the full path to the first qmake, qmake-qt4, qmake4 that has // at least version 2.0.0 and thus is a qt4 qmake - static FileName findSystemQt(const Environment &env); - static FileNameList findQtsInEnvironment(const Environment &env, int maxCount = -1); + static FilePath findSystemQt(const Environment &env); + static FilePathList findQtsInEnvironment(const Environment &env, int maxCount = -1); static bool isQtChooser(const QFileInfo &info); static QString qtChooserToQmakePath(const QString &path); // return true if the qmake at qmakePath is a Qt (used by QtVersion) @@ -61,9 +61,9 @@ public: QString directory; Environment environment; - FileName qmakeCommand; + FilePath qmakeCommand; QString targetMode; - FileName mkspec; + FilePath mkspec; QString proFilename; QStringList qmakeArguments; diff --git a/src/libs/utils/environment.cpp b/src/libs/utils/environment.cpp index 602ee04958..d61a75ebf7 100644 --- a/src/libs/utils/environment.cpp +++ b/src/libs/utils/environment.cpp @@ -392,14 +392,14 @@ void Environment::clear() m_values.clear(); } -FileName Environment::searchInDirectory(const QStringList &execs, const FileName &directory, - QSet<FileName> &alreadyChecked) const +FilePath Environment::searchInDirectory(const QStringList &execs, const FilePath &directory, + QSet<FilePath> &alreadyChecked) const { const int checkedCount = alreadyChecked.count(); alreadyChecked.insert(directory); if (directory.isEmpty() || alreadyChecked.count() == checkedCount) - return FileName(); + return FilePath(); const QString dir = directory.toString(); @@ -407,9 +407,9 @@ FileName Environment::searchInDirectory(const QStringList &execs, const FileName for (const QString &exec : execs) { fi.setFile(dir, exec); if (fi.isFile() && fi.isExecutable()) - return FileName::fromString(fi.absoluteFilePath()); + return FilePath::fromString(fi.absoluteFilePath()); } - return FileName(); + return FilePath(); } QStringList Environment::appendExeExtensions(const QString &executable) const @@ -435,8 +435,8 @@ bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) con const QStringList exe2List = appendExeExtensions(exe2); for (const QString &i1 : exe1List) { for (const QString &i2 : exe2List) { - const FileName f1 = FileName::fromString(i1); - const FileName f2 = FileName::fromString(i2); + const FilePath f1 = FilePath::fromString(i1); + const FilePath f2 = FilePath::fromString(i2); if (f1 == f2) return true; if (FileUtils::resolveSymlinks(f1) == FileUtils::resolveSymlinks(f2)) @@ -448,12 +448,12 @@ bool Environment::isSameExecutable(const QString &exe1, const QString &exe2) con return false; } -FileName Environment::searchInPath(const QString &executable, - const FileNameList &additionalDirs, +FilePath Environment::searchInPath(const QString &executable, + const FilePathList &additionalDirs, const PathFilter &func) const { if (executable.isEmpty()) - return FileName(); + return FilePath(); const QString exec = QDir::cleanPath(expandVariables(executable)); const QFileInfo fi(exec); @@ -464,34 +464,34 @@ FileName Environment::searchInPath(const QString &executable, for (const QString &path : execs) { QFileInfo pfi = QFileInfo(path); if (pfi.isFile() && pfi.isExecutable()) - return FileName::fromString(path); + return FilePath::fromString(path); } - return FileName::fromString(exec); + return FilePath::fromString(exec); } - QSet<FileName> alreadyChecked; - for (const FileName &dir : additionalDirs) { - FileName tmp = searchInDirectory(execs, dir, alreadyChecked); + QSet<FilePath> alreadyChecked; + for (const FilePath &dir : additionalDirs) { + FilePath tmp = searchInDirectory(execs, dir, alreadyChecked); if (!tmp.isEmpty() && (!func || func(tmp))) return tmp; } if (executable.contains('/')) - return FileName(); + return FilePath(); - for (const FileName &p : path()) { - FileName tmp = searchInDirectory(execs, p, alreadyChecked); + for (const FilePath &p : path()) { + FilePath tmp = searchInDirectory(execs, p, alreadyChecked); if (!tmp.isEmpty() && (!func || func(tmp))) return tmp; } - return FileName(); + return FilePath(); } -FileNameList Environment::path() const +FilePathList Environment::path() const { const QStringList pathComponents = value("PATH") .split(OsSpecificAspects::pathListSeparator(m_osType), QString::SkipEmptyParts); - return Utils::transform(pathComponents, &FileName::fromUserInput); + return Utils::transform(pathComponents, &FilePath::fromUserInput); } QString Environment::value(const QString &key) const @@ -690,9 +690,9 @@ QString Environment::expandVariables(const QString &input) const return result; } -FileName Environment::expandVariables(const FileName &variables) const +FilePath Environment::expandVariables(const FilePath &variables) const { - return FileName::fromString(expandVariables(variables.toString())); + return FilePath::fromString(expandVariables(variables.toString())); } QStringList Environment::expandVariables(const QStringList &variables) const diff --git a/src/libs/utils/environment.h b/src/libs/utils/environment.h index bf716e29ff..f1e957ab6d 100644 --- a/src/libs/utils/environment.h +++ b/src/libs/utils/environment.h @@ -124,18 +124,18 @@ public: Environment::const_iterator constEnd() const; Environment::const_iterator constFind(const QString &name) const; - using PathFilter = std::function<bool(const FileName &)>; - FileName searchInPath(const QString &executable, - const FileNameList &additionalDirs = FileNameList(), + using PathFilter = std::function<bool(const FilePath &)>; + FilePath searchInPath(const QString &executable, + const FilePathList &additionalDirs = FilePathList(), const PathFilter &func = PathFilter()) const; - FileNameList path() const; + FilePathList path() const; QStringList appendExeExtensions(const QString &executable) const; bool isSameExecutable(const QString &exe1, const QString &exe2) const; QString expandVariables(const QString &input) const; - FileName expandVariables(const FileName &input) const; + FilePath expandVariables(const FilePath &input) const; QStringList expandVariables(const QStringList &input) const; bool operator!=(const Environment &other) const; @@ -144,8 +144,8 @@ public: static void modifySystemEnvironment(const QList<EnvironmentItem> &list); // use with care!!! private: - FileName searchInDirectory(const QStringList &execs, const FileName &directory, - QSet<FileName> &alreadyChecked) const; + FilePath searchInDirectory(const QStringList &execs, const FilePath &directory, + QSet<FilePath> &alreadyChecked) const; QMap<QString, QString> m_values; OsType m_osType; }; diff --git a/src/libs/utils/filecrumblabel.cpp b/src/libs/utils/filecrumblabel.cpp index a4bbe37c44..cf03af553c 100644 --- a/src/libs/utils/filecrumblabel.cpp +++ b/src/libs/utils/filecrumblabel.cpp @@ -38,22 +38,22 @@ FileCrumbLabel::FileCrumbLabel(QWidget *parent) setTextFormat(Qt::RichText); setWordWrap(true); connect(this, &QLabel::linkActivated, this, [this](const QString &url) { - emit pathClicked(FileName::fromString(QUrl(url).toLocalFile())); + emit pathClicked(FilePath::fromString(QUrl(url).toLocalFile())); }); - setPath(FileName()); + setPath(FilePath()); } -static QString linkForPath(const FileName &path, const QString &display) +static QString linkForPath(const FilePath &path, const QString &display) { return "<a href=\"" + QUrl::fromLocalFile(path.toString()).toString(QUrl::FullyEncoded) + "\">" + display + "</a>"; } -void FileCrumbLabel::setPath(const FileName &path) +void FileCrumbLabel::setPath(const FilePath &path) { QStringList links; - FileName current = path; + FilePath current = path; while (!current.isEmpty()) { const QString fileName = current.fileName(); if (!fileName.isEmpty()) { diff --git a/src/libs/utils/filecrumblabel.h b/src/libs/utils/filecrumblabel.h index 6320b115c0..05dd050812 100644 --- a/src/libs/utils/filecrumblabel.h +++ b/src/libs/utils/filecrumblabel.h @@ -38,10 +38,10 @@ class QTCREATOR_UTILS_EXPORT FileCrumbLabel : public QLabel public: FileCrumbLabel(QWidget *parent = nullptr); - void setPath(const FileName &path); + void setPath(const FilePath &path); signals: - void pathClicked(const FileName &path); + void pathClicked(const FilePath &path); }; } // Utils diff --git a/src/libs/utils/fileinprojectfinder.cpp b/src/libs/utils/fileinprojectfinder.cpp index 6167ff1484..3dbde17792 100644 --- a/src/libs/utils/fileinprojectfinder.cpp +++ b/src/libs/utils/fileinprojectfinder.cpp @@ -82,7 +82,7 @@ static bool checkPath(const QString &candidate, int matchLength, FileInProjectFinder::FileInProjectFinder() = default; FileInProjectFinder::~FileInProjectFinder() = default; -void FileInProjectFinder::setProjectDirectory(const FileName &absoluteProjectPath) +void FileInProjectFinder::setProjectDirectory(const FilePath &absoluteProjectPath) { if (absoluteProjectPath == m_projectDir) return; @@ -95,12 +95,12 @@ void FileInProjectFinder::setProjectDirectory(const FileName &absoluteProjectPat m_cache.clear(); } -FileName FileInProjectFinder::projectDirectory() const +FilePath FileInProjectFinder::projectDirectory() const { return m_projectDir; } -void FileInProjectFinder::setProjectFiles(const FileNameList &projectFiles) +void FileInProjectFinder::setProjectFiles(const FilePathList &projectFiles) { if (m_projectFiles == projectFiles) return; @@ -110,7 +110,7 @@ void FileInProjectFinder::setProjectFiles(const FileNameList &projectFiles) m_qrcUrlFinder.setProjectFiles(projectFiles); } -void FileInProjectFinder::setSysroot(const FileName &sysroot) +void FileInProjectFinder::setSysroot(const FilePath &sysroot) { if (m_sysroot == sysroot) return; @@ -119,7 +119,7 @@ void FileInProjectFinder::setSysroot(const FileName &sysroot) m_cache.clear(); } -void FileInProjectFinder::addMappedPath(const FileName &localFilePath, const QString &remoteFilePath) +void FileInProjectFinder::addMappedPath(const FilePath &localFilePath, const QString &remoteFilePath) { const QStringList segments = remoteFilePath.split('/', QString::SkipEmptyParts); @@ -142,12 +142,12 @@ void FileInProjectFinder::addMappedPath(const FileName &localFilePath, const QSt folder specified. Third, we walk the list of project files, and search for a file name match there. If all fails, it returns the original path from the file URL. */ -FileNameList FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const +FilePathList FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) const { qCDebug(finderLog) << "FileInProjectFinder: trying to find file" << fileUrl.toString() << "..."; if (fileUrl.scheme() == "qrc" || fileUrl.toString().startsWith(':')) { - const FileNameList result = m_qrcUrlFinder.find(fileUrl); + const FilePathList result = m_qrcUrlFinder.find(fileUrl); if (!result.isEmpty()) { if (success) *success = true; @@ -159,12 +159,12 @@ FileNameList FileInProjectFinder::findFile(const QUrl &fileUrl, bool *success) c if (originalPath.isEmpty()) // e.g. qrc:// originalPath = fileUrl.path(); - FileNameList result; + FilePathList result; bool found = findFileOrDirectory(originalPath, [&](const QString &fileName, int) { - result << FileName::fromString(fileName); + result << FilePath::fromString(fileName); }); if (!found) - result << FileName::fromString(originalPath); + result << FilePath::fromString(originalPath); if (success) *success = found; @@ -291,7 +291,7 @@ bool FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FileH qCDebug(finderLog) << "FileInProjectFinder: checking project files ..."; QStringList matches; - const QString lastSegment = FileName::fromString(originalPath).fileName(); + const QString lastSegment = FilePath::fromString(originalPath).fileName(); if (fileHandler) matches.append(filesWithSameFileName(lastSegment)); if (directoryHandler) @@ -318,7 +318,7 @@ bool FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FileH // check if absolute path is found in sysroot if (!m_sysroot.isEmpty()) { - const FileName sysrootPath = m_sysroot.pathAppended(originalPath); + const FilePath sysrootPath = m_sysroot.pathAppended(originalPath); if (checkPath(sysrootPath.toString(), origLength, fileHandler, directoryHandler)) { return handleSuccess(originalPath, QStringList(sysrootPath.toString()), origLength, "in sysroot"); @@ -333,7 +333,7 @@ bool FileInProjectFinder::findFileOrDirectory(const QString &originalPath, FileH FileInProjectFinder::CacheEntry FileInProjectFinder::findInSearchPaths( const QString &filePath, FileHandler fileHandler, DirectoryHandler directoryHandler) const { - for (const FileName &dirPath : m_searchDirectories) { + for (const FilePath &dirPath : m_searchDirectories) { const CacheEntry found = findInSearchPath(dirPath.toString(), filePath, fileHandler, directoryHandler); if (!found.paths.isEmpty()) @@ -386,7 +386,7 @@ FileInProjectFinder::CacheEntry FileInProjectFinder::findInSearchPath( QStringList FileInProjectFinder::filesWithSameFileName(const QString &fileName) const { QStringList result; - foreach (const FileName &f, m_projectFiles) { + foreach (const FilePath &f, m_projectFiles) { if (f.fileName() == fileName) result << f.toString(); } @@ -396,8 +396,8 @@ QStringList FileInProjectFinder::filesWithSameFileName(const QString &fileName) QStringList FileInProjectFinder::pathSegmentsWithSameName(const QString &pathSegment) const { QStringList result; - for (const FileName &f : m_projectFiles) { - FileName currentPath = f.parentDir(); + for (const FilePath &f : m_projectFiles) { + FilePath currentPath = f.parentDir(); do { if (currentPath.fileName() == pathSegment) { if (result.isEmpty() || result.last() != currentPath.toString()) @@ -446,12 +446,12 @@ QStringList FileInProjectFinder::bestMatches(const QStringList &filePaths, return bestFilePaths; } -FileNameList FileInProjectFinder::searchDirectories() const +FilePathList FileInProjectFinder::searchDirectories() const { return m_searchDirectories; } -void FileInProjectFinder::setAdditionalSearchDirectories(const FileNameList &searchDirectories) +void FileInProjectFinder::setAdditionalSearchDirectories(const FilePathList &searchDirectories) { m_searchDirectories = searchDirectories; } @@ -461,13 +461,13 @@ FileInProjectFinder::PathMappingNode::~PathMappingNode() qDeleteAll(children); } -FileNameList FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const +FilePathList FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const { const auto fileIt = m_fileCache.constFind(fileUrl); if (fileIt != m_fileCache.cend()) return fileIt.value(); QStringList hits; - for (const FileName &f : m_allQrcFiles) { + for (const FilePath &f : m_allQrcFiles) { QrcParser::Ptr &qrcParser = m_parserCache[f]; if (!qrcParser) qrcParser = QrcParser::parseQrcFile(f.toString(), QString()); @@ -476,28 +476,28 @@ FileNameList FileInProjectFinder::QrcUrlFinder::find(const QUrl &fileUrl) const qrcParser->collectFilesAtPath(QrcParser::normalizedQrcFilePath(fileUrl.toString()), &hits); } hits.removeDuplicates(); - const FileNameList result = transform(hits, &FileName::fromString); + const FilePathList result = transform(hits, &FilePath::fromString); m_fileCache.insert(fileUrl, result); return result; } -void FileInProjectFinder::QrcUrlFinder::setProjectFiles(const FileNameList &projectFiles) +void FileInProjectFinder::QrcUrlFinder::setProjectFiles(const FilePathList &projectFiles) { - m_allQrcFiles = filtered(projectFiles, [](const FileName &f) { return f.endsWith(".qrc"); }); + m_allQrcFiles = filtered(projectFiles, [](const FilePath &f) { return f.endsWith(".qrc"); }); m_fileCache.clear(); m_parserCache.clear(); } -FileName chooseFileFromList(const FileNameList &candidates) +FilePath chooseFileFromList(const FilePathList &candidates) { if (candidates.length() == 1) return candidates.first(); QMenu filesMenu; - for (const FileName &candidate : candidates) + for (const FilePath &candidate : candidates) filesMenu.addAction(candidate.toUserOutput()); if (const QAction * const action = filesMenu.exec(QCursor::pos())) - return FileName::fromUserInput(action->text()); - return FileName(); + return FilePath::fromUserInput(action->text()); + return FilePath(); } } // namespace Utils diff --git a/src/libs/utils/fileinprojectfinder.h b/src/libs/utils/fileinprojectfinder.h index ac8cd0a588..66b5317235 100644 --- a/src/libs/utils/fileinprojectfinder.h +++ b/src/libs/utils/fileinprojectfinder.h @@ -47,26 +47,26 @@ public: FileInProjectFinder(); ~FileInProjectFinder(); - void setProjectDirectory(const FileName &absoluteProjectPath); - FileName projectDirectory() const; + void setProjectDirectory(const FilePath &absoluteProjectPath); + FilePath projectDirectory() const; - void setProjectFiles(const FileNameList &projectFiles); - void setSysroot(const FileName &sysroot); + void setProjectFiles(const FilePathList &projectFiles); + void setSysroot(const FilePath &sysroot); - void addMappedPath(const FileName &localFilePath, const QString &remoteFilePath); + void addMappedPath(const FilePath &localFilePath, const QString &remoteFilePath); - FileNameList findFile(const QUrl &fileUrl, bool *success = nullptr) const; + FilePathList findFile(const QUrl &fileUrl, bool *success = nullptr) const; bool findFileOrDirectory(const QString &originalPath, FileHandler fileHandler = nullptr, DirectoryHandler directoryHandler = nullptr) const; - FileNameList searchDirectories() const; - void setAdditionalSearchDirectories(const FileNameList &searchDirectories); + FilePathList searchDirectories() const; + void setAdditionalSearchDirectories(const FilePathList &searchDirectories); private: struct PathMappingNode { ~PathMappingNode(); - FileName localPath; + FilePath localPath; QHash<QString, PathMappingNode *> children; }; @@ -77,12 +77,12 @@ private: class QrcUrlFinder { public: - FileNameList find(const QUrl &fileUrl) const; - void setProjectFiles(const FileNameList &projectFiles); + FilePathList find(const QUrl &fileUrl) const; + void setProjectFiles(const FilePathList &projectFiles); private: - FileNameList m_allQrcFiles; - mutable QHash<QUrl, FileNameList> m_fileCache; - mutable QHash<FileName, QSharedPointer<QrcParser>> m_parserCache; + FilePathList m_allQrcFiles; + mutable QHash<QUrl, FilePathList> m_fileCache; + mutable QHash<FilePath, QSharedPointer<QrcParser>> m_parserCache; }; CacheEntry findInSearchPaths(const QString &filePath, FileHandler fileHandler, @@ -98,16 +98,16 @@ private: static int commonPostFixLength(const QString &candidatePath, const QString &filePathToFind); static QStringList bestMatches(const QStringList &filePaths, const QString &filePathToFind); - FileName m_projectDir; - FileName m_sysroot; - FileNameList m_projectFiles; - FileNameList m_searchDirectories; + FilePath m_projectDir; + FilePath m_sysroot; + FilePathList m_projectFiles; + FilePathList m_searchDirectories; PathMappingNode m_pathMapRoot; mutable QHash<QString, CacheEntry> m_cache; QrcUrlFinder m_qrcUrlFinder; }; -QTCREATOR_UTILS_EXPORT FileName chooseFileFromList(const FileNameList &candidates); +QTCREATOR_UTILS_EXPORT FilePath chooseFileFromList(const FilePathList &candidates); } // namespace Utils diff --git a/src/libs/utils/filesearch.cpp b/src/libs/utils/filesearch.cpp index c34532a1de..0bdf3991c5 100644 --- a/src/libs/utils/filesearch.cpp +++ b/src/libs/utils/filesearch.cpp @@ -482,7 +482,7 @@ static bool matches(const QList<QRegExp> &exprList, const QString &filePath) { return Utils::anyOf(exprList, [&filePath](QRegExp reg) { return (reg.exactMatch(filePath) - || reg.exactMatch(FileName::fromString(filePath).fileName())); + || reg.exactMatch(FilePath::fromString(filePath).fileName())); }); } diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index b920acf7c2..ff739a90a4 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -57,7 +57,7 @@ #endif QT_BEGIN_NAMESPACE -QDebug operator<<(QDebug dbg, const Utils::FileName &c) +QDebug operator<<(QDebug dbg, const Utils::FilePath &c) { return dbg << c.toString(); } @@ -80,7 +80,7 @@ namespace Utils { Returns whether the operation succeeded. */ -bool FileUtils::removeRecursively(const FileName &filePath, QString *error) +bool FileUtils::removeRecursively(const FilePath &filePath, QString *error) { QFileInfo fileInfo = filePath.toFileInfo(); if (!fileInfo.exists() && !fileInfo.isSymLink()) @@ -146,7 +146,7 @@ bool FileUtils::removeRecursively(const FileName &filePath, QString *error) Returns whether the operation succeeded. */ -bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgtFilePath, +bool FileUtils::copyRecursively(const FilePath &srcFilePath, const FilePath &tgtFilePath, QString *error, const std::function<bool (QFileInfo, QFileInfo, QString *)> ©Helper) { QFileInfo srcFileInfo = srcFilePath.toFileInfo(); @@ -166,8 +166,8 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt QStringList fileNames = sourceDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System); foreach (const QString &fileName, fileNames) { - const FileName newSrcFilePath = srcFilePath.pathAppended(fileName); - const FileName newTgtFilePath = tgtFilePath.pathAppended(fileName); + const FilePath newSrcFilePath = srcFilePath.pathAppended(fileName); + const FilePath newTgtFilePath = tgtFilePath.pathAppended(fileName); if (!copyRecursively(newSrcFilePath, newTgtFilePath, error, copyHelper)) return false; } @@ -196,7 +196,7 @@ bool FileUtils::copyRecursively(const FileName &srcFilePath, const FileName &tgt Returns whether at least one file in \a filePath has a newer date than \a timeStamp. */ -bool FileName::isNewerThan(const QDateTime &timeStamp) const +bool FilePath::isNewerThan(const QDateTime &timeStamp) const { const QFileInfo fileInfo = toFileInfo(); if (!fileInfo.exists() || fileInfo.lastModified() >= timeStamp) @@ -222,15 +222,15 @@ bool FileName::isNewerThan(const QDateTime &timeStamp) const Returns the symlink target file path. */ -FileName FileUtils::resolveSymlinks(const FileName &path) +FilePath FileUtils::resolveSymlinks(const FilePath &path) { QFileInfo f = path.toFileInfo(); int links = 16; while (links-- && f.isSymLink()) f.setFile(f.dir(), f.symLinkTarget()); if (links <= 0) - return FileName(); - return FileName::fromString(f.filePath()); + return FilePath(); + return FilePath::fromString(f.filePath()); } /*! @@ -240,12 +240,12 @@ FileName FileUtils::resolveSymlinks(const FileName &path) Returns the canonical path. */ -FileName FileName::canonicalPath() const +FilePath FilePath::canonicalPath() const { const QString result = toFileInfo().canonicalFilePath(); if (result.isEmpty()) return *this; - return FileName::fromString(result); + return FilePath::fromString(result); } /*! @@ -254,10 +254,10 @@ FileName FileName::canonicalPath() const Returns the possibly shortened path with native separators. */ -QString FileName::shortNativePath() const +QString FilePath::shortNativePath() const { if (HostOsInfo::isAnyUnixHost()) { - const FileName home = FileName::fromString(QDir::cleanPath(QDir::homePath())); + const FilePath home = FilePath::fromString(QDir::cleanPath(QDir::homePath())); if (isChildOf(home)) { return QLatin1Char('~') + QDir::separator() + QDir::toNativeSeparators(relativeChildPath(home).toString()); @@ -297,7 +297,7 @@ QString FileUtils::qmakeFriendlyName(const QString &name) return fileSystemFriendlyName(result); } -bool FileUtils::makeWritable(const FileName &path) +bool FileUtils::makeWritable(const FilePath &path) { const QString fileName = path.toString(); return QFile::setPermissions(fileName, QFile::permissions(fileName) | QFile::WriteUser); @@ -351,9 +351,9 @@ QString FileUtils::resolvePath(const QString &baseDir, const QString &fileName) return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName); } -FileName FileUtils::commonPath(const FileName &oldCommonPath, const FileName &fileName) +FilePath FileUtils::commonPath(const FilePath &oldCommonPath, const FilePath &fileName) { - FileName newCommonPath = oldCommonPath; + FilePath newCommonPath = oldCommonPath; while (!newCommonPath.isEmpty() && !fileName.isChildOf(newCommonPath)) newCommonPath = newCommonPath.parentDir(); return newCommonPath.canonicalPath(); @@ -400,7 +400,7 @@ static QByteArray fileIdWin(HANDLE fHandle) } #endif -QByteArray FileUtils::fileId(const FileName &fileName) +QByteArray FileUtils::fileId(const FilePath &fileName) { QByteArray result; @@ -632,51 +632,51 @@ TempFileSaver::~TempFileSaver() On windows filenames are compared case insensitively. */ -FileName::FileName() +FilePath::FilePath() { } /// Constructs a FileName from \a info -FileName FileName::fromFileInfo(const QFileInfo &info) +FilePath FilePath::fromFileInfo(const QFileInfo &info) { - return FileName::fromString(info.absoluteFilePath()); + return FilePath::fromString(info.absoluteFilePath()); } /// \returns a QFileInfo -QFileInfo FileName::toFileInfo() const +QFileInfo FilePath::toFileInfo() const { return QFileInfo(m_data); } -FileName FileName::fromUrl(const QUrl &url) +FilePath FilePath::fromUrl(const QUrl &url) { - FileName fn; + FilePath fn; fn.m_url = url; fn.m_data = url.path(); return fn; } /// \returns a QString for passing on to QString based APIs -const QString &FileName::toString() const +const QString &FilePath::toString() const { return m_data; } -QUrl FileName::toUrl() const +QUrl FilePath::toUrl() const { return m_url; } /// \returns a QString to display to the user /// Converts the separators to the native format -QString FileName::toUserOutput() const +QString FilePath::toUserOutput() const { if (m_url.isEmpty()) return QDir::toNativeSeparators(toString()); return m_url.toString(); } -QString FileName::fileName(int pathComponents) const +QString FilePath::fileName(int pathComponents) const { if (pathComponents < 0) return m_data; @@ -703,7 +703,7 @@ QString FileName::fileName(int pathComponents) const /// \returns a bool indicating whether a file with this /// FileName exists. -bool FileName::exists() const +bool FilePath::exists() const { return !isEmpty() && QFileInfo::exists(m_data); } @@ -714,28 +714,28 @@ bool FileName::exists() const /// a root level directory. /// \returns \a FileName with the last segment removed. -FileName FileName::parentDir() const +FilePath FilePath::parentDir() const { const QString basePath = toString(); if (basePath.isEmpty()) - return FileName(); + return FilePath(); const QDir base(basePath); if (base.isRoot()) - return FileName(); + return FilePath(); const QString path = basePath + QLatin1String("/.."); const QString parent = QDir::cleanPath(path); - QTC_ASSERT(parent != path, return FileName()); + QTC_ASSERT(parent != path, return FilePath()); - return FileName::fromString(parent); + return FilePath::fromString(parent); } /// Constructs a FileName from \a filename /// \a filename is not checked for validity. -FileName FileName::fromString(const QString &filename) +FilePath FilePath::fromString(const QString &filename) { - FileName fn; + FilePath fn; fn.m_data = filename; return fn; } @@ -743,13 +743,13 @@ FileName FileName::fromString(const QString &filename) /// Constructs a FileName from \a fileName. The \a defaultExtension is appended /// to \a filename if that does not have an extension already. /// \a fileName is not checked for validity. -FileName FileName::fromStringWithExtension(const QString &filename, const QString &defaultExtension) +FilePath FilePath::fromStringWithExtension(const QString &filepath, const QString &defaultExtension) { - if (filename.isEmpty() || defaultExtension.isEmpty()) - return FileName::fromString(filename); + if (filepath.isEmpty() || defaultExtension.isEmpty()) + return FilePath::fromString(filepath); - QString rc = filename; - QFileInfo fi(filename); + QString rc = filepath; + QFileInfo fi(filepath); // Add extension unless user specified something else const QChar dot = QLatin1Char('.'); if (!fi.fileName().contains(dot)) { @@ -757,88 +757,88 @@ FileName FileName::fromStringWithExtension(const QString &filename, const QStrin rc += dot; rc += defaultExtension; } - return FileName::fromString(rc); + return FilePath::fromString(rc); } /// Constructs a FileName from \a fileName /// \a fileName is not checked for validity. -FileName FileName::fromLatin1(const QByteArray &filename) +FilePath FilePath::fromLatin1(const QByteArray &filename) { - return FileName::fromString(QString::fromLatin1(filename)); + return FilePath::fromString(QString::fromLatin1(filename)); } /// Constructs a FileName from \a fileName /// \a fileName is only passed through QDir::cleanPath -FileName FileName::fromUserInput(const QString &filename) +FilePath FilePath::fromUserInput(const QString &filename) { QString clean = QDir::cleanPath(filename); if (clean.startsWith(QLatin1String("~/"))) clean = QDir::homePath() + clean.mid(1); - return FileName::fromString(clean); + return FilePath::fromString(clean); } /// Constructs a FileName from \a fileName, which is encoded as UTF-8. /// \a fileName is not checked for validity. -FileName FileName::fromUtf8(const char *filename, int filenameSize) +FilePath FilePath::fromUtf8(const char *filename, int filenameSize) { - return FileName::fromString(QString::fromUtf8(filename, filenameSize)); + return FilePath::fromString(QString::fromUtf8(filename, filenameSize)); } -FileName FileName::fromVariant(const QVariant &variant) +FilePath FilePath::fromVariant(const QVariant &variant) { if (variant.type() == QVariant::Url) - return FileName::fromUrl(variant.toUrl()); - return FileName::fromString(variant.toString()); + return FilePath::fromUrl(variant.toUrl()); + return FilePath::fromString(variant.toString()); } -QVariant FileName::toVariant() const +QVariant FilePath::toVariant() const { if (!m_url.isEmpty()) return m_url; return m_data; } -bool FileName::operator==(const FileName &other) const +bool FilePath::operator==(const FilePath &other) const { if (!m_url.isEmpty()) return m_url == other.m_url; return QString::compare(m_data, other.m_data, HostOsInfo::fileNameCaseSensitivity()) == 0; } -bool FileName::operator!=(const FileName &other) const +bool FilePath::operator!=(const FilePath &other) const { return !(*this == other); } -bool FileName::operator<(const FileName &other) const +bool FilePath::operator<(const FilePath &other) const { if (!m_url.isEmpty()) return m_url < other.m_url; return QString::compare(m_data, other.m_data, HostOsInfo::fileNameCaseSensitivity()) < 0; } -bool FileName::operator<=(const FileName &other) const +bool FilePath::operator<=(const FilePath &other) const { return !(other < *this); } -bool FileName::operator>(const FileName &other) const +bool FilePath::operator>(const FilePath &other) const { return other < *this; } -bool FileName::operator>=(const FileName &other) const +bool FilePath::operator>=(const FilePath &other) const { return !(*this < other); } -FileName FileName::operator+(const QString &s) const +FilePath FilePath::operator+(const QString &s) const { - return FileName::fromString(m_data + s); + return FilePath::fromString(m_data + s); } /// \returns whether FileName is a child of \a s -bool FileName::isChildOf(const FileName &s) const +bool FilePath::isChildOf(const FilePath &s) const { if (s.isEmpty()) return false; @@ -854,18 +854,18 @@ bool FileName::isChildOf(const FileName &s) const } /// \overload -bool FileName::isChildOf(const QDir &dir) const +bool FilePath::isChildOf(const QDir &dir) const { - return isChildOf(FileName::fromString(dir.absolutePath())); + return isChildOf(FilePath::fromString(dir.absolutePath())); } /// \returns whether FileName endsWith \a s -bool FileName::endsWith(const QString &s) const +bool FilePath::endsWith(const QString &s) const { return m_data.endsWith(s, HostOsInfo::fileNameCaseSensitivity()); } -bool FileName::isLocal() const +bool FilePath::isLocal() const { return m_url.isEmpty() || m_url.isLocalFile(); } @@ -873,16 +873,16 @@ bool FileName::isLocal() const /// \returns the relativeChildPath of FileName to parent if FileName is a child of parent /// \note returns a empty FileName if FileName is not a child of parent /// That is, this never returns a path starting with "../" -FileName FileName::relativeChildPath(const FileName &parent) const +FilePath FilePath::relativeChildPath(const FilePath &parent) const { if (!isChildOf(parent)) - return FileName(); - return FileName::fromString(m_data.mid(parent.m_data.size() + 1, -1)); + return FilePath(); + return FilePath::fromString(m_data.mid(parent.m_data.size() + 1, -1)); } -FileName FileName::pathAppended(const QString &str) const +FilePath FilePath::pathAppended(const QString &str) const { - FileName fn = *this; + FilePath fn = *this; if (str.isEmpty()) return fn; if (!isEmpty() && !m_data.endsWith(QLatin1Char('/'))) @@ -891,21 +891,21 @@ FileName FileName::pathAppended(const QString &str) const return fn; } -FileName FileName::stringAppended(const QString &str) const +FilePath FilePath::stringAppended(const QString &str) const { - FileName fn = *this; + FilePath fn = *this; fn.m_data.append(str); return fn; } -uint FileName::hash(uint seed) const +uint FilePath::hash(uint seed) const { if (Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive) return qHash(m_data.toUpper(), seed); return qHash(m_data, seed); } -QTextStream &operator<<(QTextStream &s, const FileName &fn) +QTextStream &operator<<(QTextStream &s, const FilePath &fn) { return s << fn.toString(); } diff --git a/src/libs/utils/fileutils.h b/src/libs/utils/fileutils.h index 97c79d6535..c6d765a284 100644 --- a/src/libs/utils/fileutils.h +++ b/src/libs/utils/fileutils.h @@ -38,7 +38,7 @@ #include <functional> #include <memory> -namespace Utils {class FileName; } +namespace Utils { class FilePath; } QT_BEGIN_NAMESPACE class QDataStream; @@ -50,7 +50,7 @@ class QTemporaryFile; class QTextStream; class QWidget; -QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FileName &c); +QTCREATOR_UTILS_EXPORT QDebug operator<<(QDebug dbg, const Utils::FilePath &c); // for withNtfsPermissions #ifdef Q_OS_WIN @@ -61,18 +61,18 @@ QT_END_NAMESPACE namespace Utils { -class QTCREATOR_UTILS_EXPORT FileName +class QTCREATOR_UTILS_EXPORT FilePath { public: - FileName(); + FilePath(); - 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); - static FileName fromVariant(const QVariant &variant); + static FilePath fromString(const QString &filepath); + static FilePath fromFileInfo(const QFileInfo &info); + static FilePath fromStringWithExtension(const QString &filepath, const QString &defaultExtension); + static FilePath fromLatin1(const QByteArray &filepath); + static FilePath fromUserInput(const QString &filepath); + static FilePath fromUtf8(const char *filepath, int filepathSize = -1); + static FilePath fromVariant(const QVariant &variant); const QString &toString() const; QFileInfo toFileInfo() const; @@ -84,37 +84,37 @@ public: QString fileName(int pathComponents = 0) const; bool exists() const; - FileName parentDir() const; + FilePath parentDir() const; - bool operator==(const FileName &other) const; - bool operator!=(const FileName &other) const; - bool operator<(const FileName &other) const; - bool operator<=(const FileName &other) const; - bool operator>(const FileName &other) const; - bool operator>=(const FileName &other) const; - FileName operator+(const QString &s) const; + bool operator==(const FilePath &other) const; + bool operator!=(const FilePath &other) const; + bool operator<(const FilePath &other) const; + bool operator<=(const FilePath &other) const; + bool operator>(const FilePath &other) const; + bool operator>=(const FilePath &other) const; + FilePath operator+(const QString &s) const; - bool isChildOf(const FileName &s) const; + bool isChildOf(const FilePath &s) const; bool isChildOf(const QDir &dir) const; bool endsWith(const QString &s) const; bool isLocal() const; bool isNewerThan(const QDateTime &timeStamp) const; - FileName relativeChildPath(const FileName &parent) const; - FileName pathAppended(const QString &str) const; - FileName stringAppended(const QString &str) const; + FilePath relativeChildPath(const FilePath &parent) const; + FilePath pathAppended(const QString &str) const; + FilePath stringAppended(const QString &str) const; - FileName canonicalPath() const; + FilePath canonicalPath() const; void clear() { m_data.clear(); } bool isEmpty() const { return m_data.isEmpty(); } uint hash(uint seed) const; - // NOTE: FileName operations on FileName created from URL currenly + // NOTE: FileName operations on FilePath created from URL currenly // do not work except for .toVariant() and .toUrl(). - static FileName fromUrl(const QUrl &url); + static FilePath fromUrl(const QUrl &url); QUrl toUrl() const; private: @@ -122,28 +122,31 @@ private: QUrl m_url; }; -QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FileName &fn); +QTCREATOR_UTILS_EXPORT QTextStream &operator<<(QTextStream &s, const FilePath &fn); -using FileNameList = QList<FileName>; +using FilePathList = QList<FilePath>; + +using FileName = FilePath; +using FileNameList = FilePathList; class QTCREATOR_UTILS_EXPORT FileUtils { public: - static bool removeRecursively(const FileName &filePath, QString *error = nullptr); + static bool removeRecursively(const FilePath &filePath, QString *error = nullptr); static bool copyRecursively( - const FileName &srcFilePath, const FileName &tgtFilePath, QString *error = nullptr, + const FilePath &srcFilePath, const FilePath &tgtFilePath, QString *error = nullptr, const std::function<bool (QFileInfo, QFileInfo, QString *)> ©Helper = nullptr); - static FileName resolveSymlinks(const FileName &path); + static FilePath resolveSymlinks(const FilePath &path); static QString fileSystemFriendlyName(const QString &name); static int indexOfQmakeUnfriendly(const QString &name, int startpos = 0); static QString qmakeFriendlyName(const QString &name); - static bool makeWritable(const FileName &path); + static bool makeWritable(const FilePath &path); static QString normalizePathName(const QString &name); static bool isRelativePath(const QString &fileName); static bool isAbsolutePath(const QString &fileName) { return !isRelativePath(fileName); } static QString resolvePath(const QString &baseDir, const QString &fileName); - static FileName commonPath(const FileName &oldCommonPath, const FileName &fileName); - static QByteArray fileId(const FileName &fileName); + static FilePath commonPath(const FilePath &oldCommonPath, const FilePath &fileName); + static QByteArray fileId(const FilePath &fileName); }; // for actually finding out if e.g. directories are writable on Windows @@ -254,14 +257,14 @@ private: bool m_autoRemove = true; }; -inline uint qHash(const Utils::FileName &a, uint seed = 0) { return a.hash(seed); } +inline uint qHash(const Utils::FilePath &a, uint seed = 0) { return a.hash(seed); } } // namespace Utils namespace std { -template<> struct hash<Utils::FileName> +template<> struct hash<Utils::FilePath> { - using argument_type = Utils::FileName; + using argument_type = Utils::FilePath; using result_type = size_t; result_type operator()(const argument_type &fn) const { @@ -272,4 +275,4 @@ template<> struct hash<Utils::FileName> }; } // namespace std -Q_DECLARE_METATYPE(Utils::FileName) +Q_DECLARE_METATYPE(Utils::FilePath) diff --git a/src/libs/utils/macroexpander.cpp b/src/libs/utils/macroexpander.cpp index d80adeac91..a41fbde31d 100644 --- a/src/libs/utils/macroexpander.cpp +++ b/src/libs/utils/macroexpander.cpp @@ -290,9 +290,9 @@ QString MacroExpander::expand(const QString &stringWithVariables) const return res; } -FileName MacroExpander::expand(const FileName &fileNameWithVariables) const +FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const { - return FileName::fromString(expand(fileNameWithVariables.toString())); + return FilePath::fromString(expand(fileNameWithVariables.toString())); } QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const @@ -422,7 +422,7 @@ void MacroExpander::registerFileVariables(const QByteArray &prefix, registerVariable(prefix + kFileNamePostfix, tr("%1: File name without path.").arg(heading), - [base]() -> QString { QString tmp = base(); return tmp.isEmpty() ? QString() : FileName::fromString(tmp).fileName(); }, + [base]() -> QString { QString tmp = base(); return tmp.isEmpty() ? QString() : FilePath::fromString(tmp).fileName(); }, visibleInChooser); registerVariable(prefix + kFileBaseNamePostfix, diff --git a/src/libs/utils/macroexpander.h b/src/libs/utils/macroexpander.h index f7f48a6da3..70448069c5 100644 --- a/src/libs/utils/macroexpander.h +++ b/src/libs/utils/macroexpander.h @@ -37,7 +37,7 @@ namespace Utils { namespace Internal { class MacroExpanderPrivate; } -class FileName; +class FilePath; class MacroExpander; using MacroExpanderProvider = std::function<MacroExpander *()>; using MacroExpanderProviders = QVector<MacroExpanderProvider>; @@ -56,7 +56,7 @@ public: QString value(const QByteArray &variable, bool *found = nullptr) const; QString expand(const QString &stringWithVariables) const; - FileName expand(const FileName &fileNameWithVariables) const; + FilePath expand(const FilePath &fileNameWithVariables) const; QByteArray expand(const QByteArray &stringWithVariables) const; QVariant expandVariant(const QVariant &v) const; diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index e29b0c7663..f08391d6a6 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -193,14 +193,14 @@ QString PathChooserPrivate::expandedPath(const QString &input) const if (m_macroExpander) expandedInput = m_macroExpander->expand(expandedInput); - const QString path = FileName::fromUserInput(expandedInput).toString(); + const QString path = FilePath::fromUserInput(expandedInput).toString(); if (path.isEmpty()) return path; switch (m_acceptingKind) { case PathChooser::Command: case PathChooser::ExistingCommand: { - const FileName expanded = m_environment.searchInPath(path, {FileName::fromString(m_baseDirectory)}); + const FilePath expanded = m_environment.searchInPath(path, {FilePath::fromString(m_baseDirectory)}); return expanded.isEmpty() ? path : expanded.toString(); } case PathChooser::Any: @@ -293,12 +293,12 @@ void PathChooser::setBaseDirectory(const QString &directory) triggerChanged(); } -FileName PathChooser::baseFileName() const +FilePath PathChooser::baseFileName() const { - return FileName::fromString(d->m_baseDirectory); + return FilePath::fromString(d->m_baseDirectory); } -void PathChooser::setBaseFileName(const FileName &base) +void PathChooser::setBaseFileName(const FilePath &base) { setBaseDirectory(base.toString()); } @@ -323,14 +323,14 @@ QString PathChooser::path() const return fileName().toString(); } -FileName PathChooser::rawFileName() const +FilePath PathChooser::rawFileName() const { - return FileName::fromString(QDir::fromNativeSeparators(d->m_lineEdit->text())); + return FilePath::fromString(QDir::fromNativeSeparators(d->m_lineEdit->text())); } -FileName PathChooser::fileName() const +FilePath PathChooser::fileName() const { - return FileName::fromUserInput(d->expandedPath(rawFileName().toString())); + return FilePath::fromUserInput(d->expandedPath(rawFileName().toString())); } // FIXME: try to remove again @@ -352,7 +352,7 @@ void PathChooser::setPath(const QString &path) d->m_lineEdit->setTextKeepingActiveCursor(QDir::toNativeSeparators(path)); } -void PathChooser::setFileName(const FileName &fn) +void PathChooser::setFileName(const FilePath &fn) { d->m_lineEdit->setTextKeepingActiveCursor(fn.toUserOutput()); } diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h index 73939e1bf4..09d98e71c8 100644 --- a/src/libs/utils/pathchooser.h +++ b/src/libs/utils/pathchooser.h @@ -55,8 +55,8 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget Q_PROPERTY(QStringList commandVersionArguments READ commandVersionArguments WRITE setCommandVersionArguments) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly DESIGNABLE true) // Designer does not know this type, so force designable to false: - Q_PROPERTY(Utils::FileName fileName READ fileName WRITE setFileName DESIGNABLE false) - Q_PROPERTY(Utils::FileName baseFileName READ baseFileName WRITE setBaseFileName DESIGNABLE false) + Q_PROPERTY(Utils::FilePath fileName READ fileName WRITE setFileName DESIGNABLE false) + Q_PROPERTY(Utils::FilePath baseFileName READ baseFileName WRITE setBaseFileName DESIGNABLE false) Q_PROPERTY(QColor errorColor READ errorColor WRITE setErrorColor DESIGNABLE true) Q_PROPERTY(QColor okColor READ okColor WRITE setOkColor DESIGNABLE true) @@ -93,8 +93,8 @@ public: QString path() const; QString rawPath() const; // The raw unexpanded input. - FileName rawFileName() const; // The raw unexpanded input. - FileName fileName() const; + FilePath rawFileName() const; // The raw unexpanded input. + FilePath fileName() const; static QString expandedDirectory(const QString &input, const Environment &env, const QString &baseDir); @@ -102,8 +102,8 @@ public: QString baseDirectory() const; void setBaseDirectory(const QString &directory); - FileName baseFileName() const; - void setBaseFileName(const FileName &base); + FilePath baseFileName() const; + void setBaseFileName(const FilePath &base); void setEnvironment(const Environment &env); @@ -172,7 +172,7 @@ signals: public slots: void setPath(const QString &); - void setFileName(const FileName &); + void setFileName(const FilePath &); void setErrorColor(const QColor &errorColor); void setOkColor(const QColor &okColor); diff --git a/src/libs/utils/persistentsettings.cpp b/src/libs/utils/persistentsettings.cpp index db0f8d0db5..92d32109ea 100644 --- a/src/libs/utils/persistentsettings.cpp +++ b/src/libs/utils/persistentsettings.cpp @@ -341,7 +341,7 @@ QVariantMap PersistentSettingsReader::restoreValues() const return m_valueMap; } -bool PersistentSettingsReader::load(const FileName &fileName) +bool PersistentSettingsReader::load(const FilePath &fileName) { m_valueMap.clear(); @@ -409,7 +409,7 @@ static void writeVariantValue(QXmlStreamWriter &w, const Context &ctx, } } -PersistentSettingsWriter::PersistentSettingsWriter(const FileName &fileName, const QString &docType) : +PersistentSettingsWriter::PersistentSettingsWriter(const FilePath &fileName, const QString &docType) : m_fileName(fileName), m_docType(docType) { } @@ -438,7 +438,7 @@ bool PersistentSettingsWriter::save(const QVariantMap &data, QWidget *parent) co } #endif // QT_GUI_LIB -FileName PersistentSettingsWriter::fileName() const +FilePath PersistentSettingsWriter::fileName() const { return m_fileName; } //** * @brief Set contents of file (e.g. from data read from it). */ diff --git a/src/libs/utils/persistentsettings.h b/src/libs/utils/persistentsettings.h index a7255dcb8a..92dbf0d8c9 100644 --- a/src/libs/utils/persistentsettings.h +++ b/src/libs/utils/persistentsettings.h @@ -42,7 +42,7 @@ public: PersistentSettingsReader(); QVariant restoreValue(const QString &variable, const QVariant &defaultValue = QVariant()) const; QVariantMap restoreValues() const; - bool load(const FileName &fileName); + bool load(const FilePath &fileName); private: QMap<QString, QVariant> m_valueMap; @@ -51,7 +51,7 @@ private: class QTCREATOR_UTILS_EXPORT PersistentSettingsWriter { public: - PersistentSettingsWriter(const FileName &fileName, const QString &docType); + PersistentSettingsWriter(const FilePath &fileName, const QString &docType); ~PersistentSettingsWriter(); bool save(const QVariantMap &data, QString *errorString) const; @@ -59,14 +59,14 @@ public: bool save(const QVariantMap &data, QWidget *parent) const; #endif - FileName fileName() const; + FilePath fileName() const; void setContents(const QVariantMap &data); private: bool write(const QVariantMap &data, QString *errorString) const; - const FileName m_fileName; + const FilePath m_fileName; const QString m_docType; mutable QMap<QString, QVariant> m_savedData; }; diff --git a/src/libs/utils/reloadpromptutils.cpp b/src/libs/utils/reloadpromptutils.cpp index ab910d7bc5..09a9855784 100644 --- a/src/libs/utils/reloadpromptutils.cpp +++ b/src/libs/utils/reloadpromptutils.cpp @@ -33,7 +33,7 @@ namespace Utils { -QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const FileName &fileName, +QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const FilePath &fileName, bool modified, bool enableDiffOption, QWidget *parent) diff --git a/src/libs/utils/reloadpromptutils.h b/src/libs/utils/reloadpromptutils.h index 8991d52b59..82aa409cf5 100644 --- a/src/libs/utils/reloadpromptutils.h +++ b/src/libs/utils/reloadpromptutils.h @@ -33,7 +33,7 @@ class QWidget; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; enum ReloadPromptAnswer { ReloadCurrent, @@ -44,7 +44,7 @@ enum ReloadPromptAnswer { CloseCurrent }; -QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const FileName &fileName, +QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const FilePath &fileName, bool modified, bool enableDiffOption, QWidget *parent); diff --git a/src/libs/utils/savefile.cpp b/src/libs/utils/savefile.cpp index cac25546db..b25432a280 100644 --- a/src/libs/utils/savefile.cpp +++ b/src/libs/utils/savefile.cpp @@ -119,7 +119,7 @@ bool SaveFile::commit() } QString finalFileName - = FileUtils::resolveSymlinks(FileName::fromString(m_finalFileName)).toString(); + = FileUtils::resolveSymlinks(FilePath::fromString(m_finalFileName)).toString(); #ifdef Q_OS_WIN // Release the file lock diff --git a/src/libs/utils/settingsaccessor.cpp b/src/libs/utils/settingsaccessor.cpp index 2499597db0..f6d90df7e0 100644 --- a/src/libs/utils/settingsaccessor.cpp +++ b/src/libs/utils/settingsaccessor.cpp @@ -98,7 +98,7 @@ bool SettingsAccessor::saveSettings(const QVariantMap &data, QWidget *parent) co /*! * Read data from \a path. Do all the necessary postprocessing of the data. */ -SettingsAccessor::RestoreData SettingsAccessor::readData(const FileName &path, QWidget *parent) const +SettingsAccessor::RestoreData SettingsAccessor::readData(const FilePath &path, QWidget *parent) const { Q_UNUSED(parent); RestoreData result = readFile(path); @@ -111,13 +111,13 @@ SettingsAccessor::RestoreData SettingsAccessor::readData(const FileName &path, Q * Store the \a data in \a path on disk. Do all the necessary preprocessing of the data. */ optional<SettingsAccessor::Issue> -SettingsAccessor::writeData(const FileName &path, const QVariantMap &data, QWidget *parent) const +SettingsAccessor::writeData(const FilePath &path, const QVariantMap &data, QWidget *parent) const { Q_UNUSED(parent); return writeFile(path, prepareToWriteSettings(data)); } -QVariantMap SettingsAccessor::restoreSettings(const FileName &settingsPath, QWidget *parent) const +QVariantMap SettingsAccessor::restoreSettings(const FilePath &settingsPath, QWidget *parent) const { const RestoreData result = readData(settingsPath, parent); @@ -131,7 +131,7 @@ QVariantMap SettingsAccessor::restoreSettings(const FileName &settingsPath, QWid * * This method does not do *any* processing of the file contents. */ -SettingsAccessor::RestoreData SettingsAccessor::readFile(const FileName &path) const +SettingsAccessor::RestoreData SettingsAccessor::readFile(const FilePath &path) const { PersistentSettingsReader reader; if (!reader.load(path)) { @@ -156,7 +156,7 @@ SettingsAccessor::RestoreData SettingsAccessor::readFile(const FileName &path) c * This method does not do *any* processing of the file contents. */ optional<SettingsAccessor::Issue> -SettingsAccessor::writeFile(const FileName &path, const QVariantMap &data) const +SettingsAccessor::writeFile(const FilePath &path, const QVariantMap &data) const { if (data.isEmpty()) { return Issue(QCoreApplication::translate("Utils::SettingsAccessor", "Failed to Write File"), @@ -176,7 +176,7 @@ SettingsAccessor::writeFile(const FileName &path, const QVariantMap &data) const } SettingsAccessor::ProceedInfo -SettingsAccessor::reportIssues(const SettingsAccessor::Issue &issue, const FileName &path, +SettingsAccessor::reportIssues(const SettingsAccessor::Issue &issue, const FilePath &path, QWidget *parent) const { if (!path.exists()) @@ -217,14 +217,14 @@ QVariantMap SettingsAccessor::prepareToWriteSettings(const QVariantMap &data) co // BackingUpSettingsAccessor: // -------------------------------------------------------------------- -FileNameList BackUpStrategy::readFileCandidates(const FileName &baseFileName) const +FilePathList BackUpStrategy::readFileCandidates(const FilePath &baseFileName) const { const QFileInfo pfi = baseFileName.toFileInfo(); const QStringList filter(pfi.fileName() + '*'); const QFileInfoList list = QDir(pfi.dir()).entryInfoList(filter, QDir::Files | QDir::Hidden | QDir::System); - return Utils::transform(list, [](const QFileInfo &fi) { return FileName::fromString(fi.absoluteFilePath()); }); + return Utils::transform(list, [](const QFileInfo &fi) { return FilePath::fromString(fi.absoluteFilePath()); }); } int BackUpStrategy::compare(const SettingsAccessor::RestoreData &data1, @@ -239,8 +239,8 @@ int BackUpStrategy::compare(const SettingsAccessor::RestoreData &data1, return 0; } -optional<FileName> -BackUpStrategy::backupName(const QVariantMap &oldData, const FileName &path, const QVariantMap &data) const +optional<FilePath> +BackUpStrategy::backupName(const QVariantMap &oldData, const FilePath &path, const QVariantMap &data) const { if (oldData == data) return nullopt; @@ -262,9 +262,9 @@ BackingUpSettingsAccessor::BackingUpSettingsAccessor(std::unique_ptr<BackUpStrat { } SettingsAccessor::RestoreData -BackingUpSettingsAccessor::readData(const FileName &path, QWidget *parent) const +BackingUpSettingsAccessor::readData(const FilePath &path, QWidget *parent) const { - const FileNameList fileList = readFileCandidates(path); + const FilePathList fileList = readFileCandidates(path); if (fileList.isEmpty()) // No settings found at all. return RestoreData(path, QVariantMap()); @@ -287,7 +287,7 @@ BackingUpSettingsAccessor::readData(const FileName &path, QWidget *parent) const } optional<SettingsAccessor::Issue> -BackingUpSettingsAccessor::writeData(const FileName &path, const QVariantMap &data, +BackingUpSettingsAccessor::writeData(const FilePath &path, const QVariantMap &data, QWidget *parent) const { if (data.isEmpty()) @@ -298,9 +298,9 @@ BackingUpSettingsAccessor::writeData(const FileName &path, const QVariantMap &da return SettingsAccessor::writeData(path, data, parent); } -FileNameList BackingUpSettingsAccessor::readFileCandidates(const FileName &path) const +FilePathList BackingUpSettingsAccessor::readFileCandidates(const FilePath &path) const { - FileNameList result = Utils::filteredUnique(m_strategy->readFileCandidates(path)); + FilePathList result = Utils::filteredUnique(m_strategy->readFileCandidates(path)); if (result.removeOne(baseFilePath())) result.prepend(baseFilePath()); @@ -308,10 +308,10 @@ FileNameList BackingUpSettingsAccessor::readFileCandidates(const FileName &path) } SettingsAccessor::RestoreData -BackingUpSettingsAccessor::bestReadFileData(const FileNameList &candidates, QWidget *parent) const +BackingUpSettingsAccessor::bestReadFileData(const FilePathList &candidates, QWidget *parent) const { SettingsAccessor::RestoreData bestMatch; - for (const FileName &c : candidates) { + for (const FilePath &c : candidates) { RestoreData cData = SettingsAccessor::readData(c, parent); if (m_strategy->compare(bestMatch, cData) > 0) bestMatch = cData; @@ -319,7 +319,7 @@ BackingUpSettingsAccessor::bestReadFileData(const FileNameList &candidates, QWid return bestMatch; } -void BackingUpSettingsAccessor::backupFile(const FileName &path, const QVariantMap &data, +void BackingUpSettingsAccessor::backupFile(const FilePath &path, const QVariantMap &data, QWidget *parent) const { RestoreData oldSettings = SettingsAccessor::readData(path, parent); @@ -328,7 +328,7 @@ void BackingUpSettingsAccessor::backupFile(const FileName &path, const QVariantM // Do we need to do a backup? const QString origName = path.toString(); - optional<FileName> backupFileName = m_strategy->backupName(oldSettings.data, path, data); + optional<FilePath> backupFileName = m_strategy->backupName(oldSettings.data, path, data); if (backupFileName) QFile::copy(origName, backupFileName.value().toString()); } @@ -359,11 +359,11 @@ int VersionedBackUpStrategy::compare(const SettingsAccessor::RestoreData &data1, return -1; } -optional<FileName> -VersionedBackUpStrategy::backupName(const QVariantMap &oldData, const FileName &path, const QVariantMap &data) const +optional<FilePath> +VersionedBackUpStrategy::backupName(const QVariantMap &oldData, const FilePath &path, const QVariantMap &data) const { Q_UNUSED(data); - FileName backupName = path; + FilePath backupName = path; const QByteArray oldEnvironmentId = settingsIdFromMap(oldData); const int oldVersion = versionFromMap(oldData); @@ -463,7 +463,7 @@ bool UpgradingSettingsAccessor::isValidVersionAndId(const int version, const QBy && (id.isEmpty() || id == m_id || m_id.isEmpty()); } -SettingsAccessor::RestoreData UpgradingSettingsAccessor::readData(const FileName &path, +SettingsAccessor::RestoreData UpgradingSettingsAccessor::readData(const FilePath &path, QWidget *parent) const { return upgradeSettings(BackingUpSettingsAccessor::readData(path, parent), currentVersion()); @@ -605,7 +605,7 @@ MergingSettingsAccessor::MergingSettingsAccessor(std::unique_ptr<BackUpStrategy> UpgradingSettingsAccessor(std::move(strategy), docType, displayName, applicationDisplayName) { } -SettingsAccessor::RestoreData MergingSettingsAccessor::readData(const FileName &path, +SettingsAccessor::RestoreData MergingSettingsAccessor::readData(const FilePath &path, QWidget *parent) const { RestoreData mainData = UpgradingSettingsAccessor::readData(path, parent); // FULLY upgraded! diff --git a/src/libs/utils/settingsaccessor.h b/src/libs/utils/settingsaccessor.h index 10675cbf4c..fd5cf87ef7 100644 --- a/src/libs/utils/settingsaccessor.h +++ b/src/libs/utils/settingsaccessor.h @@ -99,7 +99,7 @@ public: class RestoreData { public: RestoreData() = default; - RestoreData(const FileName &path, const QVariantMap &data) : path{path}, data{data} { } + RestoreData(const FilePath &path, const QVariantMap &data) : path{path}, data{data} { } RestoreData(const QString &title, const QString &message, const Issue::Type type) : RestoreData(Issue(title, message, type)) { } @@ -109,7 +109,7 @@ public: bool hasError() const { return hasIssue() && issue.value().type == Issue::Type::ERROR; } bool hasWarning() const { return hasIssue() && issue.value().type == Issue::Type::WARNING; } - FileName path; + FilePath path; QVariantMap data; optional<Issue> issue; }; @@ -121,26 +121,26 @@ public: const QString displayName; const QString applicationDisplayName; - void setBaseFilePath(const FileName &baseFilePath) { m_baseFilePath = baseFilePath; } + void setBaseFilePath(const FilePath &baseFilePath) { m_baseFilePath = baseFilePath; } void setReadOnly() { m_readOnly = true; } - FileName baseFilePath() const { return m_baseFilePath; } + FilePath baseFilePath() const { return m_baseFilePath; } - virtual RestoreData readData(const FileName &path, QWidget *parent) const; - virtual optional<Issue> writeData(const FileName &path, const QVariantMap &data, QWidget *parent) const; + virtual RestoreData readData(const FilePath &path, QWidget *parent) const; + virtual optional<Issue> writeData(const FilePath &path, const QVariantMap &data, QWidget *parent) const; protected: // Report errors: - QVariantMap restoreSettings(const FileName &settingsPath, QWidget *parent) const; - ProceedInfo reportIssues(const Issue &issue, const FileName &path, QWidget *parent) const; + QVariantMap restoreSettings(const FilePath &settingsPath, QWidget *parent) const; + ProceedInfo reportIssues(const Issue &issue, const FilePath &path, QWidget *parent) const; virtual QVariantMap preprocessReadSettings(const QVariantMap &data) const; virtual QVariantMap prepareToWriteSettings(const QVariantMap &data) const; - virtual RestoreData readFile(const FileName &path) const; - virtual optional<Issue> writeFile(const FileName &path, const QVariantMap &data) const; + virtual RestoreData readFile(const FilePath &path) const; + virtual optional<Issue> writeFile(const FilePath &path, const QVariantMap &data) const; private: - FileName m_baseFilePath; + FilePath m_baseFilePath; mutable std::unique_ptr<PersistentSettingsWriter> m_writer; bool m_readOnly = false; }; @@ -154,14 +154,14 @@ class QTCREATOR_UTILS_EXPORT BackUpStrategy public: virtual ~BackUpStrategy() = default; - virtual FileNameList readFileCandidates(const FileName &baseFileName) const; + virtual FilePathList readFileCandidates(const FilePath &baseFileName) const; // Return -1 if data1 is better that data2, 0 if both are equally worthwhile // and 1 if data2 is better than data1 virtual int compare(const SettingsAccessor::RestoreData &data1, const SettingsAccessor::RestoreData &data2) const; - virtual optional<FileName> - backupName(const QVariantMap &oldData, const FileName &path, const QVariantMap &data) const; + virtual optional<FilePath> + backupName(const QVariantMap &oldData, const FilePath &path, const QVariantMap &data) const; }; class QTCREATOR_UTILS_EXPORT BackingUpSettingsAccessor : public SettingsAccessor @@ -172,16 +172,16 @@ public: BackingUpSettingsAccessor(std::unique_ptr<BackUpStrategy> &&strategy, const QString &docType, const QString &displayName, const QString &applicationDisplayName); - RestoreData readData(const FileName &path, QWidget *parent) const override; - optional<Issue> writeData(const FileName &path, const QVariantMap &data, + RestoreData readData(const FilePath &path, QWidget *parent) const override; + optional<Issue> writeData(const FilePath &path, const QVariantMap &data, QWidget *parent) const override; BackUpStrategy *strategy() const { return m_strategy.get(); } private: - FileNameList readFileCandidates(const FileName &path) const; - RestoreData bestReadFileData(const FileNameList &candidates, QWidget *parent) const; - void backupFile(const FileName &path, const QVariantMap &data, QWidget *parent) const; + FilePathList readFileCandidates(const FilePath &path) const; + RestoreData bestReadFileData(const FilePathList &candidates, QWidget *parent) const; + void backupFile(const FilePath &path, const QVariantMap &data, QWidget *parent) const; std::unique_ptr<BackUpStrategy> m_strategy; }; @@ -202,8 +202,8 @@ public: int compare(const SettingsAccessor::RestoreData &data1, const SettingsAccessor::RestoreData &data2) const override; - optional<FileName> - backupName(const QVariantMap &oldData, const FileName &path, const QVariantMap &data) const override; + optional<FilePath> + backupName(const QVariantMap &oldData, const FilePath &path, const QVariantMap &data) const override; const UpgradingSettingsAccessor *accessor() const { return m_accessor; } @@ -251,7 +251,7 @@ public: bool isValidVersionAndId(const int version, const QByteArray &id) const; VersionUpgrader *upgrader(const int version) const; - RestoreData readData(const FileName &path, QWidget *parent) const override; + RestoreData readData(const FilePath &path, QWidget *parent) const override; protected: QVariantMap prepareToWriteSettings(const QVariantMap &data) const override; @@ -284,7 +284,7 @@ public: const QString &docType, const QString &displayName, const QString &applicationDisplayName); - RestoreData readData(const FileName &path, QWidget *parent) const final; + RestoreData readData(const FilePath &path, QWidget *parent) const final; void setSecondaryAccessor(std::unique_ptr<SettingsAccessor> &&secondary); diff --git a/src/libs/utils/shellcommand.cpp b/src/libs/utils/shellcommand.cpp index 14f52d2539..5a84c92f15 100644 --- a/src/libs/utils/shellcommand.cpp +++ b/src/libs/utils/shellcommand.cpp @@ -68,11 +68,11 @@ class ShellCommandPrivate { public: struct Job { - explicit Job(const QString &wd, const FileName &b, const QStringList &a, int t, + explicit Job(const QString &wd, const FilePath &b, const QStringList &a, int t, const ExitCodeInterpreter &interpreter); QString workingDirectory; - FileName binary; + FilePath binary; QStringList arguments; ExitCodeInterpreter exitCodeInterpreter; int timeoutS; @@ -113,7 +113,7 @@ ShellCommandPrivate::~ShellCommandPrivate() delete m_progressParser; } -ShellCommandPrivate::Job::Job(const QString &wd, const FileName &b, const QStringList &a, +ShellCommandPrivate::Job::Job(const QString &wd, const FilePath &b, const QStringList &a, int t, const ExitCodeInterpreter &interpreter) : workingDirectory(wd), binary(b), @@ -195,13 +195,13 @@ void ShellCommand::addFlags(unsigned f) d->m_flags |= f; } -void ShellCommand::addJob(const FileName &binary, const QStringList &arguments, +void ShellCommand::addJob(const FilePath &binary, const QStringList &arguments, const QString &workingDirectory, const ExitCodeInterpreter &interpreter) { addJob(binary, arguments, defaultTimeoutS(), workingDirectory, interpreter); } -void ShellCommand::addJob(const FileName &binary, const QStringList &arguments, int timeoutS, +void ShellCommand::addJob(const FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory, const ExitCodeInterpreter &interpreter) { d->m_jobs.push_back(Internal::ShellCommandPrivate::Job(workDirectory(workingDirectory), binary, @@ -319,7 +319,7 @@ void ShellCommand::run(QFutureInterface<void> &future) this->deleteLater(); } -SynchronousProcessResponse ShellCommand::runCommand(const FileName &binary, +SynchronousProcessResponse ShellCommand::runCommand(const FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory, const ExitCodeInterpreter &interpreter) @@ -359,7 +359,7 @@ SynchronousProcessResponse ShellCommand::runCommand(const FileName &binary, return response; } -SynchronousProcessResponse ShellCommand::runFullySynchronous(const FileName &binary, +SynchronousProcessResponse ShellCommand::runFullySynchronous(const FilePath &binary, const QStringList &arguments, QSharedPointer<OutputProxy> proxy, int timeoutS, @@ -399,7 +399,7 @@ SynchronousProcessResponse ShellCommand::runFullySynchronous(const FileName &bin return resp; } -SynchronousProcessResponse ShellCommand::runSynchronous(const FileName &binary, +SynchronousProcessResponse ShellCommand::runSynchronous(const FilePath &binary, const QStringList &arguments, QSharedPointer<OutputProxy> proxy, int timeoutS, diff --git a/src/libs/utils/shellcommand.h b/src/libs/utils/shellcommand.h index 22ff4a8df2..f0c427ef53 100644 --- a/src/libs/utils/shellcommand.h +++ b/src/libs/utils/shellcommand.h @@ -46,7 +46,7 @@ QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; namespace Internal { class ShellCommandPrivate; } class QTCREATOR_UTILS_EXPORT ProgressParser @@ -79,7 +79,7 @@ signals: void append(const QString &text); void appendSilently(const QString &text); void appendError(const QString &text); - void appendCommand(const QString &workingDirectory, const Utils::FileName &binary, + void appendCommand(const QString &workingDirectory, const Utils::FilePath &binary, const QStringList &args); void appendMessage(const QString &text); }; @@ -112,9 +112,9 @@ public: QString displayName() const; void setDisplayName(const QString &name); - void addJob(const FileName &binary, const QStringList &arguments, + void addJob(const FilePath &binary, const QStringList &arguments, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter); - void addJob(const FileName &binary, const QStringList &arguments, int timeoutS, + void addJob(const FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter); void execute(); // Execute tasks asynchronously! void abort(); @@ -145,7 +145,7 @@ public: // This is called once per job in a thread. // When called from the UI thread it will execute fully synchronously, so no signals will // be triggered! - virtual SynchronousProcessResponse runCommand(const FileName &binary, const QStringList &arguments, + virtual SynchronousProcessResponse runCommand(const FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory = QString(), const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter); @@ -171,12 +171,12 @@ private: void run(QFutureInterface<void> &future); // Run without a event loop in fully blocking mode. No signals will be delivered. - SynchronousProcessResponse runFullySynchronous(const FileName &binary, const QStringList &arguments, + SynchronousProcessResponse runFullySynchronous(const FilePath &binary, const QStringList &arguments, QSharedPointer<OutputProxy> proxy, int timeoutS, const QString &workingDirectory, const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter); // Run with an event loop. Signals will be delivered. - SynchronousProcessResponse runSynchronous(const FileName &binary, const QStringList &arguments, + SynchronousProcessResponse runSynchronous(const FilePath &binary, const QStringList &arguments, QSharedPointer<OutputProxy> proxy, int timeoutS, const QString &workingDirectory, const ExitCodeInterpreter &interpreter = defaultExitCodeInterpreter); diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp index 7db05c22ea..77daae645c 100644 --- a/src/libs/utils/unixutils.cpp +++ b/src/libs/utils/unixutils.cpp @@ -77,7 +77,7 @@ QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QSt } else if (c == QLatin1Char('f')) { s = QLatin1Char('"') + file + QLatin1Char('"'); } else if (c == QLatin1Char('n')) { - s = QLatin1Char('"') + FileName::fromString(file).fileName() + QLatin1Char('"'); + s = QLatin1Char('"') + FilePath::fromString(file).fileName() + QLatin1Char('"'); } else if (c == QLatin1Char('%')) { s = c; } else { diff --git a/src/plugins/android/androidavdmanager.cpp b/src/plugins/android/androidavdmanager.cpp index 53c5608f62..17a9eb9b59 100644 --- a/src/plugins/android/androidavdmanager.cpp +++ b/src/plugins/android/androidavdmanager.cpp @@ -429,11 +429,11 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi } else if (valueForKey(avdInfoNameKey, line, &value)) { avd->avdname = value; } else if (valueForKey(avdInfoPathKey, line, &value)) { - const Utils::FileName avdPath = Utils::FileName::fromString(value); + const Utils::FilePath avdPath = Utils::FilePath::fromString(value); if (avdPath.exists()) { // Get ABI. - const Utils::FileName configFile = avdPath.pathAppended("config.ini"); + const Utils::FilePath configFile = avdPath.pathAppended("config.ini"); QSettings config(configFile.toString(), QSettings::IniFormat); value = config.value(avdInfoAbiKey).toString(); if (!value.isEmpty()) @@ -443,7 +443,7 @@ bool AvdManagerOutputParser::parseAvd(const QStringList &deviceInfo, AndroidDevi // Get Target QString avdInfoFileName = avdPath.toFileInfo().baseName() + ".ini"; - const Utils::FileName + const Utils::FilePath avdInfoFile = avdPath.parentDir().pathAppended(avdInfoFileName); QSettings avdInfo(avdInfoFile.toString(), QSettings::IniFormat); value = avdInfo.value(avdInfoTargetKey).toString(); diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index 04e05fac2a..8adc12c6d6 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -94,7 +94,7 @@ static void setupProcessParameters(ProcessParameters *pp, pp->setWorkingDirectory(bc->buildDirectory()); Utils::Environment env = bc->environment(); pp->setEnvironment(env); - pp->setCommand(FileName::fromString(command)); + pp->setCommand(FilePath::fromString(command)); pp->setArguments(Utils::QtcProcess::joinArgs(arguments)); pp->resolveAll(); } @@ -191,7 +191,7 @@ bool AndroidBuildApkStep::init() auto parser = new JavaParser; parser->setProjectFileList(Utils::transform(target()->project()->files(ProjectExplorer::Project::AllFiles), - &Utils::FileName::toString)); + &Utils::FilePath::toString)); RunConfiguration *rc = target()->activeRunConfiguration(); const QString buildKey = rc ? rc->buildKey() : QString(); @@ -202,7 +202,7 @@ bool AndroidBuildApkStep::init() sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString(); QFileInfo sourceDirInfo(sourceDirName); - parser->setSourceDirectory(Utils::FileName::fromString(sourceDirInfo.canonicalFilePath())); + parser->setSourceDirectory(Utils::FilePath::fromString(sourceDirInfo.canonicalFilePath())); parser->setBuildDirectory(bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY)); setOutputParser(parser); @@ -375,7 +375,7 @@ void AndroidBuildApkStep::doRun() auto setup = [this] { auto bc = target()->activeBuildConfiguration(); - Utils::FileName androidLibsDir = bc->buildDirectory() + Utils::FilePath androidLibsDir = bc->buildDirectory() .pathAppended("android-build/libs") .pathAppended(AndroidManager::targetArch(target())); if (!androidLibsDir.exists() && !QDir{bc->buildDirectory().toString()}.mkpath(androidLibsDir.toString())) @@ -443,7 +443,7 @@ void AndroidBuildApkStep::processStarted() bool AndroidBuildApkStep::fromMap(const QVariantMap &map) { - m_keystorePath = Utils::FileName::fromString(map.value(KeystoreLocationKey).toString()); + m_keystorePath = Utils::FilePath::fromString(map.value(KeystoreLocationKey).toString()); m_signPackage = false; // don't restore this m_buildTargetSdk = map.value(BuildTargetSdkKey).toString(); if (m_buildTargetSdk.isEmpty()) { @@ -465,7 +465,7 @@ QVariantMap AndroidBuildApkStep::toMap() const return map; } -Utils::FileName AndroidBuildApkStep::keystorePath() +Utils::FilePath AndroidBuildApkStep::keystorePath() { return m_keystorePath; } @@ -493,7 +493,7 @@ QVariant AndroidBuildApkStep::data(Core::Id id) const return AbstractProcessStep::data(id); } -void AndroidBuildApkStep::setKeystorePath(const Utils::FileName &path) +void AndroidBuildApkStep::setKeystorePath(const Utils::FilePath &path) { m_keystorePath = path; m_certificatePasswd.clear(); diff --git a/src/plugins/android/androidbuildapkstep.h b/src/plugins/android/androidbuildapkstep.h index 8c1028c656..9e7ec4a07a 100644 --- a/src/plugins/android/androidbuildapkstep.h +++ b/src/plugins/android/androidbuildapkstep.h @@ -51,8 +51,8 @@ public: QVariantMap toMap() const override; // signing - Utils::FileName keystorePath(); - void setKeystorePath(const Utils::FileName &path); + Utils::FilePath keystorePath(); + void setKeystorePath(const Utils::FilePath &path); void setKeystorePassword(const QString &pwd); void setCertificateAlias(const QString &alias); void setCertificatePassword(const QString &pwd); @@ -97,7 +97,7 @@ private: bool m_addDebugger = true; QString m_buildTargetSdk; - Utils::FileName m_keystorePath; + Utils::FilePath m_keystorePath; QString m_keystorePasswd; QString m_certificateAlias; QString m_certificatePasswd; diff --git a/src/plugins/android/androidbuildapkwidget.cpp b/src/plugins/android/androidbuildapkwidget.cpp index 516685e14f..ff8441f889 100644 --- a/src/plugins/android/androidbuildapkwidget.cpp +++ b/src/plugins/android/androidbuildapkwidget.cpp @@ -132,7 +132,7 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup() keystoreLocationChooser->setPromptDialogFilter(tr("Keystore files (*.keystore *.jks)")); keystoreLocationChooser->setPromptDialogTitle(tr("Select Keystore File")); connect(keystoreLocationChooser, &PathChooser::pathChanged, this, [this](const QString &path) { - FileName file = FileName::fromString(path); + FilePath file = FilePath::fromString(path); m_step->setKeystorePath(file); m_signPackageCheckBox->setChecked(!file.isEmpty()); if (!file.isEmpty()) diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp index 00bb8b68c1..292fe361da 100644 --- a/src/plugins/android/androidconfigurations.cpp +++ b/src/plugins/android/androidconfigurations.cpp @@ -225,23 +225,23 @@ void AndroidConfig::load(const QSettings &settings) { // user settings m_partitionSize = settings.value(PartitionSizeKey, 1024).toInt(); - m_sdkLocation = FileName::fromString(settings.value(SDKLocationKey).toString()); + m_sdkLocation = FilePath::fromString(settings.value(SDKLocationKey).toString()); m_sdkManagerToolArgs = settings.value(SDKManagerToolArgsKey).toStringList(); - m_ndkLocation = FileName::fromString(settings.value(NDKLocationKey).toString()); - m_openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString()); - m_keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString()); + m_ndkLocation = FilePath::fromString(settings.value(NDKLocationKey).toString()); + m_openJDKLocation = FilePath::fromString(settings.value(OpenJDKLocationKey).toString()); + m_keystoreLocation = FilePath::fromString(settings.value(KeystoreLocationKey).toString()); m_toolchainHost = settings.value(ToolchainHostKey).toString(); m_automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool(); PersistentSettingsReader reader; - if (reader.load(FileName::fromString(sdkSettingsFileName())) + if (reader.load(FilePath::fromString(sdkSettingsFileName())) && settings.value(changeTimeStamp).toInt() != QFileInfo(sdkSettingsFileName()).lastModified().toMSecsSinceEpoch() / 1000) { // persisten settings - m_sdkLocation = FileName::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString()); + m_sdkLocation = FilePath::fromString(reader.restoreValue(SDKLocationKey, m_sdkLocation.toString()).toString()); m_sdkManagerToolArgs = reader.restoreValue(SDKManagerToolArgsKey, m_sdkManagerToolArgs).toStringList(); - m_ndkLocation = FileName::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString()); - m_openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString()); - m_keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString()); + m_ndkLocation = FilePath::fromString(reader.restoreValue(NDKLocationKey, m_ndkLocation.toString()).toString()); + m_openJDKLocation = FilePath::fromString(reader.restoreValue(OpenJDKLocationKey, m_openJDKLocation.toString()).toString()); + m_keystoreLocation = FilePath::fromString(reader.restoreValue(KeystoreLocationKey, m_keystoreLocation.toString()).toString()); m_toolchainHost = reader.restoreValue(ToolchainHostKey, m_toolchainHost).toString(); m_automaticKitCreation = reader.restoreValue(AutomaticKitCreationKey, m_automaticKitCreation).toBool(); // persistent settings @@ -313,17 +313,17 @@ QString AndroidConfig::apiLevelNameFor(const SdkPlatform *platform) QString("android-%1").arg(platform->apiLevel()) : ""; } -FileName AndroidConfig::adbToolPath() const +FilePath AndroidConfig::adbToolPath() const { return m_sdkLocation.pathAppended("platform-tools/adb" QTC_HOST_EXE_SUFFIX); } -FileName AndroidConfig::androidToolPath() const +FilePath AndroidConfig::androidToolPath() const { if (HostOsInfo::isWindowsHost()) { // I want to switch from using android.bat to using an executable. All it really does is call // Java and I've made some progress on it. So if android.exe exists, return that instead. - const FileName path = m_sdkLocation.pathAppended("tools/android" QTC_HOST_EXE_SUFFIX); + const FilePath path = m_sdkLocation.pathAppended("tools/android" QTC_HOST_EXE_SUFFIX); if (path.exists()) return path; return m_sdkLocation.pathAppended("tools/android" ANDROID_BAT_SUFFIX); @@ -331,7 +331,7 @@ FileName AndroidConfig::androidToolPath() const return m_sdkLocation.pathAppended("tools/android"); } -FileName AndroidConfig::emulatorToolPath() const +FilePath AndroidConfig::emulatorToolPath() const { QString relativePath = "emulator/emulator"; if (sdkToolsVersion() < QVersionNumber(25, 3, 0)) @@ -339,7 +339,7 @@ FileName AndroidConfig::emulatorToolPath() const return m_sdkLocation.pathAppended(relativePath + QTC_HOST_EXE_SUFFIX); } -FileName AndroidConfig::sdkManagerToolPath() const +FilePath AndroidConfig::sdkManagerToolPath() const { QString toolPath = "tools/bin/sdkmanager"; if (HostOsInfo::isWindowsHost()) @@ -347,7 +347,7 @@ FileName AndroidConfig::sdkManagerToolPath() const return m_sdkLocation.pathAppended(toolPath); } -FileName AndroidConfig::avdManagerToolPath() const +FilePath AndroidConfig::avdManagerToolPath() const { QString toolPath = "tools/bin/avdmanager"; if (HostOsInfo::isWindowsHost()) @@ -355,20 +355,20 @@ FileName AndroidConfig::avdManagerToolPath() const return m_sdkLocation.pathAppended(toolPath); } -FileName AndroidConfig::aaptToolPath() const +FilePath AndroidConfig::aaptToolPath() const { - const Utils::FileName aaptToolPath = m_sdkLocation.pathAppended("build-tools"); + const Utils::FilePath aaptToolPath = m_sdkLocation.pathAppended("build-tools"); QString toolPath = QString("%1/aapt").arg(buildToolsVersion().toString()); if (HostOsInfo::isWindowsHost()) toolPath += QTC_HOST_EXE_SUFFIX; return aaptToolPath.pathAppended(toolPath); } -FileName AndroidConfig::clangPath() const +FilePath AndroidConfig::clangPath() const { - const FileName clangPath = m_ndkLocation.pathAppended("toolchains/llvm/prebuilt/"); - const FileName oldNdkClangPath = m_ndkLocation.pathAppended("toolchains/llvm-3.6/prebuilt/"); - const QVector<FileName> clangSearchPaths{clangPath, oldNdkClangPath}; + const FilePath clangPath = m_ndkLocation.pathAppended("toolchains/llvm/prebuilt/"); + const FilePath oldNdkClangPath = m_ndkLocation.pathAppended("toolchains/llvm-3.6/prebuilt/"); + const QVector<FilePath> clangSearchPaths{clangPath, oldNdkClangPath}; // detect toolchain host QStringList hostPatterns; @@ -382,10 +382,10 @@ FileName AndroidConfig::clangPath() const case OsTypeMac: hostPatterns << QLatin1String("darwin*"); break; - default: /* unknown host */ return FileName(); + default: /* unknown host */ return FilePath(); } - for (const FileName &path : clangSearchPaths) { + for (const FilePath &path : clangSearchPaths) { QDirIterator iter(path.toString(), hostPatterns, QDir::Dirs); if (iter.hasNext()) { iter.next(); @@ -397,9 +397,9 @@ FileName AndroidConfig::clangPath() const return {}; } -FileName AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const +FilePath AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const { - const FileName path = m_ndkLocation.pathAppended( + const FilePath path = m_ndkLocation.pathAppended( QString("prebuilt/%1/bin/gdb%2").arg(toolchainHost(), QTC_HOST_EXE_SUFFIX)); if (path.exists()) return path; @@ -408,21 +408,21 @@ FileName AndroidConfig::gdbPath(const ProjectExplorer::Abi &abi) const .arg(toolchainPrefix(abi), toolchainHost(), toolsPrefix(abi), QTC_HOST_EXE_SUFFIX)); } -FileName AndroidConfig::makePath() const +FilePath AndroidConfig::makePath() const { return m_ndkLocation.pathAppended( QString("prebuilt/%1/bin/make%2").arg(toolchainHost(), QTC_HOST_EXE_SUFFIX)); } -FileName AndroidConfig::openJDKBinPath() const +FilePath AndroidConfig::openJDKBinPath() const { - const FileName path = m_openJDKLocation; + const FilePath path = m_openJDKLocation; if (!path.isEmpty()) return path.pathAppended("bin"); return path; } -FileName AndroidConfig::keytoolPath() const +FilePath AndroidConfig::keytoolPath() const { return openJDKBinPath().pathAppended(keytoolName); } @@ -685,12 +685,12 @@ QString AndroidConfig::bestNdkPlatformMatch(int target) const return QString("android-%1").arg(AndroidManager::apiLevelRange().first); } -FileName AndroidConfig::sdkLocation() const +FilePath AndroidConfig::sdkLocation() const { return m_sdkLocation; } -void AndroidConfig::setSdkLocation(const FileName &sdkLocation) +void AndroidConfig::setSdkLocation(const FilePath &sdkLocation) { m_sdkLocation = sdkLocation; } @@ -699,7 +699,7 @@ QVersionNumber AndroidConfig::sdkToolsVersion() const { QVersionNumber version; if (m_sdkLocation.exists()) { - const Utils::FileName sdkToolsPropertiesPath + const Utils::FilePath sdkToolsPropertiesPath = m_sdkLocation.pathAppended("tools/source.properties"); QSettings settings(sdkToolsPropertiesPath.toString(), QSettings::IniFormat); auto versionStr = settings.value(sdkToolsVersionKey).toString(); @@ -728,7 +728,7 @@ void AndroidConfig::setSdkManagerToolArgs(const QStringList &args) m_sdkManagerToolArgs = args; } -FileName AndroidConfig::ndkLocation() const +FilePath AndroidConfig::ndkLocation() const { return m_ndkLocation; } @@ -744,9 +744,9 @@ static inline QString gdbServerArch(const Abi &abi) }; } -FileName AndroidConfig::gdbServer(const ProjectExplorer::Abi &abi) const +FilePath AndroidConfig::gdbServer(const ProjectExplorer::Abi &abi) const { - const FileName path = AndroidConfigurations::currentConfig().ndkLocation() + const FilePath path = AndroidConfigurations::currentConfig().ndkLocation() .pathAppended(QString("prebuilt/android-%1/gdbserver/gdbserver") .arg(gdbServerArch(abi))); if (path.exists()) @@ -763,7 +763,7 @@ QVersionNumber AndroidConfig::ndkVersion() const return version; } - const FileName ndkPropertiesPath = m_ndkLocation.pathAppended("source.properties"); + const FilePath ndkPropertiesPath = m_ndkLocation.pathAppended("source.properties"); if (ndkPropertiesPath.exists()) { // source.properties files exists in NDK version > 11 QSettings settings(ndkPropertiesPath.toString(), QSettings::IniFormat); @@ -771,7 +771,7 @@ QVersionNumber AndroidConfig::ndkVersion() const version = QVersionNumber::fromString(versionStr); } else { // No source.properties. There should be a file named RELEASE.TXT - const FileName ndkReleaseTxtPath = m_ndkLocation.pathAppended("RELEASE.TXT"); + const FilePath ndkReleaseTxtPath = m_ndkLocation.pathAppended("RELEASE.TXT"); Utils::FileReader reader; QString errorString; if (reader.fetch(ndkReleaseTxtPath.toString(), &errorString)) { @@ -799,28 +799,28 @@ QVersionNumber AndroidConfig::ndkVersion() const return version; } -void AndroidConfig::setNdkLocation(const FileName &ndkLocation) +void AndroidConfig::setNdkLocation(const FilePath &ndkLocation) { m_ndkLocation = ndkLocation; m_NdkInformationUpToDate = false; } -FileName AndroidConfig::openJDKLocation() const +FilePath AndroidConfig::openJDKLocation() const { return m_openJDKLocation; } -void AndroidConfig::setOpenJDKLocation(const FileName &openJDKLocation) +void AndroidConfig::setOpenJDKLocation(const FilePath &openJDKLocation) { m_openJDKLocation = openJDKLocation; } -FileName AndroidConfig::keystoreLocation() const +FilePath AndroidConfig::keystoreLocation() const { return m_keystoreLocation; } -void AndroidConfig::setKeystoreLocation(const FileName &keystoreLocation) +void AndroidConfig::setKeystoreLocation(const FilePath &keystoreLocation) { m_keystoreLocation = keystoreLocation; } @@ -851,12 +851,12 @@ void AndroidConfig::setAutomaticKitCreation(bool b) m_automaticKitCreation = b; } -FileName AndroidConfig::qtLiveApkPath() const +FilePath AndroidConfig::qtLiveApkPath() const { QString apkPathStr(defaultQtLiveApk); if (qEnvironmentVariableIsSet("QTC_QT_LIVE_APK_PATH")) apkPathStr = QString::fromLocal8Bit(qgetenv("QTC_QT_LIVE_APK_PATH")); - return Utils::FileName::fromString(apkPathStr); + return Utils::FilePath::fromString(apkPathStr); } /////////////////////////////////// @@ -947,7 +947,7 @@ void AndroidConfigurations::removeOldToolChains() static QVariant findOrRegisterDebugger(ToolChain *tc) { - const FileName command = tc->suggestedDebugger(); + const FilePath command = tc->suggestedDebugger(); // check if the debugger is already registered, but ignoring the display name const Debugger::DebuggerItem *existing = Debugger::DebuggerItemManager::findByCommand(command); if (existing && existing->engineType() == Debugger::GdbEngineType && existing->isAutoDetected() @@ -1074,7 +1074,7 @@ bool AndroidConfigurations::force32bitEmulator() QProcessEnvironment AndroidConfigurations::toolsEnvironment(const AndroidConfig &config) { Environment env = Environment::systemEnvironment(); - Utils::FileName jdkLocation = config.openJDKLocation(); + Utils::FilePath jdkLocation = config.openJDKLocation(); if (!jdkLocation.isEmpty()) { env.set("JAVA_HOME", jdkLocation.toUserOutput()); env.prependOrSetPath(jdkLocation.pathAppended("bin").toUserOutput()); @@ -1147,7 +1147,7 @@ AndroidConfigurations::AndroidConfigurations() AndroidConfigurations::~AndroidConfigurations() = default; -static FileName javaHomeForJavac(const FileName &location) +static FilePath javaHomeForJavac(const FilePath &location) { QFileInfo fileInfo = location.toFileInfo(); int tries = 5; @@ -1155,14 +1155,14 @@ static FileName javaHomeForJavac(const FileName &location) QDir dir = fileInfo.dir(); dir.cdUp(); if (QFileInfo::exists(dir.filePath(QLatin1String("lib/tools.jar")))) - return FileName::fromString(dir.path()); + return FilePath::fromString(dir.path()); if (fileInfo.isSymLink()) fileInfo.setFile(fileInfo.symLinkTarget()); else break; --tries; } - return FileName(); + return FilePath(); } void AndroidConfigurations::load() @@ -1175,7 +1175,7 @@ void AndroidConfigurations::load() if (m_config.openJDKLocation().isEmpty()) { if (HostOsInfo::isLinuxHost()) { Environment env = Environment::systemEnvironment(); - FileName location = env.searchInPath(QLatin1String("javac")); + FilePath location = env.searchInPath(QLatin1String("javac")); QFileInfo fi = location.toFileInfo(); if (fi.exists() && fi.isExecutable() && !fi.isDir()) { m_config.setOpenJDKLocation(javaHomeForJavac(location)); @@ -1191,7 +1191,7 @@ void AndroidConfigurations::load() if (response.result == SynchronousProcessResponse::Finished) { const QString &javaHome = response.allOutput().trimmed(); if (!javaHome.isEmpty() && QFileInfo::exists(javaHome)) - m_config.setOpenJDKLocation(FileName::fromString(javaHome)); + m_config.setOpenJDKLocation(FilePath::fromString(javaHome)); } } } else if (HostOsInfo::isWindowsHost()) { @@ -1233,7 +1233,7 @@ void AndroidConfigurations::load() } } if (!javaHome.isEmpty()) { - m_config.setOpenJDKLocation(FileName::fromString(javaHome)); + m_config.setOpenJDKLocation(FilePath::fromString(javaHome)); saveSettings = true; } } diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h index ec0aff5589..3b9ecb4bb1 100644 --- a/src/plugins/android/androidconfigurations.h +++ b/src/plugins/android/androidconfigurations.h @@ -97,23 +97,23 @@ public: static QStringList apiLevelNamesFor(const SdkPlatformList &platforms); static QString apiLevelNameFor(const SdkPlatform *platform); - Utils::FileName sdkLocation() const; - void setSdkLocation(const Utils::FileName &sdkLocation); + Utils::FilePath sdkLocation() const; + void setSdkLocation(const Utils::FilePath &sdkLocation); QVersionNumber sdkToolsVersion() const; QVersionNumber buildToolsVersion() const; QStringList sdkManagerToolArgs() const; void setSdkManagerToolArgs(const QStringList &args); - Utils::FileName ndkLocation() const; - Utils::FileName gdbServer(const ProjectExplorer::Abi &abi) const; + Utils::FilePath ndkLocation() const; + Utils::FilePath gdbServer(const ProjectExplorer::Abi &abi) const; QVersionNumber ndkVersion() const; - void setNdkLocation(const Utils::FileName &ndkLocation); + void setNdkLocation(const Utils::FilePath &ndkLocation); - Utils::FileName openJDKLocation() const; - void setOpenJDKLocation(const Utils::FileName &openJDKLocation); + Utils::FilePath openJDKLocation() const; + void setOpenJDKLocation(const Utils::FilePath &openJDKLocation); - Utils::FileName keystoreLocation() const; - void setKeystoreLocation(const Utils::FileName &keystoreLocation); + Utils::FilePath keystoreLocation() const; + void setKeystoreLocation(const Utils::FilePath &keystoreLocation); QString toolchainHost() const; @@ -123,20 +123,20 @@ public: bool automaticKitCreation() const; void setAutomaticKitCreation(bool b); - Utils::FileName qtLiveApkPath() const; + Utils::FilePath qtLiveApkPath() const; - Utils::FileName adbToolPath() const; - Utils::FileName androidToolPath() const; - Utils::FileName emulatorToolPath() const; - Utils::FileName sdkManagerToolPath() const; - Utils::FileName avdManagerToolPath() const; - Utils::FileName aaptToolPath() const; + Utils::FilePath adbToolPath() const; + Utils::FilePath androidToolPath() const; + Utils::FilePath emulatorToolPath() const; + Utils::FilePath sdkManagerToolPath() const; + Utils::FilePath avdManagerToolPath() const; + Utils::FilePath aaptToolPath() const; - Utils::FileName clangPath() const; - Utils::FileName gdbPath(const ProjectExplorer::Abi &abi) const; - Utils::FileName makePath() const; + Utils::FilePath clangPath() const; + Utils::FilePath gdbPath(const ProjectExplorer::Abi &abi) const; + Utils::FilePath makePath() const; - Utils::FileName keytoolPath() const; + Utils::FilePath keytoolPath() const; QVector<AndroidDeviceInfo> connectedDevices(QString *error = nullptr) const; static QVector<AndroidDeviceInfo> connectedDevices(const QString &adbToolPath, QString *error = nullptr); @@ -158,7 +158,7 @@ public: private: static QString getDeviceProperty(const QString &adbToolPath, const QString &device, const QString &property); - Utils::FileName openJDKBinPath() const; + Utils::FilePath openJDKBinPath() const; int getSDKVersion(const QString &device) const; static int getSDKVersion(const QString &adbToolPath, const QString &device); QStringList getAbis(const QString &device) const; @@ -169,11 +169,11 @@ private: void updateNdkInformation() const; - Utils::FileName m_sdkLocation; + Utils::FilePath m_sdkLocation; QStringList m_sdkManagerToolArgs; - Utils::FileName m_ndkLocation; - Utils::FileName m_openJDKLocation; - Utils::FileName m_keystoreLocation; + Utils::FilePath m_ndkLocation; + Utils::FilePath m_openJDKLocation; + Utils::FilePath m_keystoreLocation; unsigned m_partitionSize = 1024; bool m_automaticKitCreation = true; diff --git a/src/plugins/android/androidcreatekeystorecertificate.cpp b/src/plugins/android/androidcreatekeystorecertificate.cpp index dd2906e575..1ac6e1ea12 100644 --- a/src/plugins/android/androidcreatekeystorecertificate.cpp +++ b/src/plugins/android/androidcreatekeystorecertificate.cpp @@ -58,7 +58,7 @@ AndroidCreateKeystoreCertificate::~AndroidCreateKeystoreCertificate() delete ui; } -Utils::FileName AndroidCreateKeystoreCertificate::keystoreFilePath() +Utils::FilePath AndroidCreateKeystoreCertificate::keystoreFilePath() { return m_keystoreFilePath; } @@ -152,7 +152,7 @@ void AndroidCreateKeystoreCertificate::on_buttonBox_accepted() if (!validateUserInput()) return; - m_keystoreFilePath = Utils::FileName::fromString(QFileDialog::getSaveFileName(this, tr("Keystore Filename"), + m_keystoreFilePath = Utils::FilePath::fromString(QFileDialog::getSaveFileName(this, tr("Keystore Filename"), QDir::homePath() + QLatin1String("/android_release.keystore"), tr("Keystore files (*.keystore *.jks)"))); if (m_keystoreFilePath.isEmpty()) diff --git a/src/plugins/android/androidcreatekeystorecertificate.h b/src/plugins/android/androidcreatekeystorecertificate.h index 86c9f36fcf..4a9cbe9c42 100644 --- a/src/plugins/android/androidcreatekeystorecertificate.h +++ b/src/plugins/android/androidcreatekeystorecertificate.h @@ -49,7 +49,7 @@ class AndroidCreateKeystoreCertificate : public QDialog public: explicit AndroidCreateKeystoreCertificate(QWidget *parent = nullptr); ~AndroidCreateKeystoreCertificate() override; - Utils::FileName keystoreFilePath(); + Utils::FilePath keystoreFilePath(); QString keystorePassword(); QString certificateAlias(); QString certificatePassword(); @@ -69,7 +69,7 @@ private slots: private: bool validateUserInput(); Ui::AndroidCreateKeystoreCertificate *ui; - Utils::FileName m_keystoreFilePath; + Utils::FilePath m_keystoreFilePath; }; } // namespace Internal diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp index 4cd3a09942..a703c31936 100644 --- a/src/plugins/android/androiddebugsupport.cpp +++ b/src/plugins/android/androiddebugsupport.cpp @@ -190,7 +190,7 @@ void AndroidDebugSupport::start() const int minimumNdk = qt ? qt->minimumNDK() : 0; int sdkVersion = qMax(AndroidManager::minimumSDK(kit), minimumNdk); - Utils::FileName sysRoot = AndroidConfigurations::currentConfig().ndkLocation() + Utils::FilePath sysRoot = AndroidConfigurations::currentConfig().ndkLocation() .pathAppended("platforms") .pathAppended(QString("android-%1").arg(sdkVersion)) .pathAppended(toNdkArch(AndroidManager::targetArch(target))); diff --git a/src/plugins/android/androiddeployqtstep.cpp b/src/plugins/android/androiddeployqtstep.cpp index e75606253c..77ea540e6f 100644 --- a/src/plugins/android/androiddeployqtstep.cpp +++ b/src/plugins/android/androiddeployqtstep.cpp @@ -232,9 +232,9 @@ bool AndroidDeployQtStep::init() if (m_useAndroiddeployqt) { const ProjectNode *node = target()->project()->findNodeForBuildKey(rc->buildKey()); - m_apkPath = Utils::FileName::fromString(node->data(Constants::AndroidApk).toString()); + m_apkPath = Utils::FilePath::fromString(node->data(Constants::AndroidApk).toString()); if (!m_apkPath.isEmpty()) { - m_manifestName = Utils::FileName::fromString(node->data(Constants::AndroidManifest).toString()); + m_manifestName = Utils::FilePath::fromString(node->data(Constants::AndroidManifest).toString()); m_command = AndroidConfigurations::currentConfig().adbToolPath().toString(); AndroidManager::setManifestPath(target(), m_manifestName); } else { diff --git a/src/plugins/android/androiddeployqtstep.h b/src/plugins/android/androiddeployqtstep.h index b2a831efe7..949992d0e3 100644 --- a/src/plugins/android/androiddeployqtstep.h +++ b/src/plugins/android/androiddeployqtstep.h @@ -106,10 +106,10 @@ private: friend void operator|=(DeployErrorCode &e1, const DeployErrorCode &e2) { e1 = static_cast<AndroidDeployQtStep::DeployErrorCode>((int)e1 | (int)e2); } friend DeployErrorCode operator|(const DeployErrorCode &e1, const DeployErrorCode &e2) { return static_cast<AndroidDeployQtStep::DeployErrorCode>((int)e1 | (int)e2); } - Utils::FileName m_manifestName; + Utils::FilePath m_manifestName; QString m_serialNumber; QString m_avdName; - Utils::FileName m_apkPath; + Utils::FilePath m_apkPath; QMap<QString, QString> m_filesToPull; QString m_targetArch; diff --git a/src/plugins/android/androidgdbserverkitinformation.cpp b/src/plugins/android/androidgdbserverkitinformation.cpp index 1387e60be2..fdc5946c80 100644 --- a/src/plugins/android/androidgdbserverkitinformation.cpp +++ b/src/plugins/android/androidgdbserverkitinformation.cpp @@ -112,23 +112,23 @@ Core::Id AndroidGdbServerKitAspect::id() return "Android.GdbServer.Information"; } -FileName AndroidGdbServerKitAspect::gdbServer(const Kit *kit) +FilePath AndroidGdbServerKitAspect::gdbServer(const Kit *kit) { - QTC_ASSERT(kit, return FileName()); - return FileName::fromString(kit->value(AndroidGdbServerKitAspect::id()).toString()); + QTC_ASSERT(kit, return FilePath()); + return FilePath::fromString(kit->value(AndroidGdbServerKitAspect::id()).toString()); } -void AndroidGdbServerKitAspect::setGdbSever(Kit *kit, const FileName &gdbServerCommand) +void AndroidGdbServerKitAspect::setGdbSever(Kit *kit, const FilePath &gdbServerCommand) { QTC_ASSERT(kit, return); kit->setValue(AndroidGdbServerKitAspect::id(), gdbServerCommand.toString()); } -FileName AndroidGdbServerKitAspect::autoDetect(const Kit *kit) +FilePath AndroidGdbServerKitAspect::autoDetect(const Kit *kit) { ToolChain *tc = ToolChainKitAspect::toolChain(kit, ProjectExplorer::Constants::CXX_LANGUAGE_ID); if (!tc || tc->typeId() != Constants::ANDROID_TOOLCHAIN_ID) - return FileName(); + return FilePath(); auto atc = static_cast<AndroidToolChain *>(tc); return atc->suggestedGdbServer(); } diff --git a/src/plugins/android/androidgdbserverkitinformation.h b/src/plugins/android/androidgdbserverkitinformation.h index ebf416ae09..db4f349344 100644 --- a/src/plugins/android/androidgdbserverkitinformation.h +++ b/src/plugins/android/androidgdbserverkitinformation.h @@ -44,9 +44,9 @@ public: ProjectExplorer::KitAspectWidget *createConfigWidget(ProjectExplorer::Kit *) const override; static Core::Id id(); - static Utils::FileName gdbServer(const ProjectExplorer::Kit *kit); - static void setGdbSever(ProjectExplorer::Kit *kit, const Utils::FileName &gdbServerCommand); - static Utils::FileName autoDetect(const ProjectExplorer::Kit *kit); + static Utils::FilePath gdbServer(const ProjectExplorer::Kit *kit); + static void setGdbSever(ProjectExplorer::Kit *kit, const Utils::FilePath &gdbServerCommand); + static Utils::FilePath autoDetect(const ProjectExplorer::Kit *kit); }; } // namespace Internal diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp index 5612a14228..bccc0e3b2a 100644 --- a/src/plugins/android/androidmanager.cpp +++ b/src/plugins/android/androidmanager.cpp @@ -109,7 +109,7 @@ public: using LibrariesMap = QMap<QString, Library>; -static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName); +static bool openXmlFile(QDomDocument &doc, const Utils::FilePath &fileName); static bool openManifest(ProjectExplorer::Target *target, QDomDocument &doc); static int parseMinSdk(const QDomElement &manifestElem); @@ -129,7 +129,7 @@ QString AndroidManager::packageName(ProjectExplorer::Target *target) return manifestElem.attribute(QLatin1String("package")); } -QString AndroidManager::packageName(const Utils::FileName &manifestFile) +QString AndroidManager::packageName(const Utils::FilePath &manifestFile) { QDomDocument doc; if (!openXmlFile(doc, manifestFile)) @@ -174,7 +174,7 @@ int AndroidManager::packageVersionCode(const QString &deviceSerial, return -1; } -void AndroidManager::apkInfo(const Utils::FileName &apkPath, +void AndroidManager::apkInfo(const Utils::FilePath &apkPath, QString *packageName, int *version, QString *activityPath) @@ -237,8 +237,8 @@ int AndroidManager::minimumSDK(const ProjectExplorer::Kit *kit) int minSDKVersion = -1; QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(kit); if (version && version->targetDeviceTypes().contains(Constants::ANDROID_DEVICE_TYPE)) { - Utils::FileName stockManifestFilePath = - Utils::FileName::fromUserInput(version->qmakeProperty("QT_INSTALL_PREFIX") + + Utils::FilePath stockManifestFilePath = + Utils::FilePath::fromUserInput(version->qmakeProperty("QT_INSTALL_PREFIX") + QLatin1String("/src/android/templates/AndroidManifest.xml")); QDomDocument doc; if (openXmlFile(doc, stockManifestFilePath)) { @@ -292,20 +292,20 @@ QJsonObject AndroidManager::deploymentSettings(const Target *target) return settings; } -Utils::FileName AndroidManager::dirPath(const ProjectExplorer::Target *target) +Utils::FilePath AndroidManager::dirPath(const ProjectExplorer::Target *target) { if (target->activeBuildConfiguration()) return target->activeBuildConfiguration()->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY); - return Utils::FileName(); + return Utils::FilePath(); } -Utils::FileName AndroidManager::apkPath(const ProjectExplorer::Target *target) +Utils::FilePath AndroidManager::apkPath(const ProjectExplorer::Target *target) { - QTC_ASSERT(target, return Utils::FileName()); + QTC_ASSERT(target, return Utils::FilePath()); auto buildApkStep = AndroidBuildApkStep::findInBuild(target->activeBuildConfiguration()); if (!buildApkStep) - return Utils::FileName(); + return Utils::FilePath(); QString apkPath("build/outputs/apk/android-build-"); if (buildApkStep->signPackage()) @@ -316,13 +316,13 @@ Utils::FileName AndroidManager::apkPath(const ProjectExplorer::Target *target) return dirPath(target).pathAppended(apkPath); } -Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *target) +Utils::FilePath AndroidManager::manifestSourcePath(ProjectExplorer::Target *target) { if (const ProjectNode *node = currentProjectNode(target)) { const QString packageSource = node->data(Android::Constants::AndroidPackageSourceDir).toString(); if (!packageSource.isEmpty()) { - const FileName manifest = FileName::fromUserInput(packageSource + "/AndroidManifest.xml"); + const FilePath manifest = FilePath::fromUserInput(packageSource + "/AndroidManifest.xml"); if (manifest.exists()) return manifest; } @@ -330,20 +330,20 @@ Utils::FileName AndroidManager::manifestSourcePath(ProjectExplorer::Target *targ return manifestPath(target); } -Utils::FileName AndroidManager::manifestPath(ProjectExplorer::Target *target) +Utils::FilePath AndroidManager::manifestPath(ProjectExplorer::Target *target) { QVariant manifest = target->namedSettings(AndroidManifestName); if (manifest.isValid()) - return manifest.value<FileName>(); + return manifest.value<FilePath>(); return dirPath(target).pathAppended(AndroidManifestName); } -void AndroidManager::setManifestPath(Target *target, const FileName &path) +void AndroidManager::setManifestPath(Target *target, const FilePath &path) { target->setNamedSettings(AndroidManifestName, QVariant::fromValue(path)); } -Utils::FileName AndroidManager::defaultPropertiesPath(ProjectExplorer::Target *target) +Utils::FilePath AndroidManager::defaultPropertiesPath(ProjectExplorer::Target *target) { return dirPath(target).pathAppended(AndroidDefaultPropertiesName); } @@ -440,7 +440,7 @@ static void raiseError(const QString &reason) QMessageBox::critical(nullptr, AndroidManager::tr("Error creating Android templates."), reason); } -static bool openXmlFile(QDomDocument &doc, const Utils::FileName &fileName) +static bool openXmlFile(QDomDocument &doc, const Utils::FilePath &fileName) { QFile f(fileName.toString()); if (!f.open(QIODevice::ReadOnly)) @@ -643,12 +643,12 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target) const QString sourceDirName = node->data(Constants::AndroidPackageSourceDir).toString(); QFileInfo sourceDirInfo(sourceDirName); - const FileName packageSourceDir = FileName::fromString(sourceDirInfo.canonicalFilePath()) + const FilePath packageSourceDir = FilePath::fromString(sourceDirInfo.canonicalFilePath()) .pathAppended("gradlew"); if (!packageSourceDir.exists()) return false; - const FileName wrapperProps = packageSourceDir.pathAppended("gradle/wrapper/gradle-wrapper.properties"); + const FilePath wrapperProps = packageSourceDir.pathAppended("gradle/wrapper/gradle-wrapper.properties"); if (wrapperProps.exists()) { GradleProperties wrapperProperties = readGradleProperties(wrapperProps.toString()); QString distributionUrl = QString::fromLocal8Bit(wrapperProperties["distributionUrl"]); @@ -661,7 +661,7 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target) GradleProperties localProperties; localProperties["sdk.dir"] = AndroidConfigurations::currentConfig().sdkLocation().toString().toLocal8Bit(); - const FileName localPropertiesFile = packageSourceDir.pathAppended("local.properties"); + const FilePath localPropertiesFile = packageSourceDir.pathAppended("local.properties"); if (!mergeGradleProperties(localPropertiesFile.toString(), localProperties)) return false; @@ -680,10 +680,10 @@ bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target) return mergeGradleProperties(gradlePropertiesPath, gradleProperties); } -int AndroidManager::findApiLevel(const Utils::FileName &platformPath) +int AndroidManager::findApiLevel(const Utils::FilePath &platformPath) { int apiLevel = -1; - const Utils::FileName propertiesPath = platformPath.pathAppended("/source.properties"); + const Utils::FilePath propertiesPath = platformPath.pathAppended("/source.properties"); if (propertiesPath.exists()) { QSettings sdkProperties(propertiesPath.toString(), QSettings::IniFormat); bool validInt = false; diff --git a/src/plugins/android/androidmanager.h b/src/plugins/android/androidmanager.h index 329661d965..12bf9ddf90 100644 --- a/src/plugins/android/androidmanager.h +++ b/src/plugins/android/androidmanager.h @@ -40,7 +40,7 @@ class Kit; class Target; } -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Android { @@ -66,10 +66,10 @@ class ANDROID_EXPORT AndroidManager : public QObject public: static QString packageName(ProjectExplorer::Target *target); - static QString packageName(const Utils::FileName &manifestFile); + static QString packageName(const Utils::FilePath &manifestFile); static bool packageInstalled(const QString &deviceSerial, const QString &packageName); static int packageVersionCode(const QString &deviceSerial, const QString &packageName); - static void apkInfo(const Utils::FileName &apkPath, + static void apkInfo(const Utils::FilePath &apkPath, QString *packageName = nullptr, int *version = nullptr, QString *activityPath = nullptr); @@ -89,12 +89,12 @@ public: static QString targetArch(const ProjectExplorer::Target *target); - static Utils::FileName dirPath(const ProjectExplorer::Target *target); - static Utils::FileName manifestPath(ProjectExplorer::Target *target); - static void setManifestPath(ProjectExplorer::Target *target, const Utils::FileName &path); - static Utils::FileName manifestSourcePath(ProjectExplorer::Target *target); - static Utils::FileName defaultPropertiesPath(ProjectExplorer::Target *target); - static Utils::FileName apkPath(const ProjectExplorer::Target *target); + static Utils::FilePath dirPath(const ProjectExplorer::Target *target); + static Utils::FilePath manifestPath(ProjectExplorer::Target *target); + static void setManifestPath(ProjectExplorer::Target *target, const Utils::FilePath &path); + static Utils::FilePath manifestSourcePath(ProjectExplorer::Target *target); + static Utils::FilePath defaultPropertiesPath(ProjectExplorer::Target *target); + static Utils::FilePath apkPath(const ProjectExplorer::Target *target); static QPair<int, int> apiLevelRange(); static QString androidNameForApiLevel(int x); @@ -107,7 +107,7 @@ public: static bool checkCertificateExists(const QString &keystorePath, const QString &keystorePasswd, const QString &alias); static bool updateGradleProperties(ProjectExplorer::Target *target); - static int findApiLevel(const Utils::FileName &platformPath); + static int findApiLevel(const Utils::FilePath &platformPath); static QProcess *runAdbCommandDetached(const QStringList &args, QString *err = nullptr, bool deleteOnFinish = false); diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp index ca0946d1c9..72ab0c9984 100644 --- a/src/plugins/android/androidmanifesteditorwidget.cpp +++ b/src/plugins/android/androidmanifesteditorwidget.cpp @@ -85,7 +85,7 @@ bool checkPackageName(const QString &packageName) return QRegExp(packageNameRegExp).exactMatch(packageName); } -Project *androidProject(const Utils::FileName &fileName) +Project *androidProject(const Utils::FilePath &fileName) { for (Project *project : SessionManager::projects()) { if (!project->activeTarget()) @@ -604,7 +604,7 @@ void AndroidManifestEditorWidget::preSave() void AndroidManifestEditorWidget::postSave() { - const Utils::FileName docPath = m_textEditorWidget->textDocument()->filePath(); + const Utils::FilePath docPath = m_textEditorWidget->textDocument()->filePath(); ProjectExplorer::Project *project = androidProject(docPath); if (project) { if (Target *target = project->activeTarget()) { diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index 3aafb45cc9..9ad698bdec 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -100,7 +100,7 @@ void AndroidPackageInstallationStep::doRun() { QString error; foreach (const QString &dir, m_androidDirsToClean) { - FileName androidDir = FileName::fromString(dir); + FilePath androidDir = FilePath::fromString(dir); if (!dir.isEmpty() && androidDir.exists()) { emit addOutput(tr("Removing directory %1").arg(dir), OutputFormat::NormalMessage); if (!FileUtils::removeRecursively(androidDir, &error)) { diff --git a/src/plugins/android/androidsdkmanager.cpp b/src/plugins/android/androidsdkmanager.cpp index e2c0453d6c..5d0333f5f8 100644 --- a/src/plugins/android/androidsdkmanager.cpp +++ b/src/plugins/android/androidsdkmanager.cpp @@ -223,7 +223,7 @@ private: AndroidSdkManager &m_sdkManager; const AndroidConfig &m_config; AndroidSdkPackageList m_allPackages; - FileName lastSdkManagerPath; + FilePath lastSdkManagerPath; QString m_licenseTextCache; QByteArray m_licenseUserInput; mutable QReadWriteLock m_licenseInputLock; @@ -243,7 +243,7 @@ class SdkManagerOutputParser QStringList headerParts; QVersionNumber revision; QString description; - Utils::FileName installedLocation; + Utils::FilePath installedLocation; QMap<QString, QString> extraData; }; @@ -612,7 +612,7 @@ bool SdkManagerOutputParser::parseAbstractData(SdkManagerOutputParser::GenericPa for (const auto &key: qAsConst(extraKeys)) { if (valueForKey(key, line, &value)) { if (key == installLocationKey) - output.installedLocation = Utils::FileName::fromString(value); + output.installedLocation = Utils::FilePath::fromString(value); else if (key == revisionKey) output.revision = QVersionNumber::fromString(value); else if (key == descriptionKey) diff --git a/src/plugins/android/androidsdkpackage.cpp b/src/plugins/android/androidsdkpackage.cpp index 127aa97a2e..59978b3b7d 100644 --- a/src/plugins/android/androidsdkpackage.cpp +++ b/src/plugins/android/androidsdkpackage.cpp @@ -69,7 +69,7 @@ const QString &AndroidSdkPackage::sdkStylePath() const return m_sdkStylePath; } -const Utils::FileName &AndroidSdkPackage::installedLocation() const +const Utils::FilePath &AndroidSdkPackage::installedLocation() const { return m_installedLocation; } @@ -89,7 +89,7 @@ void AndroidSdkPackage::setState(AndroidSdkPackage::PackageState state) m_state = state; } -void AndroidSdkPackage::setInstalledLocation(const Utils::FileName &path) +void AndroidSdkPackage::setInstalledLocation(const Utils::FilePath &path) { m_installedLocation = path; if (m_installedLocation.exists()) diff --git a/src/plugins/android/androidsdkpackage.h b/src/plugins/android/androidsdkpackage.h index beca0472dd..9f85e87be9 100644 --- a/src/plugins/android/androidsdkpackage.h +++ b/src/plugins/android/androidsdkpackage.h @@ -77,13 +77,13 @@ public: const QVersionNumber &revision() const; PackageState state() const; const QString &sdkStylePath() const; - const Utils::FileName &installedLocation() const; + const Utils::FilePath &installedLocation() const; protected: void setDisplayText(const QString &str); void setDescriptionText(const QString &str); void setState(PackageState state); - void setInstalledLocation(const Utils::FileName &path); + void setInstalledLocation(const Utils::FilePath &path); virtual void updatePackageDetails(); @@ -93,7 +93,7 @@ private: QVersionNumber m_revision; PackageState m_state = PackageState::Unknown; QString m_sdkStylePath; - Utils::FileName m_installedLocation; + Utils::FilePath m_installedLocation; friend class Internal::SdkManagerOutputParser; friend class Internal::AndroidToolOutputParser; diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index 9b7f1f1c3b..494af3065f 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -371,28 +371,28 @@ void AndroidSettingsWidget::saveSettings() void AndroidSettingsWidget::validateJdk() { - auto javaPath = Utils::FileName::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath()); + auto javaPath = Utils::FilePath::fromUserInput(m_ui->OpenJDKLocationPathChooser->rawPath()); m_androidConfig.setOpenJDKLocation(javaPath); bool jdkPathExists = m_androidConfig.openJDKLocation().exists(); auto summaryWidget = static_cast<SummaryWidget *>(m_ui->javaDetailsWidget->widget()); summaryWidget->setPointValid(JavaPathExistsRow, jdkPathExists); - const Utils::FileName bin = m_androidConfig.openJDKLocation().pathAppended("bin/javac" QTC_HOST_EXE_SUFFIX); + const Utils::FilePath bin = m_androidConfig.openJDKLocation().pathAppended("bin/javac" QTC_HOST_EXE_SUFFIX); summaryWidget->setPointValid(JavaJdkValidRow, jdkPathExists && bin.exists()); updateUI(); } void AndroidSettingsWidget::validateNdk() { - auto ndkPath = Utils::FileName::fromUserInput(m_ui->NDKLocationPathChooser->rawPath()); + auto ndkPath = Utils::FilePath::fromUserInput(m_ui->NDKLocationPathChooser->rawPath()); m_androidConfig.setNdkLocation(ndkPath); auto summaryWidget = static_cast<SummaryWidget *>(m_ui->androidDetailsWidget->widget()); summaryWidget->setPointValid(NdkPathExistsRow, m_androidConfig.ndkLocation().exists()); - const Utils::FileName ndkPlatformsDir = ndkPath.pathAppended("platforms"); - const Utils::FileName ndkToolChainsDir = ndkPath.pathAppended("toolchains"); - const Utils::FileName ndkSourcesDir = ndkPath.pathAppended("sources/cxx-stl"); + const Utils::FilePath ndkPlatformsDir = ndkPath.pathAppended("platforms"); + const Utils::FilePath ndkToolChainsDir = ndkPath.pathAppended("toolchains"); + const Utils::FilePath ndkSourcesDir = ndkPath.pathAppended("sources/cxx-stl"); summaryWidget->setPointValid(NdkDirStructureRow, ndkPlatformsDir.exists() && ndkToolChainsDir.exists() @@ -405,7 +405,7 @@ void AndroidSettingsWidget::validateNdk() void AndroidSettingsWidget::onSdkPathChanged() { - auto sdkPath = Utils::FileName::fromUserInput(m_ui->SDKLocationPathChooser->rawPath()); + auto sdkPath = Utils::FilePath::fromUserInput(m_ui->SDKLocationPathChooser->rawPath()); m_androidConfig.setSdkLocation(sdkPath); // Package reload will trigger validateSdk. m_sdkManager->reloadPackages(); diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp index 0b65eacf23..3c45885471 100644 --- a/src/plugins/android/androidtoolchain.cpp +++ b/src/plugins/android/androidtoolchain.cpp @@ -60,7 +60,7 @@ static const QHash<QString, Abi> ClangTargets = { static const QList<Core::Id> LanguageIds = {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}; -static ToolChain *findToolChain(Utils::FileName &compilerPath, Core::Id lang, const QString &target, +static ToolChain *findToolChain(Utils::FilePath &compilerPath, Core::Id lang, const QString &target, CToolChainList &alreadyKnown) { ToolChain * tc = Utils::findOrDefault(alreadyKnown, [target, compilerPath, lang](ToolChain *tc) { @@ -92,11 +92,11 @@ void AndroidToolChain::addToEnvironment(Environment &env) const { env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::currentConfig().toolchainHost()); - const Utils::FileName javaHome = AndroidConfigurations::currentConfig().openJDKLocation(); + const Utils::FilePath javaHome = AndroidConfigurations::currentConfig().openJDKLocation(); if (!javaHome.exists()) { env.set(QLatin1String("JAVA_HOME"), javaHome.toString()); - const FileName javaBin = javaHome.pathAppended("bin"); - if (!Utils::contains(env.path(), [&javaBin](const Utils::FileName &p) { return p == javaBin; })) + const FilePath javaBin = javaHome.pathAppended("bin"); + if (!Utils::contains(env.path(), [&javaBin](const Utils::FilePath &p) { return p == javaBin; })) env.prependOrSetPath(javaBin.toUserOutput()); } env.set(QLatin1String("ANDROID_HOME"), @@ -105,13 +105,13 @@ void AndroidToolChain::addToEnvironment(Environment &env) const AndroidConfigurations::currentConfig().sdkLocation().toString()); } -FileName AndroidToolChain::suggestedDebugger() const +FilePath AndroidToolChain::suggestedDebugger() const { // TODO: Make use of LLDB if available. return AndroidConfigurations::currentConfig().gdbPath(targetAbi()); } -FileName AndroidToolChain::suggestedGdbServer() const +FilePath AndroidToolChain::suggestedGdbServer() const { return AndroidConfigurations::currentConfig().gdbServer(targetAbi()); } @@ -128,11 +128,11 @@ QStringList AndroidToolChain::suggestedMkspecList() const return {"android-g++", "android-clang"}; } -FileName AndroidToolChain::makeCommand(const Environment &env) const +FilePath AndroidToolChain::makeCommand(const Environment &env) const { Q_UNUSED(env); - FileName makePath = AndroidConfigurations::currentConfig().makePath(); - return makePath.exists() ? makePath : FileName::fromString("make"); + FilePath makePath = AndroidConfigurations::currentConfig().makePath(); + return makePath.exists() ? makePath : FilePath::fromString("make"); } GccToolChain::DetectedAbisResult AndroidToolChain::detectSupportedAbis() const @@ -162,7 +162,7 @@ ToolChainList AndroidToolChainFactory::autoDetect(CToolChainList &alreadyKnown) return autodetectToolChainsForNdk(alreadyKnown); } -static FileName clangPlusPlusPath(const FileName &clangPath) +static FilePath clangPlusPlusPath(const FilePath &clangPath) { return clangPath.parentDir().pathAppended( HostOsInfo::withExecutableSuffix( @@ -172,7 +172,7 @@ static FileName clangPlusPlusPath(const FileName &clangPath) ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(CToolChainList &alreadyKnown) { QList<ToolChain *> result; - FileName clangPath = AndroidConfigurations::currentConfig().clangPath(); + FilePath clangPath = AndroidConfigurations::currentConfig().clangPath(); if (!clangPath.exists()) { qCDebug(androidTCLog) << "Clang toolchains detection fails. Can not find Clang"<< clangPath; return result; @@ -182,7 +182,7 @@ ToolChainList AndroidToolChainFactory::autodetectToolChainsForNdk(CToolChainList << AndroidConfigurations::currentConfig().ndkLocation(); for (const Core::Id &lang : LanguageIds) { - FileName compilerCommand = clangPath; + FilePath compilerCommand = clangPath; if (lang == ProjectExplorer::Constants::CXX_LANGUAGE_ID) compilerCommand = clangPlusPlusPath(clangPath); diff --git a/src/plugins/android/androidtoolchain.h b/src/plugins/android/androidtoolchain.h index 2a3562172d..1665f49b6a 100644 --- a/src/plugins/android/androidtoolchain.h +++ b/src/plugins/android/androidtoolchain.h @@ -42,10 +42,10 @@ public: bool isValid() const override; void addToEnvironment(Utils::Environment &env) const override; - Utils::FileName suggestedDebugger() const override; - Utils::FileName suggestedGdbServer() const; + Utils::FilePath suggestedDebugger() const override; + Utils::FilePath suggestedGdbServer() const; QStringList suggestedMkspecList() const override; - Utils::FileName makeCommand(const Utils::Environment &environment) const override; + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; bool fromMap(const QVariantMap &data) override; protected: @@ -70,7 +70,7 @@ public: { public: Core::Id language; - Utils::FileName compilerCommand; + Utils::FilePath compilerCommand; ProjectExplorer::Abi abi; QString version; }; diff --git a/src/plugins/android/androidtoolmanager.cpp b/src/plugins/android/androidtoolmanager.cpp index 84658f12b2..be26329f98 100644 --- a/src/plugins/android/androidtoolmanager.cpp +++ b/src/plugins/android/androidtoolmanager.cpp @@ -46,7 +46,7 @@ using namespace Utils; class AndroidToolOutputParser { public: - void parseTargetListing(const QString &output, const FileName &sdkLocation, + void parseTargetListing(const QString &output, const FilePath &sdkLocation, SdkPlatformList &platformList); QList<SdkPlatform> m_installedPlatforms; @@ -57,7 +57,7 @@ public: environment. Returns \c true for successful execution. Command's output is copied to \a output. */ -static bool androidToolCommand(Utils::FileName toolPath, const QStringList &args, +static bool androidToolCommand(Utils::FilePath toolPath, const QStringList &args, const QProcessEnvironment &environment, QString *output) { QString androidToolPath = toolPath.toString(); @@ -143,7 +143,7 @@ QFuture<AndroidDeviceInfoList> AndroidToolManager::androidVirtualDevicesFuture() AndroidConfigurations::toolsEnvironment(m_config)); } -CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FileName androidToolPath, +CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FilePath androidToolPath, QProcessEnvironment env) { QProcess proc; @@ -195,8 +195,8 @@ CreateAvdInfo AndroidToolManager::createAvdImpl(CreateAvdInfo info, FileName and return info; } -AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::FileName &androidTool, - const FileName &sdkLocationPath, +AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::FilePath &androidTool, + const FilePath &sdkLocationPath, const QProcessEnvironment &env) { AndroidDeviceInfoList devices; @@ -274,7 +274,7 @@ AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::Fil } void AndroidToolOutputParser::parseTargetListing(const QString &output, - const Utils::FileName &sdkLocation, + const Utils::FilePath &sdkLocation, SdkPlatformList &platformList) { auto addSystemImage = [](const QStringList& abiList, SdkPlatform *platform) { @@ -291,7 +291,7 @@ void AndroidToolOutputParser::parseTargetListing(const QString &output, QVersionNumber revision; int apiLevel = -1; QString description; - Utils::FileName installedLocation; + Utils::FilePath installedLocation; void clear() { abiList.clear(); diff --git a/src/plugins/android/androidtoolmanager.h b/src/plugins/android/androidtoolmanager.h index 76cff1881e..61db46cee2 100644 --- a/src/plugins/android/androidtoolmanager.h +++ b/src/plugins/android/androidtoolmanager.h @@ -58,10 +58,10 @@ public: // Helper methods private: - static CreateAvdInfo createAvdImpl(CreateAvdInfo info, Utils::FileName androidToolPath, + static CreateAvdInfo createAvdImpl(CreateAvdInfo info, Utils::FilePath androidToolPath, QProcessEnvironment env); - static AndroidDeviceInfoList androidVirtualDevices(const Utils::FileName &androidTool, - const Utils::FileName &sdkLlocationPath, + static AndroidDeviceInfoList androidVirtualDevices(const Utils::FilePath &androidTool, + const Utils::FilePath &sdkLlocationPath, const QProcessEnvironment &env); private: const AndroidConfig &m_config; diff --git a/src/plugins/android/createandroidmanifestwizard.cpp b/src/plugins/android/createandroidmanifestwizard.cpp index 90bd2cf0bd..ca386fa907 100644 --- a/src/plugins/android/createandroidmanifestwizard.cpp +++ b/src/plugins/android/createandroidmanifestwizard.cpp @@ -324,22 +324,22 @@ void CreateAndroidManifestWizard::createAndroidTemplateFiles() if (version->qtVersion() < QtSupport::QtVersionNumber(5, 4, 0)) { const QString src(version->qmakeProperty("QT_INSTALL_PREFIX") .append(QLatin1String("/src/android/java/AndroidManifest.xml"))); - FileUtils::copyRecursively(FileName::fromString(src), - FileName::fromString(m_directory + QLatin1String("/AndroidManifest.xml")), + FileUtils::copyRecursively(FilePath::fromString(src), + FilePath::fromString(m_directory + QLatin1String("/AndroidManifest.xml")), nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);}); } else { const QString src(version->qmakeProperty("QT_INSTALL_PREFIX") .append(QLatin1String("/src/android/templates"))); - FileUtils::copyRecursively(FileName::fromString(src), - FileName::fromString(m_directory), + FileUtils::copyRecursively(FilePath::fromString(src), + FilePath::fromString(m_directory), nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);}); if (m_copyGradle) { - FileName gradlePath = FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX").append(QLatin1String("/src/3rdparty/gradle"))); + FilePath gradlePath = FilePath::fromString(version->qmakeProperty("QT_INSTALL_PREFIX").append(QLatin1String("/src/3rdparty/gradle"))); if (!gradlePath.exists()) gradlePath = AndroidConfigurations::currentConfig().sdkLocation().pathAppended("/tools/templates/gradle/wrapper"); - FileUtils::copyRecursively(gradlePath, FileName::fromString(m_directory), + FileUtils::copyRecursively(gradlePath, FilePath::fromString(m_directory), nullptr, [this, &addedFiles](QFileInfo src, QFileInfo dst, QString *){return copy(src, dst, &addedFiles);}); } diff --git a/src/plugins/android/javaparser.cpp b/src/plugins/android/javaparser.cpp index 484a349b2a..d6c0a8d254 100644 --- a/src/plugins/android/javaparser.cpp +++ b/src/plugins/android/javaparser.cpp @@ -53,12 +53,12 @@ void JavaParser::setProjectFileList(const QStringList &fileList) m_fileList = fileList; } -void JavaParser::setBuildDirectory(const Utils::FileName &buildDirectory) +void JavaParser::setBuildDirectory(const Utils::FilePath &buildDirectory) { m_buildDirectory = buildDirectory; } -void JavaParser::setSourceDirectory(const Utils::FileName &sourceDirectory) +void JavaParser::setSourceDirectory(const Utils::FilePath &sourceDirectory) { m_sourceDirectory = sourceDirectory; } @@ -70,16 +70,16 @@ void JavaParser::parse(const QString &line) int lineno = m_javaRegExp.cap(3).toInt(&ok); if (!ok) lineno = -1; - Utils::FileName file = Utils::FileName::fromUserInput(m_javaRegExp.cap(2)); + Utils::FilePath file = Utils::FilePath::fromUserInput(m_javaRegExp.cap(2)); if (file.isChildOf(m_buildDirectory)) { - Utils::FileName relativePath = file.relativeChildPath(m_buildDirectory); + Utils::FilePath relativePath = file.relativeChildPath(m_buildDirectory); file = m_sourceDirectory.pathAppended(relativePath.toString()); } if (file.toFileInfo().isRelative()) { for (int i = 0; i < m_fileList.size(); i++) if (m_fileList[i].endsWith(file.toString())) { - file = Utils::FileName::fromString(m_fileList[i]); + file = Utils::FilePath::fromString(m_fileList[i]); break; } } diff --git a/src/plugins/android/javaparser.h b/src/plugins/android/javaparser.h index 5199f1057a..ee9a53df1f 100644 --- a/src/plugins/android/javaparser.h +++ b/src/plugins/android/javaparser.h @@ -43,16 +43,16 @@ public: void stdError(const QString &line) override; void setProjectFileList(const QStringList &fileList); - void setBuildDirectory(const Utils::FileName &buildDirectory); - void setSourceDirectory(const Utils::FileName &sourceDirectory); + void setBuildDirectory(const Utils::FilePath &buildDirectory); + void setSourceDirectory(const Utils::FilePath &sourceDirectory); private: void parse(const QString &line); QRegExp m_javaRegExp; QStringList m_fileList; - Utils::FileName m_sourceDirectory; - Utils::FileName m_buildDirectory; + Utils::FilePath m_sourceDirectory; + Utils::FilePath m_buildDirectory; }; } // namespace Internal diff --git a/src/plugins/autotest/autotestplugin.cpp b/src/plugins/autotest/autotestplugin.cpp index d40f752907..5f90f33aca 100644 --- a/src/plugins/autotest/autotestplugin.cpp +++ b/src/plugins/autotest/autotestplugin.cpp @@ -250,7 +250,7 @@ void AutotestPlugin::onRunFileTriggered() if (!document) return; - const Utils::FileName &fileName = document->filePath(); + const Utils::FilePath &fileName = document->filePath(); if (fileName.isEmpty()) return; diff --git a/src/plugins/autotest/gtest/gtesttreeitem.cpp b/src/plugins/autotest/gtest/gtesttreeitem.cpp index f558039bf7..c344669b3c 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.cpp +++ b/src/plugins/autotest/gtest/gtesttreeitem.cpp @@ -285,7 +285,7 @@ QList<TestConfiguration *> GTestTreeItem::getSelectedTestConfigurations() const return getTestConfigurations(false); } -QList<TestConfiguration *> GTestTreeItem::getTestConfigurationsForFile(const Utils::FileName &fileName) const +QList<TestConfiguration *> GTestTreeItem::getTestConfigurationsForFile(const Utils::FilePath &fileName) const { QList<TestConfiguration *> result; ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject(); diff --git a/src/plugins/autotest/gtest/gtesttreeitem.h b/src/plugins/autotest/gtest/gtesttreeitem.h index 4464a83a0c..3b93116ffc 100644 --- a/src/plugins/autotest/gtest/gtesttreeitem.h +++ b/src/plugins/autotest/gtest/gtesttreeitem.h @@ -57,7 +57,7 @@ public: TestConfiguration *debugConfiguration() const override; QList<TestConfiguration *> getAllTestConfigurations() const override; QList<TestConfiguration *> getSelectedTestConfigurations() const override; - QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FileName &fileName) const override; + QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FilePath &fileName) const override; TestTreeItem *find(const TestParseResult *result) override; TestTreeItem *findChild(const TestTreeItem *other) override; bool modify(const TestParseResult *result) override; diff --git a/src/plugins/autotest/qtest/qttesttreeitem.cpp b/src/plugins/autotest/qtest/qttesttreeitem.cpp index 424f6ed114..7069e29961 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.cpp +++ b/src/plugins/autotest/qtest/qttesttreeitem.cpp @@ -234,7 +234,7 @@ QList<TestConfiguration *> QtTestTreeItem::getSelectedTestConfigurations() const return result; } -QList<TestConfiguration *> QtTestTreeItem::getTestConfigurationsForFile(const Utils::FileName &fileName) const +QList<TestConfiguration *> QtTestTreeItem::getTestConfigurationsForFile(const Utils::FilePath &fileName) const { QList<TestConfiguration *> result; diff --git a/src/plugins/autotest/qtest/qttesttreeitem.h b/src/plugins/autotest/qtest/qttesttreeitem.h index 3c7f9c4bd7..97ad853580 100644 --- a/src/plugins/autotest/qtest/qttesttreeitem.h +++ b/src/plugins/autotest/qtest/qttesttreeitem.h @@ -45,7 +45,7 @@ public: TestConfiguration *debugConfiguration() const override; QList<TestConfiguration *> getAllTestConfigurations() const override; QList<TestConfiguration *> getSelectedTestConfigurations() const override; - QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FileName &fileName) const override; + QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FilePath &fileName) const override; TestTreeItem *find(const TestParseResult *result) override; TestTreeItem *findChild(const TestTreeItem *other) override; bool modify(const TestParseResult *result) override; diff --git a/src/plugins/autotest/quick/quicktestparser.cpp b/src/plugins/autotest/quick/quicktestparser.cpp index c4f7e7963a..2542325510 100644 --- a/src/plugins/autotest/quick/quicktestparser.cpp +++ b/src/plugins/autotest/quick/quicktestparser.cpp @@ -144,7 +144,7 @@ QList<QmlJS::Document::Ptr> QuickTestParser::scanDirectoryForQuickTestQmlFiles(c // make sure even files not listed in pro file are available inside the snapshot QFutureInterface<void> future; QmlJS::PathsAndLanguages paths; - paths.maybeInsert(Utils::FileName::fromString(srcDir), QmlJS::Dialect::Qml); + paths.maybeInsert(Utils::FilePath::fromString(srcDir), QmlJS::Dialect::Qml); QmlJS::ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM, false /*emitDocumentChanges*/, false /*onlyTheLib*/, true /*forceRescan*/ ); @@ -276,7 +276,7 @@ void QuickTestParser::handleDirectoryChanged(const QString &directory) }); if (timestampChanged) { QmlJS::PathsAndLanguages paths; - paths.maybeInsert(Utils::FileName::fromString(directory), QmlJS::Dialect::Qml); + paths.maybeInsert(Utils::FilePath::fromString(directory), QmlJS::Dialect::Qml); QFutureInterface<void> future; QmlJS::ModelManagerInterface *qmlJsMM = QmlJS::ModelManagerInterface::instance(); QmlJS::ModelManagerInterface::importScan(future, qmlJsMM->workingCopy(), paths, qmlJsMM, diff --git a/src/plugins/autotest/quick/quicktesttreeitem.cpp b/src/plugins/autotest/quick/quicktesttreeitem.cpp index 0ef0de7292..52d3796463 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.cpp +++ b/src/plugins/autotest/quick/quicktesttreeitem.cpp @@ -280,7 +280,7 @@ QList<TestConfiguration *> QuickTestTreeItem::getSelectedTestConfigurations() co return result; } -QList<TestConfiguration *> QuickTestTreeItem::getTestConfigurationsForFile(const Utils::FileName &fileName) const +QList<TestConfiguration *> QuickTestTreeItem::getTestConfigurationsForFile(const Utils::FilePath &fileName) const { QList<TestConfiguration *> result; ProjectExplorer::Project *project = ProjectExplorer::SessionManager::startupProject(); diff --git a/src/plugins/autotest/quick/quicktesttreeitem.h b/src/plugins/autotest/quick/quicktesttreeitem.h index b1d49065f3..b9f06d6a07 100644 --- a/src/plugins/autotest/quick/quicktesttreeitem.h +++ b/src/plugins/autotest/quick/quicktesttreeitem.h @@ -45,7 +45,7 @@ public: TestConfiguration *debugConfiguration() const override; QList<TestConfiguration *> getAllTestConfigurations() const override; QList<TestConfiguration *> getSelectedTestConfigurations() const override; - QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FileName &fileName) const override; + QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FilePath &fileName) const override; TestTreeItem *find(const TestParseResult *result) override; TestTreeItem *findChild(const TestTreeItem *other) override; bool modify(const TestParseResult *result) override; diff --git a/src/plugins/autotest/testcodeparser.cpp b/src/plugins/autotest/testcodeparser.cpp index 5916291b7f..c944073dc7 100644 --- a/src/plugins/autotest/testcodeparser.cpp +++ b/src/plugins/autotest/testcodeparser.cpp @@ -186,7 +186,7 @@ void TestCodeParser::onDocumentUpdated(const QString &fileName, bool isQmlFile) if (!project) return; // Quick tests: qml files aren't necessarily listed inside project files - if (!isQmlFile && !project->isKnownFile(Utils::FileName::fromString(fileName))) + if (!isQmlFile && !project->isKnownFile(Utils::FilePath::fromString(fileName))) return; scanForTests(QStringList(fileName)); @@ -321,7 +321,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList, ITestParser *pars return; QStringList list; if (isFullParse) { - list = Utils::transform(project->files(Project::SourceFiles), &Utils::FileName::toString); + list = Utils::transform(project->files(Project::SourceFiles), &Utils::FilePath::toString); if (list.isEmpty()) { // at least project file should be there, but might happen if parsing current project // takes too long, especially when opening sessions holding multiple projects diff --git a/src/plugins/autotest/testeditormark.cpp b/src/plugins/autotest/testeditormark.cpp index 61e53ef4bd..29ca484c9c 100644 --- a/src/plugins/autotest/testeditormark.cpp +++ b/src/plugins/autotest/testeditormark.cpp @@ -29,7 +29,7 @@ namespace Autotest { namespace Internal { -TestEditorMark::TestEditorMark(QPersistentModelIndex item, const Utils::FileName &file, int line) +TestEditorMark::TestEditorMark(QPersistentModelIndex item, const Utils::FilePath &file, int line) : TextEditor::TextMark(file, line, Core::Id(Constants::TASK_MARK_ID)), m_item(item) { diff --git a/src/plugins/autotest/testeditormark.h b/src/plugins/autotest/testeditormark.h index c84e8efb73..458bb4f0c0 100644 --- a/src/plugins/autotest/testeditormark.h +++ b/src/plugins/autotest/testeditormark.h @@ -35,7 +35,7 @@ namespace Internal { class TestEditorMark : public TextEditor::TextMark { public: - TestEditorMark(QPersistentModelIndex item, const Utils::FileName &file, int line); + TestEditorMark(QPersistentModelIndex item, const Utils::FilePath &file, int line); bool isClickable() const override { return true; } void clicked() override; diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 8ee178a338..468cc9e32c 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -671,7 +671,7 @@ void TestResultsPane::createMarks(const QModelIndex &parent) bool isLocationItem = result->result() == ResultType::MessageLocation; if (interested.contains(result->result()) || (isLocationItem && interested.contains(parentType))) { - const Utils::FileName fileName = Utils::FileName::fromString(result->fileName()); + const Utils::FilePath fileName = Utils::FilePath::fromString(result->fileName()); TestEditorMark *mark = new TestEditorMark(index, fileName, result->line()); mark->setIcon(index.data(Qt::DecorationRole).value<QIcon>()); mark->setColor(Utils::Theme::OutputPanes_TestFailTextColor); diff --git a/src/plugins/autotest/testtreeitem.cpp b/src/plugins/autotest/testtreeitem.cpp index a473f2d088..bc3c4f16be 100644 --- a/src/plugins/autotest/testtreeitem.cpp +++ b/src/plugins/autotest/testtreeitem.cpp @@ -259,7 +259,7 @@ QList<TestConfiguration *> TestTreeItem::getSelectedTestConfigurations() const return QList<TestConfiguration *>(); } -QList<TestConfiguration *> TestTreeItem::getTestConfigurationsForFile(const Utils::FileName &) const +QList<TestConfiguration *> TestTreeItem::getTestConfigurationsForFile(const Utils::FilePath &) const { return QList<TestConfiguration *>(); } @@ -368,9 +368,9 @@ QSet<QString> TestTreeItem::dependingInternalTargets(CppTools::CppModelManager * bool wasHeader; const QString correspondingFile = CppTools::correspondingHeaderOrSource(file, &wasHeader, CppTools::CacheUsage::ReadOnly); - const Utils::FileNameList dependingFiles = snapshot.filesDependingOn( + const Utils::FilePathList dependingFiles = snapshot.filesDependingOn( wasHeader ? file : correspondingFile); - for (const Utils::FileName &fn : dependingFiles) { + for (const Utils::FilePath &fn : dependingFiles) { for (const CppTools::ProjectPart::Ptr &part : cppMM->projectPart(fn)) result.insert(part->buildSystemTarget); } diff --git a/src/plugins/autotest/testtreeitem.h b/src/plugins/autotest/testtreeitem.h index 287693465d..e6d47bb820 100644 --- a/src/plugins/autotest/testtreeitem.h +++ b/src/plugins/autotest/testtreeitem.h @@ -42,7 +42,7 @@ namespace { } namespace CppTools { class CppModelManager; } -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Autotest { namespace Internal { @@ -116,7 +116,7 @@ public: TestConfiguration *asConfiguration(TestRunMode mode) const; virtual QList<TestConfiguration *> getAllTestConfigurations() const; virtual QList<TestConfiguration *> getSelectedTestConfigurations() const; - virtual QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FileName &fileName) const; + virtual QList<TestConfiguration *> getTestConfigurationsForFile(const Utils::FilePath &fileName) const; virtual bool lessThan(const TestTreeItem *other, SortMode mode) const; virtual TestTreeItem *find(const TestParseResult *result) = 0; virtual TestTreeItem *findChild(const TestTreeItem *other) = 0; diff --git a/src/plugins/autotest/testtreemodel.cpp b/src/plugins/autotest/testtreemodel.cpp index 68f9ff47f2..953e93dc9c 100644 --- a/src/plugins/autotest/testtreemodel.cpp +++ b/src/plugins/autotest/testtreemodel.cpp @@ -158,7 +158,7 @@ QList<TestConfiguration *> TestTreeModel::getSelectedTests() const return result; } -QList<TestConfiguration *> TestTreeModel::getTestsForFile(const Utils::FileName &fileName) const +QList<TestConfiguration *> TestTreeModel::getTestsForFile(const Utils::FilePath &fileName) const { QList<TestConfiguration *> result; for (Utils::TreeItem *frameworkRoot : *rootItem()) diff --git a/src/plugins/autotest/testtreemodel.h b/src/plugins/autotest/testtreemodel.h index e1f271d5bc..895a9a582e 100644 --- a/src/plugins/autotest/testtreemodel.h +++ b/src/plugins/autotest/testtreemodel.h @@ -56,7 +56,7 @@ public: bool hasTests() const; QList<TestConfiguration *> getAllTestCases() const; QList<TestConfiguration *> getSelectedTests() const; - QList<TestConfiguration *> getTestsForFile(const Utils::FileName &fileName) const; + QList<TestConfiguration *> getTestsForFile(const Utils::FilePath &fileName) const; QList<TestTreeItem *> testItemsByName(const QString &testName); void syncTestFrameworks(); void rebuild(const QList<Core::Id> &frameworkIds); diff --git a/src/plugins/autotoolsprojectmanager/autogenstep.cpp b/src/plugins/autotoolsprojectmanager/autogenstep.cpp index 950982ee15..fcb6b5c9ac 100644 --- a/src/plugins/autotoolsprojectmanager/autogenstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autogenstep.cpp @@ -78,7 +78,7 @@ bool AutogenStep::init() pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(bc->target()->project()->projectDirectory()); - pp->setCommand(Utils::FileName::fromString("./autogen.sh")); + pp->setCommand(Utils::FilePath::fromString("./autogen.sh")); pp->setArguments(m_additionalArgumentsAspect->value()); pp->resolveAll(); @@ -122,7 +122,7 @@ BuildStepConfigWidget *AutogenStep::createConfigWidget() param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->target()->project()->projectDirectory()); - param.setCommand(Utils::FileName::fromString("./autogen.sh")); + param.setCommand(Utils::FilePath::fromString("./autogen.sh")); param.setArguments(m_additionalArgumentsAspect->value()); widget->setSummaryText(param.summary(displayName())); diff --git a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp index dd44dd4015..58ee0f383b 100644 --- a/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp +++ b/src/plugins/autotoolsprojectmanager/autoreconfstep.cpp @@ -76,7 +76,7 @@ bool AutoreconfStep::init() pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(bc->target()->project()->projectDirectory()); - pp->setCommand(Utils::FileName::fromString("autoreconf")); + pp->setCommand(Utils::FilePath::fromString("autoreconf")); pp->setArguments(m_additionalArgumentsAspect->value()); pp->resolveAll(); @@ -114,7 +114,7 @@ BuildStepConfigWidget *AutoreconfStep::createConfigWidget() param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->target()->project()->projectDirectory()); - param.setCommand(Utils::FileName::fromString("autoreconf")); + param.setCommand(Utils::FilePath::fromString("autoreconf")); param.setArguments(m_additionalArgumentsAspect->value()); widget->setSummaryText(param.summary(displayName())); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp index 97c37d2df2..0007ddf447 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.cpp @@ -58,7 +58,7 @@ AutotoolsBuildConfiguration::AutotoolsBuildConfiguration(Target *parent, Core::I { // /<foobar> is used so the un-changed check in setBuildDirectory() works correctly. // The leading / is to avoid the relative the path expansion in BuildConfiguration::buildDirectory. - setBuildDirectory(Utils::FileName::fromString("/<foobar>")); + setBuildDirectory(Utils::FilePath::fromString("/<foobar>")); setBuildDirectoryHistoryCompleter("AutoTools.BuildDir.History"); setConfigWidgetDisplayName(tr("Autotools Manager")); } @@ -116,14 +116,14 @@ QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableBuilds(const Targe QList<BuildInfo> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const { const QString path = QFileInfo(projectPath).absolutePath(); - BuildInfo info = createBuildInfo(k, Utils::FileName::fromString(path)); + BuildInfo info = createBuildInfo(k, Utils::FilePath::fromString(path)); //: The name of the build configuration created by default for a autotools project. info.displayName = tr("Default"); return {info}; } BuildInfo AutotoolsBuildConfigurationFactory::createBuildInfo(const Kit *k, - const Utils::FileName &buildDir) const + const Utils::FilePath &buildDir) const { BuildInfo info(this); info.typeName = tr("Build"); diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h index b2f02cbd0e..ec33f6a224 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildconfiguration.h @@ -29,7 +29,7 @@ #include <projectexplorer/buildconfiguration.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace AutotoolsProjectManager { namespace Internal { @@ -57,7 +57,7 @@ private: QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const override; - ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FileName &buildDir) const; + ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const; }; } // namespace Internal diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp index a6c48db149..baafa22bfa 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp @@ -68,7 +68,7 @@ using namespace AutotoolsProjectManager; using namespace AutotoolsProjectManager::Internal; using namespace ProjectExplorer; -AutotoolsProject::AutotoolsProject(const Utils::FileName &fileName) : +AutotoolsProject::AutotoolsProject(const Utils::FilePath &fileName) : Project(Constants::MAKEFILE_MIMETYPE, fileName), m_fileWatcher(new Utils::FileSystemWatcher(this)), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater) @@ -204,7 +204,7 @@ void AutotoolsProject::makefileParsingFinished() auto newRoot = std::make_unique<ProjectNode>(projectDirectory()); for (const QString &f : m_files) { - const Utils::FileName path = Utils::FileName::fromString(f); + const Utils::FilePath path = Utils::FilePath::fromString(f); newRoot->addNestedNode(std::make_unique<FileNode>(path, FileNode::fileTypeForFileName(path))); } diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.h b/src/plugins/autotoolsprojectmanager/autotoolsproject.h index 66c3dc45af..fcd81d093b 100644 --- a/src/plugins/autotoolsprojectmanager/autotoolsproject.h +++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.h @@ -53,7 +53,7 @@ class AutotoolsProject : public ProjectExplorer::Project Q_OBJECT public: - explicit AutotoolsProject(const Utils::FileName &fileName); + explicit AutotoolsProject(const Utils::FilePath &fileName); ~AutotoolsProject() override; QStringList buildTargets() const; diff --git a/src/plugins/autotoolsprojectmanager/configurestep.cpp b/src/plugins/autotoolsprojectmanager/configurestep.cpp index 8cda28566d..91b72eb4af 100644 --- a/src/plugins/autotoolsprojectmanager/configurestep.cpp +++ b/src/plugins/autotoolsprojectmanager/configurestep.cpp @@ -98,7 +98,7 @@ bool ConfigureStep::init() pp->setMacroExpander(bc->macroExpander()); pp->setEnvironment(bc->environment()); pp->setWorkingDirectory(bc->buildDirectory()); - pp->setCommand(Utils::FileName::fromString(projectDirRelativeToBuildDir(bc) + "configure")); + pp->setCommand(Utils::FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure")); pp->setArguments(m_additionalArgumentsAspect->value()); pp->resolveAll(); @@ -159,7 +159,7 @@ void ConfigureStep::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setEnvironment(bc->environment()); param.setWorkingDirectory(bc->buildDirectory()); - param.setCommand(Utils::FileName::fromString(projectDirRelativeToBuildDir(bc) + "configure")); + param.setCommand(Utils::FilePath::fromString(projectDirRelativeToBuildDir(bc) + "configure")); param.setArguments(m_additionalArgumentsAspect->value()); m_widget->setSummaryText(param.summaryInWorkdir(displayName())); diff --git a/src/plugins/baremetal/gdbserverprovidermanager.cpp b/src/plugins/baremetal/gdbserverprovidermanager.cpp index 3a72942dd3..16758ee30c 100644 --- a/src/plugins/baremetal/gdbserverprovidermanager.cpp +++ b/src/plugins/baremetal/gdbserverprovidermanager.cpp @@ -53,7 +53,7 @@ static GdbServerProviderManager *m_instance = nullptr; // GdbServerProviderManager GdbServerProviderManager::GdbServerProviderManager() - : m_configFile(Utils::FileName::fromString(Core::ICore::userResourcePath() + fileNameKeyC)) + : m_configFile(Utils::FilePath::fromString(Core::ICore::userResourcePath() + fileNameKeyC)) , m_factories({new DefaultGdbServerProviderFactory, new OpenOcdGdbServerProviderFactory, new StLinkUtilGdbServerProviderFactory}) diff --git a/src/plugins/baremetal/gdbserverprovidermanager.h b/src/plugins/baremetal/gdbserverprovidermanager.h index 0f3132c96b..64bd6df409 100644 --- a/src/plugins/baremetal/gdbserverprovidermanager.h +++ b/src/plugins/baremetal/gdbserverprovidermanager.h @@ -73,7 +73,7 @@ private: Utils::PersistentSettingsWriter *m_writer = nullptr; QList<GdbServerProvider *> m_providers; - const Utils::FileName m_configFile; + const Utils::FilePath m_configFile; const QList<GdbServerProviderFactory *> m_factories; friend class BareMetalPlugin; // for restoreProviders diff --git a/src/plugins/baremetal/iarewparser.cpp b/src/plugins/baremetal/iarewparser.cpp index 532126cabd..50e25706ca 100644 --- a/src/plugins/baremetal/iarewparser.cpp +++ b/src/plugins/baremetal/iarewparser.cpp @@ -97,7 +97,7 @@ void IarParser::amendFilePath() QString filePath; while (!m_filePathParts.isEmpty()) filePath.append(m_filePathParts.takeFirst().trimmed()); - m_lastTask.setFile(Utils::FileName::fromUserInput(filePath)); + m_lastTask.setFile(Utils::FilePath::fromUserInput(filePath)); m_expectFilePath = false; } @@ -154,7 +154,7 @@ void IarParser::stdError(const QString &line) if (match.hasMatch()) { enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, MessageTypeIndex, MessageCodeIndex }; - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); @@ -271,7 +271,7 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString() << (Tasks() << Task(Task::Error, QLatin1String("Error in command line: Some error"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -286,7 +286,7 @@ void BareMetalPlugin::testIarOutputParsers_data() " Some warning \"foo\" bar\n") << (Tasks() << Task(Task::Warning, QLatin1String("[Pe223]: Some warning \"foo\" bar"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -306,7 +306,7 @@ void BareMetalPlugin::testIarOutputParsers_data() QLatin1String("[Pe223]: Some warning\n" " some_detail;\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -322,7 +322,7 @@ void BareMetalPlugin::testIarOutputParsers_data() " , split\n") << (Tasks() << Task(Task::Warning, QLatin1String("[Pe223]: Some warning, split"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -336,7 +336,7 @@ void BareMetalPlugin::testIarOutputParsers_data() " Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("[Pe223]: Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -356,7 +356,7 @@ void BareMetalPlugin::testIarOutputParsers_data() QLatin1String("[Pe223]: Some error\n" " some_detail;\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -372,7 +372,7 @@ void BareMetalPlugin::testIarOutputParsers_data() " , split\n") << (Tasks() << Task(Task::Error, QLatin1String("[Pe223]: Some error, split"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -390,7 +390,7 @@ void BareMetalPlugin::testIarOutputParsers_data() "]\n") << (Tasks() << Task(Task::Error, QLatin1String("[Li005]: Some error \"foo\""), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\bar\\main.c.o")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\bar\\main.c.o")), -1, categoryCompile)) << QString(); @@ -410,7 +410,7 @@ void BareMetalPlugin::testIarOutputParsers_data() QLatin1String("[Su011]: Some error:\n" " c:\\foo.c\n" " c:\\bar.c"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -422,7 +422,7 @@ void BareMetalPlugin::testIarOutputParsers_data() << QString::fromLatin1("At end of source Error[Pe040]: Some error \";\"\n") << (Tasks() << Task(Task::Error, QLatin1String("[Pe040]: Some error \";\""), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); diff --git a/src/plugins/baremetal/iarewtoolchain.cpp b/src/plugins/baremetal/iarewtoolchain.cpp index a635ec90e4..1955a0fec7 100644 --- a/src/plugins/baremetal/iarewtoolchain.cpp +++ b/src/plugins/baremetal/iarewtoolchain.cpp @@ -60,13 +60,13 @@ namespace Internal { static const char compilerCommandKeyC[] = "BareMetal.IarToolChain.CompilerPath"; static const char targetAbiKeyC[] = "BareMetal.IarToolChain.TargetAbi"; -static bool compilerExists(const FileName &compilerPath) +static bool compilerExists(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); return fi.exists() && fi.isExecutable() && fi.isFile(); } -static Macros dumpPredefinedMacros(const FileName &compiler, const Core::Id languageId, +static Macros dumpPredefinedMacros(const FilePath &compiler, const Core::Id languageId, const QStringList &env) { if (compiler.isEmpty() || !compiler.toFileInfo().isExecutable()) @@ -108,7 +108,7 @@ static Macros dumpPredefinedMacros(const FileName &compiler, const Core::Id lang return Macro::toMacros(output); } -static HeaderPaths dumpHeaderPaths(const FileName &compiler, const Core::Id languageId, +static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const Core::Id languageId, const QStringList &env) { if (!compiler.exists()) @@ -257,7 +257,7 @@ ToolChain::MacroInspectionRunner IarToolChain::createMacroInspectionRunner() con Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const Core::Id languageId = language(); MacrosCache macrosCache = predefinedMacrosCache(); @@ -299,7 +299,7 @@ ToolChain::BuiltInHeaderPathsRunner IarToolChain::createBuiltInHeaderPathsRunner Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const Core::Id languageId = language(); HeaderPathsCache headerPaths = headerPathsCache(); @@ -318,7 +318,7 @@ ToolChain::BuiltInHeaderPathsRunner IarToolChain::createBuiltInHeaderPathsRunner } HeaderPaths IarToolChain::builtInHeaderPaths(const QStringList &cxxFlags, - const FileName &fileName) const + const FilePath &fileName) const { return createBuiltInHeaderPathsRunner()(cxxFlags, fileName.toString(), ""); } @@ -326,7 +326,7 @@ HeaderPaths IarToolChain::builtInHeaderPaths(const QStringList &cxxFlags, void IarToolChain::addToEnvironment(Environment &env) const { if (!m_compilerCommand.isEmpty()) { - const FileName path = m_compilerCommand.parentDir(); + const FilePath path = m_compilerCommand.parentDir(); env.prependOrSetPath(path.toString()); } } @@ -348,7 +348,7 @@ bool IarToolChain::fromMap(const QVariantMap &data) { if (!ToolChain::fromMap(data)) return false; - m_compilerCommand = FileName::fromString(data.value(compilerCommandKeyC).toString()); + m_compilerCommand = FilePath::fromString(data.value(compilerCommandKeyC).toString()); m_targetAbi = Abi::fromString(data.value(targetAbiKeyC).toString()); return true; } @@ -369,7 +369,7 @@ bool IarToolChain::operator==(const ToolChain &other) const ; } -void IarToolChain::setCompilerCommand(const FileName &file) +void IarToolChain::setCompilerCommand(const FilePath &file) { if (file == m_compilerCommand) return; @@ -377,12 +377,12 @@ void IarToolChain::setCompilerCommand(const FileName &file) toolChainUpdated(); } -FileName IarToolChain::compilerCommand() const +FilePath IarToolChain::compilerCommand() const { return m_compilerCommand; } -FileName IarToolChain::makeCommand(const Environment &env) const +FilePath IarToolChain::makeCommand(const Environment &env) const { Q_UNUSED(env) return {}; @@ -575,7 +575,7 @@ void IarToolChainConfigWidget::setFromToolchain() void IarToolChainConfigWidget::handleCompilerCommandChange() { - const FileName compilerPath = m_compilerCommand->fileName(); + const FilePath compilerPath = m_compilerCommand->fileName(); const bool haveCompiler = compilerExists(compilerPath); if (haveCompiler) { const auto env = Environment::systemEnvironment(); diff --git a/src/plugins/baremetal/iarewtoolchain.h b/src/plugins/baremetal/iarewtoolchain.h index 8f0f179157..019c9e7185 100644 --- a/src/plugins/baremetal/iarewtoolchain.h +++ b/src/plugins/baremetal/iarewtoolchain.h @@ -36,7 +36,7 @@ class QTextEdit; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; class PathChooser; } @@ -67,7 +67,7 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const final; ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags, - const Utils::FileName &) const final; + const Utils::FilePath &) const final; void addToEnvironment(Utils::Environment &env) const final; ProjectExplorer::IOutputParser *outputParser() const final; @@ -78,16 +78,16 @@ public: bool operator ==(const ToolChain &other) const final; - void setCompilerCommand(const Utils::FileName &file); - Utils::FileName compilerCommand() const final; + void setCompilerCommand(const Utils::FilePath &file); + Utils::FilePath compilerCommand() const final; - Utils::FileName makeCommand(const Utils::Environment &env) const final; + Utils::FilePath makeCommand(const Utils::Environment &env) const final; private: IarToolChain(); ProjectExplorer::Abi m_targetAbi; - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; friend class IarToolChainFactory; friend class IarToolChainConfigWidget; diff --git a/src/plugins/baremetal/keilparser.cpp b/src/plugins/baremetal/keilparser.cpp index 67b4d18641..c1f8c34731 100644 --- a/src/plugins/baremetal/keilparser.cpp +++ b/src/plugins/baremetal/keilparser.cpp @@ -102,7 +102,7 @@ void KeilParser::stdError(const QString &line) if (match.hasMatch()) { enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, MessageTypeIndex, MessageNoteIndex, DescriptionIndex }; - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); @@ -149,7 +149,7 @@ void KeilParser::stdOutput(const QString &line) FilePathIndex, MessageTextIndex }; const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const QString descr = QString("%1: %2").arg(match.captured(MessageCodeIndex), match.captured(MessageTextIndex)); @@ -164,7 +164,7 @@ void KeilParser::stdOutput(const QString &line) FilePathIndex, MessageTextIndex }; const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const QString descr = QString("%1: %2").arg(match.captured(MessageCodeIndex), match.captured(MessageTextIndex)); @@ -261,7 +261,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Warning: #1234: Some warning\n") << (Tasks() << Task(Task::Warning, QLatin1String("#1234: Some warning"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -279,7 +279,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() QLatin1String("#1234: Some warning\n" " int f;\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -291,7 +291,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("\"c:\\foo\\main.c\", line 63: Error: #1234: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("#1234: Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -303,7 +303,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("\"flash.sct\", line 51 (column 20): Error: L1234: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("L1234: Some error"), - Utils::FileName::fromUserInput(QLatin1String("flash.sct")), + Utils::FilePath::fromUserInput(QLatin1String("flash.sct")), 51, categoryCompile)) << QString(); @@ -321,7 +321,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() QLatin1String("#1234: Some error\n" " int f;\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -333,7 +333,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("\"c:\\foo\\main.c\", line 71: Error: At end of source: #40: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("#40: Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 71, categoryCompile)) << QString(); @@ -345,7 +345,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString::fromLatin1("Error: L6226E: Some error.\n") << (Tasks() << Task(Task::Error, QLatin1String("L6226E: Some error."), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -360,7 +360,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("#A9: Some warning"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), 15, categoryCompile)) << QString(); @@ -372,7 +372,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Error, QLatin1String("#A9: Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\dscr.a51")), 15, categoryCompile)) << QString(); @@ -390,7 +390,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() QLatin1String("Assembler fatal error\n" " Some detail 1\n" " Some detail N"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -403,7 +403,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("C123: Some warning"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), 13, categoryCompile)) << QString(); @@ -415,7 +415,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("C123: Some warning : 'extended text'"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), 13, categoryCompile)) << QString(); @@ -427,7 +427,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Error, QLatin1String("C123: Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), 13, categoryCompile)) << QString(); @@ -439,7 +439,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Error, QLatin1String("C123: Some error : 'extended text'"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo.c")), 13, categoryCompile)) << QString(); @@ -457,7 +457,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() QLatin1String("Compiler fatal error\n" " Some detail 1\n" " Some detail N"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -470,7 +470,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() << QString() << (Tasks() << Task(Task::Error, QLatin1String("L456: Some error"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -488,7 +488,7 @@ void BareMetalPlugin::testKeilOutputParsers_data() QLatin1String("L456: Some error\n" " Some detail 1\n" " Some detail N"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); diff --git a/src/plugins/baremetal/keiltoolchain.cpp b/src/plugins/baremetal/keiltoolchain.cpp index ef93a76b5e..303efa3440 100644 --- a/src/plugins/baremetal/keiltoolchain.cpp +++ b/src/plugins/baremetal/keiltoolchain.cpp @@ -62,13 +62,13 @@ namespace Internal { static const char compilerCommandKeyC[] = "BareMetal.KeilToolchain.CompilerPath"; static const char targetAbiKeyC[] = "BareMetal.KeilToolchain.TargetAbi"; -static bool compilerExists(const FileName &compilerPath) +static bool compilerExists(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); return fi.exists() && fi.isExecutable() && fi.isFile(); } -static Abi::Architecture guessArchitecture(const FileName &compilerPath) +static Abi::Architecture guessArchitecture(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); const QString bn = fi.baseName().toLower(); @@ -82,7 +82,7 @@ static Abi::Architecture guessArchitecture(const FileName &compilerPath) // Note: The KEIL 8051 compiler does not support the predefined // macros dumping. So, we do it with following trick where we try // to compile a temporary file and to parse the console output. -static Macros dumpC51PredefinedMacros(const FileName &compiler, const QStringList &env) +static Macros dumpC51PredefinedMacros(const FilePath &compiler, const QStringList &env) { QTemporaryFile fakeIn; if (!fakeIn.open()) @@ -125,7 +125,7 @@ static Macros dumpC51PredefinedMacros(const FileName &compiler, const QStringLis return macros; } -static Macros dumpArmPredefinedMacros(const FileName &compiler, const QStringList &env) +static Macros dumpArmPredefinedMacros(const FilePath &compiler, const QStringList &env) { SynchronousProcess cpp; cpp.setEnvironment(env); @@ -146,7 +146,7 @@ static Macros dumpArmPredefinedMacros(const FileName &compiler, const QStringLis return Macro::toMacros(output); } -static Macros dumpPredefinedMacros(const FileName &compiler, const QStringList &env) +static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &env) { if (compiler.isEmpty() || !compiler.toFileInfo().isExecutable()) return {}; @@ -162,7 +162,7 @@ static Macros dumpPredefinedMacros(const FileName &compiler, const QStringList & } } -static HeaderPaths dumpHeaderPaths(const FileName &compiler) +static HeaderPaths dumpHeaderPaths(const FilePath &compiler) { if (!compiler.exists()) return {}; @@ -271,7 +271,7 @@ ToolChain::MacroInspectionRunner KeilToolchain::createMacroInspectionRunner() co Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const Core::Id lang = language(); MacrosCache macroCache = predefinedMacrosCache(); @@ -306,7 +306,7 @@ WarningFlags KeilToolchain::warningFlags(const QStringList &cxxflags) const ToolChain::BuiltInHeaderPathsRunner KeilToolchain::createBuiltInHeaderPathsRunner() const { - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; HeaderPathsCache headerPaths = headerPathsCache(); @@ -323,7 +323,7 @@ ToolChain::BuiltInHeaderPathsRunner KeilToolchain::createBuiltInHeaderPathsRunne } HeaderPaths KeilToolchain::builtInHeaderPaths(const QStringList &cxxFlags, - const FileName &fileName) const + const FilePath &fileName) const { return createBuiltInHeaderPathsRunner()(cxxFlags, fileName.toString(), ""); } @@ -331,7 +331,7 @@ HeaderPaths KeilToolchain::builtInHeaderPaths(const QStringList &cxxFlags, void KeilToolchain::addToEnvironment(Environment &env) const { if (!m_compilerCommand.isEmpty()) { - const FileName path = m_compilerCommand.parentDir(); + const FilePath path = m_compilerCommand.parentDir(); env.prependOrSetPath(path.toString()); } } @@ -353,7 +353,7 @@ bool KeilToolchain::fromMap(const QVariantMap &data) { if (!ToolChain::fromMap(data)) return false; - m_compilerCommand = FileName::fromString(data.value(compilerCommandKeyC).toString()); + m_compilerCommand = FilePath::fromString(data.value(compilerCommandKeyC).toString()); m_targetAbi = Abi::fromString(data.value(targetAbiKeyC).toString()); return true; } @@ -374,7 +374,7 @@ bool KeilToolchain::operator ==(const ToolChain &other) const ; } -void KeilToolchain::setCompilerCommand(const FileName &file) +void KeilToolchain::setCompilerCommand(const FilePath &file) { if (file == m_compilerCommand) return; @@ -382,12 +382,12 @@ void KeilToolchain::setCompilerCommand(const FileName &file) toolChainUpdated(); } -FileName KeilToolchain::compilerCommand() const +FilePath KeilToolchain::compilerCommand() const { return m_compilerCommand; } -FileName KeilToolchain::makeCommand(const Environment &env) const +FilePath KeilToolchain::makeCommand(const Environment &env) const { Q_UNUSED(env) return {}; @@ -441,7 +441,7 @@ QList<ToolChain *> KeilToolchainFactory::autoDetect(const QList<ToolChain *> &al if (!compilerPath.isEmpty()) { // Build full compiler path. compilerPath += entry.subExePath; - const FileName fn = FileName::fromString(compilerPath); + const FilePath fn = FilePath::fromString(compilerPath); if (compilerExists(fn)) { QString version = registry.value("Version").toString(); if (version.startsWith('V')) @@ -579,7 +579,7 @@ void KeilToolchainConfigWidget::setFromToolchain() void KeilToolchainConfigWidget::handleCompilerCommandChange() { - const FileName compilerPath = m_compilerCommand->fileName(); + const FilePath compilerPath = m_compilerCommand->fileName(); const bool haveCompiler = compilerExists(compilerPath); if (haveCompiler) { const auto env = Environment::systemEnvironment(); diff --git a/src/plugins/baremetal/keiltoolchain.h b/src/plugins/baremetal/keiltoolchain.h index a493d5a993..5ccf9e05ff 100644 --- a/src/plugins/baremetal/keiltoolchain.h +++ b/src/plugins/baremetal/keiltoolchain.h @@ -36,7 +36,7 @@ class QTextEdit; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; class PathChooser; } @@ -67,7 +67,7 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const final; ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags, - const Utils::FileName &) const final; + const Utils::FilePath &) const final; void addToEnvironment(Utils::Environment &env) const final; ProjectExplorer::IOutputParser *outputParser() const final; @@ -78,16 +78,16 @@ public: bool operator ==(const ToolChain &other) const final; - void setCompilerCommand(const Utils::FileName &file); - Utils::FileName compilerCommand() const final; + void setCompilerCommand(const Utils::FilePath &file); + Utils::FilePath compilerCommand() const final; - Utils::FileName makeCommand(const Utils::Environment &env) const final; + Utils::FilePath makeCommand(const Utils::Environment &env) const final; private: KeilToolchain(); ProjectExplorer::Abi m_targetAbi; - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; friend class KeilToolchainFactory; friend class KeilToolchainConfigWidget; diff --git a/src/plugins/baremetal/openocdgdbserverprovider.cpp b/src/plugins/baremetal/openocdgdbserverprovider.cpp index f97eb22839..7417f1476a 100644 --- a/src/plugins/baremetal/openocdgdbserverprovider.cpp +++ b/src/plugins/baremetal/openocdgdbserverprovider.cpp @@ -348,9 +348,9 @@ void OpenOcdGdbServerProviderConfigWidget::setFromProvider() startupModeChanged(); m_hostWidget->setHost(p->m_host); m_hostWidget->setPort(p->m_port); - m_executableFileChooser->setFileName(Utils::FileName::fromString(p->m_executableFile)); - m_rootScriptsDirChooser->setFileName(Utils::FileName::fromString(p->m_rootScriptsDir)); - m_configurationFileChooser->setFileName(Utils::FileName::fromString(p->m_configurationFile)); + m_executableFileChooser->setFileName(Utils::FilePath::fromString(p->m_executableFile)); + m_rootScriptsDirChooser->setFileName(Utils::FilePath::fromString(p->m_rootScriptsDir)); + m_configurationFileChooser->setFileName(Utils::FilePath::fromString(p->m_configurationFile)); m_additionalArgumentsLineEdit->setText(p->m_additionalArguments); m_initCommandsTextEdit->setPlainText(p->initCommands()); m_resetCommandsTextEdit->setPlainText(p->resetCommands()); diff --git a/src/plugins/baremetal/sdccparser.cpp b/src/plugins/baremetal/sdccparser.cpp index d1575bce89..e84021dd7b 100644 --- a/src/plugins/baremetal/sdccparser.cpp +++ b/src/plugins/baremetal/sdccparser.cpp @@ -100,7 +100,7 @@ void SdccParser::stdError(const QString &line) if (match.hasMatch()) { enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, MessageTypeIndex, MessageCodeIndex, MessageTextIndex }; - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); @@ -115,7 +115,7 @@ void SdccParser::stdError(const QString &line) if (match.hasMatch()) { enum CaptureIndex { FilePathIndex = 1, LineNumberIndex, MessageTypeIndex, MessageTextIndex }; - const Utils::FileName fileName = Utils::FileName::fromUserInput( + const Utils::FilePath fileName = Utils::FilePath::fromUserInput( match.captured(FilePathIndex)); const int lineno = match.captured(LineNumberIndex).toInt(); const Task::TaskType type = taskType(match.captured(MessageTypeIndex)); @@ -215,7 +215,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("c:\\foo\\main.c:63: warning 123: Some warning\n") << (Tasks() << Task(Task::Warning, QLatin1String("Some warning"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -233,7 +233,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() QLatin1String("Some warning\n" "details #1\n" " details #2"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -245,7 +245,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("c:\\foo\\main.c:63: error 123: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -263,7 +263,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() QLatin1String("Some error\n" "details #1\n" " details #2"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -275,7 +275,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("c:\\foo\\main.c:63: syntax error: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("Some error"), - Utils::FileName::fromUserInput(QLatin1String("c:\\foo\\main.c")), + Utils::FilePath::fromUserInput(QLatin1String("c:\\foo\\main.c")), 63, categoryCompile)) << QString(); @@ -287,7 +287,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("at 1: error 123: Some error\n") << (Tasks() << Task(Task::Error, QLatin1String("Some error"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -299,7 +299,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("?ASlink-Warning-Couldn't find library 'foo.lib'\n") << (Tasks() << Task(Task::Warning, QLatin1String("Couldn't find library 'foo.lib'"), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -311,7 +311,7 @@ void BareMetalPlugin::testSdccOutputParsers_data() << QString::fromLatin1("?ASlink-Error-<cannot open> : \"foo.rel\"\n") << (Tasks() << Task(Task::Error, QLatin1String("<cannot open> : \"foo.rel\""), - Utils::FileName(), + Utils::FilePath(), -1, categoryCompile)) << QString(); diff --git a/src/plugins/baremetal/sdcctoolchain.cpp b/src/plugins/baremetal/sdcctoolchain.cpp index abfc7a804a..b839a68fe8 100644 --- a/src/plugins/baremetal/sdcctoolchain.cpp +++ b/src/plugins/baremetal/sdcctoolchain.cpp @@ -61,7 +61,7 @@ namespace Internal { static const char compilerCommandKeyC[] = "BareMetal.SdccToolChain.CompilerPath"; static const char targetAbiKeyC[] = "BareMetal.SdccToolChain.TargetAbi"; -static bool compilerExists(const FileName &compilerPath) +static bool compilerExists(const FilePath &compilerPath) { const QFileInfo fi = compilerPath.toFileInfo(); return fi.exists() && fi.isExecutable() && fi.isFile(); @@ -77,7 +77,7 @@ static QString compilerTargetFlag(const Abi &abi) } } -static Macros dumpPredefinedMacros(const FileName &compiler, const QStringList &env, +static Macros dumpPredefinedMacros(const FilePath &compiler, const QStringList &env, const Abi &abi) { if (compiler.isEmpty() || !compiler.toFileInfo().isExecutable()) @@ -109,7 +109,7 @@ static Macros dumpPredefinedMacros(const FileName &compiler, const QStringList & return Macro::toMacros(output); } -static HeaderPaths dumpHeaderPaths(const FileName &compiler, const QStringList &env, +static HeaderPaths dumpHeaderPaths(const FilePath &compiler, const QStringList &env, const Abi &abi) { if (!compiler.exists()) @@ -208,7 +208,7 @@ static QString buildDisplayName(Abi::Architecture arch, Core::Id language, .arg(version, langName, archName); } -static Utils::FileName compilerPathFromEnvironment(const QString &compilerName) +static Utils::FilePath compilerPathFromEnvironment(const QString &compilerName) { const Environment systemEnvironment = Environment::systemEnvironment(); return systemEnvironment.searchInPath(compilerName); @@ -248,7 +248,7 @@ ToolChain::MacroInspectionRunner SdccToolChain::createMacroInspectionRunner() co Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const Core::Id lang = language(); const Abi abi = m_targetAbi; @@ -288,7 +288,7 @@ ToolChain::BuiltInHeaderPathsRunner SdccToolChain::createBuiltInHeaderPathsRunne Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const Core::Id languageId = language(); const Abi abi = m_targetAbi; @@ -308,7 +308,7 @@ ToolChain::BuiltInHeaderPathsRunner SdccToolChain::createBuiltInHeaderPathsRunne } HeaderPaths SdccToolChain::builtInHeaderPaths(const QStringList &cxxFlags, - const FileName &fileName) const + const FilePath &fileName) const { return createBuiltInHeaderPathsRunner()(cxxFlags, fileName.toString(), ""); } @@ -316,7 +316,7 @@ HeaderPaths SdccToolChain::builtInHeaderPaths(const QStringList &cxxFlags, void SdccToolChain::addToEnvironment(Environment &env) const { if (!m_compilerCommand.isEmpty()) { - const FileName path = m_compilerCommand.parentDir(); + const FilePath path = m_compilerCommand.parentDir(); env.prependOrSetPath(path.toString()); } } @@ -338,7 +338,7 @@ bool SdccToolChain::fromMap(const QVariantMap &data) { if (!ToolChain::fromMap(data)) return false; - m_compilerCommand = FileName::fromString(data.value(compilerCommandKeyC).toString()); + m_compilerCommand = FilePath::fromString(data.value(compilerCommandKeyC).toString()); m_targetAbi = Abi::fromString(data.value(targetAbiKeyC).toString()); return true; } @@ -359,7 +359,7 @@ bool SdccToolChain::operator==(const ToolChain &other) const ; } -void SdccToolChain::setCompilerCommand(const FileName &file) +void SdccToolChain::setCompilerCommand(const FilePath &file) { if (file == m_compilerCommand) return; @@ -367,12 +367,12 @@ void SdccToolChain::setCompilerCommand(const FileName &file) toolChainUpdated(); } -FileName SdccToolChain::compilerCommand() const +FilePath SdccToolChain::compilerCommand() const { return m_compilerCommand; } -FileName SdccToolChain::makeCommand(const Environment &env) const +FilePath SdccToolChain::makeCommand(const Environment &env) const { Q_UNUSED(env) return {}; @@ -406,7 +406,7 @@ QList<ToolChain *> SdccToolChainFactory::autoDetect(const QList<ToolChain *> &al if (!compilerPath.isEmpty()) { // Build full compiler path. compilerPath += "\\bin\\sdcc.exe"; - const FileName fn = FileName::fromString( + const FilePath fn = FilePath::fromString( QFileInfo(compilerPath).absoluteFilePath()); if (compilerExists(fn)) { // Build compiler version. @@ -419,7 +419,7 @@ QList<ToolChain *> SdccToolChainFactory::autoDetect(const QList<ToolChain *> &al } } - const FileName fn = compilerPathFromEnvironment("sdcc"); + const FilePath fn = compilerPathFromEnvironment("sdcc"); if (fn.exists()) { const auto env = Environment::systemEnvironment(); const auto macros = dumpPredefinedMacros(fn, env.toStringList(), {}); @@ -547,7 +547,7 @@ void SdccToolChainConfigWidget::setFromToolchain() void SdccToolChainConfigWidget::handleCompilerCommandChange() { - const FileName compilerPath = m_compilerCommand->fileName(); + const FilePath compilerPath = m_compilerCommand->fileName(); const bool haveCompiler = compilerExists(compilerPath); if (haveCompiler) { const auto env = Environment::systemEnvironment(); diff --git a/src/plugins/baremetal/sdcctoolchain.h b/src/plugins/baremetal/sdcctoolchain.h index 6e76e96aae..15ed599524 100644 --- a/src/plugins/baremetal/sdcctoolchain.h +++ b/src/plugins/baremetal/sdcctoolchain.h @@ -36,7 +36,7 @@ class QTextEdit; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; class PathChooser; } @@ -67,7 +67,7 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const final; ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags, - const Utils::FileName &) const final; + const Utils::FilePath &) const final; void addToEnvironment(Utils::Environment &env) const final; ProjectExplorer::IOutputParser *outputParser() const final; @@ -78,16 +78,16 @@ public: bool operator ==(const ToolChain &other) const final; - void setCompilerCommand(const Utils::FileName &file); - Utils::FileName compilerCommand() const final; + void setCompilerCommand(const Utils::FilePath &file); + Utils::FilePath compilerCommand() const final; - Utils::FileName makeCommand(const Utils::Environment &env) const final; + Utils::FilePath makeCommand(const Utils::Environment &env) const final; private: SdccToolChain(); ProjectExplorer::Abi m_targetAbi; - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; friend class SdccToolChainFactory; friend class SdccToolChainConfigWidget; diff --git a/src/plugins/baremetal/stlinkutilgdbserverprovider.cpp b/src/plugins/baremetal/stlinkutilgdbserverprovider.cpp index db3f26f40d..a8e32f1c99 100644 --- a/src/plugins/baremetal/stlinkutilgdbserverprovider.cpp +++ b/src/plugins/baremetal/stlinkutilgdbserverprovider.cpp @@ -393,7 +393,7 @@ void StLinkUtilGdbServerProviderConfigWidget::setFromProvider() startupModeChanged(); m_hostWidget->setHost(p->m_host); m_hostWidget->setPort(p->m_port); - m_executableFileChooser->setFileName(Utils::FileName::fromString(p->m_executableFile)); + m_executableFileChooser->setFileName(Utils::FilePath::fromString(p->m_executableFile)); m_verboseLevelSpinBox->setValue(p->m_verboseLevel); m_extendedModeCheckBox->setChecked(p->m_extendedMode); m_resetBoardCheckBox->setChecked(p->m_resetBoard); diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index f9941b2966..a60c7f331e 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -178,7 +178,7 @@ VcsBaseEditorWidget *BazaarClient::annotate( QStringList(extraOptions) << QLatin1String("--long")); } -bool BazaarClient::isVcsDirectory(const FileName &fileName) const +bool BazaarClient::isVcsDirectory(const FilePath &fileName) const { return fileName.toFileInfo().isDir() && !fileName.fileName().compare(Constants::BAZAARREPO, HostOsInfo::fileNameCaseSensitivity()); diff --git a/src/plugins/bazaar/bazaarclient.h b/src/plugins/bazaar/bazaarclient.h index 21750daf22..78d1ca5b35 100644 --- a/src/plugins/bazaar/bazaarclient.h +++ b/src/plugins/bazaar/bazaarclient.h @@ -52,7 +52,7 @@ public: VcsBase::VcsBaseEditorWidget *annotate( const QString &workingDir, const QString &file, const QString &revision = QString(), int lineNumber = -1, const QStringList &extraOptions = QStringList()) override; - bool isVcsDirectory(const Utils::FileName &fileName) const; + bool isVcsDirectory(const Utils::FilePath &fileName) const; QString findTopLevelForFile(const QFileInfo &file) const override; bool managesFile(const QString &workingDirectory, const QString &fileName) const; void view(const QString &source, const QString &id, diff --git a/src/plugins/bazaar/bazaarcontrol.cpp b/src/plugins/bazaar/bazaarcontrol.cpp index 3db806cf0c..7b38aa971c 100644 --- a/src/plugins/bazaar/bazaarcontrol.cpp +++ b/src/plugins/bazaar/bazaarcontrol.cpp @@ -52,7 +52,7 @@ Core::Id BazaarControl::id() const return Core::Id(VcsBase::Constants::VCS_ID_BAZAAR); } -bool BazaarControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool BazaarControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { return m_bazaarClient->isVcsDirectory(fileName); } @@ -73,7 +73,7 @@ bool BazaarControl::managesFile(const QString &workingDirectory, const QString & bool BazaarControl::isConfigured() const { - const Utils::FileName binary = m_bazaarClient->vcsBinary(); + const Utils::FilePath binary = m_bazaarClient->vcsBinary(); if (binary.isEmpty()) return false; QFileInfo fi = binary.toFileInfo(); @@ -139,7 +139,7 @@ bool BazaarControl::vcsAnnotate(const QString &file, int line) } Core::ShellCommand *BazaarControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/bazaar/bazaarcontrol.h b/src/plugins/bazaar/bazaarcontrol.h index ced12c9a79..d0d5b514d6 100644 --- a/src/plugins/bazaar/bazaarcontrol.h +++ b/src/plugins/bazaar/bazaarcontrol.h @@ -48,7 +48,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &filename, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; @@ -62,7 +62,7 @@ public: bool vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; diff --git a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp index 65f20cb125..2788214fee 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstyle.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstyle.cpp @@ -103,8 +103,8 @@ QString ArtisticStyle::configurationFile() const if (m_settings.useOtherFiles()) { if (const ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject()) { - const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles); - for (const Utils::FileName &file : files) { + const Utils::FilePathList files = project->files(ProjectExplorer::Project::AllFiles); + for (const Utils::FilePath &file : files) { if (!file.endsWith(".astylerc")) continue; const QFileInfo fi = file.toFileInfo(); @@ -115,7 +115,7 @@ QString ArtisticStyle::configurationFile() const } if (m_settings.useSpecificConfigFile()) { - const Utils::FileName file = m_settings.specificConfigFile(); + const Utils::FilePath file = m_settings.specificConfigFile(); if (file.exists()) return file.toUserOutput(); } diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp index c6b9c60f07..41ba9270aa 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp +++ b/src/plugins/beautifier/artisticstyle/artisticstylesettings.cpp @@ -131,12 +131,12 @@ void ArtisticStyleSettings::setUseSpecificConfigFile(bool useSpecificConfigFile) m_settings.insert(USE_SPECIFIC_CONFIG_FILE, QVariant(useSpecificConfigFile)); } -Utils::FileName ArtisticStyleSettings::specificConfigFile() const +Utils::FilePath ArtisticStyleSettings::specificConfigFile() const { - return Utils::FileName::fromString(m_settings.value(SPECIFIC_CONFIG_FILE).toString()); + return Utils::FilePath::fromString(m_settings.value(SPECIFIC_CONFIG_FILE).toString()); } -void ArtisticStyleSettings::setSpecificConfigFile(const Utils::FileName &specificConfigFile) +void ArtisticStyleSettings::setSpecificConfigFile(const Utils::FilePath &specificConfigFile) { m_settings.insert(SPECIFIC_CONFIG_FILE, QVariant(specificConfigFile.toString())); } diff --git a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h b/src/plugins/beautifier/artisticstyle/artisticstylesettings.h index 9e3c60e435..50deba87d6 100644 --- a/src/plugins/beautifier/artisticstyle/artisticstylesettings.h +++ b/src/plugins/beautifier/artisticstyle/artisticstylesettings.h @@ -56,8 +56,8 @@ public: bool useSpecificConfigFile() const; void setUseSpecificConfigFile(bool useSpecificConfigFile); - Utils::FileName specificConfigFile() const; - void setSpecificConfigFile(const Utils::FileName &specificConfigFile); + Utils::FilePath specificConfigFile() const; + void setSpecificConfigFile(const Utils::FilePath &specificConfigFile); bool useHomeFile() const; void setUseHomeFile(bool useHomeFile); diff --git a/src/plugins/beautifier/uncrustify/uncrustify.cpp b/src/plugins/beautifier/uncrustify/uncrustify.cpp index e2d2488224..f6a36eadc0 100644 --- a/src/plugins/beautifier/uncrustify/uncrustify.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustify.cpp @@ -144,8 +144,8 @@ QString Uncrustify::configurationFile() const if (m_settings.useOtherFiles()) { if (const ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject()) { - const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles); - for (const Utils::FileName &file : files) { + const Utils::FilePathList files = project->files(ProjectExplorer::Project::AllFiles); + for (const Utils::FilePath &file : files) { if (!file.endsWith("cfg")) continue; const QFileInfo fi = file.toFileInfo(); @@ -156,7 +156,7 @@ QString Uncrustify::configurationFile() const } if (m_settings.useSpecificConfigFile()) { - const Utils::FileName file = m_settings.specificConfigFile(); + const Utils::FilePath file = m_settings.specificConfigFile(); if (file.exists()) return file.toString(); } diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp index 20b134d122..a9c5760ce3 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp +++ b/src/plugins/beautifier/uncrustify/uncrustifysettings.cpp @@ -91,12 +91,12 @@ void UncrustifySettings::setUseHomeFile(bool useHomeFile) m_settings.insert(USE_HOME_FILE, QVariant(useHomeFile)); } -Utils::FileName UncrustifySettings::specificConfigFile() const +Utils::FilePath UncrustifySettings::specificConfigFile() const { - return Utils::FileName::fromString(m_settings.value(SPECIFIC_CONFIG_FILE_PATH).toString()); + return Utils::FilePath::fromString(m_settings.value(SPECIFIC_CONFIG_FILE_PATH).toString()); } -void UncrustifySettings::setSpecificConfigFile(const Utils::FileName &filePath) +void UncrustifySettings::setSpecificConfigFile(const Utils::FilePath &filePath) { m_settings.insert(SPECIFIC_CONFIG_FILE_PATH, QVariant(filePath.toString())); } diff --git a/src/plugins/beautifier/uncrustify/uncrustifysettings.h b/src/plugins/beautifier/uncrustify/uncrustifysettings.h index 8b21db84f9..07798ef1e1 100644 --- a/src/plugins/beautifier/uncrustify/uncrustifysettings.h +++ b/src/plugins/beautifier/uncrustify/uncrustifysettings.h @@ -60,8 +60,8 @@ public: void updateVersion() override; - Utils::FileName specificConfigFile() const; - void setSpecificConfigFile(const Utils::FileName &filePath); + Utils::FilePath specificConfigFile() const; + void setSpecificConfigFile(const Utils::FilePath &filePath); bool useSpecificConfigFile() const; void setUseSpecificConfigFile(bool useConfigFile); diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index 7ca01958d0..9fbba5c7f8 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -234,7 +234,7 @@ public: bool save(QString *errorString, const QString &fn, bool autoSave) override { QTC_ASSERT(!autoSave, return true); // bineditor does not support autosave - it would be a bit expensive - const FileName fileNameToUse = fn.isEmpty() ? filePath() : FileName::fromString(fn); + const FilePath fileNameToUse = fn.isEmpty() ? filePath() : FilePath::fromString(fn); if (m_widget->save(errorString, filePath().toString(), fileNameToUse.toString())) { setFilePath(fileNameToUse); return true; @@ -275,7 +275,7 @@ public: } if (offset >= size) return OpenResult::CannotHandle; - setFilePath(FileName::fromString(fileName)); + setFilePath(FilePath::fromString(fileName)); m_widget->setSizes(offset, file.size()); return OpenResult::Success; } @@ -290,7 +290,7 @@ public: void provideData(quint64 address) { - const FileName fn = filePath(); + const FilePath fn = filePath(); if (fn.isEmpty()) return; QFile file(fn.toString()); @@ -324,7 +324,7 @@ public: } bool isFileReadOnly() const override { - const FileName fn = filePath(); + const FilePath fn = filePath(); if (fn.isEmpty()) return false; return !fn.toFileInfo().isWritable(); diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp index cf591035d7..1e5d0d2c0d 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/bookmarks/bookmark.cpp @@ -37,7 +37,7 @@ using namespace Bookmarks::Internal; using namespace Utils; Bookmark::Bookmark(int lineNumber, BookmarkManager *manager) : - TextMark(FileName(), lineNumber, Constants::BOOKMARKS_TEXT_MARK_CATEGORY), + TextMark(FilePath(), lineNumber, Constants::BOOKMARKS_TEXT_MARK_CATEGORY), m_manager(manager) { setColor(Utils::Theme::Bookmarks_TextMarkColor); @@ -87,9 +87,9 @@ void Bookmark::updateBlock(const QTextBlock &block) } } -void Bookmark::updateFileName(const FileName &fileName) +void Bookmark::updateFileName(const FilePath &fileName) { - const FileName &oldFileName = this->fileName(); + const FilePath &oldFileName = this->fileName(); TextMark::updateFileName(fileName); m_manager->updateBookmarkFileName(this, oldFileName.toString()); } diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index 1dceba433c..b6d3cef26c 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -40,7 +40,7 @@ public: void updateLineNumber(int lineNumber) override; void move(int line) override; void updateBlock(const QTextBlock &block) override; - void updateFileName(const Utils::FileName &fileName) override; + void updateFileName(const Utils::FilePath &fileName) override; void removedFromEditor() override; bool isDraggable() const override; diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp index 21ed0e7090..89bb911de7 100644 --- a/src/plugins/bookmarks/bookmarkmanager.cpp +++ b/src/plugins/bookmarks/bookmarkmanager.cpp @@ -331,7 +331,7 @@ QItemSelectionModel *BookmarkManager::selectionModel() const return m_selectionModel; } -bool BookmarkManager::hasBookmarkInPosition(const Utils::FileName &fileName, int lineNumber) +bool BookmarkManager::hasBookmarkInPosition(const Utils::FilePath &fileName, int lineNumber) { return findBookmark(fileName, lineNumber); } @@ -414,7 +414,7 @@ QMimeData *BookmarkManager::mimeData(const QModelIndexList &indexes) const return data; } -void BookmarkManager::toggleBookmark(const FileName &fileName, int lineNumber) +void BookmarkManager::toggleBookmark(const FilePath &fileName, int lineNumber) { if (lineNumber <= 0 || fileName.isEmpty()) return; @@ -450,7 +450,7 @@ void BookmarkManager::updateBookmarkFileName(Bookmark *bookmark, const QString & if (oldFileName == bookmark->fileName().toString()) return; - m_bookmarksMap[Utils::FileName::fromString(oldFileName)].removeAll(bookmark); + m_bookmarksMap[Utils::FilePath::fromString(oldFileName)].removeAll(bookmark); m_bookmarksMap[bookmark->fileName()].append(bookmark); updateBookmark(bookmark); } @@ -517,7 +517,7 @@ void BookmarkManager::documentPrevNext(bool next) if (editorLine <= 0) return; - const FileName filePath = editor->document()->filePath(); + const FilePath filePath = editor->document()->filePath(); if (!m_bookmarksMap.contains(filePath)) return; @@ -664,7 +664,7 @@ void BookmarkManager::moveDown() saveBookmarks(); } -void BookmarkManager::editByFileAndLine(const FileName &fileName, int lineNumber) +void BookmarkManager::editByFileAndLine(const FilePath &fileName, int lineNumber) { Bookmark *b = findBookmark(fileName, lineNumber); QModelIndex current = selectionModel()->currentIndex(); @@ -703,7 +703,7 @@ void BookmarkManager::edit() } /* Returns the bookmark at the given file and line number, or 0 if no such bookmark exists. */ -Bookmark *BookmarkManager::findBookmark(const FileName &filePath, int lineNumber) +Bookmark *BookmarkManager::findBookmark(const FilePath &filePath, int lineNumber) { return Utils::findOrDefault(m_bookmarksMap.value(filePath), Utils::equal(&Bookmark::lineNumber, lineNumber)); @@ -749,9 +749,9 @@ void BookmarkManager::addBookmark(const QString &s) const QString &filePath = s.mid(index1+1, index2-index1-1); const QString ¬e = s.mid(index3 + 1); const int lineNumber = s.midRef(index2 + 1, index3 - index2 - 1).toInt(); - if (!filePath.isEmpty() && !findBookmark(FileName::fromString(filePath), lineNumber)) { + if (!filePath.isEmpty() && !findBookmark(FilePath::fromString(filePath), lineNumber)) { auto b = new Bookmark(lineNumber, this); - b->updateFileName(FileName::fromString(filePath)); + b->updateFileName(FilePath::fromString(filePath)); b->setNote(note); addBookmark(b, false); } diff --git a/src/plugins/bookmarks/bookmarkmanager.h b/src/plugins/bookmarks/bookmarkmanager.h index c1cbef10f3..24ff63742b 100644 --- a/src/plugins/bookmarks/bookmarkmanager.h +++ b/src/plugins/bookmarks/bookmarkmanager.h @@ -77,7 +77,7 @@ public: // this QItemSelectionModel is shared by all views QItemSelectionModel *selectionModel() const; - bool hasBookmarkInPosition(const Utils::FileName &fileName, int lineNumber); + bool hasBookmarkInPosition(const Utils::FilePath &fileName, int lineNumber); enum Roles { Filename = Qt::UserRole, @@ -87,7 +87,7 @@ public: Note = Qt::UserRole + 4 }; - void toggleBookmark(const Utils::FileName &fileName, int lineNumber); + void toggleBookmark(const Utils::FilePath &fileName, int lineNumber); void nextInDocument(); void prevInDocument(); void next(); @@ -95,7 +95,7 @@ public: void moveUp(); void moveDown(); void edit(); - void editByFileAndLine(const Utils::FileName &fileName, int lineNumber); + void editByFileAndLine(const Utils::FilePath &fileName, int lineNumber); bool gotoBookmark(const Bookmark *bookmark) const; signals: @@ -109,14 +109,14 @@ private: void documentPrevNext(bool next); - Bookmark *findBookmark(const Utils::FileName &filePath, int lineNumber); + Bookmark *findBookmark(const Utils::FilePath &filePath, int lineNumber); void insertBookmark(int index, Bookmark *bookmark, bool userset = true); void addBookmark(Bookmark *bookmark, bool userset = true); void addBookmark(const QString &s); static QString bookmarkToString(const Bookmark *b); void saveBookmarks(); - QMap<Utils::FileName, QVector<Bookmark *>> m_bookmarksMap; + QMap<Utils::FilePath, QVector<Bookmark *>> m_bookmarksMap; QList<Bookmark *> m_bookmarksList; QItemSelectionModel *m_selectionModel; diff --git a/src/plugins/bookmarks/bookmarksplugin.cpp b/src/plugins/bookmarks/bookmarksplugin.cpp index dcba2a66d1..06eb6b49c9 100644 --- a/src/plugins/bookmarks/bookmarksplugin.cpp +++ b/src/plugins/bookmarks/bookmarksplugin.cpp @@ -79,7 +79,7 @@ public: QAction m_bookmarkMarginAction{BookmarksPlugin::tr("Toggle Bookmark"), nullptr}; int m_marginActionLineNumber = 0; - Utils::FileName m_marginActionFileName; + Utils::FilePath m_marginActionFileName; }; BookmarksPlugin::~BookmarksPlugin() diff --git a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp index 8fcbe3477b..6e1873c4b5 100644 --- a/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp +++ b/src/plugins/clangcodemodel/clangdiagnosticmanager.cpp @@ -301,10 +301,10 @@ void ClangDiagnosticManager::generateFixItAvailableMarkers() static void addTask(const ClangBackEnd::DiagnosticContainer &diagnostic, bool isChild = false) { using namespace ProjectExplorer; - using ::Utils::FileName; + using ::Utils::FilePath; Task::TaskType taskType = ProjectExplorer::Task::TaskType::Unknown; - FileName iconPath; + FilePath iconPath; QIcon icon; if (!isChild) { @@ -325,7 +325,7 @@ static void addTask(const ClangBackEnd::DiagnosticContainer &diagnostic, bool is TaskHub::addTask(Task(taskType, Utils::diagnosticCategoryPrefixRemoved(diagnostic.text.toString()), - FileName::fromString(diagnostic.location.filePath.toString()), + FilePath::fromString(diagnostic.location.filePath.toString()), diagnostic.location.line, Constants::TASK_CATEGORY_DIAGNOSTICS, icon, @@ -452,7 +452,7 @@ void ClangDiagnosticManager::addClangTextMarks( m_clangTextMarks.erase(it, m_clangTextMarks.end()); delete mark; }; - auto textMark = new ClangTextMark(::Utils::FileName::fromString(filePath()), + auto textMark = new ClangTextMark(::Utils::FilePath::fromString(filePath()), diagnostic, onMarkRemoved, m_fullVisualization); diff --git a/src/plugins/clangcodemodel/clangfollowsymbol.cpp b/src/plugins/clangcodemodel/clangfollowsymbol.cpp index f1113de164..e03a2b904c 100644 --- a/src/plugins/clangcodemodel/clangfollowsymbol.cpp +++ b/src/plugins/clangcodemodel/clangfollowsymbol.cpp @@ -159,7 +159,7 @@ static ::Utils::ProcessLinkCallback extendedCallback(::Utils::ProcessLinkCallbac }; } -static bool isSameInvocationContext(const Utils::FileName &filePath) +static bool isSameInvocationContext(const Utils::FilePath &filePath) { return TextEditor::BaseTextEditor::currentTextEditor()->editorWidget()->isVisible() && Core::EditorManager::currentDocument()->filePath() == filePath; diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp index f629e743bc..7907abdfed 100644 --- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp +++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp @@ -154,7 +154,7 @@ void ClangModelManagerSupport::onCurrentEditorChanged(Core::IEditor *editor) if (!editor || !editor->document() || !cppModelManager()->isCppEditor(editor)) return; - const ::Utils::FileName filePath = editor->document()->filePath(); + const ::Utils::FilePath filePath = editor->document()->filePath(); if (auto processor = ClangEditorDocumentProcessor::get(filePath.toString())) processor->generateTaskHubIssues(); } diff --git a/src/plugins/clangcodemodel/clangtextmark.cpp b/src/plugins/clangcodemodel/clangtextmark.cpp index f756acf2d3..905682cd0f 100644 --- a/src/plugins/clangcodemodel/clangtextmark.cpp +++ b/src/plugins/clangcodemodel/clangtextmark.cpp @@ -209,7 +209,7 @@ void disableDiagnosticInCurrentProjectConfig(const ClangBackEnd::DiagnosticConta } // anonymous namespace -ClangTextMark::ClangTextMark(const FileName &fileName, +ClangTextMark::ClangTextMark(const FilePath &fileName, const ClangBackEnd::DiagnosticContainer &diagnostic, const RemovedFromEditorHandler &removedHandler, bool fullVisualization) diff --git a/src/plugins/clangcodemodel/clangtextmark.h b/src/plugins/clangcodemodel/clangtextmark.h index ae67bcef86..2ac2df1e91 100644 --- a/src/plugins/clangcodemodel/clangtextmark.h +++ b/src/plugins/clangcodemodel/clangtextmark.h @@ -40,7 +40,7 @@ class ClangTextMark : public TextEditor::TextMark public: using RemovedFromEditorHandler = std::function<void(ClangTextMark *)>; - ClangTextMark(const ::Utils::FileName &fileName, + ClangTextMark(const ::Utils::FilePath &fileName, const ClangBackEnd::DiagnosticContainer &diagnostic, const RemovedFromEditorHandler &removedHandler, bool fullVisualization); diff --git a/src/plugins/clangcodemodel/clangutils.cpp b/src/plugins/clangcodemodel/clangutils.cpp index fb06e9c384..e7d7de420a 100644 --- a/src/plugins/clangcodemodel/clangutils.cpp +++ b/src/plugins/clangcodemodel/clangutils.cpp @@ -301,11 +301,11 @@ QString diagnosticCategoryPrefixRemoved(const QString &text) return text; } -static ::Utils::FileName compilerPath(const CppTools::ProjectPart &projectPart) +static ::Utils::FilePath compilerPath(const CppTools::ProjectPart &projectPart) { ProjectExplorer::Target *target = projectPart.project->activeTarget(); if (!target) - return ::Utils::FileName(); + return ::Utils::FilePath(); ProjectExplorer::ToolChain *toolchain = ProjectExplorer::ToolChainKitAspect::toolChain( target->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID); @@ -313,15 +313,15 @@ static ::Utils::FileName compilerPath(const CppTools::ProjectPart &projectPart) return toolchain->compilerCommand(); } -static ::Utils::FileName buildDirectory(const ProjectExplorer::Project &project) +static ::Utils::FilePath buildDirectory(const ProjectExplorer::Project &project) { ProjectExplorer::Target *target = project.activeTarget(); if (!target) - return ::Utils::FileName(); + return ::Utils::FilePath(); ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration(); if (!buildConfig) - return ::Utils::FileName(); + return ::Utils::FilePath(); return buildConfig->buildDirectory(); } @@ -356,7 +356,7 @@ static QStringList projectPartArguments(const ProjectPart &projectPart) return args; } -static QJsonObject createFileObject(const ::Utils::FileName &buildDir, +static QJsonObject createFileObject(const ::Utils::FilePath &buildDir, const QStringList &arguments, const ProjectPart &projectPart, const ProjectFile &projFile) @@ -388,7 +388,7 @@ static QJsonObject createFileObject(const ::Utils::FileName &buildDir, GenerateCompilationDbResult generateCompilationDB(CppTools::ProjectInfo projectInfo) { - const ::Utils::FileName buildDir = buildDirectory(*projectInfo.project()); + const ::Utils::FilePath buildDir = buildDirectory(*projectInfo.project()); QTC_ASSERT(!buildDir.isEmpty(), return GenerateCompilationDbResult(QString(), QCoreApplication::translate("ClangUtils", "Could not retrieve build directory."))); diff --git a/src/plugins/clangcodemodel/clangutils.h b/src/plugins/clangcodemodel/clangutils.h index d3d57d8dd5..98b31f0e23 100644 --- a/src/plugins/clangcodemodel/clangutils.h +++ b/src/plugins/clangcodemodel/clangutils.h @@ -42,7 +42,7 @@ class ProjectInfo; } namespace Utils { -class FileName; +class FilePath; } namespace ClangBackEnd { class TokenInfoContainer; } diff --git a/src/plugins/clangformat/clangformatconfigwidget.cpp b/src/plugins/clangformat/clangformatconfigwidget.cpp index ca17d0f51c..f419780a3e 100644 --- a/src/plugins/clangformat/clangformatconfigwidget.cpp +++ b/src/plugins/clangformat/clangformatconfigwidget.cpp @@ -169,12 +169,12 @@ void ClangFormatConfigWidget::initChecksAndPreview() m_preview->textDocument()->setFontSettings(TextEditor::TextEditorSettings::fontSettings()); m_preview->textDocument()->setSyntaxHighlighter(new CppEditor::CppHighlighter); - Utils::FileName fileName; + Utils::FilePath fileName; if (m_project) { connect(m_ui->applyButton, &QPushButton::clicked, this, &ClangFormatConfigWidget::apply); fileName = m_project->projectFilePath().pathAppended("snippet.cpp"); } else { - fileName = Utils::FileName::fromString(Core::ICore::userResourcePath()) + fileName = Utils::FilePath::fromString(Core::ICore::userResourcePath()) .pathAppended("snippet.cpp"); } m_preview->textDocument()->indenter()->setFileName(fileName); @@ -241,7 +241,7 @@ void ClangFormatConfigWidget::showGlobalCheckboxes() static bool projectConfigExists() { - return Utils::FileName::fromString(Core::ICore::userResourcePath()) + return Utils::FilePath::fromString(Core::ICore::userResourcePath()) .pathAppended("clang-format") .pathAppended(currentProjectUniqueId()) .pathAppended((Constants::SETTINGS_FILE_NAME)) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 7af95e64f3..14d59a757c 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -165,21 +165,21 @@ static bool useProjectOverriddenSettings() return project ? project->namedSettings(Constants::OVERRIDE_FILE_ID).toBool() : false; } -static Utils::FileName globalPath() +static Utils::FilePath globalPath() { - return Utils::FileName::fromString(Core::ICore::userResourcePath()); + return Utils::FilePath::fromString(Core::ICore::userResourcePath()); } -static Utils::FileName projectPath() +static Utils::FilePath projectPath() { const Project *project = SessionManager::startupProject(); if (project) return globalPath().pathAppended("clang-format/" + currentProjectUniqueId()); - return Utils::FileName(); + return Utils::FilePath(); } -static QString findConfig(Utils::FileName fileName) +static QString findConfig(Utils::FilePath fileName) { QDir parentDir(fileName.parentDir().toString()); while (!parentDir.exists(Constants::SETTINGS_FILE_NAME) @@ -193,7 +193,7 @@ static QString findConfig(Utils::FileName fileName) return parentDir.filePath(Constants::SETTINGS_FILE_ALT_NAME); } -static QString configForFile(Utils::FileName fileName, bool checkForSettings) +static QString configForFile(Utils::FilePath fileName, bool checkForSettings) { QDir overrideDir; if (!checkForSettings || useProjectOverriddenSettings()) { @@ -211,14 +211,14 @@ static QString configForFile(Utils::FileName fileName, bool checkForSettings) return findConfig(fileName); } -QString configForFile(Utils::FileName fileName) +QString configForFile(Utils::FilePath fileName) { return configForFile(fileName, true); } -Utils::FileName assumedPathForConfig(const QString &configFile) +Utils::FilePath assumedPathForConfig(const QString &configFile) { - Utils::FileName fileName = Utils::FileName::fromString(configFile); + Utils::FilePath fileName = Utils::FilePath::fromString(configFile); return fileName.parentDir().pathAppended("test.cpp"); } @@ -243,7 +243,7 @@ static clang::format::FormatStyle constructStyle(const QByteArray &baseStyle = Q void createStyleFileIfNeeded(bool isGlobal) { - const Utils::FileName path = isGlobal ? globalPath() : projectPath(); + const Utils::FilePath path = isGlobal ? globalPath() : projectPath(); const QString configFile = path.pathAppended(Constants::SETTINGS_FILE_NAME).toString(); if (QFile::exists(configFile)) @@ -252,7 +252,7 @@ void createStyleFileIfNeeded(bool isGlobal) QDir().mkpath(path.toString()); if (!isGlobal) { const Project *project = SessionManager::startupProject(); - Utils::FileName possibleProjectConfig = project->rootProjectDirectory().pathAppended( + Utils::FilePath possibleProjectConfig = project->rootProjectDirectory().pathAppended( Constants::SETTINGS_FILE_NAME); if (possibleProjectConfig.exists()) { // Just copy th .clang-format if current project has one. @@ -290,7 +290,7 @@ static QByteArray configBaseStyleName(const QString &configFile) .trimmed(); } -static clang::format::FormatStyle styleForFile(Utils::FileName fileName, bool checkForSettings) +static clang::format::FormatStyle styleForFile(Utils::FilePath fileName, bool checkForSettings) { QString configFile = configForFile(fileName, checkForSettings); if (configFile.isEmpty()) { @@ -313,7 +313,7 @@ static clang::format::FormatStyle styleForFile(Utils::FileName fileName, bool ch return constructStyle(configBaseStyleName(configFile)); } -clang::format::FormatStyle styleForFile(Utils::FileName fileName) +clang::format::FormatStyle styleForFile(Utils::FilePath fileName) { return styleForFile(fileName, true); } diff --git a/src/plugins/clangformat/clangformatutils.h b/src/plugins/clangformat/clangformatutils.h index 2db47003ca..e8c21bbcf6 100644 --- a/src/plugins/clangformat/clangformatutils.h +++ b/src/plugins/clangformat/clangformatutils.h @@ -47,7 +47,7 @@ clang::format::FormatStyle currentProjectStyle(); clang::format::FormatStyle currentGlobalStyle(); // Is the style from the matching .clang-format file or global one if it's not found. -QString configForFile(Utils::FileName fileName); -clang::format::FormatStyle styleForFile(Utils::FileName fileName); +QString configForFile(Utils::FilePath fileName); +clang::format::FormatStyle styleForFile(Utils::FilePath fileName); } diff --git a/src/plugins/clangpchmanager/qtcreatorprojectupdater.h b/src/plugins/clangpchmanager/qtcreatorprojectupdater.h index a53bbc678a..1cdef70b79 100644 --- a/src/plugins/clangpchmanager/qtcreatorprojectupdater.h +++ b/src/plugins/clangpchmanager/qtcreatorprojectupdater.h @@ -95,10 +95,10 @@ public: protected: void newExtraCompiler(const ProjectExplorer::Project *, - const Utils::FileName &, - const Utils::FileNameList &targets) override + const Utils::FilePath &, + const Utils::FilePathList &targets) override { - for (const Utils::FileName &target : targets) + for (const Utils::FilePath &target : targets) abstractEditorUpdated(target.toString(), {}); } diff --git a/src/plugins/clangtools/clangfileinfo.h b/src/plugins/clangtools/clangfileinfo.h index 735028a1f9..eaeaecce12 100644 --- a/src/plugins/clangtools/clangfileinfo.h +++ b/src/plugins/clangtools/clangfileinfo.h @@ -37,14 +37,14 @@ class FileInfo { public: FileInfo() = default; - FileInfo(Utils::FileName file, + FileInfo(Utils::FilePath file, CppTools::ProjectFile::Kind kind, CppTools::ProjectPart::Ptr projectPart) : file(std::move(file)) , kind(kind) , projectPart(projectPart) {} - Utils::FileName file; + Utils::FilePath file; CppTools::ProjectFile::Kind kind; CppTools::ProjectPart::Ptr projectPart; }; diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index c3b6f4ac3e..e32553f976 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -109,7 +109,7 @@ bool FixitsRefactoringFile::apply() format(*indenter, doc, operationsForFile, i); operationsForFile.clear(); indenter = std::unique_ptr<TextEditor::Indenter>(factory->createIndenter(doc)); - indenter->setFileName(Utils::FileName::fromString(op.fileName)); + indenter->setFileName(Utils::FilePath::fromString(op.fileName)); } QTextCursor cursor(doc); diff --git a/src/plugins/clangtools/clangselectablefilesdialog.cpp b/src/plugins/clangtools/clangselectablefilesdialog.cpp index 7a7dbd9013..e48679aa05 100644 --- a/src/plugins/clangtools/clangselectablefilesdialog.cpp +++ b/src/plugins/clangtools/clangselectablefilesdialog.cpp @@ -71,7 +71,7 @@ static void linkFileNode(Tree *parentNode, Tree *childNode) parentNode->visibleFiles.append(childNode); } -static Tree *createDirNode(const QString &name, const FileName &filePath = FileName()) +static Tree *createDirNode(const QString &name, const FilePath &filePath = FilePath()) { auto node = new Tree; node->name = name; @@ -106,7 +106,7 @@ public: // // For example, if a directory node if fully checked, there is no need to // save all the children of that node. - void minimalSelection(QSet<FileName> &checkedDirs, QSet<FileName> &checkedFiles) const + void minimalSelection(QSet<FilePath> &checkedDirs, QSet<FilePath> &checkedFiles) const { traverse(index(0, 0, QModelIndex()), [&](const QModelIndex &index){ auto node = static_cast<Tree *>(index.internalPointer()); @@ -124,7 +124,7 @@ public: }); } - void restoreMinimalSelection(const QSet<FileName> &dirs, const QSet<FileName> &files) + void restoreMinimalSelection(const QSet<FilePath> &dirs, const QSet<FilePath> &files) { if (dirs.isEmpty() && files.isEmpty()) return; @@ -211,20 +211,20 @@ private: // Add files outside of the base directory to a separate node Tree *externalFilesNode = createDirNode(SelectableFilesDialog::tr( "Files outside of the base directory"), - FileName::fromString("/")); + FilePath::fromString("/")); linkDirNode(m_root, externalFilesNode); for (const FileInfo &fileInfo : outOfBaseDirFiles) linkFileNode(externalFilesNode, createFileNode(fileInfo, true)); } } - Tree *buildProjectDirTree(const FileName &projectDir, + Tree *buildProjectDirTree(const FilePath &projectDir, const FileInfos &fileInfos, FileInfos &outOfBaseDirFiles) const { Tree *projectDirNode = createDirNode(projectDir.fileName(), projectDir); - QHash<FileName, Tree *> dirsToNode; + QHash<FilePath, Tree *> dirsToNode; dirsToNode.insert(projectDirNode->fullPath, projectDirNode); for (const FileInfo &fileInfo : fileInfos) { @@ -234,7 +234,7 @@ private: } // Find or create parent nodes - FileName parentDir = fileInfo.file.parentDir(); + FilePath parentDir = fileInfo.file.parentDir(); Tree *parentNode = dirsToNode[parentDir]; if (!parentNode) { // Find nearest existing node @@ -246,7 +246,7 @@ private: } // Create needed extra dir nodes - FileName currentDirPath = parentDir; + FilePath currentDirPath = parentDir; for (const QString &dirName : dirsToCreate) { currentDirPath = currentDirPath.pathAppended(dirName); @@ -380,8 +380,8 @@ void SelectableFilesDialog::accept() settings->setBuildBeforeAnalysis(m_buildBeforeAnalysis); // Save selection - QSet<FileName> checkedDirs; - QSet<FileName> checkedFiles; + QSet<FilePath> checkedDirs; + QSet<FilePath> checkedFiles; m_filesModel->minimalSelection(checkedDirs, checkedFiles); settings->setSelectedDirs(checkedDirs); settings->setSelectedFiles(checkedFiles); diff --git a/src/plugins/clangtools/clangtidyclazytool.cpp b/src/plugins/clangtools/clangtidyclazytool.cpp index 43858cc865..f07fdcd3f7 100644 --- a/src/plugins/clangtools/clangtidyclazytool.cpp +++ b/src/plugins/clangtools/clangtidyclazytool.cpp @@ -464,7 +464,7 @@ void ClangTidyClazyTool::handleStateUpdate() } QList<Diagnostic> ClangTidyClazyTool::read(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath, QString *errorMessage) const { diff --git a/src/plugins/clangtools/clangtidyclazytool.h b/src/plugins/clangtools/clangtidyclazytool.h index 24aac6673b..c0765dc6a9 100644 --- a/src/plugins/clangtools/clangtidyclazytool.h +++ b/src/plugins/clangtools/clangtidyclazytool.h @@ -54,7 +54,7 @@ public: void startTool(bool askUserForFileSelection) final; QList<Diagnostic> read(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath, QString *errorMessage) const final; diff --git a/src/plugins/clangtools/clangtool.cpp b/src/plugins/clangtools/clangtool.cpp index 52746080c1..10295ed28b 100644 --- a/src/plugins/clangtools/clangtool.cpp +++ b/src/plugins/clangtools/clangtool.cpp @@ -79,7 +79,7 @@ static FileInfos sortedFileInfos(const QVector<CppTools::ProjectPart::Ptr> &proj continue; if (file.active && CppTools::ProjectFile::isSource(file.kind)) { - fileInfos.emplace_back(Utils::FileName::fromString(file.path), + fileInfos.emplace_back(Utils::FilePath::fromString(file.path), file.kind, projectPart); } diff --git a/src/plugins/clangtools/clangtool.h b/src/plugins/clangtools/clangtool.h index 65dde58009..0f322feb47 100644 --- a/src/plugins/clangtools/clangtool.h +++ b/src/plugins/clangtools/clangtool.h @@ -31,7 +31,7 @@ #include <cpptools/projectinfo.h> namespace Debugger { class DetailedErrorView; } -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ClangTools { namespace Internal { @@ -50,7 +50,7 @@ public: virtual void startTool(bool askUserForFileSelection) = 0; virtual QList<Diagnostic> read(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath, QString *errorMessage) const = 0; diff --git a/src/plugins/clangtools/clangtoolruncontrol.cpp b/src/plugins/clangtools/clangtoolruncontrol.cpp index 2f994c3a8f..2ff19c620e 100644 --- a/src/plugins/clangtools/clangtoolruncontrol.cpp +++ b/src/plugins/clangtools/clangtoolruncontrol.cpp @@ -299,7 +299,7 @@ void ClangToolRunControl::start() return; } - const Utils::FileName projectFile = m_projectInfo.project()->projectFilePath(); + const Utils::FilePath projectFile = m_projectInfo.project()->projectFilePath(); appendMessage(tr("Running %1 on %2").arg(toolName).arg(projectFile.toUserOutput()), Utils::NormalMessageFormat); @@ -386,13 +386,13 @@ void ClangToolRunControl::analyzeNextFile() QTC_ASSERT(runner->run(unit.file, unit.arguments), return); appendMessage(tr("Analyzing \"%1\".").arg( - Utils::FileName::fromString(unit.file).toUserOutput()), + Utils::FilePath::fromString(unit.file).toUserOutput()), Utils::StdOutFormat); } -static Utils::FileName cleanPath(const Utils::FileName &filePath) +static Utils::FilePath cleanPath(const Utils::FilePath &filePath) { - return Utils::FileName::fromString(QDir::cleanPath(filePath.toString())); + return Utils::FilePath::fromString(QDir::cleanPath(filePath.toString())); } void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath) @@ -401,7 +401,7 @@ void ClangToolRunControl::onRunnerFinishedWithSuccess(const QString &filePath) qCDebug(LOG) << "onRunnerFinishedWithSuccess:" << logFilePath; QTC_ASSERT(m_projectInfo.project(), return); - const Utils::FileName projectRootDir = cleanPath(m_projectInfo.project()->projectDirectory()); + const Utils::FilePath projectRootDir = cleanPath(m_projectInfo.project()->projectDirectory()); QString errorMessage; const QList<Diagnostic> diagnostics = tool()->read(filePath, diff --git a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h index c0d64664bf..e5a97fea29 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticmodel.h +++ b/src/plugins/clangtools/clangtoolsdiagnosticmodel.h @@ -162,7 +162,7 @@ private: void handleSuppressedDiagnosticsChanged(); QPointer<ProjectExplorer::Project> m_project; - Utils::FileName m_lastProjectDirectory; + Utils::FilePath m_lastProjectDirectory; SuppressedDiagnosticsList m_suppressedDiagnostics; }; diff --git a/src/plugins/clangtools/clangtoolsdiagnosticview.cpp b/src/plugins/clangtools/clangtoolsdiagnosticview.cpp index 33b002ced2..e59b1f22f3 100644 --- a/src/plugins/clangtools/clangtoolsdiagnosticview.cpp +++ b/src/plugins/clangtools/clangtoolsdiagnosticview.cpp @@ -205,8 +205,8 @@ void DiagnosticView::suppressCurrentDiagnostic() auto * const filterModel = static_cast<DiagnosticFilterModel *>(model()); ProjectExplorer::Project * const project = filterModel->project(); if (project) { - Utils::FileName filePath = Utils::FileName::fromString(diag.location.filePath); - const Utils::FileName relativeFilePath + Utils::FilePath filePath = Utils::FilePath::fromString(diag.location.filePath); + const Utils::FilePath relativeFilePath = filePath.relativeChildPath(project->projectDirectory()); if (!relativeFilePath.isEmpty()) filePath = relativeFilePath; diff --git a/src/plugins/clangtools/clangtoolslogfilereader.cpp b/src/plugins/clangtools/clangtoolslogfilereader.cpp index e8a6fbcc96..63751181ee 100644 --- a/src/plugins/clangtools/clangtoolslogfilereader.cpp +++ b/src/plugins/clangtools/clangtoolslogfilereader.cpp @@ -122,7 +122,7 @@ static ExplainingStep buildFixIt(const CXDiagnostic cxDiagnostic, unsigned index } static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &nativeFilePath) { Diagnostic diagnostic; @@ -135,7 +135,7 @@ static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic, return diagnostic; diagnostic.location = diagLocationFromSourceLocation(cxLocation); - const auto diagnosticFilePath = Utils::FileName::fromString(diagnostic.location.filePath); + const auto diagnosticFilePath = Utils::FilePath::fromString(diagnostic.location.filePath); if (!diagnosticFilePath.isChildOf(projectRootDir)) return diagnostic; @@ -183,7 +183,7 @@ static Diagnostic buildDiagnostic(const CXDiagnostic cxDiagnostic, } static QList<Diagnostic> readSerializedDiagnostics_helper(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath) { QList<Diagnostic> list; @@ -232,7 +232,7 @@ static bool checkFilePath(const QString &filePath, QString *errorMessage) } QList<Diagnostic> readSerializedDiagnostics(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath, QString *errorMessage) { diff --git a/src/plugins/clangtools/clangtoolslogfilereader.h b/src/plugins/clangtools/clangtoolslogfilereader.h index 3d8a776932..c95ce645ae 100644 --- a/src/plugins/clangtools/clangtoolslogfilereader.h +++ b/src/plugins/clangtools/clangtoolslogfilereader.h @@ -29,13 +29,13 @@ #include <QList> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ClangTools { namespace Internal { QList<Diagnostic> readSerializedDiagnostics(const QString &filePath, - const Utils::FileName &projectRootDir, + const Utils::FilePath &projectRootDir, const QString &logFilePath, QString *errorMessage); diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.cpp b/src/plugins/clangtools/clangtoolsprojectsettings.cpp index a44e2e0129..bc8a3cabb6 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettings.cpp +++ b/src/plugins/clangtools/clangtoolsprojectsettings.cpp @@ -89,7 +89,7 @@ void ClangToolsProjectSettings::load() m_project->namedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG)); m_buildBeforeAnalysis = m_project->namedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS).toBool(); - auto toFileName = [](const QString &s) { return Utils::FileName::fromString(s); }; + auto toFileName = [](const QString &s) { return Utils::FilePath::fromString(s); }; const QStringList dirs = m_project->namedSettings(SETTINGS_KEY_SELECTED_DIRS).toStringList(); m_selectedDirs = Utils::transform<QSet>(dirs, toFileName); @@ -106,7 +106,7 @@ void ClangToolsProjectSettings::load() const QString message = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_MESSAGE).toString(); if (message.isEmpty()) continue; - Utils::FileName fullPath = Utils::FileName::fromString(fp); + Utils::FilePath fullPath = Utils::FilePath::fromString(fp); if (fullPath.toFileInfo().isRelative()) fullPath = m_project->projectDirectory().pathAppended(fp); if (!fullPath.exists()) @@ -114,7 +114,7 @@ void ClangToolsProjectSettings::load() const QString contextKind = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_CONTEXTKIND).toString(); const QString context = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_CONTEXT).toString(); const int uniquifier = diag.value(SETTINGS_KEY_SUPPRESSED_DIAGS_UNIQIFIER).toInt(); - m_suppressedDiagnostics << SuppressedDiagnostic(Utils::FileName::fromString(fp), message, + m_suppressedDiagnostics << SuppressedDiagnostic(Utils::FilePath::fromString(fp), message, contextKind, context, uniquifier); } emit suppressedDiagnosticsChanged(); @@ -126,10 +126,10 @@ void ClangToolsProjectSettings::store() m_project->setNamedSettings(SETTINGS_KEY_DIAGNOSTIC_CONFIG, m_diagnosticConfig.toSetting()); m_project->setNamedSettings(SETTINGS_KEY_BUILD_BEFORE_ANALYSIS, m_buildBeforeAnalysis); - const QStringList dirs = Utils::transform(m_selectedDirs.toList(), &Utils::FileName::toString); + const QStringList dirs = Utils::transform(m_selectedDirs.toList(), &Utils::FilePath::toString); m_project->setNamedSettings(SETTINGS_KEY_SELECTED_DIRS, dirs); - const QStringList files = Utils::transform(m_selectedFiles.toList(), &Utils::FileName::toString); + const QStringList files = Utils::transform(m_selectedFiles.toList(), &Utils::FilePath::toString); m_project->setNamedSettings(SETTINGS_KEY_SELECTED_FILES, files); QVariantList list; @@ -199,7 +199,7 @@ void ClangToolsProjectSettingsManager::handleProjectToBeRemoved(ProjectExplorer: ClangToolsProjectSettingsManager::SettingsMap ClangToolsProjectSettingsManager::m_settings; SuppressedDiagnostic::SuppressedDiagnostic(const Diagnostic &diag) - : filePath(Utils::FileName::fromString(diag.location.filePath)) + : filePath(Utils::FilePath::fromString(diag.location.filePath)) , description(diag.description) , contextKind(diag.issueContextKind) , context(diag.issueContext) diff --git a/src/plugins/clangtools/clangtoolsprojectsettings.h b/src/plugins/clangtools/clangtoolsprojectsettings.h index fb52862966..757140bc2c 100644 --- a/src/plugins/clangtools/clangtoolsprojectsettings.h +++ b/src/plugins/clangtools/clangtoolsprojectsettings.h @@ -39,7 +39,7 @@ class Diagnostic; class SuppressedDiagnostic { public: - SuppressedDiagnostic(const Utils::FileName &filePath, const QString &description, + SuppressedDiagnostic(const Utils::FilePath &filePath, const QString &description, const QString &contextKind, const QString &context, int uniquifier) : filePath(filePath) , description(description) @@ -51,7 +51,7 @@ public: SuppressedDiagnostic(const Diagnostic &diag); - Utils::FileName filePath; // Relative for files in project, absolute otherwise. + Utils::FilePath filePath; // Relative for files in project, absolute otherwise. QString description; QString contextKind; QString context; @@ -84,11 +84,11 @@ public: bool buildBeforeAnalysis() const; void setBuildBeforeAnalysis(bool build); - QSet<Utils::FileName> selectedDirs() const { return m_selectedDirs; } - void setSelectedDirs(const QSet<Utils::FileName> &value) { m_selectedDirs = value; } + QSet<Utils::FilePath> selectedDirs() const { return m_selectedDirs; } + void setSelectedDirs(const QSet<Utils::FilePath> &value) { m_selectedDirs = value; } - QSet<Utils::FileName> selectedFiles() const { return m_selectedFiles; } - void setSelectedFiles(const QSet<Utils::FileName> &value) { m_selectedFiles = value; } + QSet<Utils::FilePath> selectedFiles() const { return m_selectedFiles; } + void setSelectedFiles(const QSet<Utils::FilePath> &value) { m_selectedFiles = value; } SuppressedDiagnosticsList suppressedDiagnostics() const { return m_suppressedDiagnostics; } void addSuppressedDiagnostic(const SuppressedDiagnostic &diag); @@ -105,8 +105,8 @@ private: ProjectExplorer::Project *m_project; bool m_useGlobalSettings = true; Core::Id m_diagnosticConfig; - QSet<Utils::FileName> m_selectedDirs; - QSet<Utils::FileName> m_selectedFiles; + QSet<Utils::FilePath> m_selectedDirs; + QSet<Utils::FilePath> m_selectedFiles; SuppressedDiagnosticsList m_suppressedDiagnostics; bool m_buildBeforeAnalysis = true; }; diff --git a/src/plugins/classview/classviewparser.cpp b/src/plugins/classview/classviewparser.cpp index 14034b46a3..34b6de2950 100644 --- a/src/plugins/classview/classviewparser.cpp +++ b/src/plugins/classview/classviewparser.cpp @@ -634,12 +634,12 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot) d->docLocker.unlock(); // recalculate file list - ::Utils::FileNameList fileList; + ::Utils::FilePathList fileList; // check all projects for (const Project *prj : SessionManager::projects()) fileList += prj->files(Project::SourceFiles); - setFileList(::Utils::transform(fileList, &::Utils::FileName::toString)); + setFileList(::Utils::transform(fileList, &::Utils::FilePath::toString)); emit resetDataDone(); } @@ -721,7 +721,7 @@ QStringList Parser::addProjectTree(const ParserTreeItem::Ptr &item, const Projec if (cit != d->cachedPrjFileLists.constEnd()) { fileList = cit.value(); } else { - fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FileName::toString); + fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FilePath::toString); d->cachedPrjFileLists[projectPath] = fileList; } if (fileList.count() > 0) { @@ -746,7 +746,7 @@ QStringList Parser::getAllFiles(const Project *project) if (cit != d->cachedPrjFileLists.constEnd()) { fileList = cit.value(); } else { - fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FileName::toString); + fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FilePath::toString); d->cachedPrjFileLists[nodePath] = fileList; } return fileList; diff --git a/src/plugins/clearcase/clearcasecontrol.cpp b/src/plugins/clearcase/clearcasecontrol.cpp index ef18e6d62d..c3fdbc8d64 100644 --- a/src/plugins/clearcase/clearcasecontrol.cpp +++ b/src/plugins/clearcase/clearcasecontrol.cpp @@ -49,7 +49,7 @@ Core::Id ClearCaseControl::id() const return Constants::VCS_ID_CLEARCASE; } -bool ClearCaseControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool ClearCaseControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { Q_UNUSED(fileName); return false; // ClearCase has no files/directories littering the sources diff --git a/src/plugins/clearcase/clearcasecontrol.h b/src/plugins/clearcase/clearcasecontrol.h index 757ea34486..6a77fe592e 100644 --- a/src/plugins/clearcase/clearcasecontrol.h +++ b/src/plugins/clearcase/clearcasecontrol.h @@ -42,7 +42,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp index 6223bedd4b..f33fa88639 100644 --- a/src/plugins/clearcase/clearcaseplugin.cpp +++ b/src/plugins/clearcase/clearcaseplugin.cpp @@ -353,7 +353,7 @@ QString ClearCasePlugin::ccManagesDirectory(const QString &directory) const foreach (const QString &relativeVobDir, vobs) { const QString vobPath = QDir::cleanPath(rootDir + QDir::fromNativeSeparators(relativeVobDir)); const bool isManaged = (vobPath == directory) - || FileName::fromString(directory).isChildOf(FileName::fromString(vobPath)); + || FilePath::fromString(directory).isChildOf(FilePath::fromString(vobPath)); if (isManaged) return vobPath; } @@ -390,7 +390,7 @@ QString ClearCasePlugin::findTopLevel(const QString &directory) const // Do not check again if we've already tested that the dir is managed, // or if it is a child of a managed dir (top level). if ((directory == m_topLevel) || - FileName::fromString(directory).isChildOf(FileName::fromString(m_topLevel))) + FilePath::fromString(directory).isChildOf(FilePath::fromString(m_topLevel))) return m_topLevel; return ccManagesDirectory(directory); @@ -1452,7 +1452,7 @@ ClearCasePlugin::runCleartool(const QString &workingDir, } const SynchronousProcessResponse sp_resp = - VcsBasePlugin::runVcs(workingDir, FileName::fromUserInput(executable), + VcsBasePlugin::runVcs(workingDir, FilePath::fromUserInput(executable), arguments, timeOutS, flags, outputCodec); @@ -2027,7 +2027,7 @@ void ClearCasePlugin::updateIndex() return; m_checkInAllAction->setEnabled(false); m_statusMap->clear(); - QFuture<void> result = Utils::runAsync(sync, transform(project->files(Project::SourceFiles), &FileName::toString)); + QFuture<void> result = Utils::runAsync(sync, transform(project->files(Project::SourceFiles), &FilePath::toString)); if (!m_settings.disableIndexer) ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX); } diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.cpp b/src/plugins/cmakeprojectmanager/builddirmanager.cpp index 7610c47745..490082d517 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.cpp +++ b/src/plugins/cmakeprojectmanager/builddirmanager.cpp @@ -62,9 +62,9 @@ namespace Internal { BuildDirManager::BuildDirManager() = default; BuildDirManager::~BuildDirManager() = default; -Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶meters) const +Utils::FilePath BuildDirManager::workDirectory(const BuildDirParameters ¶meters) const { - const Utils::FileName bdir = parameters.buildDirectory; + const Utils::FilePath bdir = parameters.buildDirectory; const CMakeTool *cmake = parameters.cmakeTool(); if (bdir.exists()) { m_buildDirToTempDir.erase(bdir); @@ -88,7 +88,7 @@ Utils::FileName BuildDirManager::workDirectory(const BuildDirParameters ¶met return bdir; } } - return Utils::FileName::fromString(tmpDirIt->second->path()); + return Utils::FilePath::fromString(tmpDirIt->second->path()); } void BuildDirManager::emitDataAvailable() @@ -261,7 +261,7 @@ bool BuildDirManager::persistCMakeState() if (m_parameters.workDirectory == m_parameters.buildDirectory) return false; - const Utils::FileName buildDir = m_parameters.buildDirectory; + const Utils::FilePath buildDir = m_parameters.buildDirectory; QDir dir(buildDir.toString()); dir.mkpath(buildDir.toString()); @@ -311,8 +311,8 @@ void BuildDirManager::clearCache() QTC_ASSERT(m_parameters.isValid(), return); QTC_ASSERT(!m_isHandlingError, return); - const FileName cmakeCache = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); - const FileName cmakeFiles = m_parameters.workDirectory.pathAppended("CMakeFiles"); + const FilePath cmakeCache = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); + const FilePath cmakeFiles = m_parameters.workDirectory.pathAppended("CMakeFiles"); const bool mustCleanUp = cmakeCache.exists() || cmakeFiles.exists(); if (!mustCleanUp) @@ -367,7 +367,7 @@ CMakeConfig BuildDirManager::takeCMakeConfiguration() const return result; } -CMakeConfig BuildDirManager::parseCMakeConfiguration(const Utils::FileName &cacheFile, +CMakeConfig BuildDirManager::parseCMakeConfiguration(const Utils::FilePath &cacheFile, QString *errorMessage) { if (!cacheFile.exists()) { diff --git a/src/plugins/cmakeprojectmanager/builddirmanager.h b/src/plugins/cmakeprojectmanager/builddirmanager.h index d55e05aed2..e2f9b8ff05 100644 --- a/src/plugins/cmakeprojectmanager/builddirmanager.h +++ b/src/plugins/cmakeprojectmanager/builddirmanager.h @@ -81,7 +81,7 @@ public: QList<CMakeBuildTarget> takeBuildTargets() const; CMakeConfig takeCMakeConfiguration() const; - static CMakeConfig parseCMakeConfiguration(const Utils::FileName &cacheFile, + static CMakeConfig parseCMakeConfiguration(const Utils::FilePath &cacheFile, QString *errorMessage); enum ReparseParameters { REPARSE_DEFAULT = 0, // use defaults @@ -104,7 +104,7 @@ private: void emitErrorOccured(const QString &message) const; bool checkConfiguration(); - Utils::FileName workDirectory(const BuildDirParameters ¶meters) const; + Utils::FilePath workDirectory(const BuildDirParameters ¶meters) const; void updateReaderType(const BuildDirParameters &p, std::function<void()> todo); @@ -114,7 +114,7 @@ private: void becameDirty(); BuildDirParameters m_parameters; - mutable std::unordered_map<Utils::FileName, std::unique_ptr<Utils::TemporaryDirectory>> m_buildDirToTempDir; + mutable std::unordered_map<Utils::FilePath, std::unique_ptr<Utils::TemporaryDirectory>> m_buildDirToTempDir; mutable std::unique_ptr<BuildDirReader> m_reader; mutable bool m_isHandlingError = false; }; diff --git a/src/plugins/cmakeprojectmanager/builddirparameters.h b/src/plugins/cmakeprojectmanager/builddirparameters.h index eb24862056..d0bd9dd783 100644 --- a/src/plugins/cmakeprojectmanager/builddirparameters.h +++ b/src/plugins/cmakeprojectmanager/builddirparameters.h @@ -52,16 +52,16 @@ public: CMakeBuildConfiguration *buildConfiguration = nullptr; QString projectName; - Utils::FileName sourceDirectory; - Utils::FileName buildDirectory; - Utils::FileName workDirectory; // either buildDirectory or a QTemporaryDirectory! + Utils::FilePath sourceDirectory; + Utils::FilePath buildDirectory; + Utils::FilePath workDirectory; // either buildDirectory or a QTemporaryDirectory! Utils::Environment environment; Core::Id cmakeToolId; QByteArray cxxToolChainId; QByteArray cToolChainId; - Utils::FileName sysRoot; + Utils::FilePath sysRoot; Utils::MacroExpander *expander = nullptr; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 690cb7039b..f7cfa7f33f 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -101,7 +101,7 @@ void CMakeBuildConfiguration::initialize(const BuildInfo &info) CMakeProjectManager::CMakeConfigItem::Type::STRING, "Android native API level", bs->data(Android::Constants::AndroidNdkPlatform).toString().toUtf8()}); - auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FileName>(); + auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FilePath>(); m_initialConfiguration.prepend(CMakeProjectManager::CMakeConfigItem{"ANDROID_NDK", CMakeProjectManager::CMakeConfigItem::Type::PATH, "Android NDK PATH", @@ -258,20 +258,20 @@ const QList<CMakeBuildTarget> &CMakeBuildConfiguration::buildTargets() const return m_buildTargets; } -FileName CMakeBuildConfiguration::shadowBuildDirectory(const FileName &projectFilePath, +FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFilePath, const Kit *k, const QString &bcName, BuildConfiguration::BuildType buildType) { if (projectFilePath.isEmpty()) - return FileName(); + return FilePath(); const QString projectName = projectFilePath.parentDir().fileName(); ProjectMacroExpander expander(projectFilePath.toString(), projectName, k, bcName, buildType); QDir projectDir = QDir(Project::projectDirectory(projectFilePath).toString()); QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate()); buildPath.replace(" ", "-"); - return FileName::fromUserInput(projectDir.absoluteFilePath(buildPath)); + return FilePath::fromUserInput(projectDir.absoluteFilePath(buildPath)); } void CMakeBuildConfiguration::buildTarget(const QString &buildTarget) @@ -496,7 +496,7 @@ QList<BuildInfo> CMakeBuildConfigurationFactory::availableBuilds(const Target *p QList<BuildInfo> CMakeBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const { QList<BuildInfo> result; - const FileName projectPathName = FileName::fromString(projectPath); + const FilePath projectPathName = FilePath::fromString(projectPath); for (int type = BuildTypeDebug; type != BuildTypeLast; ++type) { BuildInfo info = createBuildInfo(k, ProjectExplorer::Project::projectDirectory(projectPathName).toString(), diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h index fbfb8961dd..050dd6f084 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.h @@ -67,8 +67,8 @@ public: const QList<ProjectExplorer::BuildTargetInfo> appTargets() const; ProjectExplorer::DeploymentData deploymentData() const; - static Utils::FileName - shadowBuildDirectory(const Utils::FileName &projectFilePath, const ProjectExplorer::Kit *k, + static Utils::FilePath + shadowBuildDirectory(const Utils::FilePath &projectFilePath, const ProjectExplorer::Kit *k, const QString &bcName, BuildConfiguration::BuildType buildType); // Context menu action: diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp index f5121b6ab3..cf94cbf23d 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsettingswidget.cpp @@ -111,7 +111,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc) connect(buildDirChooser, &Utils::PathChooser::rawPathChanged, this, [this](const QString &path) { m_configModel->flush(); // clear out config cache... - m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(path)); + m_buildConfiguration->setBuildDirectory(Utils::FilePath::fromString(path)); }); int row = 0; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp index 84ced20bb2..1d2ef2cb75 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.cpp @@ -160,7 +160,7 @@ bool CMakeBuildStep::init() emit addTask(Task(Task::Error, QCoreApplication::translate("CMakeProjectManager::CMakeBuildStep", "The build configuration is currently disabled."), - Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); canInit = false; } @@ -169,7 +169,7 @@ bool CMakeBuildStep::init() emit addTask(Task(Task::Error, tr("A CMake tool must be set up for building. " "Configure a CMake tool in the kit options."), - Utils::FileName(), -1, + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); canInit = false; } @@ -181,7 +181,7 @@ bool CMakeBuildStep::init() "You asked to build the current Run Configuration's build target only, " "but it is not associated with a build target. " "Update the Make Step in your build settings."), - Utils::FileName(), -1, + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); canInit = false; } @@ -192,7 +192,7 @@ bool CMakeBuildStep::init() } // Warn if doing out-of-source builds with a CMakeCache.txt is the source directory - const Utils::FileName projectDirectory = bc->target()->project()->projectDirectory(); + const Utils::FilePath projectDirectory = bc->target()->project()->projectDirectory(); if (bc->buildDirectory() != projectDirectory) { if (projectDirectory.pathAppended("CMakeCache.txt").exists()) { emit addTask(Task(Task::Warning, @@ -200,7 +200,7 @@ bool CMakeBuildStep::init() "in-source build was done before. You are now building in \"%2\", " "and the CMakeCache.txt file might confuse CMake.") .arg(projectDirectory.toUserOutput(), bc->buildDirectory().toUserOutput()), - Utils::FileName(), -1, + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } @@ -371,10 +371,10 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const return arguments; } -Utils::FileName CMakeBuildStep::cmakeCommand() const +Utils::FilePath CMakeBuildStep::cmakeCommand() const { CMakeTool *tool = CMakeKitAspect::cmakeTool(target()->kit()); - return tool ? tool->cmakeExecutable() : Utils::FileName(); + return tool ? tool->cmakeExecutable() : Utils::FilePath(); } QString CMakeBuildStep::cleanTarget() diff --git a/src/plugins/cmakeprojectmanager/cmakebuildstep.h b/src/plugins/cmakeprojectmanager/cmakebuildstep.h index 73c29ff5ab..ba2f62dab6 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildstep.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildstep.h @@ -66,7 +66,7 @@ public: QString allArguments(const CMakeRunConfiguration *rc) const; - Utils::FileName cmakeCommand() const; + Utils::FilePath cmakeCommand() const; QVariantMap toMap() const override; diff --git a/src/plugins/cmakeprojectmanager/cmakebuildtarget.h b/src/plugins/cmakeprojectmanager/cmakebuildtarget.h index a22bb804c1..e46394bef5 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildtarget.h +++ b/src/plugins/cmakeprojectmanager/cmakebuildtarget.h @@ -46,17 +46,17 @@ class CMAKE_EXPORT CMakeBuildTarget { public: QString title; - Utils::FileName executable; // TODO: rename to output? + Utils::FilePath executable; // TODO: rename to output? TargetType targetType = UtilityType; - Utils::FileName workingDirectory; - Utils::FileName sourceDirectory; - Utils::FileName makeCommand; + Utils::FilePath workingDirectory; + Utils::FilePath sourceDirectory; + Utils::FilePath makeCommand; // code model - QList<Utils::FileName> includeFiles; + QList<Utils::FilePath> includeFiles; QStringList compilerOptions; ProjectExplorer::Macros macros; - QList<Utils::FileName> files; + QList<Utils::FilePath> files; }; } // namespace CMakeProjectManager diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp index 3409a2cdb1..b257d78619 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.cpp @@ -46,7 +46,7 @@ namespace Internal { //// namespace { -int distance(const FileName &targetDirectory, const FileName &fileName) +int distance(const FilePath &targetDirectory, const FilePath &fileName) { const QString commonParent = commonPath(QStringList({targetDirectory.toString(), fileName.toString()})); return targetDirectory.toString().midRef(commonParent.size()).count('/') @@ -61,12 +61,12 @@ int distance(const FileName &targetDirectory, const FileName &fileName) void CMakeCbpParser::sortFiles() { QLoggingCategory log("qtc.cmakeprojectmanager.filetargetmapping", QtWarningMsg); - FileNameList fileNames = transform<QList>(m_fileList, &FileNode::filePath); + FilePathList fileNames = transform<QList>(m_fileList, &FileNode::filePath); sort(fileNames); CMakeBuildTarget *last = nullptr; - FileName parentDirectory; + FilePath parentDirectory; qCDebug(log) << "###############"; qCDebug(log) << "# Pre Dump #"; @@ -96,7 +96,7 @@ void CMakeCbpParser::sortFiles() qCDebug(log) << "# Sorting #"; qCDebug(log) << "###############"; - foreach (const FileName &fileName, fileNames) { + foreach (const FilePath &fileName, fileNames) { qCDebug(log) << fileName; const QStringList unitTargets = m_unitTargetMap[fileName]; if (!unitTargets.isEmpty()) { @@ -160,12 +160,12 @@ void CMakeCbpParser::sortFiles() << target.files << "\n"; } -bool CMakeCbpParser::parseCbpFile(CMakeTool::PathMapper mapper, const FileName &fileName, - const FileName &sourceDirectory) +bool CMakeCbpParser::parseCbpFile(CMakeTool::PathMapper mapper, const FilePath &fileName, + const FilePath &sourceDirectory) { m_pathMapper = mapper; - m_buildDirectory = FileName::fromString(fileName.toFileInfo().absolutePath()); + m_buildDirectory = FilePath::fromString(fileName.toFileInfo().absolutePath()); m_sourceDirectory = sourceDirectory; QFile fi(fileName.toString()); @@ -263,7 +263,7 @@ void CMakeCbpParser::parseBuildTarget() void CMakeCbpParser::parseBuildTargetOption() { if (attributes().hasAttribute("output")) { - m_buildTarget.executable = m_pathMapper(FileName::fromString(attributes().value("output").toString())); + m_buildTarget.executable = m_pathMapper(FilePath::fromString(attributes().value("output").toString())); } else if (attributes().hasAttribute("type")) { const QStringRef value = attributes().value("type"); if (value == "0" || value == "1") @@ -275,7 +275,7 @@ void CMakeCbpParser::parseBuildTargetOption() else m_buildTarget.targetType = UtilityType; } else if (attributes().hasAttribute("working_dir")) { - m_buildTarget.workingDirectory = FileName::fromUserInput(attributes().value("working_dir").toString()); + m_buildTarget.workingDirectory = FilePath::fromUserInput(attributes().value("working_dir").toString()); QFile cmakeSourceInfoFile(m_buildTarget.workingDirectory.toString() + QStringLiteral("/CMakeFiles/CMakeDirectoryInformation.cmake")); @@ -287,7 +287,7 @@ void CMakeCbpParser::parseBuildTargetOption() if (lineTopSource.startsWith(searchSource, Qt::CaseInsensitive)) { QString src = lineTopSource.mid(searchSource.size()); src.chop(2); - m_buildTarget.sourceDirectory = FileName::fromString(src); + m_buildTarget.sourceDirectory = FilePath::fromString(src); break; } } @@ -348,7 +348,7 @@ void CMakeCbpParser::parseMakeCommands() void CMakeCbpParser::parseBuildTargetBuild() { if (attributes().hasAttribute("command")) - m_buildTarget.makeCommand = m_pathMapper(FileName::fromUserInput(attributes().value("command").toString())); + m_buildTarget.makeCommand = m_pathMapper(FilePath::fromUserInput(attributes().value("command").toString())); while (!atEnd()) { readNext(); if (isEndElement()) @@ -387,8 +387,8 @@ void CMakeCbpParser::parseAdd() // CMake only supports <Add option=\> and <Add directory=\> const QXmlStreamAttributes addAttributes = attributes(); - FileName includeDirectory - = m_pathMapper(FileName::fromString(addAttributes.value("directory").toString())); + FilePath includeDirectory + = m_pathMapper(FilePath::fromString(addAttributes.value("directory").toString())); // allow adding multiple times because order happens if (!includeDirectory.isEmpty()) @@ -416,8 +416,8 @@ void CMakeCbpParser::parseAdd() void CMakeCbpParser::parseUnit() { - FileName fileName = - m_pathMapper(FileName::fromUserInput(attributes().value("filename").toString())); + FilePath fileName = + m_pathMapper(FilePath::fromUserInput(attributes().value("filename").toString())); m_parsingCMakeUnit = false; m_unitTargets.clear(); diff --git a/src/plugins/cmakeprojectmanager/cmakecbpparser.h b/src/plugins/cmakeprojectmanager/cmakecbpparser.h index 44da473bcf..8a8d5fbe7f 100644 --- a/src/plugins/cmakeprojectmanager/cmakecbpparser.h +++ b/src/plugins/cmakeprojectmanager/cmakecbpparser.h @@ -46,8 +46,8 @@ namespace Internal { class CMakeCbpParser : public QXmlStreamReader { public: - bool parseCbpFile(CMakeTool::PathMapper mapper, const Utils::FileName &fileName, - const Utils::FileName &sourceDirectory); + bool parseCbpFile(CMakeTool::PathMapper mapper, const Utils::FilePath &fileName, + const Utils::FilePath &sourceDirectory); std::vector<std::unique_ptr<ProjectExplorer::FileNode>> && takeFileList() { return std::move(m_fileList); } std::vector<std::unique_ptr<ProjectExplorer::FileNode>> && @@ -74,19 +74,19 @@ private: void parseUnknownElement(); void sortFiles(); - QMap<Utils::FileName, QStringList> m_unitTargetMap; + QMap<Utils::FilePath, QStringList> m_unitTargetMap; CMakeTool::PathMapper m_pathMapper; std::vector<std::unique_ptr<ProjectExplorer::FileNode>> m_fileList; std::vector<std::unique_ptr<ProjectExplorer::FileNode>> m_cmakeFileList; - QSet<Utils::FileName> m_processedUnits; + QSet<Utils::FilePath> m_processedUnits; bool m_parsingCMakeUnit = false; CMakeBuildTarget m_buildTarget; QList<CMakeBuildTarget> m_buildTargets; QString m_projectName; QString m_compiler; - Utils::FileName m_sourceDirectory; - Utils::FileName m_buildDirectory; + Utils::FilePath m_sourceDirectory; + Utils::FilePath m_buildDirectory; QStringList m_unitTargets; }; diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp index 1b55f49216..c3e27c001b 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.cpp @@ -243,7 +243,7 @@ static QByteArrayList splitCMakeCacheLine(const QByteArray &line) { << line.mid(equalPos + 1); } -QList<CMakeConfigItem> CMakeConfigItem::itemsFromFile(const Utils::FileName &cacheFile, QString *errorMessage) +QList<CMakeConfigItem> CMakeConfigItem::itemsFromFile(const Utils::FilePath &cacheFile, QString *errorMessage) { CMakeConfig result; QFile cache(cacheFile.toString()); diff --git a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h index e5ccee8dcb..16bc8acea3 100644 --- a/src/plugins/cmakeprojectmanager/cmakeconfigitem.h +++ b/src/plugins/cmakeprojectmanager/cmakeconfigitem.h @@ -32,7 +32,7 @@ namespace ProjectExplorer { class Kit; } namespace Utils { -class FileName; +class FilePath; class MacroExpander; } // namespace Utils @@ -57,7 +57,7 @@ public: static std::function<bool(const CMakeConfigItem &a, const CMakeConfigItem &b)> sortOperator(); static CMakeConfigItem fromString(const QString &s); - static QList<CMakeConfigItem> itemsFromFile(const Utils::FileName &input, QString *errorMessage); + static QList<CMakeConfigItem> itemsFromFile(const Utils::FilePath &input, QString *errorMessage); QString toString(const Utils::MacroExpander *expander = nullptr) const; QString toArgument(const Utils::MacroExpander *expander = nullptr) const; diff --git a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp index ba2c902f0c..07f350caf1 100644 --- a/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp +++ b/src/plugins/cmakeprojectmanager/cmakefilecompletionassist.cpp @@ -63,7 +63,7 @@ IAssistProposal *CMakeFileCompletionAssist::perform(const AssistInterface *inter Keywords kw; QString fileName = interface->fileName(); if (!fileName.isEmpty() && QFileInfo(fileName).isFile()) { - Project *p = SessionManager::projectForFile(Utils::FileName::fromString(fileName)); + Project *p = SessionManager::projectForFile(Utils::FilePath::fromString(fileName)); if (p && p->activeTarget()) { CMakeTool *cmake = CMakeKitAspect::cmakeTool(p->activeTarget()->kit()); if (cmake && cmake->isValid()) diff --git a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp index fa4d26fc2e..823d471102 100644 --- a/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp +++ b/src/plugins/cmakeprojectmanager/cmakekitinformation.cpp @@ -254,7 +254,7 @@ Tasks CMakeKitAspect::validate(const Kit *k) const if (version.major < 3) { result << Task(Task::Warning, tr("CMake version %1 is unsupported. Please update to " "version 3.0 or later.").arg(QString::fromUtf8(version.fullVersion)), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } return result; @@ -615,7 +615,7 @@ QVariant CMakeGeneratorKitAspect::defaultValue(const Kit *k) const if (it != known.constEnd()) { Utils::Environment env = Utils::Environment::systemEnvironment(); k->addToEnvironment(env); - const Utils::FileName ninjaExec = env.searchInPath(QLatin1String("ninja")); + const Utils::FilePath ninjaExec = env.searchInPath(QLatin1String("ninja")); if (!ninjaExec.isEmpty()) return GeneratorInfo({QString("Ninja"), extraGenerator, QString(), QString()}).toVariant(); } @@ -659,7 +659,7 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const if (tool) { if (!tool->isValid()) { result << Task(Task::Warning, tr("CMake Tool is unconfigured, CMake generator will be ignored."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } else { QList<CMakeTool::Generator> known = tool->supportedGenerators(); auto it = std::find_if(known.constBegin(), known.constEnd(), [info](const CMakeTool::Generator &g) { @@ -667,15 +667,15 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const }); if (it == known.constEnd()) { result << Task(Task::Warning, tr("CMake Tool does not support the configured generator."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } else { if (!it->supportsPlatform && !info.platform.isEmpty()) { result << Task(Task::Warning, tr("Platform is not supported by the selected CMake generator."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } if (!it->supportsToolset && !info.toolset.isEmpty()) { result << Task(Task::Warning, tr("Toolset is not supported by the selected CMake generator."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } if (!tool->hasServerMode() && info.extraGenerator != "CodeBlocks") { @@ -683,7 +683,7 @@ Tasks CMakeGeneratorKitAspect::validate(const Kit *k) const "generator does not generate a CodeBlocks file. " "%1 will not be able to parse CMake projects.") .arg(Core::Constants::IDE_DISPLAY_NAME), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } } @@ -962,14 +962,14 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const const CMakeConfig config = configuration(k); const bool isQt4 = version && version->qtVersion() < QtSupport::QtVersionNumber(5, 0, 0); - Utils::FileName qmakePath; + Utils::FilePath qmakePath; QStringList qtInstallDirs; - Utils::FileName tcCPath; - Utils::FileName tcCxxPath; + Utils::FilePath tcCPath; + Utils::FilePath tcCxxPath; foreach (const CMakeConfigItem &i, config) { // Do not use expand(QByteArray) as we cannot be sure the input is latin1 - const Utils::FileName expandedValue - = Utils::FileName::fromString(k->macroExpander()->expand(QString::fromUtf8(i.value))); + const Utils::FilePath expandedValue + = Utils::FilePath::fromString(k->macroExpander()->expand(QString::fromUtf8(i.value))); if (i.key == CMAKE_QMAKE_KEY) qmakePath = expandedValue; else if (i.key == CMAKE_C_TOOLCHAIN_KEY) @@ -986,25 +986,25 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const if (version && version->isValid() && isQt4) { result << Task(Task::Warning, tr("CMake configuration has no path to qmake binary set, " "even though the kit has a valid Qt version."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } else { if (!version || !version->isValid()) { result << Task(Task::Warning, tr("CMake configuration has a path to a qmake binary set, " "even though the kit has no valid Qt version."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } else if (qmakePath != version->qmakeCommand() && isQt4) { result << Task(Task::Warning, tr("CMake configuration has a path to a qmake binary set " "that does not match the qmake binary path " "configured in the Qt version."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } if (version && !qtInstallDirs.contains(version->qmakeProperty("QT_INSTALL_PREFIX")) && !isQt4) { if (version->isValid()) { result << Task(Task::Warning, tr("CMake configuration has no CMAKE_PREFIX_PATH set " "that points to the kit Qt version."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } @@ -1013,18 +1013,18 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const if (tcC && tcC->isValid()) { result << Task(Task::Warning, tr("CMake configuration has no path to a C compiler set, " "even though the kit has a valid tool chain."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } else { if (!tcC || !tcC->isValid()) { result << Task(Task::Warning, tr("CMake configuration has a path to a C compiler set, " "even though the kit has no valid tool chain."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } else if (tcCPath != tcC->compilerCommand()) { result << Task(Task::Warning, tr("CMake configuration has a path to a C compiler set " "that does not match the compiler path " "configured in the tool chain of the kit."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } @@ -1032,18 +1032,18 @@ Tasks CMakeConfigurationKitAspect::validate(const Kit *k) const if (tcCxx && tcCxx->isValid()) { result << Task(Task::Warning, tr("CMake configuration has no path to a C++ compiler set, " "even though the kit has a valid tool chain."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } else { if (!tcCxx || !tcCxx->isValid()) { result << Task(Task::Warning, tr("CMake configuration has a path to a C++ compiler set, " "even though the kit has no valid tool chain."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } else if (tcCxxPath != tcCxx->compilerCommand()) { result << Task(Task::Warning, tr("CMake configuration has a path to a C++ compiler set " "that does not match the compiler path " "configured in the tool chain of the kit."), - Utils::FileName(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } } diff --git a/src/plugins/cmakeprojectmanager/cmakeparser.cpp b/src/plugins/cmakeprojectmanager/cmakeparser.cpp index ac3a55dfe4..be67db464f 100644 --- a/src/plugins/cmakeprojectmanager/cmakeparser.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeparser.cpp @@ -67,12 +67,12 @@ void CMakeParser::stdError(const QString &line) m_skippedFirstEmptyLine = false; if (m_commonError.indexIn(trimmedLine) != -1) { - m_lastTask = Task(Task::Error, QString(), Utils::FileName::fromUserInput(m_commonError.cap(1)), + m_lastTask = Task(Task::Error, QString(), Utils::FilePath::fromUserInput(m_commonError.cap(1)), m_commonError.cap(2).toInt(), Constants::TASK_CATEGORY_BUILDSYSTEM); m_lines = 1; return; } else if (m_nextSubError.indexIn(trimmedLine) != -1) { - m_lastTask = Task(Task::Error, QString(), Utils::FileName::fromUserInput(m_nextSubError.cap(1)), -1, + m_lastTask = Task(Task::Error, QString(), Utils::FilePath::fromUserInput(m_nextSubError.cap(1)), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); m_lines = 1; return; @@ -86,11 +86,11 @@ void CMakeParser::stdError(const QString &line) m_expectTripleLineErrorData = LINE_LOCATION; doFlush(); m_lastTask = Task(trimmedLine.contains(QLatin1String("Error")) ? Task::Error : Task::Warning, - QString(), Utils::FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); + QString(), Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); return; } else if (trimmedLine.startsWith("CMake Error: ")) { m_lastTask = Task(Task::Error, trimmedLine.mid(13), - Utils::FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); + Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); m_lines = 1; return; } @@ -100,7 +100,7 @@ void CMakeParser::stdError(const QString &line) { QRegularExpressionMatch m = m_locationLine.match(trimmedLine); QTC_CHECK(m.hasMatch()); - m_lastTask.file = Utils::FileName::fromUserInput(trimmedLine.mid(0, m.capturedStart())); + m_lastTask.file = Utils::FilePath::fromUserInput(trimmedLine.mid(0, m.capturedStart())); m_lastTask.line = m.captured(1).toInt(); m_expectTripleLineErrorData = LINE_DESCRIPTION; } @@ -180,11 +180,11 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("Cannot find source file: unknownFile.qml Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx"), - Utils::FileName::fromUserInput(QLatin1String("src/1/app/CMakeLists.txt")), 70, + Utils::FilePath::fromUserInput(QLatin1String("src/1/app/CMakeLists.txt")), 70, categoryBuild) << Task(Task::Error, QLatin1String("Cannot find source file: CMakeLists.txt2 Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp .hxx .in .txx"), - Utils::FileName::fromUserInput(QLatin1String("src/1/app/CMakeLists.txt")), -1, + Utils::FilePath::fromUserInput(QLatin1String("src/1/app/CMakeLists.txt")), -1, categoryBuild)) << QString(); @@ -196,7 +196,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("add_subdirectory given source \"app1\" which is not an existing directory."), - Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, + Utils::FilePath::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, categoryBuild)) << QString(); @@ -208,7 +208,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("Unknown CMake command \"i_am_wrong_command\"."), - Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, + Utils::FilePath::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, categoryBuild)) << QString(); @@ -220,7 +220,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("message called with incorrect number of arguments"), - Utils::FileName::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, + Utils::FilePath::fromUserInput(QLatin1String("src/1/CMakeLists.txt")), 8, categoryBuild)) << QString(); @@ -234,7 +234,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("Parse error. Expected \"(\", got newline with text \"\n\"."), - Utils::FileName::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9, + Utils::FilePath::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9, categoryBuild)) << QString(); @@ -247,7 +247,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("Error required internal CMake variable not set, cmake may be not be built correctly."), - Utils::FileName(), -1, categoryBuild)) + Utils::FilePath(), -1, categoryBuild)) << QString(); QTest::newRow("cmake error at") @@ -260,7 +260,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Error, QLatin1String("Parse error. Expected \"(\", got newline with text \" \"."), - Utils::FileName::fromUserInput(QLatin1String("CMakeLists.txt")), 4, + Utils::FilePath::fromUserInput(QLatin1String("CMakeLists.txt")), 4, categoryBuild)) << QString(); @@ -273,7 +273,7 @@ void Internal::CMakeProjectPlugin::testCMakeParser_data() << (Tasks() << Task(Task::Warning, QLatin1String("Argument not separated from preceding token by whitespace."), - Utils::FileName::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9, + Utils::FilePath::fromUserInput(QLatin1String("/test/path/CMakeLists.txt")), 9, categoryBuild)) << QString(); } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 29b6d8cb30..4814ab4c32 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -80,7 +80,7 @@ static CMakeBuildConfiguration *activeBc(const CMakeProject *p) /*! \class CMakeProject */ -CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEMIMETYPE, fileName), +CMakeProject::CMakeProject(const FilePath &fileName) : Project(Constants::CMAKEMIMETYPE, fileName), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater) { setId(CMakeProjectManager::Constants::CMAKEPROJECT_ID); @@ -213,7 +213,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM // TreeScanner: connect(&m_treeScanner, &TreeScanner::finished, this, &CMakeProject::handleTreeScanningFinished); - m_treeScanner.setFilter([this](const Utils::MimeType &mimeType, const Utils::FileName &fn) { + m_treeScanner.setFilter([this](const Utils::MimeType &mimeType, const Utils::FilePath &fn) { // Mime checks requires more resources, so keep it last in check list auto isIgnored = fn.toString().startsWith(projectFilePath().toString() + ".user") || @@ -233,7 +233,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM return isIgnored; }); - m_treeScanner.setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FileName &fn) { + m_treeScanner.setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FilePath &fn) { auto type = TreeScanner::genericFileType(mimeType, fn); if (type == FileType::Unknown) { if (mimeType.isValid()) { @@ -381,7 +381,7 @@ void CMakeProject::updateQmlJSCodeModel() } foreach (const QString &cmakeImport, CMakeConfigItem::cmakeSplitValue(cmakeImports)) - projectInfo.importPaths.maybeInsert(FileName::fromString(cmakeImport), QmlJS::Dialect::Qml); + projectInfo.importPaths.maybeInsert(FilePath::fromString(cmakeImport), QmlJS::Dialect::Qml); modelManager->updateProjectInfo(projectInfo, this); } @@ -588,16 +588,16 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const if (!activeTarget()) return QStringList(); QFileInfo fi(sourceFile); - FileName project = projectDirectory(); - FileName baseDirectory = FileName::fromString(fi.absolutePath()); + FilePath project = projectDirectory(); + FilePath baseDirectory = FilePath::fromString(fi.absolutePath()); while (baseDirectory.isChildOf(project)) { - const FileName cmakeListsTxt = baseDirectory.pathAppended("CMakeLists.txt"); + const FilePath cmakeListsTxt = baseDirectory.pathAppended("CMakeLists.txt"); if (cmakeListsTxt.exists()) break; QDir dir(baseDirectory.toString()); dir.cdUp(); - baseDirectory = FileName::fromString(dir.absolutePath()); + baseDirectory = FilePath::fromString(dir.absolutePath()); } QDir srcDirRoot = QDir(project.toString()); @@ -623,7 +623,7 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const ProjectExplorer::DeploymentKnowledge CMakeProject::deploymentKnowledge() const { - return contains(files(AllFiles), [](const FileName &f) { + return contains(files(AllFiles), [](const FilePath &f) { return f.fileName() == "QtCreatorDeployment.txt"; }) ? DeploymentKnowledge::Approximative : DeploymentKnowledge::Bad; } @@ -658,7 +658,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const = Utils::transform<QSet>(factories, &ExtraCompilerFactory::sourceTag); // Find all files generated by any of the extra compilers, in a rather crude way. - const FileNameList fileList = files([&fileExtensions](const Node *n) { + const FilePathList fileList = files([&fileExtensions](const Node *n) { if (!SourceFiles(n)) return false; const QString fp = n->filePath().toString(); @@ -667,7 +667,7 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const }); // Generate the necessary information: - for (const FileName &file : fileList) { + for (const FilePath &file : fileList) { ExtraCompilerFactory *factory = Utils::findOrDefault(factories, [&file](const ExtraCompilerFactory *f) { return file.endsWith('.' + f->sourceTag()); }); @@ -677,9 +677,9 @@ QList<ProjectExplorer::ExtraCompiler *> CMakeProject::findExtraCompilers() const if (generated.isEmpty()) continue; - const FileNameList fileNames + const FilePathList fileNames = transform(generated, - [](const QString &s) { return FileName::fromString(s); }); + [](const QString &s) { return FilePath::fromString(s); }); extraCompilers.append(factory->create(this, file, fileNames)); } diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h index de8dd9f800..3af409f1b6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.h +++ b/src/plugins/cmakeprojectmanager/cmakeproject.h @@ -60,7 +60,7 @@ class CMAKE_EXPORT CMakeProject : public ProjectExplorer::Project Q_OBJECT public: - explicit CMakeProject(const Utils::FileName &filename); + explicit CMakeProject(const Utils::FilePath &filename); ~CMakeProject() final; QStringList buildTargetTitles() const; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 66652dfcba..e647692439 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -56,7 +56,7 @@ Q_LOGGING_CATEGORY(cmInputLog, "qtc.cmake.import", QtWarningMsg); struct CMakeToolChainData { QByteArray languageId; - Utils::FileName compilerPath; + Utils::FilePath compilerPath; Core::Id mapLanguageIdToQtC() const { const QByteArray li = languageId.toLower(); @@ -73,10 +73,10 @@ struct DirectoryData { // Project Stuff: QByteArray cmakeBuildType; - Utils::FileName buildDirectory; + Utils::FilePath buildDirectory; // Kit Stuff - Utils::FileName cmakeBinary; + Utils::FilePath cmakeBinary; QByteArray generator; QByteArray extraGenerator; QByteArray platform; @@ -106,7 +106,7 @@ static QStringList scanDirectory(const QString &path, const QString &prefix) namespace CMakeProjectManager { namespace Internal { -CMakeProjectImporter::CMakeProjectImporter(const Utils::FileName &path) : QtProjectImporter(path) +CMakeProjectImporter::CMakeProjectImporter(const Utils::FilePath &path) : QtProjectImporter(path) { useTemporaryKitAspect(CMakeKitAspect::id(), [this](Kit *k, const QVariantList &vl) { cleanupTemporaryCMake(k, vl); }, @@ -131,24 +131,24 @@ QStringList CMakeProjectImporter::importCandidates() return finalists; } -static Utils::FileName qmakeFromCMakeCache(const CMakeConfig &config) +static Utils::FilePath qmakeFromCMakeCache(const CMakeConfig &config) { // Qt4 way to define things (more convenient for us, so try this first;-) - Utils::FileName qmake - = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf(QByteArray("QT_QMAKE_EXECUTABLE"), config)); + Utils::FilePath qmake + = Utils::FilePath::fromUtf8(CMakeConfigItem::valueOf(QByteArray("QT_QMAKE_EXECUTABLE"), config)); qCDebug(cmInputLog()) << "QT_QMAKE_EXECUTABLE=" << qmake.toUserOutput(); if (!qmake.isEmpty()) return qmake; // Check Qt5 settings: oh, the horror! - const Utils::FileName qtCMakeDir - = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf(QByteArray("Qt5Core_DIR"), config)); + const Utils::FilePath qtCMakeDir + = Utils::FilePath::fromUtf8(CMakeConfigItem::valueOf(QByteArray("Qt5Core_DIR"), config)); qCDebug(cmInputLog()) << "Qt5Core_DIR=" << qtCMakeDir.toUserOutput(); - const Utils::FileName canQtCMakeDir = Utils::FileName::fromString(qtCMakeDir.toFileInfo().canonicalFilePath()); + const Utils::FilePath canQtCMakeDir = Utils::FilePath::fromString(qtCMakeDir.toFileInfo().canonicalFilePath()); qCInfo(cmInputLog()) << "Qt5Core_DIR (canonical)=" << canQtCMakeDir.toUserOutput(); if (qtCMakeDir.isEmpty()) - return Utils::FileName(); - const Utils::FileName baseQtDir = canQtCMakeDir.parentDir().parentDir().parentDir(); // Up 3 levels... + return Utils::FilePath(); + const Utils::FilePath baseQtDir = canQtCMakeDir.parentDir().parentDir().parentDir(); // Up 3 levels... qCDebug(cmInputLog()) << "BaseQtDir:" << baseQtDir.toUserOutput(); // "Parse" Qt5Core/Qt5CoreConfigExtras.cmake: @@ -167,7 +167,7 @@ static Utils::FileName qmakeFromCMakeCache(const CMakeConfig &config) QFile extras(qtCMakeDir.toString() + "/Qt5CoreConfigExtras.cmake"); if (!extras.open(QIODevice::ReadOnly)) - return Utils::FileName(); + return Utils::FilePath(); QByteArray data; bool inQmakeSection = false; @@ -202,9 +202,9 @@ static Utils::FileName qmakeFromCMakeCache(const CMakeConfig &config) const int sp = origLine.indexOf('}'); const int ep = origLine.lastIndexOf('"'); - QTC_ASSERT(sp > 0, return Utils::FileName()); - QTC_ASSERT(ep > sp + 2, return Utils::FileName()); - QTC_ASSERT(ep < origLine.count(), return Utils::FileName()); + QTC_ASSERT(sp > 0, return Utils::FilePath()); + QTC_ASSERT(ep > sp + 2, return Utils::FilePath()); + QTC_ASSERT(ep < origLine.count(), return Utils::FilePath()); // Eat the leading "}/" and trailing " const QByteArray locationPart = origLine.mid(sp + 2, ep - 2 - sp); @@ -215,7 +215,7 @@ static Utils::FileName qmakeFromCMakeCache(const CMakeConfig &config) } // Now try to make sense of .../Qt5CoreConfig.cmake: - return Utils::FileName(); + return Utils::FilePath(); } QVector<CMakeToolChainData> extractToolChainsFromCache(const CMakeConfig &config) @@ -225,15 +225,15 @@ QVector<CMakeToolChainData> extractToolChainsFromCache(const CMakeConfig &config if (!i.key.startsWith("CMAKE_") || !i.key.endsWith("_COMPILER")) continue; const QByteArray language = i.key.mid(6, i.key.count() - 6 - 9); // skip "CMAKE_" and "_COMPILER" - result.append({language, Utils::FileName::fromUtf8(i.value)}); + result.append({language, Utils::FilePath::fromUtf8(i.value)}); } return result; } -QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &importPath) const +QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FilePath &importPath) const { qCInfo(cmInputLog()) << "Examining directory:" << importPath.toUserOutput(); - const FileName cacheFile = importPath.pathAppended("CMakeCache.txt"); + const FilePath cacheFile = importPath.pathAppended("CMakeCache.txt"); if (!cacheFile.exists()) { qCDebug(cmInputLog()) << cacheFile.toUserOutput() << "does not exist, returning."; @@ -247,8 +247,8 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo return { }; } const auto homeDir - = Utils::FileName::fromUserInput(QString::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", config))); - const Utils::FileName canonicalProjectDirectory = projectDirectory().canonicalPath(); + = Utils::FilePath::fromUserInput(QString::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", config))); + const Utils::FilePath canonicalProjectDirectory = projectDirectory().canonicalPath(); if (homeDir != canonicalProjectDirectory) { qCDebug(cmInputLog()) << "Wrong source directory:" << homeDir.toUserOutput() << "expected:" << canonicalProjectDirectory.toUserOutput(); @@ -260,7 +260,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo data->cmakeBuildType = CMakeConfigItem::valueOf("CMAKE_BUILD_TYPE", config); data->cmakeBinary - = Utils::FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_COMMAND", config)); + = Utils::FilePath::fromUtf8(CMakeConfigItem::valueOf("CMAKE_COMMAND", config)); data->generator = CMakeConfigItem::valueOf("CMAKE_GENERATOR", config); data->extraGenerator = CMakeConfigItem::valueOf("CMAKE_EXTRA_GENERATOR", config); data->platform = CMakeConfigItem::valueOf("CMAKE_GENERATOR_PLATFORM", config); @@ -269,7 +269,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo data->sysroot = CMakeConfigItem::valueOf("CMAKE_SYSROOT", config); // Qt: - const Utils::FileName qmake = qmakeFromCMakeCache(config); + const Utils::FilePath qmake = qmakeFromCMakeCache(config); if (!qmake.isEmpty()) data->qt = findOrCreateQtVersion(qmake); @@ -294,7 +294,7 @@ bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const || CMakeGeneratorKitAspect::toolset(k) != QString::fromUtf8(data->toolset)) return false; - if (SysRootKitAspect::sysRoot(k) != Utils::FileName::fromUtf8(data->sysroot)) + if (SysRootKitAspect::sysRoot(k) != Utils::FilePath::fromUtf8(data->sysroot)) return false; if (data->qt.qt && QtSupport::QtKitAspect::qtVersionId(k) != data->qt.qt->uniqueId()) @@ -326,7 +326,7 @@ Kit *CMakeProjectImporter::createKit(void *directoryData) const CMakeGeneratorKitAspect::setPlatform(k, QString::fromUtf8(data->platform)); CMakeGeneratorKitAspect::setToolset(k, QString::fromUtf8(data->toolset)); - SysRootKitAspect::setSysRoot(k, Utils::FileName::fromUtf8(data->sysroot)); + SysRootKitAspect::setSysRoot(k, Utils::FilePath::fromUtf8(data->sysroot)); for (const CMakeToolChainData &cmtcd : data->toolChains) { const ToolChainData tcd @@ -364,7 +364,7 @@ const QList<BuildInfo> CMakeProjectImporter::buildInfoListForKit(const Kit *k, v } CMakeProjectImporter::CMakeToolData -CMakeProjectImporter::findOrCreateCMakeTool(const Utils::FileName &cmakeToolPath) const +CMakeProjectImporter::findOrCreateCMakeTool(const Utils::FilePath &cmakeToolPath) const { CMakeToolData result; result.cmakeTool = CMakeToolManager::findByCommand(cmakeToolPath); @@ -448,7 +448,7 @@ void CMakeProjectPlugin::testCMakeProjectImporterQt() config.append(CMakeConfigItem(key.toUtf8(), value.toUtf8())); } - Utils::FileName realQmake = qmakeFromCMakeCache(config); + Utils::FilePath realQmake = qmakeFromCMakeCache(config); QCOMPARE(realQmake.toString(), expectedQmake); } void CMakeProjectPlugin::testCMakeProjectImporterToolChain_data() diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h index c86fe77041..9940da3723 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.h @@ -36,12 +36,12 @@ namespace Internal { class CMakeProjectImporter : public QtSupport::QtProjectImporter { public: - CMakeProjectImporter(const Utils::FileName &path); + CMakeProjectImporter(const Utils::FilePath &path); QStringList importCandidates() final; private: - QList<void *> examineDirectory(const Utils::FileName &importPath) const final; + QList<void *> examineDirectory(const Utils::FilePath &importPath) const final; bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const final; ProjectExplorer::Kit *createKit(void *directoryData) const final; const QList<ProjectExplorer::BuildInfo> buildInfoListForKit(const ProjectExplorer::Kit *k, @@ -51,7 +51,7 @@ private: bool isTemporary = false; CMakeTool *cmakeTool = nullptr; }; - CMakeToolData findOrCreateCMakeTool(const Utils::FileName &cmakeToolPath) const; + CMakeToolData findOrCreateCMakeTool(const Utils::FilePath &cmakeToolPath) const; void deleteDirectoryData(void *directoryData) const final; diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp index 1770c59dc4..b4ad72595d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.cpp @@ -115,7 +115,7 @@ void noAutoAdditionNotify(const QStringList &filePaths, const ProjectExplorer::P } -CMakeInputsNode::CMakeInputsNode(const Utils::FileName &cmakeLists) : +CMakeInputsNode::CMakeInputsNode(const Utils::FilePath &cmakeLists) : ProjectExplorer::ProjectNode(cmakeLists) { setPriority(Node::DefaultPriority - 10); // Bottom most! @@ -124,7 +124,7 @@ CMakeInputsNode::CMakeInputsNode(const Utils::FileName &cmakeLists) : setListInProject(false); } -CMakeListsNode::CMakeListsNode(const Utils::FileName &cmakeListPath) : +CMakeListsNode::CMakeListsNode(const Utils::FilePath &cmakeListPath) : ProjectExplorer::ProjectNode(cmakeListPath) { static QIcon folderIcon = Core::FileIconProvider::directoryIcon(Constants::FILEOVERLAY_CMAKE); @@ -142,12 +142,12 @@ bool CMakeListsNode::supportsAction(ProjectExplorer::ProjectAction action, const return action == ProjectExplorer::ProjectAction::AddNewFile; } -Utils::optional<Utils::FileName> CMakeListsNode::visibleAfterAddFileAction() const +Utils::optional<Utils::FilePath> CMakeListsNode::visibleAfterAddFileAction() const { return filePath().pathAppended("CMakeLists.txt"); } -CMakeProjectNode::CMakeProjectNode(const Utils::FileName &directory) : +CMakeProjectNode::CMakeProjectNode(const Utils::FilePath &directory) : ProjectExplorer::ProjectNode(directory) { setPriority(Node::DefaultProjectPriority + 1000); @@ -166,7 +166,7 @@ bool CMakeProjectNode::addFiles(const QStringList &filePaths, QStringList *) return true; // Return always true as autoadd is not supported! } -CMakeTargetNode::CMakeTargetNode(const Utils::FileName &directory, const QString &target) : +CMakeTargetNode::CMakeTargetNode(const Utils::FilePath &directory, const QString &target) : ProjectExplorer::ProjectNode(directory) { m_target = target; @@ -176,7 +176,7 @@ CMakeTargetNode::CMakeTargetNode(const Utils::FileName &directory, const QString setIsProduct(); } -QString CMakeTargetNode::generateId(const Utils::FileName &directory, const QString &target) +QString CMakeTargetNode::generateId(const Utils::FilePath &directory, const QString &target) { return directory.toString() + "///::///" + target; } @@ -249,19 +249,19 @@ bool CMakeTargetNode::addFiles(const QStringList &filePaths, QStringList *) return true; // Return always true as autoadd is not supported! } -Utils::optional<Utils::FileName> CMakeTargetNode::visibleAfterAddFileAction() const +Utils::optional<Utils::FilePath> CMakeTargetNode::visibleAfterAddFileAction() const { return filePath().pathAppended("CMakeLists.txt"); } -void CMakeTargetNode::setTargetInformation(const QList<Utils::FileName> &artifacts, +void CMakeTargetNode::setTargetInformation(const QList<Utils::FilePath> &artifacts, const QString &type) { m_tooltip = QCoreApplication::translate("CMakeTargetNode", "Target type: ") + type + "<br>"; if (artifacts.isEmpty()) { m_tooltip += QCoreApplication::translate("CMakeTargetNode", "No build artifacts"); } else { - const QStringList tmp = Utils::transform(artifacts, &Utils::FileName::toUserOutput); + const QStringList tmp = Utils::transform(artifacts, &Utils::FilePath::toUserOutput); m_tooltip += QCoreApplication::translate("CMakeTargetNode", "Build artifacts:") + "<br>" + tmp.join("<br>"); } diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h index 82cbb73dbb..18a4288f08 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h +++ b/src/plugins/cmakeprojectmanager/cmakeprojectnodes.h @@ -35,23 +35,23 @@ namespace Internal { class CMakeInputsNode : public ProjectExplorer::ProjectNode { public: - CMakeInputsNode(const Utils::FileName &cmakeLists); + CMakeInputsNode(const Utils::FilePath &cmakeLists); }; class CMakeListsNode : public ProjectExplorer::ProjectNode { public: - CMakeListsNode(const Utils::FileName &cmakeListPath); + CMakeListsNode(const Utils::FilePath &cmakeListPath); bool showInSimpleTree() const final; bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override; - Utils::optional<Utils::FileName> visibleAfterAddFileAction() const override; + Utils::optional<Utils::FilePath> visibleAfterAddFileAction() const override; }; class CMakeProjectNode : public ProjectExplorer::ProjectNode { public: - CMakeProjectNode(const Utils::FileName &directory); + CMakeProjectNode(const Utils::FilePath &directory); QString tooltip() const final; @@ -61,18 +61,18 @@ public: class CMakeTargetNode : public ProjectExplorer::ProjectNode { public: - CMakeTargetNode(const Utils::FileName &directory, const QString &target); + CMakeTargetNode(const Utils::FilePath &directory, const QString &target); - static QString generateId(const Utils::FileName &directory, const QString &target); + static QString generateId(const Utils::FilePath &directory, const QString &target); - void setTargetInformation(const QList<Utils::FileName> &artifacts, const QString &type); + void setTargetInformation(const QList<Utils::FilePath> &artifacts, const QString &type); QString tooltip() const final; QString buildKey() const final; bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override; bool addFiles(const QStringList &filePaths, QStringList *notAdded) override; - Utils::optional<Utils::FileName> visibleAfterAddFileAction() const override; + Utils::optional<Utils::FilePath> visibleAfterAddFileAction() const override; QVariant data(Core::Id role) const override; void setConfig(const CMakeConfig &config); diff --git a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp index 0f125ba6e4..991eb274c4 100644 --- a/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp +++ b/src/plugins/cmakeprojectmanager/cmakesettingspage.cpp @@ -67,12 +67,12 @@ public: CMakeToolTreeItem *cmakeToolItem(const Core::Id &id) const; CMakeToolTreeItem *cmakeToolItem(const QModelIndex &index) const; - QModelIndex addCMakeTool(const QString &name, const FileName &executable, const bool autoRun, const bool autoCreate, const bool isAutoDetected); + QModelIndex addCMakeTool(const QString &name, const FilePath &executable, const bool autoRun, const bool autoCreate, const bool isAutoDetected); void addCMakeTool(const CMakeTool *item, bool changed); TreeItem *autoGroupItem() const; TreeItem *manualGroupItem() const; void reevaluateChangedFlag(CMakeToolTreeItem *item) const; - void updateCMakeTool(const Core::Id &id, const QString &displayName, const FileName &executable, + void updateCMakeTool(const Core::Id &id, const QString &displayName, const FilePath &executable, bool autoRun, bool autoCreate); void removeCMakeTool(const Core::Id &id); void apply(); @@ -101,7 +101,7 @@ public: m_changed(changed) {} - CMakeToolTreeItem(const QString &name, const Utils::FileName &executable, + CMakeToolTreeItem(const QString &name, const Utils::FilePath &executable, bool autoRun, bool autoCreate, bool autodetected) : m_id(Core::Id::fromString(QUuid::createUuid().toString())), m_name(name), @@ -143,7 +143,7 @@ public: Core::Id m_id; QString m_name; - FileName m_executable; + FilePath m_executable; bool m_isAutoRun = true; bool m_autoCreateBuildDirectory = false; bool m_autodetected = false; @@ -168,7 +168,7 @@ CMakeToolItemModel::CMakeToolItemModel() } -QModelIndex CMakeToolItemModel::addCMakeTool(const QString &name, const FileName &executable, +QModelIndex CMakeToolItemModel::addCMakeTool(const QString &name, const FilePath &executable, const bool autoRun, const bool autoCreate, const bool isAutoDetected) { @@ -223,7 +223,7 @@ void CMakeToolItemModel::reevaluateChangedFlag(CMakeToolTreeItem *item) const } void CMakeToolItemModel::updateCMakeTool(const Core::Id &id, const QString &displayName, - const FileName &executable, bool autoRun, + const FilePath &executable, bool autoRun, bool autoCreate) { CMakeToolTreeItem *treeItem = cmakeToolItem(id); @@ -519,7 +519,7 @@ void CMakeToolConfigWidget::cloneCMakeTool() void CMakeToolConfigWidget::addCMakeTool() { QModelIndex newItem = m_model.addCMakeTool(m_model.uniqueDisplayName(tr("New CMake")), - FileName(), true, false, false); + FilePath(), true, false, false); m_cmakeToolsView->setCurrentIndex(newItem); } diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 0f348f13e3..ac0ac0999e 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -102,7 +102,7 @@ CMakeTool::CMakeTool(const QVariantMap &map, bool fromSdk) : if (!fromSdk) m_isAutoDetected = map.value(CMAKE_INFORMATION_AUTODETECTED, false).toBool(); - setCMakeExecutable(Utils::FileName::fromString(map.value(CMAKE_INFORMATION_COMMAND).toString())); + setCMakeExecutable(Utils::FilePath::fromString(map.value(CMAKE_INFORMATION_COMMAND).toString())); } CMakeTool::~CMakeTool() = default; @@ -112,7 +112,7 @@ Core::Id CMakeTool::createId() return Core::Id::fromString(QUuid::createUuid().toString()); } -void CMakeTool::setCMakeExecutable(const Utils::FileName &executable) +void CMakeTool::setCMakeExecutable(const Utils::FilePath &executable) { if (m_executable == executable) return; @@ -187,10 +187,10 @@ QVariantMap CMakeTool::toMap() const return data; } -Utils::FileName CMakeTool::cmakeExecutable() const +Utils::FilePath CMakeTool::cmakeExecutable() const { if (Utils::HostOsInfo::isMacHost() && m_executable.endsWith(".app")) { - const Utils::FileName toTest = m_executable.pathAppended("Contents/bin/cmake"); + const Utils::FilePath toTest = m_executable.pathAppended("Contents/bin/cmake"); if (toTest.exists()) return toTest; } @@ -279,7 +279,7 @@ CMakeTool::PathMapper CMakeTool::pathMapper() const { if (m_pathMapper) return m_pathMapper; - return [](const Utils::FileName &fn) { return fn; }; + return [](const Utils::FilePath &fn) { return fn; }; } void CMakeTool::readInformation(CMakeTool::QueryType type) const diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 052722d89f..85feaf41e5 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -76,7 +76,7 @@ public: bool matches(const QString &n, const QString &ex) const; }; - using PathMapper = std::function<Utils::FileName (const Utils::FileName &)>; + using PathMapper = std::function<Utils::FilePath (const Utils::FilePath &)>; explicit CMakeTool(Detection d, const Core::Id &id); explicit CMakeTool(const QVariantMap &map, bool fromSdk); @@ -89,11 +89,11 @@ public: Core::Id id() const { return m_id; } QVariantMap toMap () const; - void setCMakeExecutable(const Utils::FileName &executable); + void setCMakeExecutable(const Utils::FilePath &executable); void setAutorun(bool autoRun); void setAutoCreateBuildDirectory(bool autoBuildDir); - Utils::FileName cmakeExecutable() const; + Utils::FilePath cmakeExecutable() const; bool isAutoRun() const; bool autoCreateBuildDirectory() const; QList<Generator> supportedGenerators() const; @@ -129,7 +129,7 @@ private: Core::Id m_id; QString m_displayName; - Utils::FileName m_executable; + Utils::FilePath m_executable; bool m_isAutoRun = true; bool m_isAutoDetected = false; diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp index 24ccc2b2ef..b9b70c5352 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.cpp @@ -86,7 +86,7 @@ QList<CMakeTool *> CMakeToolManager::cmakeTools() return Utils::toRawPointer<QList>(d->m_cmakeTools); } -Id CMakeToolManager::registerOrFindCMakeTool(const FileName &command) +Id CMakeToolManager::registerOrFindCMakeTool(const FilePath &command) { if (CMakeTool *cmake = findByCommand(command)) return cmake->id(); @@ -149,7 +149,7 @@ void CMakeToolManager::setDefaultCMakeTool(const Id &id) ensureDefaultCMakeToolIsValid(); } -CMakeTool *CMakeToolManager::findByCommand(const FileName &command) +CMakeTool *CMakeToolManager::findByCommand(const FilePath &command) { return Utils::findOrDefault(d->m_cmakeTools, Utils::equal(&CMakeTool::cmakeExecutable, command)); } diff --git a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h index 0ee394ba0c..49308e616b 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolmanager.h +++ b/src/plugins/cmakeprojectmanager/cmaketoolmanager.h @@ -47,13 +47,13 @@ public: static QList<CMakeTool *> cmakeTools(); - static Core::Id registerOrFindCMakeTool(const Utils::FileName &command); + static Core::Id registerOrFindCMakeTool(const Utils::FilePath &command); static bool registerCMakeTool(std::unique_ptr<CMakeTool> &&tool); static void deregisterCMakeTool(const Core::Id &id); static CMakeTool *defaultCMakeTool(); static void setDefaultCMakeTool(const Core::Id &id); - static CMakeTool *findByCommand(const Utils::FileName &command); + static CMakeTool *findByCommand(const Utils::FilePath &command); static CMakeTool *findById(const Core::Id &id); static void notifyAboutUpdate(CMakeTool *); diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 2f2d40b91d..a34f463318 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -72,30 +72,30 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools() { Utils::Environment env = Environment::systemEnvironment(); - Utils::FileNameList path = env.path(); + Utils::FilePathList path = env.path(); path = Utils::filteredUnique(path); if (HostOsInfo::isWindowsHost()) { const QString progFiles = QLatin1String(qgetenv("ProgramFiles")); - path.append(Utils::FileName::fromString(progFiles + "/CMake")); - path.append(Utils::FileName::fromString(progFiles + "/CMake/bin")); + path.append(Utils::FilePath::fromString(progFiles + "/CMake")); + path.append(Utils::FilePath::fromString(progFiles + "/CMake/bin")); const QString progFilesX86 = QLatin1String(qgetenv("ProgramFiles(x86)")); if (!progFilesX86.isEmpty()) { - path.append(Utils::FileName::fromString(progFilesX86 + "/CMake")); - path.append(Utils::FileName::fromString(progFilesX86 + "/CMake/bin")); + path.append(Utils::FilePath::fromString(progFilesX86 + "/CMake")); + path.append(Utils::FilePath::fromString(progFilesX86 + "/CMake/bin")); } } if (HostOsInfo::isMacHost()) { - path.append(Utils::FileName::fromString("/Applications/CMake.app/Contents/bin")); - path.append(Utils::FileName::fromString("/usr/local/bin")); - path.append(Utils::FileName::fromString("/opt/local/bin")); + path.append(Utils::FilePath::fromString("/Applications/CMake.app/Contents/bin")); + path.append(Utils::FilePath::fromString("/usr/local/bin")); + path.append(Utils::FilePath::fromString("/opt/local/bin")); } const QStringList execs = env.appendExeExtensions(QLatin1String("cmake")); - FileNameList suspects; - foreach (const Utils::FileName &base, path) { + FilePathList suspects; + foreach (const Utils::FilePath &base, path) { if (base.isEmpty()) continue; @@ -103,12 +103,12 @@ static std::vector<std::unique_ptr<CMakeTool>> autoDetectCMakeTools() for (const QString &exec : execs) { fi.setFile(QDir(base.toString()), exec); if (fi.exists() && fi.isFile() && fi.isExecutable()) - suspects << FileName::fromString(fi.absoluteFilePath()); + suspects << FilePath::fromString(fi.absoluteFilePath()); } } std::vector<std::unique_ptr<CMakeTool>> found; - foreach (const FileName &command, suspects) { + foreach (const FilePath &command, suspects) { auto item = std::make_unique<CMakeTool>(CMakeTool::AutoDetection, CMakeTool::createId()); item->setCMakeExecutable(command); item->setDisplayName(CMakeToolManager::tr("System CMake at %1").arg(command.toUserOutput())); @@ -166,7 +166,7 @@ CMakeToolSettingsAccessor::CMakeToolSettingsAccessor() : QCoreApplication::translate("CMakeProjectManager::CMakeToolManager", "CMake"), Core::Constants::IDE_DISPLAY_NAME) { - setBaseFilePath(FileName::fromString(Core::ICore::userResourcePath() + CMAKE_TOOL_FILENAME)); + setBaseFilePath(FilePath::fromString(Core::ICore::userResourcePath() + CMAKE_TOOL_FILENAME)); addVersionUpgrader(std::make_unique<CMakeToolSettingsUpgraderV0>()); } @@ -175,7 +175,7 @@ CMakeToolSettingsAccessor::CMakeTools CMakeToolSettingsAccessor::restoreCMakeToo { CMakeTools result; - const FileName sdkSettingsFile = FileName::fromString(Core::ICore::installerResourcePath() + const FilePath sdkSettingsFile = FilePath::fromString(Core::ICore::installerResourcePath() + CMAKE_TOOL_FILENAME); CMakeTools sdkTools = cmakeTools(restoreSettings(sdkSettingsFile, parent), true); diff --git a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp index 90a3c40f24..588855d345 100644 --- a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp +++ b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.cpp @@ -28,7 +28,7 @@ namespace CMakeProjectManager { -ConfigModelItemDelegate::ConfigModelItemDelegate(const Utils::FileName &base, QObject* parent) +ConfigModelItemDelegate::ConfigModelItemDelegate(const Utils::FilePath &base, QObject* parent) : QStyledItemDelegate(parent) , m_base(base) { } @@ -78,7 +78,7 @@ void ConfigModelItemDelegate::setEditorData(QWidget *editor, const QModelIndex & ConfigModel::DataItem data = ConfigModel::dataItemFromIndex(index); if (data.type == ConfigModel::DataItem::FILE || data.type == ConfigModel::DataItem::DIRECTORY) { auto edit = static_cast<Utils::PathChooser *>(editor); - edit->setFileName(Utils::FileName::fromUserInput(data.value)); + edit->setFileName(Utils::FilePath::fromUserInput(data.value)); return; } else if (!data.values.isEmpty()) { auto edit = static_cast<QComboBox *>(editor); diff --git a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.h b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.h index ce5571b6be..d33fb48c7a 100644 --- a/src/plugins/cmakeprojectmanager/configmodelitemdelegate.h +++ b/src/plugins/cmakeprojectmanager/configmodelitemdelegate.h @@ -30,7 +30,7 @@ class ConfigModelItemDelegate : public QStyledItemDelegate Q_OBJECT public: - ConfigModelItemDelegate(const Utils::FileName &base, QObject *parent = nullptr); + ConfigModelItemDelegate(const Utils::FilePath &base, QObject *parent = nullptr); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const final; @@ -40,7 +40,7 @@ public: QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const final; private: - Utils::FileName m_base; + Utils::FilePath m_base; QComboBox m_measurement; }; diff --git a/src/plugins/cmakeprojectmanager/servermode.cpp b/src/plugins/cmakeprojectmanager/servermode.cpp index 8e21749927..e9a0e3ad0c 100644 --- a/src/plugins/cmakeprojectmanager/servermode.cpp +++ b/src/plugins/cmakeprojectmanager/servermode.cpp @@ -78,8 +78,8 @@ bool isValid(const QVariant &v) ServerMode::ServerMode(const Environment &env, - const FileName &sourceDirectory, const FileName &buildDirectory, - const FileName &cmakeExecutable, + const FilePath &sourceDirectory, const FilePath &buildDirectory, + const FilePath &cmakeExecutable, const QString &generator, const QString &extraGenerator, const QString &platform, const QString &toolset, bool experimental, int major, int minor, diff --git a/src/plugins/cmakeprojectmanager/servermode.h b/src/plugins/cmakeprojectmanager/servermode.h index e7b645623a..1b9e376ff9 100644 --- a/src/plugins/cmakeprojectmanager/servermode.h +++ b/src/plugins/cmakeprojectmanager/servermode.h @@ -47,8 +47,8 @@ class ServerMode : public QObject public: ServerMode(const Utils::Environment &env, - const Utils::FileName &sourceDirectory, const Utils::FileName &buildDirectory, - const Utils::FileName &cmakeExecutable, + const Utils::FilePath &sourceDirectory, const Utils::FilePath &buildDirectory, + const Utils::FilePath &cmakeExecutable, const QString &generator, const QString &extraGenerator, const QString &platform, const QString &toolset, bool experimental, int major, int minor = -1, @@ -92,9 +92,9 @@ private: QLocalSocket *m_cmakeSocket = nullptr; QTimer m_connectionTimer; - Utils::FileName m_sourceDirectory; - Utils::FileName m_buildDirectory; - Utils::FileName m_cmakeExecutable; + Utils::FilePath m_sourceDirectory; + Utils::FilePath m_buildDirectory; + Utils::FilePath m_cmakeExecutable; QByteArray m_buffer; diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp index dba909b478..bfa9d5869b 100644 --- a/src/plugins/cmakeprojectmanager/servermodereader.cpp +++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp @@ -85,7 +85,7 @@ ServerModeReader::ServerModeReader() Task editable(t); if (!editable.file.isEmpty()) { QDir srcDir(m_parameters.sourceDirectory.toString()); - editable.file = FileName::fromString(srcDir.absoluteFilePath(editable.file.toString())); + editable.file = FilePath::fromString(srcDir.absoluteFilePath(editable.file.toString())); } TaskHub::addTask(editable); }); @@ -228,7 +228,7 @@ QList<CMakeBuildTarget> ServerModeReader::takeBuildTargets() const QList<CMakeBuildTarget> result = transform(m_targets, [](const Target *t) -> CMakeBuildTarget { CMakeBuildTarget ct; ct.title = t->name; - ct.executable = t->artifacts.isEmpty() ? FileName() : t->artifacts.at(0); + ct.executable = t->artifacts.isEmpty() ? FilePath() : t->artifacts.at(0); TargetType type = UtilityType; if (t->type == "EXECUTABLE") type = ExecutableType; @@ -245,7 +245,7 @@ QList<CMakeBuildTarget> ServerModeReader::takeBuildTargets() if (t->artifacts.isEmpty()) { ct.workingDirectory = t->buildDirectory; } else { - ct.workingDirectory = Utils::FileName::fromString(t->artifacts.at(0).toFileInfo().absolutePath()); + ct.workingDirectory = Utils::FilePath::fromString(t->artifacts.at(0).toFileInfo().absolutePath()); } ct.sourceDirectory = t->sourceDirectory; return ct; @@ -261,7 +261,7 @@ CMakeConfig ServerModeReader::takeParsedConfiguration() return config; } -static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, int priority, +static void addCMakeVFolder(FolderNode *base, const Utils::FilePath &basePath, int priority, const QString &displayName, std::vector<std::unique_ptr<FileNode>> &&files) { @@ -281,7 +281,7 @@ static void addCMakeVFolder(FolderNode *base, const Utils::FileName &basePath, i } static std::vector<std::unique_ptr<FileNode>> && -removeKnownNodes(const QSet<Utils::FileName> &knownFiles, +removeKnownNodes(const QSet<Utils::FilePath> &knownFiles, std::vector<std::unique_ptr<FileNode>> &&files) { Utils::erase(files, [&knownFiles](const std::unique_ptr<FileNode> &n) { @@ -291,15 +291,15 @@ removeKnownNodes(const QSet<Utils::FileName> &knownFiles, } static void addCMakeInputs(FolderNode *root, - const Utils::FileName &sourceDir, - const Utils::FileName &buildDir, + const Utils::FilePath &sourceDir, + const Utils::FilePath &buildDir, std::vector<std::unique_ptr<FileNode>> &&sourceInputs, std::vector<std::unique_ptr<FileNode>> &&buildInputs, std::vector<std::unique_ptr<FileNode>> &&rootInputs) { std::unique_ptr<ProjectNode> cmakeVFolder = std::make_unique<CMakeInputsNode>(root->filePath()); - QSet<Utils::FileName> knownFiles; + QSet<Utils::FilePath> knownFiles; root->forEachGenericNode([&knownFiles](const Node *n) { if (n->listInProject()) knownFiles.insert(n->filePath()); @@ -309,7 +309,7 @@ static void addCMakeInputs(FolderNode *root, addCMakeVFolder(cmakeVFolder.get(), buildDir, 100, QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Build Directory>"), removeKnownNodes(knownFiles, std::move(buildInputs))); - addCMakeVFolder(cmakeVFolder.get(), Utils::FileName(), 10, + addCMakeVFolder(cmakeVFolder.get(), Utils::FilePath(), 10, QCoreApplication::translate("CMakeProjectManager::Internal::ServerModeReader", "<Other Locations>"), removeKnownNodes(knownFiles, std::move(rootInputs))); @@ -326,7 +326,7 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root, std::vector<std::unique_ptr<FileNode>> cmakeLists; for (std::unique_ptr<FileNode> &fn : m_cmakeInputsFileNodes) { - const FileName path = fn->filePath(); + const FilePath path = fn->filePath(); if (path.fileName().compare("CMakeLists.txt", HostOsInfo::fileNameCaseSensitivity()) == 0) cmakeLists.emplace_back(std::move(fn)); else if (path.isChildOf(m_parameters.workDirectory)) @@ -344,7 +344,7 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root, if (topLevel) root->setDisplayName(topLevel->name); - QHash<Utils::FileName, ProjectNode *> cmakeListsNodes + QHash<Utils::FilePath, ProjectNode *> cmakeListsNodes = addCMakeLists(root, std::move(cmakeLists)); QList<FileNode *> knownHeaders; addProjects(cmakeListsNodes, m_projects, knownHeaders); @@ -369,7 +369,7 @@ CppTools::RawProjectParts ServerModeReader::createRawProjectParts() const if (fg->macros.isEmpty() && fg->includePaths.isEmpty() && !fg->isGenerated - && Utils::allOf(fg->sources, [](const Utils::FileName &source) { + && Utils::allOf(fg->sources, [](const Utils::FilePath &source) { return Node::fileTypeForFileName(source) == FileType::Header; })) { qWarning() << "Not reporting all-header file group of target" << fg->target << "to code model."; @@ -395,7 +395,7 @@ CppTools::RawProjectParts ServerModeReader::createRawProjectParts() const cxxProjectFlags.commandLineFlags = flags; rpp.setFlagsForCxx(cxxProjectFlags); - rpp.setFiles(transform(fg->sources, &FileName::toString)); + rpp.setFiles(transform(fg->sources, &FilePath::toString)); const bool isExecutable = fg->target->type == "EXECUTABLE"; rpp.setBuildTargetType(isExecutable ? CppTools::ProjectPart::Executable @@ -457,7 +457,7 @@ void ServerModeReader::handleReply(const QVariantMap &data, const QString &inRep void ServerModeReader::handleError(const QString &message) { TaskHub::addTask(Task::Error, message, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM, - Utils::FileName(), -1); + Utils::FilePath(), -1); if (!m_delayedErrorMessage.isEmpty()) { reportError(); return; @@ -535,7 +535,7 @@ ServerModeReader::Project *ServerModeReader::extractProjectData(const QVariantMa { auto project = new Project; project->name = data.value(NAME_KEY).toString(); - project->sourceDirectory = FileName::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); + project->sourceDirectory = FilePath::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); const QVariantList targets = data.value("targets").toList(); for (const QVariant &t : targets) { @@ -562,8 +562,8 @@ ServerModeReader::Target *ServerModeReader::extractTargetData(const QVariantMap auto target = new Target; target->project = p; target->name = targetName; - target->sourceDirectory = FileName::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); - target->buildDirectory = FileName::fromString(data.value("buildDirectory").toString()); + target->sourceDirectory = FilePath::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); + target->buildDirectory = FilePath::fromString(data.value("buildDirectory").toString()); target->crossReferences = extractCrossReferences(data.value("crossReferences").toMap()); @@ -571,7 +571,7 @@ ServerModeReader::Target *ServerModeReader::extractTargetData(const QVariantMap target->type = data.value("type").toString(); const QStringList artifacts = data.value("artifacts").toStringList(); - target->artifacts = transform(artifacts, [&srcDir](const QString &a) { return FileName::fromString(srcDir.absoluteFilePath(a)); }); + target->artifacts = transform(artifacts, [&srcDir](const QString &a) { return FilePath::fromString(srcDir.absoluteFilePath(a)); }); const QVariantList fileGroups = data.value("fileGroups").toList(); for (const QVariant &fg : fileGroups) { @@ -599,14 +599,14 @@ ServerModeReader::FileGroup *ServerModeReader::extractFileGroupData(const QVaria [](const QVariant &i) -> IncludePath* { const QVariantMap iData = i.toMap(); auto result = new IncludePath; - result->path = FileName::fromString(iData.value("path").toString()); + result->path = FilePath::fromString(iData.value("path").toString()); result->isSystem = iData.value("isSystem", false).toBool(); return result; }); fileGroup->isGenerated = data.value("isGenerated", false).toBool(); fileGroup->sources = transform(data.value(SOURCES_KEY).toStringList(), [&srcDir](const QString &s) { - return FileName::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s))); + return FilePath::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s))); }); m_fileGroups.append(fileGroup); @@ -681,7 +681,7 @@ QList<ServerModeReader::BacktraceItem *> ServerModeReader::extractBacktrace(cons void ServerModeReader::extractCMakeInputsData(const QVariantMap &data) { - const FileName src = FileName::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); + const FilePath src = FilePath::fromString(data.value(SOURCE_DIRECTORY_KEY).toString()); QTC_ASSERT(src == m_parameters.sourceDirectory, return); QDir srcDir(src.toString()); @@ -696,7 +696,7 @@ void ServerModeReader::extractCMakeInputsData(const QVariantMap &data) const bool isCMake = section.value("isCMake").toBool(); // part of the cmake installation for (const QString &s : sources) { - const FileName sfn = FileName::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s))); + const FilePath sfn = FilePath::fromString(QDir::cleanPath(srcDir.absoluteFilePath(s))); const int oldCount = m_cmakeFiles.count(); m_cmakeFiles.insert(sfn); if (oldCount < m_cmakeFiles.count()) { @@ -781,19 +781,19 @@ void ServerModeReader::fixTarget(ServerModeReader::Target *target) const } } -QHash<Utils::FileName, ProjectNode *> +QHash<Utils::FilePath, ProjectNode *> ServerModeReader::addCMakeLists(CMakeProjectNode *root, std::vector<std::unique_ptr<FileNode>> &&cmakeLists) { - QHash<Utils::FileName, ProjectNode *> cmakeListsNodes; + QHash<Utils::FilePath, ProjectNode *> cmakeListsNodes; cmakeListsNodes.insert(root->filePath(), root); - const QSet<Utils::FileName> cmakeDirs + const QSet<Utils::FilePath> cmakeDirs = Utils::transform<QSet>(cmakeLists, [](const std::unique_ptr<FileNode> &n) { return n->filePath().parentDir(); }); - root->addNestedNodes(std::move(cmakeLists), Utils::FileName(), - [&cmakeDirs, &cmakeListsNodes](const Utils::FileName &fp) + root->addNestedNodes(std::move(cmakeLists), Utils::FilePath(), + [&cmakeDirs, &cmakeListsNodes](const Utils::FilePath &fp) -> std::unique_ptr<ProjectExplorer::FolderNode> { if (cmakeDirs.contains(fp)) { auto fn = std::make_unique<CMakeListsNode>(fp); @@ -807,13 +807,13 @@ ServerModeReader::addCMakeLists(CMakeProjectNode *root, return cmakeListsNodes; } -static void createProjectNode(const QHash<Utils::FileName, ProjectNode *> &cmakeListsNodes, - const Utils::FileName &dir, const QString &displayName) +static void createProjectNode(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, + const Utils::FilePath &dir, const QString &displayName) { ProjectNode *cmln = cmakeListsNodes.value(dir); QTC_ASSERT(cmln, qDebug() << dir.toUserOutput(); return); - const Utils::FileName projectName = dir.pathAppended(".project::" + displayName); + const Utils::FilePath projectName = dir.pathAppended(".project::" + displayName); ProjectNode *pn = cmln->projectNode(projectName); if (!pn) { @@ -824,7 +824,7 @@ static void createProjectNode(const QHash<Utils::FileName, ProjectNode *> &cmake pn->setDisplayName(displayName); } -void ServerModeReader::addProjects(const QHash<Utils::FileName, ProjectNode *> &cmakeListsNodes, +void ServerModeReader::addProjects(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, const QList<Project *> &projects, QList<FileNode *> &knownHeaderNodes) { @@ -834,8 +834,8 @@ void ServerModeReader::addProjects(const QHash<Utils::FileName, ProjectNode *> & } } -static CMakeTargetNode *createTargetNode(const QHash<Utils::FileName, ProjectNode *> &cmakeListsNodes, - const Utils::FileName &dir, const QString &displayName) +static CMakeTargetNode *createTargetNode(const QHash<Utils::FilePath, ProjectNode *> &cmakeListsNodes, + const Utils::FilePath &dir, const QString &displayName) { ProjectNode *cmln = cmakeListsNodes.value(dir); QTC_ASSERT(cmln, return nullptr); @@ -854,7 +854,7 @@ static CMakeTargetNode *createTargetNode(const QHash<Utils::FileName, ProjectNod return tn; } -void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer::ProjectNode *> &cmakeListsNodes, +void ServerModeReader::addTargets(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, const QList<Target *> &targets, QList<ProjectExplorer::FileNode *> &knownHeaderNodes) { @@ -864,12 +864,12 @@ void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer:: tNode->setTargetInformation(t->artifacts, t->type); QList<FolderNode::LocationInfo> info; // Set up a default target path: - FileName targetPath = t->sourceDirectory.pathAppended("CMakeLists.txt"); + FilePath targetPath = t->sourceDirectory.pathAppended("CMakeLists.txt"); for (CrossReference *cr : qAsConst(t->crossReferences)) { BacktraceItem *bt = cr->backtrace.isEmpty() ? nullptr : cr->backtrace.at(0); if (bt) { const QString btName = bt->name.toLower(); - const FileName path = Utils::FileName::fromUserInput(bt->path); + const FilePath path = Utils::FilePath::fromUserInput(bt->path); QString dn; if (cr->type != CrossReference::TARGET) { if (path == targetPath) { @@ -896,27 +896,27 @@ void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer:: } void ServerModeReader::addFileGroups(ProjectNode *targetRoot, - const Utils::FileName &sourceDirectory, - const Utils::FileName &buildDirectory, + const Utils::FilePath &sourceDirectory, + const Utils::FilePath &buildDirectory, const QList<ServerModeReader::FileGroup *> &fileGroups, QList<FileNode *> &knownHeaderNodes) { std::vector<std::unique_ptr<FileNode>> toList; - QSet<Utils::FileName> alreadyListed; + QSet<Utils::FilePath> alreadyListed; // Files already added by other configurations: targetRoot->forEachGenericNode([&alreadyListed](const Node *n) { alreadyListed.insert(n->filePath()); }); for (const FileGroup *f : fileGroups) { - const QList<FileName> newSources = Utils::filtered(f->sources, [&alreadyListed](const Utils::FileName &fn) { + const QList<FilePath> newSources = Utils::filtered(f->sources, [&alreadyListed](const Utils::FilePath &fn) { const int count = alreadyListed.count(); alreadyListed.insert(fn); return count != alreadyListed.count(); }); std::vector<std::unique_ptr<FileNode>> newFileNodes = Utils::transform<std::vector>(newSources, - [f, &knownHeaderNodes](const Utils::FileName &fn) { + [f, &knownHeaderNodes](const Utils::FilePath &fn) { auto node = std::make_unique<FileNode>(fn, Node::fileTypeForFileName(fn)); node->setIsGenerated(f->isGenerated); if (node->fileType() == FileType::Header) @@ -942,7 +942,7 @@ void ServerModeReader::addFileGroups(ProjectNode *targetRoot, addCMakeVFolder(targetRoot, sourceDirectory, 1000, QString(), std::move(sourceFileNodes)); addCMakeVFolder(targetRoot, buildDirectory, 100, tr("<Build Directory>"), std::move(buildFileNodes)); - addCMakeVFolder(targetRoot, Utils::FileName(), 10, tr("<Other Locations>"), std::move(otherFileNodes)); + addCMakeVFolder(targetRoot, Utils::FilePath(), 10, tr("<Other Locations>"), std::move(otherFileNodes)); } void ServerModeReader::addHeaderNodes(ProjectNode *root, const QList<FileNode *> knownHeaders, @@ -959,7 +959,7 @@ void ServerModeReader::addHeaderNodes(ProjectNode *root, const QList<FileNode *> headerNode->setIcon(headerNodeIcon); // knownHeaders are already listed in their targets: - QSet<Utils::FileName> seenHeaders = Utils::transform<QSet>(knownHeaders, &FileNode::filePath); + QSet<Utils::FilePath> seenHeaders = Utils::transform<QSet>(knownHeaders, &FileNode::filePath); // Add scanned headers: for (const FileNode *fn : allFiles) { diff --git a/src/plugins/cmakeprojectmanager/servermodereader.h b/src/plugins/cmakeprojectmanager/servermodereader.h index a8e998c68c..b362b15b3f 100644 --- a/src/plugins/cmakeprojectmanager/servermodereader.h +++ b/src/plugins/cmakeprojectmanager/servermodereader.h @@ -78,7 +78,7 @@ private: struct Project; struct IncludePath { - Utils::FileName path; + Utils::FilePath path; bool isSystem; }; @@ -90,7 +90,7 @@ private: ProjectExplorer::Macros macros; QList<IncludePath *> includePaths; QString language; - QList<Utils::FileName> sources; + QList<Utils::FilePath> sources; bool isGenerated; }; @@ -118,9 +118,9 @@ private: Project *project = nullptr; QString name; QString type; - QList<Utils::FileName> artifacts; - Utils::FileName sourceDirectory; - Utils::FileName buildDirectory; + QList<Utils::FilePath> artifacts; + Utils::FilePath sourceDirectory; + Utils::FilePath buildDirectory; QList<FileGroup *> fileGroups; QList<CrossReference *> crossReferences; }; @@ -128,7 +128,7 @@ private: struct Project { ~Project() { qDeleteAll(targets); targets.clear(); } QString name; - Utils::FileName sourceDirectory; + Utils::FilePath sourceDirectory; QList<Target *> targets; }; @@ -145,17 +145,17 @@ private: void fixTarget(Target *target) const; - QHash<Utils::FileName, ProjectExplorer::ProjectNode *> + QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> addCMakeLists(CMakeProjectNode *root, std::vector<std::unique_ptr<ProjectExplorer::FileNode> > &&cmakeLists); - void addProjects(const QHash<Utils::FileName, ProjectExplorer::ProjectNode *> &cmakeListsNodes, + void addProjects(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, const QList<Project *> &projects, QList<ProjectExplorer::FileNode *> &knownHeaderNodes); - void addTargets(const QHash<Utils::FileName, ProjectExplorer::ProjectNode *> &cmakeListsNodes, + void addTargets(const QHash<Utils::FilePath, ProjectExplorer::ProjectNode *> &cmakeListsNodes, const QList<Target *> &targets, QList<ProjectExplorer::FileNode *> &knownHeaderNodes); void addFileGroups(ProjectExplorer::ProjectNode *targetRoot, - const Utils::FileName &sourceDirectory, - const Utils::FileName &buildDirectory, const QList<FileGroup *> &fileGroups, + const Utils::FilePath &sourceDirectory, + const Utils::FilePath &buildDirectory, const QList<FileGroup *> &fileGroups, QList<ProjectExplorer::FileNode *> &knowHeaderNodes); void addHeaderNodes(ProjectExplorer::ProjectNode *root, @@ -172,7 +172,7 @@ private: CMakeConfig m_cmakeConfiguration; - QSet<Utils::FileName> m_cmakeFiles; + QSet<Utils::FilePath> m_cmakeFiles; std::vector<std::unique_ptr<ProjectExplorer::FileNode>> m_cmakeInputsFileNodes; QList<Project *> m_projects; diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.cpp b/src/plugins/cmakeprojectmanager/tealeafreader.cpp index afaf32e945..f1cd1ddd7a 100644 --- a/src/plugins/cmakeprojectmanager/tealeafreader.cpp +++ b/src/plugins/cmakeprojectmanager/tealeafreader.cpp @@ -70,7 +70,7 @@ namespace Internal { class CMakeFile : public IDocument { public: - CMakeFile(TeaLeafReader *r, const FileName &fileName); + CMakeFile(TeaLeafReader *r, const FilePath &fileName); ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; @@ -79,7 +79,7 @@ private: TeaLeafReader *m_reader; }; -CMakeFile::CMakeFile(TeaLeafReader *r, const FileName &fileName) : m_reader(r) +CMakeFile::CMakeFile(TeaLeafReader *r, const FilePath &fileName) : m_reader(r) { setId("Cmake.ProjectFile"); setMimeType(Constants::CMAKEPROJECTMIMETYPE); @@ -200,7 +200,7 @@ void TeaLeafReader::parse(bool forceConfiguration) } const bool mustUpdate = m_cmakeFiles.isEmpty() - || anyOf(m_cmakeFiles, [&cbpFileFi](const FileName &f) { + || anyOf(m_cmakeFiles, [&cbpFileFi](const FilePath &f) { return f.toFileInfo().lastModified() > cbpFileFi.lastModified(); }); if (mustUpdate) { @@ -235,7 +235,7 @@ QList<CMakeBuildTarget> TeaLeafReader::takeBuildTargets() CMakeConfig TeaLeafReader::takeParsedConfiguration() { - const FileName cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); + const FilePath cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); if (!cacheFile.exists()) return { }; @@ -248,10 +248,10 @@ CMakeConfig TeaLeafReader::takeParsedConfiguration() return { }; } - const FileName sourceOfBuildDir - = FileName::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result)); - const FileName canonicalSourceOfBuildDir = sourceOfBuildDir.canonicalPath(); - const FileName canonicalSourceDirectory = m_parameters.sourceDirectory.canonicalPath(); + const FilePath sourceOfBuildDir + = FilePath::fromUtf8(CMakeConfigItem::valueOf("CMAKE_HOME_DIRECTORY", result)); + const FilePath canonicalSourceOfBuildDir = sourceOfBuildDir.canonicalPath(); + const FilePath canonicalSourceDirectory = m_parameters.sourceDirectory.canonicalPath(); if (canonicalSourceOfBuildDir != canonicalSourceDirectory) { // Uses case-insensitive compare where appropriate emit errorOccured(tr("The build directory is not for %1 but for %2") .arg(canonicalSourceOfBuildDir.toUserOutput(), @@ -269,10 +269,10 @@ void TeaLeafReader::generateProjectTree(CMakeProjectNode *root, const QList<cons root->setDisplayName(m_projectName); // Delete no longer necessary file watcher based on m_cmakeFiles: - const QSet<FileName> currentWatched + const QSet<FilePath> currentWatched = transform(m_watchedFiles, &CMakeFile::filePath); - const QSet<FileName> toWatch = m_cmakeFiles; - QSet<FileName> toDelete = currentWatched; + const QSet<FilePath> toWatch = m_cmakeFiles; + QSet<FilePath> toDelete = currentWatched; toDelete.subtract(toWatch); m_watchedFiles = filtered(m_watchedFiles, [&toDelete](Internal::CMakeFile *cmf) { if (toDelete.contains(cmf->filePath())) { @@ -283,30 +283,30 @@ void TeaLeafReader::generateProjectTree(CMakeProjectNode *root, const QList<cons }); // Add new file watchers: - QSet<FileName> toAdd = toWatch; + QSet<FilePath> toAdd = toWatch; toAdd.subtract(currentWatched); - foreach (const FileName &fn, toAdd) { + foreach (const FilePath &fn, toAdd) { auto cm = new CMakeFile(this, fn); DocumentManager::addDocument(cm); m_watchedFiles.insert(cm); } - QSet<FileName> allIncludePathSet; + QSet<FilePath> allIncludePathSet; for (const CMakeBuildTarget &bt : m_buildTargets) { - const QList<Utils::FileName> targetIncludePaths - = Utils::filtered(bt.includeFiles, [this](const Utils::FileName &fn) { + const QList<Utils::FilePath> targetIncludePaths + = Utils::filtered(bt.includeFiles, [this](const Utils::FilePath &fn) { return fn.isChildOf(m_parameters.sourceDirectory); }); - allIncludePathSet.unite(QSet<FileName>::fromList(targetIncludePaths)); + allIncludePathSet.unite(QSet<FilePath>::fromList(targetIncludePaths)); } - const QList<FileName> allIncludePaths = allIncludePathSet.toList(); + const QList<FilePath> allIncludePaths = allIncludePathSet.toList(); const QList<const FileNode *> missingHeaders = Utils::filtered(allFiles, [&allIncludePaths](const FileNode *fn) -> bool { if (fn->fileType() != FileType::Header) return false; - return Utils::contains(allIncludePaths, [fn](const FileName &inc) { return fn->filePath().isChildOf(inc); }); + return Utils::contains(allIncludePaths, [fn](const FilePath &inc) { return fn->filePath().isChildOf(inc); }); }); // filter duplicates: @@ -327,15 +327,15 @@ void TeaLeafReader::generateProjectTree(CMakeProjectNode *root, const QList<cons } static void processCMakeIncludes(const CMakeBuildTarget &cbt, const ToolChain *tc, - const QStringList& flags, const FileName &sysroot, - QSet<FileName> &tcIncludes, QStringList &includePaths) + const QStringList& flags, const FilePath &sysroot, + QSet<FilePath> &tcIncludes, QStringList &includePaths) { if (!tc) return; foreach (const HeaderPath &hp, tc->builtInHeaderPaths(flags, sysroot)) - tcIncludes.insert(FileName::fromString(hp.path)); - foreach (const FileName &i, cbt.includeFiles) { + tcIncludes.insert(FilePath::fromString(hp.path)); + foreach (const FilePath &i, cbt.includeFiles) { if (!tcIncludes.contains(i)) includePaths.append(i.toString()); } @@ -345,7 +345,7 @@ CppTools::RawProjectParts TeaLeafReader::createRawProjectParts() const { const ToolChain *tcCxx = ToolChainManager::findToolChain(m_parameters.cxxToolChainId); const ToolChain *tcC = ToolChainManager::findToolChain(m_parameters.cToolChainId); - const FileName sysroot = m_parameters.sysRoot; + const FilePath sysroot = m_parameters.sysRoot; CppTools::RawProjectParts rpps; QHash<QString, QStringList> targetDataCacheCxx; @@ -359,13 +359,13 @@ CppTools::RawProjectParts TeaLeafReader::createRawProjectParts() const // place. auto cxxflags = getFlagsFor(cbt, targetDataCacheCxx, ProjectExplorer::Constants::CXX_LANGUAGE_ID); auto cflags = getFlagsFor(cbt, targetDataCacheC, ProjectExplorer::Constants::C_LANGUAGE_ID); - QSet<FileName> tcIncludes; + QSet<FilePath> tcIncludes; QStringList includePaths; if (tcCxx || tcC) { processCMakeIncludes(cbt, tcCxx, cxxflags, sysroot, tcIncludes, includePaths); processCMakeIncludes(cbt, tcC, cflags, sysroot, tcIncludes, includePaths); } else { - includePaths = transform(cbt.includeFiles, &FileName::toString); + includePaths = transform(cbt.includeFiles, &FilePath::toString); } includePaths += m_parameters.workDirectory.toString(); CppTools::RawProjectPart rpp; @@ -383,7 +383,7 @@ CppTools::RawProjectParts TeaLeafReader::createRawProjectParts() const rpp.setMacros(cbt.macros); rpp.setDisplayName(cbt.title); - rpp.setFiles(transform(cbt.files, &FileName::toString)); + rpp.setFiles(transform(cbt.files, &FilePath::toString)); const bool isExecutable = cbt.targetType == ExecutableType; rpp.setBuildTargetType(isExecutable ? CppTools::ProjectPart::Executable @@ -414,9 +414,9 @@ void TeaLeafReader::extractData() CMakeTool *cmake = m_parameters.cmakeTool(); QTC_ASSERT(m_parameters.isValid() && cmake, return); - const FileName srcDir = m_parameters.sourceDirectory; - const FileName bldDir = m_parameters.workDirectory; - const FileName topCMake = srcDir.pathAppended("CMakeLists.txt"); + const FilePath srcDir = m_parameters.sourceDirectory; + const FilePath bldDir = m_parameters.workDirectory; + const FilePath topCMake = srcDir.pathAppended("CMakeLists.txt"); resetData(); @@ -425,13 +425,13 @@ void TeaLeafReader::extractData() // Do not insert topCMake into m_cmakeFiles: The project already watches that! // Find cbp file - FileName cbpFile = FileName::fromString(findCbpFile(bldDir.toString())); + FilePath cbpFile = FilePath::fromString(findCbpFile(bldDir.toString())); if (cbpFile.isEmpty()) return; m_cmakeFiles.insert(cbpFile); // Add CMakeCache.txt file: - const FileName cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); + const FilePath cacheFile = m_parameters.workDirectory.pathAppended("CMakeCache.txt"); if (cacheFile.exists()) m_cmakeFiles.insert(cacheFile); @@ -466,7 +466,7 @@ void TeaLeafReader::startCMake(const QStringList &configurationArguments) CMakeTool *cmake = m_parameters.cmakeTool(); QTC_ASSERT(m_parameters.isValid() && cmake, return); - const FileName workDirectory = m_parameters.workDirectory; + const FilePath workDirectory = m_parameters.workDirectory; QTC_ASSERT(!m_cmakeProcess, return); QTC_ASSERT(!m_parser, return); QTC_ASSERT(!m_future, return); @@ -482,7 +482,7 @@ void TeaLeafReader::startCMake(const QStringList &configurationArguments) TaskHub::addTask(task); } else { Task t = task; - t.file = FileName::fromString(source.absoluteFilePath(task.file.toString())); + t.file = FilePath::fromString(source.absoluteFilePath(task.file.toString())); TaskHub::addTask(t); } }); diff --git a/src/plugins/cmakeprojectmanager/tealeafreader.h b/src/plugins/cmakeprojectmanager/tealeafreader.h index 142ea4b5af..356adc8110 100644 --- a/src/plugins/cmakeprojectmanager/tealeafreader.h +++ b/src/plugins/cmakeprojectmanager/tealeafreader.h @@ -79,7 +79,7 @@ private: ProjectExplorer::IOutputParser *m_parser = nullptr; QFutureInterface<void> *m_future = nullptr; - QSet<Utils::FileName> m_cmakeFiles; + QSet<Utils::FilePath> m_cmakeFiles; QString m_projectName; QList<CMakeBuildTarget> m_buildTargets; std::vector<std::unique_ptr<ProjectExplorer::FileNode>> m_files; diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp index cf28412282..94bc8b40a7 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.cpp @@ -132,7 +132,7 @@ ToolChain *toolchainFromFlags(const Kit *kit, const QStringList &flags, const Co return ToolChainKitAspect::toolChain(kit, language); // Try exact compiler match. - const Utils::FileName compiler = Utils::FileName::fromString(compilerPath(flags.front())); + const Utils::FilePath compiler = Utils::FilePath::fromString(compilerPath(flags.front())); ToolChain *toolchain = ToolChainManager::toolChain([&compiler, &language](const ToolChain *tc) { return tc->isValid() && tc->language() == language && tc->compilerCommand() == compiler; }); @@ -168,11 +168,11 @@ void addDriverModeFlagIfNeeded(const ToolChain *toolchain, } } -CppTools::RawProjectPart makeRawProjectPart(const Utils::FileName &projectFile, +CppTools::RawProjectPart makeRawProjectPart(const Utils::FilePath &projectFile, Kit *kit, CppTools::KitInfo &kitInfo, const QString &workingDir, - const Utils::FileName &fileName, + const Utils::FilePath &fileName, QStringList flags) { HeaderPaths headerPaths; @@ -220,7 +220,7 @@ CppTools::RawProjectPart makeRawProjectPart(const Utils::FileName &projectFile, return rpp; } -QStringList relativeDirsList(Utils::FileName currentPath, const Utils::FileName &rootPath) +QStringList relativeDirsList(Utils::FilePath currentPath, const Utils::FilePath &rootPath) { QStringList dirsList; while (!currentPath.isEmpty() && currentPath != rootPath) { @@ -235,7 +235,7 @@ QStringList relativeDirsList(Utils::FileName currentPath, const Utils::FileName FolderNode *addChildFolderNode(FolderNode *parent, const QString &childName) { - const Utils::FileName path = parent->filePath().pathAppended(childName); + const Utils::FilePath path = parent->filePath().pathAppended(childName); auto node = std::make_unique<FolderNode>(path); FolderNode *childNode = node.get(); childNode->setDisplayName(childName); @@ -256,7 +256,7 @@ FolderNode *addOrGetChildFolderNode(FolderNode *parent, const QString &childName } // Return the node for folderPath. -FolderNode *createFoldersIfNeeded(FolderNode *root, const Utils::FileName &folderPath) +FolderNode *createFoldersIfNeeded(FolderNode *root, const Utils::FilePath &folderPath) { const QStringList dirsList = relativeDirsList(folderPath, root->filePath()); @@ -275,7 +275,7 @@ FileType fileTypeForName(const QString &fileName) return FileType::Source; } -void addChild(FolderNode *root, const Utils::FileName &fileName) +void addChild(FolderNode *root, const Utils::FilePath &fileName) { FolderNode *parentNode = createFoldersIfNeeded(root, fileName.parentDir()); if (!parentNode->fileNode(fileName)) { @@ -285,7 +285,7 @@ void addChild(FolderNode *root, const Utils::FileName &fileName) } void createTree(std::unique_ptr<ProjectNode> &root, - const Utils::FileName &rootPath, + const Utils::FilePath &rootPath, const CppTools::RawProjectParts &rpps, const QList<FileNode *> &scannedFiles = QList<FileNode *>()) { @@ -294,12 +294,12 @@ void createTree(std::unique_ptr<ProjectNode> &root, for (const CppTools::RawProjectPart &rpp : rpps) { for (const QString &filePath : rpp.files) { - Utils::FileName fileName = Utils::FileName::fromString(filePath); + Utils::FilePath fileName = Utils::FilePath::fromString(filePath); if (!fileName.isChildOf(rootPath)) { - if (fileName.isChildOf(Utils::FileName::fromString(rpp.buildSystemTarget))) { + if (fileName.isChildOf(Utils::FilePath::fromString(rpp.buildSystemTarget))) { if (!secondRoot) secondRoot = std::make_unique<ProjectNode>( - Utils::FileName::fromString(rpp.buildSystemTarget)); + Utils::FilePath::fromString(rpp.buildSystemTarget)); addChild(secondRoot.get(), fileName); } } else { @@ -312,7 +312,7 @@ void createTree(std::unique_ptr<ProjectNode> &root, if (node->fileType() != FileType::Header) continue; - const Utils::FileName fileName = node->filePath(); + const Utils::FilePath fileName = node->filePath(); if (!fileName.isChildOf(rootPath)) continue; FolderNode *parentNode = createFoldersIfNeeded(root.get(), fileName.parentDir()); @@ -367,7 +367,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts() } if (!dbContents.extras.empty()) { - const Utils::FileName baseDir = projectFilePath().parentDir(); + const Utils::FilePath baseDir = projectFilePath().parentDir(); QStringList extraFiles; for (const QString &extra : dbContents.extras) @@ -385,7 +385,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts() root->addNode(std::make_unique<FileNode>(projectFilePath(), FileType::Project)); if (QFile::exists(dbContents.extraFileName)) - root->addNode(std::make_unique<FileNode>(Utils::FileName::fromString(dbContents.extraFileName), + root->addNode(std::make_unique<FileNode>(Utils::FilePath::fromString(dbContents.extraFileName), FileType::Project)); setRootProjectNode(std::move(root)); @@ -393,7 +393,7 @@ void CompilationDatabaseProject::buildTreeAndProjectParts() m_cppCodeModelUpdater->update({this, kitInfo, rpps}); } -CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FileName &projectFile) +CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FilePath &projectFile) : Project(Constants::COMPILATIONDATABASEMIMETYPE, projectFile) , m_cppCodeModelUpdater(std::make_unique<CppTools::CppProjectUpdater>()) , m_parseDelay(new QTimer(this)) @@ -425,10 +425,10 @@ CompilationDatabaseProject::CompilationDatabaseProject(const Utils::FileName &pr m_parseDelay->setInterval(1000); } -Utils::FileName CompilationDatabaseProject::rootPathFromSettings() const +Utils::FilePath CompilationDatabaseProject::rootPathFromSettings() const { #ifdef WITH_TESTS - return Utils::FileName::fromString(projectDirectory().fileName()); + return Utils::FilePath::fromString(projectDirectory().fileName()); #else return Utils::FileName::fromString( namedSettings(ProjectExplorer::Constants::PROJECT_ROOT_PATH_KEY).toString()); @@ -440,7 +440,7 @@ Project::RestoreResult CompilationDatabaseProject::fromMap(const QVariantMap &ma { Project::RestoreResult result = Project::fromMap(map, errorMessage); if (result == Project::RestoreResult::Ok) { - const Utils::FileName rootPath = rootPathFromSettings(); + const Utils::FilePath rootPath = rootPathFromSettings(); if (rootPath.isEmpty()) changeRootProjectDirectory(); // This triggers reparse itself. else diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h index 54ca07a2e3..376ebcc63b 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseproject.h @@ -55,7 +55,7 @@ class CompilationDatabaseProject : public ProjectExplorer::Project Q_OBJECT public: - explicit CompilationDatabaseProject(const Utils::FileName &filename); + explicit CompilationDatabaseProject(const Utils::FilePath &filename); ~CompilationDatabaseProject() override; bool needsConfiguration() const override { return false; } bool needsBuildConfigurations() const override { return true; } @@ -65,7 +65,7 @@ private: void reparseProject(); void buildTreeAndProjectParts(); - Utils::FileName rootPathFromSettings() const; + Utils::FilePath rootPathFromSettings() const; QFutureWatcher<void> m_parserWatcher; std::unique_ptr<CppTools::CppProjectUpdater> m_cppCodeModelUpdater; diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h index c1686fce0f..d2c062e7c3 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdatabaseutils.h @@ -44,7 +44,7 @@ namespace Internal { class DbEntry { public: QStringList flags; - Utils::FileName fileName; + Utils::FilePath fileName; QString workingDir; }; diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index f36eec46e5..d75bf7be40 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -43,8 +43,8 @@ using namespace Utils; namespace CompilationDatabaseProjectManager { namespace Internal { -CompilationDbParser::CompilationDbParser(const QString &projectName, const FileName &projectPath, - const FileName &rootPath, MimeBinaryCache &mimeBinaryCache, +CompilationDbParser::CompilationDbParser(const QString &projectName, const FilePath &projectPath, + const FilePath &rootPath, MimeBinaryCache &mimeBinaryCache, QObject *parent) : QObject(parent), m_projectName(projectName), @@ -64,7 +64,7 @@ void CompilationDbParser::start() // Thread 1: Scan disk. if (!m_rootPath.isEmpty()) { m_treeScanner = new TreeScanner(this); - m_treeScanner->setFilter([this](const MimeType &mimeType, const FileName &fn) { + m_treeScanner->setFilter([this](const MimeType &mimeType, const FilePath &fn) { // Mime checks requires more resources, so keep it last in check list bool isIgnored = fn.toString().startsWith(m_projectFilePath.toString() + ".user") || TreeScanner::isWellKnownBinary(mimeType, fn); @@ -82,7 +82,7 @@ void CompilationDbParser::start() return isIgnored; }); - m_treeScanner->setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FileName &fn) { + m_treeScanner->setTypeFactory([](const Utils::MimeType &mimeType, const Utils::FilePath &fn) { return TreeScanner::genericFileType(mimeType, fn); }); m_treeScanner->asyncScanForFiles(m_rootPath); @@ -144,12 +144,12 @@ static QStringList jsonObjectFlags(const QJsonObject &object, QSet<QString> &fla return flags; } -static FileName jsonObjectFilename(const QJsonObject &object) +static FilePath jsonObjectFilename(const QJsonObject &object) { const QString workingDir = QDir::fromNativeSeparators(object["directory"].toString()); - FileName fileName = FileName::fromString(QDir::fromNativeSeparators(object["file"].toString())); + FilePath fileName = FilePath::fromString(QDir::fromNativeSeparators(object["file"].toString())); if (fileName.toFileInfo().isRelative()) - fileName = FileName::fromString(workingDir + "/" + fileName.toString()).canonicalPath(); + fileName = FilePath::fromString(workingDir + "/" + fileName.toString()).canonicalPath(); return fileName; } @@ -175,7 +175,7 @@ static std::vector<DbEntry> readJsonObjects(const QString &filePath) } const QJsonObject object = document.object(); - const Utils::FileName fileName = jsonObjectFilename(object); + const Utils::FilePath fileName = jsonObjectFilename(object); const QStringList flags = filterFromFileName(jsonObjectFlags(object, flagsCache), fileName.toFileInfo().baseName()); result.push_back({flags, fileName, object["directory"].toString()}); diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h index 571f38d369..ded713d590 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.h @@ -48,8 +48,8 @@ class CompilationDbParser : public QObject { Q_OBJECT public: - explicit CompilationDbParser(const QString &projectName, const Utils::FileName &projectPath, - const Utils::FileName &rootPath, MimeBinaryCache &mimeBinaryCache, + explicit CompilationDbParser(const QString &projectName, const Utils::FilePath &projectPath, + const Utils::FilePath &rootPath, MimeBinaryCache &mimeBinaryCache, QObject *parent = nullptr); void start(); @@ -66,8 +66,8 @@ private: DbContents parseProject(); const QString m_projectName; - const Utils::FileName m_projectFilePath; - const Utils::FileName m_rootPath; + const Utils::FilePath m_projectFilePath; + const Utils::FilePath m_rootPath; MimeBinaryCache &m_mimeBinaryCache; ProjectExplorer::TreeScanner *m_treeScanner = nullptr; QFutureWatcher<DbContents> m_parserWatcher; diff --git a/src/plugins/coreplugin/corejsextensions.cpp b/src/plugins/coreplugin/corejsextensions.cpp index 02e6601640..b5cbd08973 100644 --- a/src/plugins/coreplugin/corejsextensions.cpp +++ b/src/plugins/coreplugin/corejsextensions.cpp @@ -118,7 +118,7 @@ QString UtilsJsExtension::preferredSuffix(const QString &mimetype) const QString UtilsJsExtension::fileName(const QString &path, const QString &extension) const { - return Utils::FileName::fromStringWithExtension(path, extension).toString(); + return Utils::FilePath::fromStringWithExtension(path, extension).toString(); } QString UtilsJsExtension::mktemp(const QString &pattern) const diff --git a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp index e4ed48648b..fef059d7fa 100644 --- a/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp +++ b/src/plugins/coreplugin/dialogs/filepropertiesdialog.cpp @@ -37,7 +37,7 @@ #include <QFileInfo> #include <QLocale> -FilePropertiesDialog::FilePropertiesDialog(const Utils::FileName &fileName, QWidget *parent) : +FilePropertiesDialog::FilePropertiesDialog(const Utils::FilePath &fileName, QWidget *parent) : QDialog(parent), m_ui(new Ui::FilePropertiesDialog), m_fileName(fileName.toString()) diff --git a/src/plugins/coreplugin/dialogs/filepropertiesdialog.h b/src/plugins/coreplugin/dialogs/filepropertiesdialog.h index db55abeb0e..95d8bfbceb 100644 --- a/src/plugins/coreplugin/dialogs/filepropertiesdialog.h +++ b/src/plugins/coreplugin/dialogs/filepropertiesdialog.h @@ -41,7 +41,7 @@ class FilePropertiesDialog : public QDialog Q_OBJECT public: - explicit FilePropertiesDialog(const Utils::FileName &fileName, QWidget *parent = nullptr); + explicit FilePropertiesDialog(const Utils::FilePath &fileName, QWidget *parent = nullptr); ~FilePropertiesDialog() override; private: diff --git a/src/plugins/coreplugin/dialogs/openwithdialog.cpp b/src/plugins/coreplugin/dialogs/openwithdialog.cpp index 7452fdb319..526a32f7e5 100644 --- a/src/plugins/coreplugin/dialogs/openwithdialog.cpp +++ b/src/plugins/coreplugin/dialogs/openwithdialog.cpp @@ -37,7 +37,7 @@ OpenWithDialog::OpenWithDialog(const QString &fileName, QWidget *parent) { setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - label->setText(tr("Open file \"%1\" with:").arg(Utils::FileName::fromString(fileName).fileName())); + label->setText(tr("Open file \"%1\" with:").arg(Utils::FilePath::fromString(fileName).fileName())); buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); connect(buttonBox->button(QDialogButtonBox::Ok), &QAbstractButton::clicked, diff --git a/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp b/src/plugins/coreplugin/dialogs/readonlyfilesdialog.cpp index edec9d7f25..d08c74ae96 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::fromFileInfo(buttongroup.fileName))) { + if (!Utils::FileUtils::makeWritable(Utils::FilePath::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::FileName::fromFileInfo(directory).shortNativePath()); + item->setText(Folder, Utils::FilePath::fromFileInfo(directory).shortNativePath()); auto radioButtonGroup = new QButtonGroup; // Add a button for opening the file with a version control system diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index 13b5b42546..933b20bd3f 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -164,7 +164,7 @@ public: QFileSystemWatcher *m_linkWatcher = nullptr; // Delayed creation (only UNIX/if a link is seen). QString m_lastVisitedDirectory = QDir::currentPath(); QString m_defaultLocationForNewFiles; - FileName m_projectsDirectory; + FilePath m_projectsDirectory; // When we are calling into an IDocument // we don't want to receive a changed() // signal @@ -438,14 +438,14 @@ void DocumentManager::renamedFile(const QString &from, const QString &to) foreach (IDocument *document, documentsToRename) { d->m_blockedIDocument = document; removeFileInfo(document); - document->setFilePath(FileName::fromString(to)); + document->setFilePath(FilePath::fromString(to)); addFileInfo(document); d->m_blockedIDocument = nullptr; } emit m_instance->allDocumentsRenamed(from, to); } -void DocumentManager::filePathChanged(const FileName &oldName, const FileName &newName) +void DocumentManager::filePathChanged(const FilePath &oldName, const FilePath &newName) { auto doc = qobject_cast<IDocument *>(sender()); QTC_ASSERT(doc, return); @@ -961,7 +961,7 @@ bool DocumentManager::saveModifiedDocument(IDocument *document, const QString &m alwaysSaveMessage, alwaysSave, failedToClose); } -void DocumentManager::showFilePropertiesDialog(const FileName &filePath) +void DocumentManager::showFilePropertiesDialog(const FilePath &filePath) { FilePropertiesDialog properties(filePath); properties.exec(); @@ -1340,12 +1340,12 @@ void readSettings() } s->beginGroup(QLatin1String(directoryGroupC)); - const FileName settingsProjectDir = FileName::fromString(s->value(QLatin1String(projectDirectoryKeyC), + const FilePath settingsProjectDir = FilePath::fromString(s->value(QLatin1String(projectDirectoryKeyC), QString()).toString()); if (!settingsProjectDir.isEmpty() && settingsProjectDir.toFileInfo().isDir()) d->m_projectsDirectory = settingsProjectDir; else - d->m_projectsDirectory = FileName::fromString(PathChooser::homePath()); + d->m_projectsDirectory = FilePath::fromString(PathChooser::homePath()); d->m_useProjectsDirectory = s->value(QLatin1String(useProjectDirectoryKeyC), d->m_useProjectsDirectory).toBool(); @@ -1398,7 +1398,7 @@ void DocumentManager::setDefaultLocationForNewFiles(const QString &location) \sa setProjectsDirectory, setUseProjectsDirectory */ -FileName DocumentManager::projectsDirectory() +FilePath DocumentManager::projectsDirectory() { return d->m_projectsDirectory; } @@ -1410,7 +1410,7 @@ FileName DocumentManager::projectsDirectory() \sa projectsDirectory, useProjectsDirectory */ -void DocumentManager::setProjectsDirectory(const FileName &directory) +void DocumentManager::setProjectsDirectory(const FilePath &directory) { if (d->m_projectsDirectory != directory) { d->m_projectsDirectory = directory; diff --git a/src/plugins/coreplugin/documentmanager.h b/src/plugins/coreplugin/documentmanager.h index 911e46615a..92323efdc3 100644 --- a/src/plugins/coreplugin/documentmanager.h +++ b/src/plugins/coreplugin/documentmanager.h @@ -34,7 +34,7 @@ QT_BEGIN_NAMESPACE class QStringList; QT_END_NAMESPACE -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Core { @@ -123,7 +123,7 @@ public: const QString &alwaysSaveMessage = QString(), bool *alwaysSave = nullptr, QList<IDocument *> *failedToClose = nullptr); - static void showFilePropertiesDialog(const Utils::FileName &filePath); + static void showFilePropertiesDialog(const Utils::FilePath &filePath); static QString fileDialogLastVisitedDirectory(); static void setFileDialogLastVisitedDirectory(const QString &); @@ -136,8 +136,8 @@ public: static bool useProjectsDirectory(); static void setUseProjectsDirectory(bool); - static Utils::FileName projectsDirectory(); - static void setProjectsDirectory(const Utils::FileName &directory); + static Utils::FilePath projectsDirectory(); + static void setProjectsDirectory(const Utils::FilePath &directory); /* Used to notify e.g. the code model to update the given files. Does *not* lead to any editors to reload or any other editor manager actions. */ @@ -151,7 +151,7 @@ signals: void allDocumentsRenamed(const QString &from, const QString &to); /// emitted if one document changed its name e.g. due to save as void documentRenamed(Core::IDocument *document, const QString &from, const QString &to); - void projectsDirectoryChanged(const Utils::FileName &directory); + void projectsDirectoryChanged(const Utils::FilePath &directory); private: explicit DocumentManager(QObject *parent); @@ -161,7 +161,7 @@ private: void checkForNewFileName(); void checkForReload(); void changedFile(const QString &file); - void filePathChanged(const Utils::FileName &oldName, const Utils::FileName &newName); + void filePathChanged(const Utils::FilePath &oldName, const Utils::FilePath &newName); friend class Core::Internal::MainWindow; friend class Core::Internal::DocumentManagerPrivate; diff --git a/src/plugins/coreplugin/editormanager/documentmodel.cpp b/src/plugins/coreplugin/editormanager/documentmodel.cpp index 5406a59047..b3cec42210 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.cpp +++ b/src/plugins/coreplugin/editormanager/documentmodel.cpp @@ -101,7 +101,7 @@ int DocumentModelPrivate::rowCount(const QModelIndex &parent) const void DocumentModelPrivate::addEntry(DocumentModel::Entry *entry) { - const Utils::FileName fileName = entry->fileName(); + const Utils::FilePath fileName = entry->fileName(); QString fixedPath; if (!fileName.isEmpty()) fixedPath = DocumentManager::filePathKey(fileName.toString(), DocumentManager::ResolveLinks); @@ -169,7 +169,7 @@ bool DocumentModelPrivate::disambiguateDisplayNames(DocumentModel::Entry *entry) bool seenDups = false; for (int i = 0; i < dupsCount - 1; ++i) { DynamicEntry &e = dups[i]; - const Utils::FileName myFileName = e->document->filePath(); + const Utils::FilePath myFileName = e->document->filePath(); if (e->document->isTemporary() || myFileName.isEmpty() || count > 10) { // path-less entry, append number e.setNumberedName(++serial); @@ -178,7 +178,7 @@ bool DocumentModelPrivate::disambiguateDisplayNames(DocumentModel::Entry *entry) for (int j = i + 1; j < dupsCount; ++j) { DynamicEntry &e2 = dups[j]; if (e->displayName().compare(e2->displayName(), Utils::HostOsInfo::fileNameCaseSensitivity()) == 0) { - const Utils::FileName otherFileName = e2->document->filePath(); + const Utils::FilePath otherFileName = e2->document->filePath(); if (otherFileName.isEmpty()) continue; seenDups = true; @@ -225,7 +225,7 @@ QIcon DocumentModelPrivate::pinnedIcon() return icon; } -Utils::optional<int> DocumentModelPrivate::indexOfFilePath(const Utils::FileName &filePath) const +Utils::optional<int> DocumentModelPrivate::indexOfFilePath(const Utils::FilePath &filePath) const { if (filePath.isEmpty()) return Utils::nullopt; @@ -420,7 +420,7 @@ DocumentModel::Entry *DocumentModelPrivate::addSuspendedDocument(const QString & { auto entry = new DocumentModel::Entry; entry->document = new IDocument; - entry->document->setFilePath(Utils::FileName::fromString(fileName)); + entry->document->setFilePath(Utils::FilePath::fromString(fileName)); entry->document->setPreferredDisplayName(displayName); entry->document->setId(id); entry->isSuspended = true; @@ -551,7 +551,7 @@ QAbstractItemModel *DocumentModel::model() return d; } -Utils::FileName DocumentModel::Entry::fileName() const +Utils::FilePath DocumentModel::Entry::fileName() const { return document->filePath(); } @@ -594,7 +594,7 @@ Utils::optional<int> DocumentModel::indexOfDocument(IDocument *document) return d->indexOfDocument(document); } -Utils::optional<int> DocumentModel::indexOfFilePath(const Utils::FileName &filePath) +Utils::optional<int> DocumentModel::indexOfFilePath(const Utils::FilePath &filePath) { return d->indexOfFilePath(filePath); } @@ -605,7 +605,7 @@ DocumentModel::Entry *DocumentModel::entryForDocument(IDocument *document) [&document](Entry *entry) { return entry->document == document; }); } -DocumentModel::Entry *DocumentModel::entryForFilePath(const Utils::FileName &filePath) +DocumentModel::Entry *DocumentModel::entryForFilePath(const Utils::FilePath &filePath) { const Utils::optional<int> index = d->indexOfFilePath(filePath); if (!index) @@ -620,7 +620,7 @@ QList<IDocument *> DocumentModel::openedDocuments() IDocument *DocumentModel::documentForFilePath(const QString &filePath) { - const Utils::optional<int> index = d->indexOfFilePath(Utils::FileName::fromString(filePath)); + const Utils::optional<int> index = d->indexOfFilePath(Utils::FilePath::fromString(filePath)); if (!index) return nullptr; return d->m_entries.at(*index)->document; diff --git a/src/plugins/coreplugin/editormanager/documentmodel.h b/src/plugins/coreplugin/editormanager/documentmodel.h index 8cb5286c55..72b4caeedb 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel.h +++ b/src/plugins/coreplugin/editormanager/documentmodel.h @@ -53,7 +53,7 @@ public: struct CORE_EXPORT Entry { Entry(); ~Entry(); - Utils::FileName fileName() const; + Utils::FilePath fileName() const; QString displayName() const; QString plainDisplayName() const; QString uniqueDisplayName() const; @@ -79,9 +79,9 @@ public: static int entryCount(); static QList<Entry *> entries(); static Utils::optional<int> indexOfDocument(IDocument *document); - static Utils::optional<int> indexOfFilePath(const Utils::FileName &filePath); + static Utils::optional<int> indexOfFilePath(const Utils::FilePath &filePath); static Entry *entryForDocument(IDocument *document); - static Entry *entryForFilePath(const Utils::FileName &filePath); + static Entry *entryForFilePath(const Utils::FilePath &filePath); static QList<IDocument *> openedDocuments(); static IDocument *documentForFilePath(const QString &filePath); diff --git a/src/plugins/coreplugin/editormanager/documentmodel_p.h b/src/plugins/coreplugin/editormanager/documentmodel_p.h index 4a92baad7f..e5d7fa2a2c 100644 --- a/src/plugins/coreplugin/editormanager/documentmodel_p.h +++ b/src/plugins/coreplugin/editormanager/documentmodel_p.h @@ -58,7 +58,7 @@ public: void addEntry(DocumentModel::Entry *entry); void removeDocument(int idx); - Utils::optional<int> indexOfFilePath(const Utils::FileName &filePath) const; + Utils::optional<int> indexOfFilePath(const Utils::FilePath &filePath) const; Utils::optional<int> indexOfDocument(IDocument *document) const; bool disambiguateDisplayNames(DocumentModel::Entry *entry); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 62fbe7a3f1..4d5bf55bb8 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -608,7 +608,7 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const QString &fileN Utils::MimeType mimeType = Utils::mimeTypeForFile(fn); QMessageBox msgbox(QMessageBox::Critical, EditorManager::tr("File Error"), tr("Could not open \"%1\": Cannot open files of type \"%2\".") - .arg(FileName::fromString(realFn).toUserOutput(), mimeType.name()), + .arg(FilePath::fromString(realFn).toUserOutput(), mimeType.name()), QMessageBox::Ok, ICore::dialogParent()); msgbox.exec(); return nullptr; @@ -650,7 +650,7 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const QString &fileN tr("Could not open \"%1\" for reading. " "Either the file does not exist or you do not have " "the permissions to open it.") - .arg(FileName::fromString(realFn).toUserOutput()), + .arg(FilePath::fromString(realFn).toUserOutput()), QMessageBox::Ok, ICore::dialogParent()); msgbox.exec(); return nullptr; @@ -659,7 +659,7 @@ IEditor *EditorManagerPrivate::openEditor(EditorView *view, const QString &fileN if (errorString.isEmpty()) { errorString = tr("Could not open \"%1\": Unknown error.") - .arg(FileName::fromString(realFn).toUserOutput()); + .arg(FilePath::fromString(realFn).toUserOutput()); } QMessageBox msgbox(QMessageBox::Critical, EditorManager::tr("File Error"), errorString, QMessageBox::Open | QMessageBox::Cancel, ICore::mainWindow()); @@ -2306,7 +2306,7 @@ void EditorManagerPrivate::findInDirectory() { if (!d->m_contextMenuEntry || d->m_contextMenuEntry->fileName().isEmpty()) return; - const FileName path = d->m_contextMenuEntry->fileName(); + const FilePath path = d->m_contextMenuEntry->fileName(); emit m_instance->findOnFileSystemRequest( (path.toFileInfo().isDir() ? path : path.parentDir()).toString()); } @@ -2467,7 +2467,7 @@ void EditorManager::addSaveAndCloseEditorActions(QMenu *contextMenu, DocumentMod d->m_contextMenuEntry = entry; d->m_contextMenuEditor = editor; - const FileName filePath = entry ? entry->fileName() : FileName(); + const FilePath filePath = entry ? entry->fileName() : FilePath(); const bool copyActionsEnabled = !filePath.isEmpty(); d->m_copyFilePathContextAction->setEnabled(copyActionsEnabled); d->m_copyLocationContextAction->setEnabled(copyActionsEnabled); diff --git a/src/plugins/coreplugin/editormanager/editormanager.h b/src/plugins/coreplugin/editormanager/editormanager.h index 808d5ca198..41429aedb1 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.h +++ b/src/plugins/coreplugin/editormanager/editormanager.h @@ -182,7 +182,7 @@ signals: void editorsClosed(QList<Core::IEditor *> editors); void documentClosed(Core::IDocument *document); void findOnFileSystemRequest(const QString &path); - void openFileProperties(const Utils::FileName &path); + void openFileProperties(const Utils::FilePath &path); void aboutToSave(IDocument *document); void saved(IDocument *document); void autoSaved(); diff --git a/src/plugins/coreplugin/editormanager/editorview.cpp b/src/plugins/coreplugin/editormanager/editorview.cpp index aea929a3aa..d38923be38 100644 --- a/src/plugins/coreplugin/editormanager/editorview.cpp +++ b/src/plugins/coreplugin/editormanager/editorview.cpp @@ -268,7 +268,7 @@ void EditorView::updateEditorHistory(IEditor *editor, QList<EditLocation> &histo const EditLocation &item = history.at(i); if (item.document == document || (!item.document - && !DocumentModel::indexOfFilePath(FileName::fromString(item.fileName)))) { + && !DocumentModel::indexOfFilePath(FilePath::fromString(item.fileName)))) { history.removeAt(i--); } } diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index d766531f51..ad1775f9d2 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -217,7 +217,7 @@ static DocumentModel::Entry *entryForEditLocation(const EditLocation &item) { if (!item.document.isNull()) return DocumentModel::entryForDocument(item.document); - return DocumentModel::entryForFilePath(Utils::FileName::fromString(item.fileName)); + return DocumentModel::entryForFilePath(Utils::FilePath::fromString(item.fileName)); } void OpenEditorsWindow::addHistoryItems(const QList<EditLocation> &history, EditorView *view, diff --git a/src/plugins/coreplugin/externaltool.h b/src/plugins/coreplugin/externaltool.h index b41ae450f2..394ee091a5 100644 --- a/src/plugins/coreplugin/externaltool.h +++ b/src/plugins/coreplugin/externaltool.h @@ -145,7 +145,7 @@ private: bool resolve(); const ExternalTool *m_tool; // is a copy of the tool that was passed in - Utils::FileName m_resolvedExecutable; + Utils::FilePath m_resolvedExecutable; QString m_resolvedArguments; QString m_resolvedInput; QString m_resolvedWorkingDirectory; diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 157dde7477..02392cb888 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -69,7 +69,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn) const QFileInfo fileInfo(pathIn); // Mac, Windows support folder or file. if (HostOsInfo::isWindowsHost()) { - const FileName explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe")); + const FilePath explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe")); if (explorer.isEmpty()) { QMessageBox::warning(parent, QApplication::translate("Core::Internal", diff --git a/src/plugins/coreplugin/idocument.cpp b/src/plugins/coreplugin/idocument.cpp index 1f0d2f8c24..8fde404064 100644 --- a/src/plugins/coreplugin/idocument.cpp +++ b/src/plugins/coreplugin/idocument.cpp @@ -69,7 +69,7 @@ public: } QString mimeType; - Utils::FileName filePath; + Utils::FilePath filePath; QString preferredDisplayName; QString uniqueDisplayName; QString autoSaveName; @@ -168,7 +168,7 @@ bool IDocument::setContents(const QByteArray &contents) return false; } -const Utils::FileName &IDocument::filePath() const +const Utils::FilePath &IDocument::filePath() const { return d->filePath; } @@ -323,11 +323,11 @@ InfoBar *IDocument::infoBar() signals. Can be reimplemented by subclasses to do more. \sa filePath() */ -void IDocument::setFilePath(const Utils::FileName &filePath) +void IDocument::setFilePath(const Utils::FilePath &filePath) { if (d->filePath == filePath) return; - Utils::FileName oldName = d->filePath; + Utils::FilePath oldName = d->filePath; d->filePath = filePath; emit filePathChanged(oldName, d->filePath); emit changed(); diff --git a/src/plugins/coreplugin/idocument.h b/src/plugins/coreplugin/idocument.h index 4af747dc97..feae466705 100644 --- a/src/plugins/coreplugin/idocument.h +++ b/src/plugins/coreplugin/idocument.h @@ -29,7 +29,7 @@ #include <QObject> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Core { class Id; @@ -93,8 +93,8 @@ public: virtual QByteArray contents() const; virtual bool setContents(const QByteArray &contents); - const Utils::FileName &filePath() const; - virtual void setFilePath(const Utils::FileName &filePath); + const Utils::FilePath &filePath() const; + virtual void setFilePath(const Utils::FilePath &filePath); QString displayName() const; void setPreferredDisplayName(const QString &name); QString preferredDisplayName() const; @@ -144,7 +144,7 @@ signals: void aboutToReload(); void reloadFinished(bool success); - void filePathChanged(const Utils::FileName &oldName, const Utils::FileName &newName); + void filePathChanged(const Utils::FilePath &oldName, const Utils::FilePath &newName); private: Internal::IDocumentPrivate *d; diff --git a/src/plugins/coreplugin/iversioncontrol.cpp b/src/plugins/coreplugin/iversioncontrol.cpp index befa60fbab..3bc7ddd6f8 100644 --- a/src/plugins/coreplugin/iversioncontrol.cpp +++ b/src/plugins/coreplugin/iversioncontrol.cpp @@ -79,7 +79,7 @@ QStringList IVersionControl::additionalToolsPath() const } ShellCommand *IVersionControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index 9a5ef2e783..0846793b5a 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -103,7 +103,7 @@ public: * * This method needs to be thread safe! */ - virtual bool isVcsFileOrDirectory(const Utils::FileName &fileName) const = 0; + virtual bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const = 0; /*! * Returns whether files in this directory should be managed with this @@ -213,7 +213,7 @@ public: * \a extraArgs are passed on to the command being run. */ virtual ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs); @@ -245,7 +245,7 @@ public: { } ~TestVersionControl() override; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final { Q_UNUSED(fileName); return false; } void setManagedDirectories(const QHash<QString, QString> &dirs); diff --git a/src/plugins/coreplugin/locator/basefilefilter.cpp b/src/plugins/coreplugin/locator/basefilefilter.cpp index f5f34a4f43..e2b26b57ae 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 = FileName::fromFileInfo(fi).shortNativePath(); + filterEntry.extraInfo = FilePath::fromFileInfo(fi).shortNativePath(); const int matchLevel = matchLevelFor(match, matchText); if (hasPathSeparator) { diff --git a/src/plugins/coreplugin/locator/executefilter.cpp b/src/plugins/coreplugin/locator/executefilter.cpp index 52766ed9f4..2d451a5b6e 100644 --- a/src/plugins/coreplugin/locator/executefilter.cpp +++ b/src/plugins/coreplugin/locator/executefilter.cpp @@ -160,7 +160,7 @@ void ExecuteFilter::runHeadCommand() { if (!m_taskQueue.isEmpty()) { const ExecuteData &d = m_taskQueue.head(); - const Utils::FileName fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable); + const Utils::FilePath fullPath = Utils::Environment::systemEnvironment().searchInPath(d.executable); if (fullPath.isEmpty()) { MessageManager::write(tr("Could not find executable for \"%1\".").arg(d.executable)); m_taskQueue.dequeue(); diff --git a/src/plugins/coreplugin/locator/filesystemfilter.cpp b/src/plugins/coreplugin/locator/filesystemfilter.cpp index d89974b96a..0719e9b781 100644 --- a/src/plugins/coreplugin/locator/filesystemfilter.cpp +++ b/src/plugins/coreplugin/locator/filesystemfilter.cpp @@ -142,7 +142,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF const QString fullFilePath = dirInfo.filePath(fileName); if (!QFileInfo::exists(fullFilePath) && dirInfo.exists()) { LocatorFilterEntry createAndOpen(this, tr("Create and Open \"%1\"").arg(entry), fullFilePath); - createAndOpen.extraInfo = Utils::FileName::fromString(dirInfo.absolutePath()).shortNativePath(); + createAndOpen.extraInfo = Utils::FilePath::fromString(dirInfo.absolutePath()).shortNativePath(); betterEntries.append(createAndOpen); } diff --git a/src/plugins/coreplugin/locator/locator_test.cpp b/src/plugins/coreplugin/locator/locator_test.cpp index 6547fbf4ee..c76a5633ea 100644 --- a/src/plugins/coreplugin/locator/locator_test.cpp +++ b/src/plugins/coreplugin/locator/locator_test.cpp @@ -89,7 +89,7 @@ void Core::Internal::CorePlugin::test_basefilefilter() void Core::Internal::CorePlugin::test_basefilefilter_data() { auto shortNativePath = [](const QString &file) { - return Utils::FileName::fromString(file).shortNativePath(); + return Utils::FilePath::fromString(file).shortNativePath(); }; QTest::addColumn<QStringList>("testFiles"); diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp index a7d2b3e194..fe67e5d884 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.cpp +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.cpp @@ -76,7 +76,7 @@ QList<LocatorFilterEntry> OpenDocumentsFilter::matchesFor(QFutureInterface<Locat const QRegularExpressionMatch match = regexp.match(displayName); if (match.hasMatch()) { LocatorFilterEntry filterEntry(this, displayName, QString(fileName + fp.postfix)); - filterEntry.extraInfo = FileName::fromString(fileName).shortNativePath(); + filterEntry.extraInfo = FilePath::fromString(fileName).shortNativePath(); filterEntry.fileName = fileName; filterEntry.highlightInfo = highlightInfo(match); if (match.capturedStart() == 0) diff --git a/src/plugins/coreplugin/locator/opendocumentsfilter.h b/src/plugins/coreplugin/locator/opendocumentsfilter.h index 8d140c86d7..956dea22d2 100644 --- a/src/plugins/coreplugin/locator/opendocumentsfilter.h +++ b/src/plugins/coreplugin/locator/opendocumentsfilter.h @@ -56,7 +56,7 @@ private: class Entry { public: - Utils::FileName fileName; + Utils::FilePath fileName; QString displayName; }; diff --git a/src/plugins/coreplugin/mimetypesettings.cpp b/src/plugins/coreplugin/mimetypesettings.cpp index e5ba03ace4..7b4d891339 100644 --- a/src/plugins/coreplugin/mimetypesettings.cpp +++ b/src/plugins/coreplugin/mimetypesettings.cpp @@ -501,7 +501,7 @@ void MimeTypeSettingsPrivate::ensurePendingMimeType(const Utils::MimeType &mimeT void MimeTypeSettingsPrivate::writeUserModifiedMimeTypes() { - static Utils::FileName modifiedMimeTypesFile = Utils::FileName::fromString( + static Utils::FilePath modifiedMimeTypesFile = Utils::FilePath::fromString( ICore::userResourcePath() + QLatin1String(kModifiedMimeTypesFile)); if (QFile::exists(modifiedMimeTypesFile.toString()) diff --git a/src/plugins/coreplugin/patchtool.cpp b/src/plugins/coreplugin/patchtool.cpp index 724fabd133..1442046325 100644 --- a/src/plugins/coreplugin/patchtool.cpp +++ b/src/plugins/coreplugin/patchtool.cpp @@ -88,7 +88,7 @@ static bool runPatchHelper(const QByteArray &input, const QString &workingDirect return false; } - if (!Utils::FileName::fromString(patch).exists() + if (!Utils::FilePath::fromString(patch).exists() && !Utils::Environment::systemEnvironment().searchInPath(patch).exists()) { MessageManager::write(QApplication::translate("Core::PatchTool", "The patch-command configured in the general \"Environment\" settings does not exist.")); return false; diff --git a/src/plugins/coreplugin/toolsettings.cpp b/src/plugins/coreplugin/toolsettings.cpp index 857d154125..200e425140 100644 --- a/src/plugins/coreplugin/toolsettings.cpp +++ b/src/plugins/coreplugin/toolsettings.cpp @@ -143,7 +143,7 @@ void ToolSettings::apply() if (tool->preset() && (*tool) != (*(tool->preset()))) { // check if we need to choose a new file name if (tool->preset()->fileName() == tool->fileName()) { - const QString &fileName = Utils::FileName::fromString(tool->preset()->fileName()).fileName(); + const QString &fileName = Utils::FilePath::fromString(tool->preset()->fileName()).fileName(); const QString &newFilePath = getUserFilePath(fileName); // TODO error handling if newFilePath.isEmpty() (i.e. failed to find a unused name) tool->setFileName(newFilePath); diff --git a/src/plugins/cpaster/frontend/argumentscollector.cpp b/src/plugins/cpaster/frontend/argumentscollector.cpp index 7cfdc6c5fd..99f9f0c037 100644 --- a/src/plugins/cpaster/frontend/argumentscollector.cpp +++ b/src/plugins/cpaster/frontend/argumentscollector.cpp @@ -68,7 +68,7 @@ bool ArgumentsCollector::collect(const QStringList &args) QString ArgumentsCollector::usageString() const { QString usage = QString::fromLatin1("Usage:\n\t%1 <request> [ <request options>]\n\t") - .arg(Utils::FileName::fromString(QCoreApplication::applicationFilePath()).fileName()); + .arg(Utils::FilePath::fromString(QCoreApplication::applicationFilePath()).fileName()); usage += QString::fromLatin1("Possible requests: \"%1\", \"%2\", \"%3\"\n\t") .arg(pasteRequestString(), listProtocolsRequestString(), helpRequestString()); usage += QString::fromLatin1("Possible options for request \"%1\": \"%2 <file>\" (default: stdin), " diff --git a/src/plugins/cppcheck/cppcheckdiagnostic.h b/src/plugins/cppcheck/cppcheckdiagnostic.h index 66e0b1dc82..566a60b974 100644 --- a/src/plugins/cppcheck/cppcheckdiagnostic.h +++ b/src/plugins/cppcheck/cppcheckdiagnostic.h @@ -44,7 +44,7 @@ public: QString severityText; QString checkId; QString message; - Utils::FileName fileName; + Utils::FilePath fileName; int lineNumber = 0; }; diff --git a/src/plugins/cppcheck/cppcheckrunner.cpp b/src/plugins/cppcheck/cppcheckrunner.cpp index 55f7472ef6..9c3e72bddb 100644 --- a/src/plugins/cppcheck/cppcheckrunner.cpp +++ b/src/plugins/cppcheck/cppcheckrunner.cpp @@ -75,15 +75,15 @@ void CppcheckRunner::reconfigure(const QString &binary, const QString &arguments m_arguments = arguments; } -void CppcheckRunner::addToQueue(const Utils::FileNameList &files, +void CppcheckRunner::addToQueue(const Utils::FilePathList &files, const QString &additionalArguments) { - Utils::FileNameList &existing = m_queue[additionalArguments]; + Utils::FilePathList &existing = m_queue[additionalArguments]; if (existing.isEmpty()) { existing = files; } else { std::copy_if(files.cbegin(), files.cend(), std::back_inserter(existing), - [&existing](const Utils::FileName &file) { return !existing.contains(file); }); + [&existing](const Utils::FilePath &file) { return !existing.contains(file); }); } if (m_isRunning) { @@ -94,7 +94,7 @@ void CppcheckRunner::addToQueue(const Utils::FileNameList &files, m_queueTimer.start(); } -void CppcheckRunner::stop(const Utils::FileNameList &files) +void CppcheckRunner::stop(const Utils::FilePathList &files) { if (!m_isRunning) return; @@ -103,7 +103,7 @@ void CppcheckRunner::stop(const Utils::FileNameList &files) m_process->kill(); } -void CppcheckRunner::removeFromQueue(const Utils::FileNameList &files) +void CppcheckRunner::removeFromQueue(const Utils::FilePathList &files) { if (m_queue.isEmpty()) return; @@ -112,14 +112,14 @@ void CppcheckRunner::removeFromQueue(const Utils::FileNameList &files) m_queue.clear(); } else { for (auto it = m_queue.begin(), end = m_queue.end(); it != end;) { - for (const Utils::FileName &file : files) + for (const Utils::FilePath &file : files) it.value().removeOne(file); it = !it.value().isEmpty() ? ++it : m_queue.erase(it); } } } -const Utils::FileNameList &CppcheckRunner::currentFiles() const +const Utils::FilePathList &CppcheckRunner::currentFiles() const { return m_currentFiles; } @@ -135,7 +135,7 @@ void CppcheckRunner::checkQueued() if (m_queue.isEmpty() || m_binary.isEmpty()) return; - Utils::FileNameList files = m_queue.begin().value(); + Utils::FilePathList files = m_queue.begin().value(); QString arguments = m_arguments + ' ' + m_queue.begin().key(); m_currentFiles.clear(); int argumentsLength = arguments.length(); diff --git a/src/plugins/cppcheck/cppcheckrunner.h b/src/plugins/cppcheck/cppcheckrunner.h index 733ef07d6d..522c33af2c 100644 --- a/src/plugins/cppcheck/cppcheckrunner.h +++ b/src/plugins/cppcheck/cppcheckrunner.h @@ -30,8 +30,8 @@ namespace Utils { class QtcProcess; -class FileName; -using FileNameList = QList<FileName>; +class FilePath; +using FilePathList = QList<FilePath>; } namespace Cppcheck { @@ -48,12 +48,12 @@ public: ~CppcheckRunner() override; void reconfigure(const QString &binary, const QString &arguments); - void addToQueue(const Utils::FileNameList &files, + void addToQueue(const Utils::FilePathList &files, const QString &additionalArguments = {}); - void removeFromQueue(const Utils::FileNameList &files); - void stop(const Utils::FileNameList &files = {}); + void removeFromQueue(const Utils::FilePathList &files); + void stop(const Utils::FilePathList &files = {}); - const Utils::FileNameList ¤tFiles() const; + const Utils::FilePathList ¤tFiles() const; QString currentCommand() const; private: @@ -67,8 +67,8 @@ private: Utils::QtcProcess *m_process = nullptr; QString m_binary; QString m_arguments; - QHash<QString, Utils::FileNameList> m_queue; - Utils::FileNameList m_currentFiles; + QHash<QString, Utils::FilePathList> m_queue; + Utils::FilePathList m_currentFiles; QTimer m_queueTimer; int m_maxArgumentsLength = 32767; bool m_isRunning = false; diff --git a/src/plugins/cppcheck/cppchecktextmarkmanager.cpp b/src/plugins/cppcheck/cppchecktextmarkmanager.cpp index 2d19a22151..9c2d50c6aa 100644 --- a/src/plugins/cppcheck/cppchecktextmarkmanager.cpp +++ b/src/plugins/cppcheck/cppchecktextmarkmanager.cpp @@ -45,13 +45,13 @@ void CppcheckTextMarkManager::add(const Diagnostic &diagnostic) fileMarks.push_back(std::make_unique<CppcheckTextMark>(diagnostic)); } -void CppcheckTextMarkManager::clearFiles(const Utils::FileNameList &files) +void CppcheckTextMarkManager::clearFiles(const Utils::FilePathList &files) { if (m_marks.empty()) return; if (!files.empty()) { - for (const Utils::FileName &file : files) + for (const Utils::FilePath &file : files) m_marks.erase(file); } else { m_marks.clear(); diff --git a/src/plugins/cppcheck/cppchecktextmarkmanager.h b/src/plugins/cppcheck/cppchecktextmarkmanager.h index e509fe9985..01be470816 100644 --- a/src/plugins/cppcheck/cppchecktextmarkmanager.h +++ b/src/plugins/cppcheck/cppchecktextmarkmanager.h @@ -42,11 +42,11 @@ public: ~CppcheckTextMarkManager(); void add(const Diagnostic &diagnostic); - void clearFiles(const Utils::FileNameList &files); + void clearFiles(const Utils::FilePathList &files); private: using MarkPtr = std::unique_ptr<CppcheckTextMark>; - std::unordered_map<Utils::FileName, std::vector<MarkPtr>> m_marks; + std::unordered_map<Utils::FilePath, std::vector<MarkPtr>> m_marks; }; } // namespace Internal diff --git a/src/plugins/cppcheck/cppchecktool.cpp b/src/plugins/cppcheck/cppchecktool.cpp index b13b089cee..0c95f30fbd 100644 --- a/src/plugins/cppcheck/cppchecktool.cpp +++ b/src/plugins/cppcheck/cppchecktool.cpp @@ -181,16 +181,16 @@ const CppcheckOptions &CppcheckTool::options() const return m_options; } -void CppcheckTool::check(const Utils::FileNameList &files) +void CppcheckTool::check(const Utils::FilePathList &files) { QTC_ASSERT(m_project, return); - Utils::FileNameList filtered; + Utils::FilePathList filtered; if (m_filters.isEmpty()) { filtered = files; } else { std::copy_if(files.cbegin(), files.cend(), std::back_inserter(filtered), - [this](const Utils::FileName &file) { + [this](const Utils::FilePath &file) { const QString stringed = file.toString(); const auto filter = [stringed](const QRegExp &re) {return re.exactMatch(stringed);}; return !Utils::contains(m_filters, filter); @@ -208,8 +208,8 @@ void CppcheckTool::check(const Utils::FileNameList &files) return; } - std::map<CppTools::ProjectPart::Ptr, Utils::FileNameList> groups; - for (const Utils::FileName &file : qAsConst(filtered)) { + std::map<CppTools::ProjectPart::Ptr, Utils::FilePathList> groups; + for (const Utils::FilePath &file : qAsConst(filtered)) { const QString stringed = file.toString(); for (const CppTools::ProjectPart::Ptr &part : parts) { using CppTools::ProjectFile; @@ -224,7 +224,7 @@ void CppcheckTool::check(const Utils::FileNameList &files) addToQueue(group.second, *group.first); } -void CppcheckTool::addToQueue(const Utils::FileNameList &files, CppTools::ProjectPart &part) +void CppcheckTool::addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part) { const QString key = part.id(); if (!m_cachedAdditionalArguments.contains(key)) @@ -232,7 +232,7 @@ void CppcheckTool::addToQueue(const Utils::FileNameList &files, CppTools::Projec m_runner->addToQueue(files, m_cachedAdditionalArguments[key]); } -void CppcheckTool::stop(const Utils::FileNameList &files) +void CppcheckTool::stop(const Utils::FilePathList &files) { m_runner->removeFromQueue(files); m_runner->stop(files); @@ -299,7 +299,7 @@ void CppcheckTool::parseErrorLine(const QString &line) if (!match.hasMatch()) return; - const Utils::FileName fileName = Utils::FileName::fromUserInput(match.captured(File)); + const Utils::FilePath fileName = Utils::FilePath::fromUserInput(match.captured(File)); if (!m_runner->currentFiles().contains(fileName)) return; diff --git a/src/plugins/cppcheck/cppchecktool.h b/src/plugins/cppcheck/cppchecktool.h index b80e3436a7..ff668cf40e 100644 --- a/src/plugins/cppcheck/cppchecktool.h +++ b/src/plugins/cppcheck/cppchecktool.h @@ -34,8 +34,8 @@ #include <memory> namespace Utils { -class FileName; -using FileNameList = QList<FileName>; +class FilePath; +using FilePathList = QList<FilePath>; } namespace CppTools { @@ -64,8 +64,8 @@ public: void updateOptions(const CppcheckOptions &options); void setProject(ProjectExplorer::Project *project); - void check(const Utils::FileNameList &files); - void stop(const Utils::FileNameList &files); + void check(const Utils::FilePathList &files); + void stop(const Utils::FilePathList &files); void startParsing(); void parseOutputLine(const QString &line); @@ -76,7 +76,7 @@ public: private: void updateArguments(); - void addToQueue(const Utils::FileNameList &files, CppTools::ProjectPart &part); + void addToQueue(const Utils::FilePathList &files, CppTools::ProjectPart &part); QStringList additionalArguments(const CppTools::ProjectPart &part) const; CppcheckTextMarkManager &m_marks; diff --git a/src/plugins/cppcheck/cppchecktrigger.cpp b/src/plugins/cppcheck/cppchecktrigger.cpp index cac3772948..a69497f9fa 100644 --- a/src/plugins/cppcheck/cppchecktrigger.cpp +++ b/src/plugins/cppcheck/cppchecktrigger.cpp @@ -83,12 +83,12 @@ void CppcheckTrigger::checkEditors(const QList<Core::IEditor *> &editors) const QList<Core::IEditor *> editorList = !editors.isEmpty() ? editors : Core::DocumentModel::editorsForOpenedDocuments(); - Utils::FileNameList toCheck; + Utils::FilePathList toCheck; for (const Core::IEditor *editor : editorList) { QTC_ASSERT(editor, continue); Core::IDocument *document = editor->document(); QTC_ASSERT(document, continue); - const Utils::FileName &path = document->filePath(); + const Utils::FilePath &path = document->filePath(); if (path.isEmpty()) continue; @@ -128,12 +128,12 @@ void CppcheckTrigger::removeEditors(const QList<Core::IEditor *> &editors) const QList<Core::IEditor *> editorList = !editors.isEmpty() ? editors : Core::DocumentModel::editorsForOpenedDocuments(); - Utils::FileNameList toRemove; + Utils::FilePathList toRemove; for (const Core::IEditor *editor : editorList) { QTC_ASSERT(editor, return); const Core::IDocument *document = editor->document(); QTC_ASSERT(document, return); - const Utils::FileName &path = document->filePath(); + const Utils::FilePath &path = document->filePath(); if (path.isEmpty()) return; @@ -156,7 +156,7 @@ void CppcheckTrigger::checkChangedDocument(Core::IDocument *document) if (!m_currentProject) return; - const Utils::FileName &path = document->filePath(); + const Utils::FilePath &path = document->filePath(); QTC_ASSERT(!path.isEmpty(), return); if (!m_checkedFiles.contains(path)) return; @@ -185,12 +185,12 @@ void CppcheckTrigger::updateProjectFiles(ProjectExplorer::Project *project) checkEditors(Core::DocumentModel::editorsForOpenedDocuments()); } -void CppcheckTrigger::check(const Utils::FileNameList &files) +void CppcheckTrigger::check(const Utils::FilePathList &files) { m_tool.check(files); } -void CppcheckTrigger::remove(const Utils::FileNameList &files) +void CppcheckTrigger::remove(const Utils::FilePathList &files) { m_marks.clearFiles(files); m_tool.stop(files); diff --git a/src/plugins/cppcheck/cppchecktrigger.h b/src/plugins/cppcheck/cppchecktrigger.h index aa44f46fb7..069bfc7b04 100644 --- a/src/plugins/cppcheck/cppchecktrigger.h +++ b/src/plugins/cppcheck/cppchecktrigger.h @@ -29,8 +29,8 @@ #include <QPointer> namespace Utils { -class FileName; -using FileNameList = QList<FileName>; +class FilePath; +using FilePathList = QList<FilePath>; } namespace ProjectExplorer { @@ -68,13 +68,13 @@ private: void checkChangedDocument(Core::IDocument *document); void changeCurrentProject(ProjectExplorer::Project *project); void updateProjectFiles(ProjectExplorer::Project *project); - void check(const Utils::FileNameList &files); - void remove(const Utils::FileNameList &files); + void check(const Utils::FilePathList &files); + void remove(const Utils::FilePathList &files); CppcheckTextMarkManager &m_marks; CppcheckTool &m_tool; QPointer<ProjectExplorer::Project> m_currentProject; - QHash<Utils::FileName, QDateTime> m_checkedFiles; + QHash<Utils::FilePath, QDateTime> m_checkedFiles; }; } // namespace Internal diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp index 9d4854a752..6b26cd8185 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp @@ -1254,7 +1254,7 @@ void WorkingCopyModel::configure(const WorkingCopy &workingCopy) { emit layoutAboutToBeChanged(); m_workingCopyList.clear(); - QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); + QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); while (it.hasNext()) { it.next(); m_workingCopyList << WorkingCopyEntry(it.key().toString(), it.value().first, diff --git a/src/plugins/cppeditor/cppeditordocument.cpp b/src/plugins/cppeditor/cppeditordocument.cpp index 85c10e8f0c..f09e3807d3 100644 --- a/src/plugins/cppeditor/cppeditordocument.cpp +++ b/src/plugins/cppeditor/cppeditordocument.cpp @@ -238,8 +238,8 @@ void CppEditorDocument::reparseWithPreferredParseContext(const QString &parseCon scheduleProcessDocument(); } -void CppEditorDocument::onFilePathChanged(const Utils::FileName &oldPath, - const Utils::FileName &newPath) +void CppEditorDocument::onFilePathChanged(const Utils::FilePath &oldPath, + const Utils::FilePath &newPath) { Q_UNUSED(oldPath); diff --git a/src/plugins/cppeditor/cppeditordocument.h b/src/plugins/cppeditor/cppeditordocument.h index 5055b2654a..d8fc7094aa 100644 --- a/src/plugins/cppeditor/cppeditordocument.h +++ b/src/plugins/cppeditor/cppeditordocument.h @@ -91,7 +91,7 @@ protected: private: void invalidateFormatterCache(); - void onFilePathChanged(const Utils::FileName &oldPath, const Utils::FileName &newPath); + void onFilePathChanged(const Utils::FilePath &oldPath, const Utils::FilePath &newPath); void onMimeTypeChanged(); void onAboutToReload(); diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index df37a22d29..e55ac8a665 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -516,7 +516,7 @@ bool CppEditorWidget::isWidgetHighlighted(QWidget *widget) namespace { QList<ProjectPart::Ptr> fetchProjectParts(CppTools::CppModelManager *modelManager, - const Utils::FileName &filePath) + const Utils::FilePath &filePath) { QList<ProjectPart::Ptr> projectParts = modelManager->projectPart(filePath); @@ -734,7 +734,7 @@ void CppEditorWidget::findLinkAt(const QTextCursor &cursor, if (!d->m_modelManager) return processLinkCallback(Utils::Link()); - const Utils::FileName &filePath = textDocument()->filePath(); + const Utils::FilePath &filePath = textDocument()->filePath(); followSymbolInterface().findLink(CppTools::CursorInEditor{cursor, filePath, this}, std::move(processLinkCallback), diff --git a/src/plugins/cppeditor/cpppreprocessordialog.cpp b/src/plugins/cppeditor/cpppreprocessordialog.cpp index f66ee92a89..b0edff0fc0 100644 --- a/src/plugins/cppeditor/cpppreprocessordialog.cpp +++ b/src/plugins/cppeditor/cpppreprocessordialog.cpp @@ -42,7 +42,7 @@ CppPreProcessorDialog::CppPreProcessorDialog(const QString &filePath, QWidget *p setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_ui->setupUi(this); - m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(Utils::FileName::fromString(m_filePath).fileName())); + m_ui->editorLabel->setText(m_ui->editorLabel->text().arg(Utils::FilePath::fromString(m_filePath).fileName())); m_ui->editWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); CppEditor::decorateEditor(m_ui->editWidget); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index c17850662f..bec9f419e6 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -1973,16 +1973,16 @@ void AddIncludeForUndefinedIdentifier::match(const CppQuickFixInterface &interfa Snapshot localForwardHeaders = forwardHeaders; localForwardHeaders.insert(interface.snapshot().document(info->fileName())); - Utils::FileNameList headerAndItsForwardingHeaders; - headerAndItsForwardingHeaders << Utils::FileName::fromString(info->fileName()); + Utils::FilePathList headerAndItsForwardingHeaders; + headerAndItsForwardingHeaders << Utils::FilePath::fromString(info->fileName()); headerAndItsForwardingHeaders += localForwardHeaders.filesDependingOn(info->fileName()); - foreach (const Utils::FileName &header, headerAndItsForwardingHeaders) { + foreach (const Utils::FilePath &header, headerAndItsForwardingHeaders) { const QString include = findShortestInclude(currentDocumentFilePath, header.toString(), headerPaths); if (include.size() > 2) { - const QString headerFileName = Utils::FileName::fromString(info->fileName()).fileName(); + const QString headerFileName = Utils::FilePath::fromString(info->fileName()).fileName(); QTC_ASSERT(!headerFileName.isEmpty(), break); int priority = 0; diff --git a/src/plugins/cppeditor/resourcepreviewhoverhandler.cpp b/src/plugins/cppeditor/resourcepreviewhoverhandler.cpp index 72fb74f087..082c04493d 100644 --- a/src/plugins/cppeditor/resourcepreviewhoverhandler.cpp +++ b/src/plugins/cppeditor/resourcepreviewhoverhandler.cpp @@ -143,8 +143,8 @@ static QString findResourceInProject(const QString &resName) return QString(); if (auto *project = ProjectExplorer::ProjectTree::currentProject()) { - const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles); - for (const Utils::FileName &file : files) { + const Utils::FilePathList files = project->files(ProjectExplorer::Project::AllFiles); + for (const Utils::FilePath &file : files) { if (!file.endsWith(".qrc")) continue; const QFileInfo fi = file.toFileInfo(); diff --git a/src/plugins/cpptools/abstracteditorsupport.cpp b/src/plugins/cpptools/abstracteditorsupport.cpp index 8818c83efb..05c9112555 100644 --- a/src/plugins/cpptools/abstracteditorsupport.cpp +++ b/src/plugins/cpptools/abstracteditorsupport.cpp @@ -62,7 +62,7 @@ QString AbstractEditorSupport::licenseTemplate(const QString &file, const QStrin const QString license = Internal::CppFileSettings::licenseTemplate(); Utils::MacroExpander expander; expander.registerVariable("Cpp:License:FileName", tr("The file name."), - [file]() { return Utils::FileName::fromString(file).fileName(); }); + [file]() { return Utils::FilePath::fromString(file).fileName(); }); expander.registerVariable("Cpp:License:ClassName", tr("The class name."), [className]() { return className; }); diff --git a/src/plugins/cpptools/baseeditordocumentparser.cpp b/src/plugins/cpptools/baseeditordocumentparser.cpp index f0c7d9f680..91c6a3aa79 100644 --- a/src/plugins/cpptools/baseeditordocumentparser.cpp +++ b/src/plugins/cpptools/baseeditordocumentparser.cpp @@ -133,7 +133,7 @@ ProjectPartInfo BaseEditorDocumentParser::determineProjectPart( return CppModelManager::instance()->projectPart(filePath); }); chooser.setProjectPartsFromDependenciesForFile([&](const QString &filePath) { - const auto fileName = Utils::FileName::fromString(filePath); + const auto fileName = Utils::FilePath::fromString(filePath); return CppModelManager::instance()->projectPartFromDependencies(fileName); }); diff --git a/src/plugins/cpptools/builtineditordocumentparser.cpp b/src/plugins/cpptools/builtineditordocumentparser.cpp index d802e67250..a8f44e1e0c 100644 --- a/src/plugins/cpptools/builtineditordocumentparser.cpp +++ b/src/plugins/cpptools/builtineditordocumentparser.cpp @@ -145,9 +145,9 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface<void> &futur state.snapshot = Snapshot(); } else { // Remove changed files from the snapshot - QSet<Utils::FileName> toRemove; + QSet<Utils::FilePath> toRemove; foreach (const Document::Ptr &doc, state.snapshot) { - const Utils::FileName fileName = Utils::FileName::fromString(doc->fileName()); + const Utils::FilePath fileName = Utils::FilePath::fromString(doc->fileName()); if (workingCopy.contains(fileName)) { if (workingCopy.get(fileName).second != doc->editorRevision()) addFileAndDependencies(&state.snapshot, &toRemove, fileName); @@ -160,7 +160,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface<void> &futur if (!toRemove.isEmpty()) { invalidateSnapshot = true; - foreach (const Utils::FileName &fileName, toRemove) + foreach (const Utils::FilePath &fileName, toRemove) state.snapshot.remove(fileName); } } @@ -261,15 +261,15 @@ BuiltinEditorDocumentParser::Ptr BuiltinEditorDocumentParser::get(const QString } void BuiltinEditorDocumentParser::addFileAndDependencies(Snapshot *snapshot, - QSet<Utils::FileName> *toRemove, - const Utils::FileName &fileName) const + QSet<Utils::FilePath> *toRemove, + const Utils::FilePath &fileName) const { QTC_ASSERT(snapshot, return); toRemove->insert(fileName); - if (fileName != Utils::FileName::fromString(filePath())) { - Utils::FileNameList deps = snapshot->filesDependingOn(fileName); - toRemove->unite(QSet<Utils::FileName>::fromList(deps)); + if (fileName != Utils::FilePath::fromString(filePath())) { + Utils::FilePathList deps = snapshot->filesDependingOn(fileName); + toRemove->unite(QSet<Utils::FilePath>::fromList(deps)); } } diff --git a/src/plugins/cpptools/builtineditordocumentparser.h b/src/plugins/cpptools/builtineditordocumentparser.h index 3f53ae765e..7a1b9fd880 100644 --- a/src/plugins/cpptools/builtineditordocumentparser.h +++ b/src/plugins/cpptools/builtineditordocumentparser.h @@ -61,8 +61,8 @@ private: void updateImpl(const QFutureInterface<void> &future, const UpdateParams &updateParams) override; void addFileAndDependencies(CPlusPlus::Snapshot *snapshot, - QSet<Utils::FileName> *toRemove, - const Utils::FileName &fileName) const; + QSet<Utils::FilePath> *toRemove, + const Utils::FilePath &fileName) const; struct ExtraState { QByteArray configFile; diff --git a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp index 4f03a681f0..01164bfb1a 100644 --- a/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cpptools/clangdiagnosticconfigswidget.cpp @@ -70,7 +70,7 @@ static void buildTree(ProjectExplorer::Tree *parent, current->fullPath = parent->fullPath + current->name; parent->childDirectories.push_back(current); } else { - current->fullPath = Utils::FileName::fromString(current->name); + current->fullPath = Utils::FilePath::fromString(current->name); } current->parent = parent; for (const Constants::TidyNode &nodeChild : node.children) diff --git a/src/plugins/cpptools/cppcodemodelinspectordumper.cpp b/src/plugins/cpptools/cppcodemodelinspectordumper.cpp index 692d8a8634..efde14abc4 100644 --- a/src/plugins/cpptools/cppcodemodelinspectordumper.cpp +++ b/src/plugins/cpptools/cppcodemodelinspectordumper.cpp @@ -613,10 +613,10 @@ void Dumper::dumpWorkingCopy(const WorkingCopy &workingCopy) m_out << "Working Copy contains " << workingCopy.size() << " entries{{{1\n"; const QByteArray i1 = indent(1); - QHashIterator< ::Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); + QHashIterator< ::Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); while (it.hasNext()) { it.next(); - const ::Utils::FileName &filePath = it.key(); + const ::Utils::FilePath &filePath = it.key(); unsigned sourcRevision = it.value().second; m_out << i1 << "rev=" << sourcRevision << ", " << filePath << "\n"; } diff --git a/src/plugins/cpptools/cppelementevaluator.cpp b/src/plugins/cpptools/cppelementevaluator.cpp index 949442c459..88ffc3c075 100644 --- a/src/plugins/cpptools/cppelementevaluator.cpp +++ b/src/plugins/cpptools/cppelementevaluator.cpp @@ -83,7 +83,7 @@ class CppInclude : public CppElement public: explicit CppInclude(const Document::Include &includeFile) : path(QDir::toNativeSeparators(includeFile.resolvedFileName())) - , fileName(Utils::FileName::fromString(includeFile.resolvedFileName()).fileName()) + , fileName(Utils::FilePath::fromString(includeFile.resolvedFileName()).fileName()) { helpCategory = Core::HelpItem::Brief; helpIdCandidates = QStringList(fileName); diff --git a/src/plugins/cpptools/cppfindreferences.cpp b/src/plugins/cpptools/cppfindreferences.cpp index b42796c194..e277edeb4f 100644 --- a/src/plugins/cpptools/cppfindreferences.cpp +++ b/src/plugins/cpptools/cppfindreferences.cpp @@ -56,7 +56,7 @@ using namespace CppTools::Internal; using namespace CppTools; using namespace ProjectExplorer; -static QByteArray getSource(const Utils::FileName &fileName, +static QByteArray getSource(const Utils::FilePath &fileName, const WorkingCopy &workingCopy) { if (workingCopy.contains(fileName)) { @@ -178,7 +178,7 @@ class ProcessFile public: // needed by QtConcurrent - using argument_type = const Utils::FileName &; + using argument_type = const Utils::FilePath &; using result_type = QList<CPlusPlus::Usage>; ProcessFile(const WorkingCopy &workingCopy, @@ -193,7 +193,7 @@ public: future(future) { } - QList<CPlusPlus::Usage> operator()(const Utils::FileName &fileName) + QList<CPlusPlus::Usage> operator()(const Utils::FilePath &fileName) { QList<CPlusPlus::Usage> usages; if (future->isPaused()) @@ -210,7 +210,7 @@ public: CPlusPlus::Document::Ptr doc; const QByteArray unpreprocessedSource = getSource(fileName, workingCopy); - if (symbolDocument && fileName == Utils::FileName::fromString(symbolDocument->fileName())) { + if (symbolDocument && fileName == Utils::FilePath::fromString(symbolDocument->fileName())) { doc = symbolDocument; } else { doc = snapshot.preprocessedDocument(unpreprocessedSource, fileName); @@ -282,9 +282,9 @@ static void find_helper(QFutureInterface<CPlusPlus::Usage> &future, const CPlusPlus::Snapshot snapshot = context.snapshot(); - const Utils::FileName sourceFile = Utils::FileName::fromUtf8(symbol->fileName(), + const Utils::FilePath sourceFile = Utils::FilePath::fromUtf8(symbol->fileName(), symbol->fileNameLength()); - Utils::FileNameList files{sourceFile}; + Utils::FilePathList files{sourceFile}; if (symbol->isClass() || symbol->isForwardClassDeclaration() @@ -527,7 +527,7 @@ CPlusPlus::Symbol *CppFindReferences::findSymbol(const CppFindReferencesParamete CPlusPlus::Document::Ptr newSymbolDocument = snapshot.document(symbolFile); // document is not parsed and has no bindings yet, do it - QByteArray source = getSource(Utils::FileName::fromString(newSymbolDocument->fileName()), + QByteArray source = getSource(Utils::FilePath::fromString(newSymbolDocument->fileName()), m_modelManager->workingCopy()); CPlusPlus::Document::Ptr doc = snapshot.preprocessedDocument(source, newSymbolDocument->fileName()); @@ -607,7 +607,7 @@ class FindMacroUsesInFile public: // needed by QtConcurrent - using argument_type = const Utils::FileName &; + using argument_type = const Utils::FilePath &; using result_type = QList<CPlusPlus::Usage>; FindMacroUsesInFile(const WorkingCopy &workingCopy, @@ -617,7 +617,7 @@ public: : workingCopy(workingCopy), snapshot(snapshot), macro(macro), future(future) { } - QList<CPlusPlus::Usage> operator()(const Utils::FileName &fileName) + QList<CPlusPlus::Usage> operator()(const Utils::FilePath &fileName) { QList<CPlusPlus::Usage> usages; CPlusPlus::Document::Ptr doc = snapshot.document(fileName); @@ -688,8 +688,8 @@ static void findMacroUses_helper(QFutureInterface<CPlusPlus::Usage> &future, const CPlusPlus::Snapshot snapshot, const CPlusPlus::Macro macro) { - const Utils::FileName sourceFile = Utils::FileName::fromString(macro.fileName()); - Utils::FileNameList files{sourceFile}; + const Utils::FilePath sourceFile = Utils::FilePath::fromString(macro.fileName()); + Utils::FilePathList files{sourceFile}; files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile)); future.setProgressRange(0, files.size()); @@ -736,7 +736,7 @@ void CppFindReferences::findMacroUses(const CPlusPlus::Macro ¯o, const QStri // add the macro definition itself { - const QByteArray &source = getSource(Utils::FileName::fromString(macro.fileName()), + const QByteArray &source = getSource(Utils::FilePath::fromString(macro.fileName()), workingCopy); unsigned column; const QString line = FindMacroUsesInFile::matchingLine(macro.bytesOffset(), source, diff --git a/src/plugins/cpptools/cppfunctionsfilter.cpp b/src/plugins/cpptools/cppfunctionsfilter.cpp index 9e023b2c64..597e0f4d03 100644 --- a/src/plugins/cpptools/cppfunctionsfilter.cpp +++ b/src/plugins/cpptools/cppfunctionsfilter.cpp @@ -53,7 +53,7 @@ Core::LocatorFilterEntry CppFunctionsFilter::filterEntryFromIndexItem(IndexItem: if (extraInfo.isEmpty()) { extraInfo = info->shortNativeFilePath(); } else { - extraInfo.append(" (" + Utils::FileName::fromString(info->fileName()).fileName() + ')'); + extraInfo.append(" (" + Utils::FilePath::fromString(info->fileName()).fileName() + ')'); } Core::LocatorFilterEntry filterEntry(this, name + info->symbolType(), id, info->icon()); diff --git a/src/plugins/cpptools/cppheadersource_test.cpp b/src/plugins/cpptools/cppheadersource_test.cpp index ba830cc491..46994ed1f7 100644 --- a/src/plugins/cpptools/cppheadersource_test.cpp +++ b/src/plugins/cpptools/cppheadersource_test.cpp @@ -99,7 +99,7 @@ void CppToolsPlugin::initTestCase() void CppToolsPlugin::cleanupTestCase() { - Utils::FileUtils::removeRecursively(Utils::FileName::fromString(baseTestDir())); + Utils::FileUtils::removeRecursively(Utils::FilePath::fromString(baseTestDir())); m_fileSettings->headerSearchPaths.removeLast(); m_fileSettings->headerSearchPaths.removeLast(); m_fileSettings->sourceSearchPaths.removeLast(); diff --git a/src/plugins/cpptools/cppincludesfilter.cpp b/src/plugins/cpptools/cppincludesfilter.cpp index 8675a9747a..8a852fb7a5 100644 --- a/src/plugins/cpptools/cppincludesfilter.cpp +++ b/src/plugins/cpptools/cppincludesfilter.cpp @@ -160,8 +160,8 @@ void CppIncludesFilter::prepareSearch(const QString &entry) m_needsUpdate = false; QSet<QString> seedPaths; for (Project *project : SessionManager::projects()) { - const Utils::FileNameList allFiles = project->files(Project::AllFiles); - for (const Utils::FileName &filePath : allFiles ) + const Utils::FilePathList allFiles = project->files(Project::AllFiles); + for (const Utils::FilePath &filePath : allFiles ) seedPaths.insert(filePath.toString()); } const QList<DocumentModel::Entry *> entries = DocumentModel::entries(); diff --git a/src/plugins/cpptools/cpplocatorfilter_test.cpp b/src/plugins/cpptools/cpplocatorfilter_test.cpp index da6a154360..0dd3470826 100644 --- a/src/plugins/cpptools/cpplocatorfilter_test.cpp +++ b/src/plugins/cpptools/cpplocatorfilter_test.cpp @@ -166,8 +166,8 @@ void CppToolsPlugin::test_cpplocatorfilters_CppLocatorFilter_data() MyTestDataDir testDirectory("testdata_basic"); const QString testFile = testDirectory.file("file1.cpp"); const QString objTestFile = testDirectory.file("file1.mm"); - const QString testFileShort = FileName::fromString(testFile).shortNativePath(); - const QString objTestFileShort = FileName::fromString(objTestFile).shortNativePath(); + const QString testFileShort = FilePath::fromString(testFile).shortNativePath(); + const QString objTestFileShort = FilePath::fromString(objTestFile).shortNativePath(); QTest::newRow("CppFunctionsFilter") << testFile diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 5a43feb322..99d008aa3d 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -146,7 +146,7 @@ public: mutable QMutex m_projectMutex; QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo; QHash<ProjectExplorer::Project *, bool> m_projectToIndexerCanceled; - QMap<Utils::FileName, QList<ProjectPart::Ptr> > m_fileToProjectParts; + QMap<Utils::FilePath, QList<ProjectPart::Ptr> > m_fileToProjectParts; QMap<QString, ProjectPart::Ptr> m_projectPartIdToProjectProjectPart; // The members below are cached/(re)calculated from the projects and/or their project parts bool m_dirty; @@ -968,7 +968,7 @@ void CppModelManager::recalculateProjectPartMappings() foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) { d->m_projectPartIdToProjectProjectPart[projectPart->id()] = projectPart; foreach (const ProjectFile &cxxFile, projectPart->files) - d->m_fileToProjectParts[Utils::FileName::fromString(cxxFile.path)].append( + d->m_fileToProjectParts[Utils::FilePath::fromString(cxxFile.path)].append( projectPart); } @@ -1132,20 +1132,20 @@ ProjectPart::Ptr CppModelManager::projectPartForId(const QString &projectPartId) return d->m_projectPartIdToProjectProjectPart.value(projectPartId); } -QList<ProjectPart::Ptr> CppModelManager::projectPart(const Utils::FileName &fileName) const +QList<ProjectPart::Ptr> CppModelManager::projectPart(const Utils::FilePath &fileName) const { QMutexLocker locker(&d->m_projectMutex); return d->m_fileToProjectParts.value(fileName); } QList<ProjectPart::Ptr> CppModelManager::projectPartFromDependencies( - const Utils::FileName &fileName) const + const Utils::FilePath &fileName) const { QSet<ProjectPart::Ptr> parts; - const Utils::FileNameList deps = snapshot().filesDependingOn(fileName); + const Utils::FilePathList deps = snapshot().filesDependingOn(fileName); QMutexLocker locker(&d->m_projectMutex); - foreach (const Utils::FileName &dep, deps) { + foreach (const Utils::FilePath &dep, deps) { parts.unite(QSet<ProjectPart::Ptr>::fromList(d->m_fileToProjectParts.value(dep))); } @@ -1338,7 +1338,7 @@ void CppModelManager::GC() filesInEditorSupports << abstractEditorSupport->fileName(); Snapshot currentSnapshot = snapshot(); - QSet<Utils::FileName> reachableFiles; + QSet<Utils::FilePath> reachableFiles; // The configuration file is part of the project files, which is just fine. // If single files are open, without any project, then there is no need to // keep the configuration file around. @@ -1349,7 +1349,7 @@ void CppModelManager::GC() const QString file = todo.last(); todo.removeLast(); - const Utils::FileName fileName = Utils::FileName::fromString(file); + const Utils::FilePath fileName = Utils::FilePath::fromString(file); if (reachableFiles.contains(fileName)) continue; reachableFiles.insert(fileName); @@ -1362,7 +1362,7 @@ void CppModelManager::GC() QStringList notReachableFiles; Snapshot newSnapshot; for (Snapshot::const_iterator it = currentSnapshot.begin(); it != currentSnapshot.end(); ++it) { - const Utils::FileName &fileName = it.key(); + const Utils::FilePath &fileName = it.key(); if (reachableFiles.contains(fileName)) newSnapshot.insert(it.value()); diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index 2c5fe960f2..9deaa2e392 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -121,12 +121,12 @@ public: /// \return The project part with the given project file ProjectPart::Ptr projectPartForId(const QString &projectPartId) const override; /// \return All project parts that mention the given file name as one of the sources/headers. - QList<ProjectPart::Ptr> projectPart(const Utils::FileName &fileName) const; + QList<ProjectPart::Ptr> projectPart(const Utils::FilePath &fileName) const; QList<ProjectPart::Ptr> projectPart(const QString &fileName) const - { return projectPart(Utils::FileName::fromString(fileName)); } + { return projectPart(Utils::FilePath::fromString(fileName)); } /// This is a fall-back function: find all files that includes the file directly or indirectly, /// and return its \c ProjectPart list for use with this file. - QList<ProjectPart::Ptr> projectPartFromDependencies(const Utils::FileName &fileName) const; + QList<ProjectPart::Ptr> projectPartFromDependencies(const Utils::FilePath &fileName) const; /// \return A synthetic \c ProjectPart which consists of all defines/includes/frameworks from /// all loaded projects. ProjectPart::Ptr fallbackProjectPart(); diff --git a/src/plugins/cpptools/cppmodelmanager_test.cpp b/src/plugins/cpptools/cppmodelmanager_test.cpp index aac046745b..ceab10028e 100644 --- a/src/plugins/cpptools/cppmodelmanager_test.cpp +++ b/src/plugins/cpptools/cppmodelmanager_test.cpp @@ -618,10 +618,10 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() QCOMPARE(workingCopy.size(), 2); // mm->configurationFileName() and "ui_*.h" QStringList fileNamesInWorkinCopy; - QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); + QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); while (it.hasNext()) { it.next(); - fileNamesInWorkinCopy << Utils::FileName::fromString(it.key().toString()).fileName(); + fileNamesInWorkinCopy << Utils::FilePath::fromString(it.key().toString()).fileName(); } fileNamesInWorkinCopy.sort(); const QString expectedUiHeaderFileName = _("ui_mainwindow.h"); @@ -639,8 +639,8 @@ void CppToolsPlugin::test_modelmanager_extraeditorsupport_uiFiles() QVERIFY(document); const QStringList includedFiles = document->includedFiles(); QCOMPARE(includedFiles.size(), 2); - QCOMPARE(Utils::FileName::fromString(includedFiles.at(0)).fileName(), _("mainwindow.h")); - QCOMPARE(Utils::FileName::fromString(includedFiles.at(1)).fileName(), _("ui_mainwindow.h")); + QCOMPARE(Utils::FilePath::fromString(includedFiles.at(0)).fileName(), _("mainwindow.h")); + QCOMPARE(Utils::FilePath::fromString(includedFiles.at(1)).fileName(), _("ui_mainwindow.h")); } /// QTCREATORBUG-9828: Locator shows symbols of closed files diff --git a/src/plugins/cpptools/cpptoolsjsextension.cpp b/src/plugins/cpptools/cpptoolsjsextension.cpp index d25448f304..4c283fc644 100644 --- a/src/plugins/cpptools/cpptoolsjsextension.cpp +++ b/src/plugins/cpptools/cpptoolsjsextension.cpp @@ -40,7 +40,7 @@ namespace Internal { static QString fileName(const QString &path, const QString &extension) { - return Utils::FileName::fromStringWithExtension(path, extension).toString(); + return Utils::FilePath::fromStringWithExtension(path, extension).toString(); } QString CppToolsJsExtension::headerGuard(const QString &in) const diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 4d7599b24b..be52ced3f1 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -130,9 +130,9 @@ void CppToolsPlugin::clearHeaderSourceCache() m_headerSourceMapping.clear(); } -Utils::FileName CppToolsPlugin::licenseTemplatePath() +Utils::FilePath CppToolsPlugin::licenseTemplatePath() { - return Utils::FileName::fromString(m_instance->m_fileSettings->licenseTemplatePath); + return Utils::FilePath::fromString(m_instance->m_fileSettings->licenseTemplatePath); } QString CppToolsPlugin::licenseTemplate() @@ -256,7 +256,7 @@ static QStringList findFilesInProject(const QString &name, QString pattern = QString(1, QLatin1Char('/')); pattern += name; const QStringList projectFiles - = Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString); + = Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FilePath::toString); const QStringList::const_iterator pcend = projectFiles.constEnd(); QStringList candidateList; for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) { diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h index 84e43da383..d319c9eb1e 100644 --- a/src/plugins/cpptools/cpptoolsplugin.h +++ b/src/plugins/cpptools/cpptoolsplugin.h @@ -36,7 +36,7 @@ class QFileInfo; class QDir; QT_END_NAMESPACE -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace CppTools { @@ -63,7 +63,7 @@ public: static const QStringList &headerPrefixes(); static const QStringList &sourcePrefixes(); static void clearHeaderSourceCache(); - static Utils::FileName licenseTemplatePath(); + static Utils::FilePath licenseTemplatePath(); static QString licenseTemplate(); static bool usePragmaOnce(); diff --git a/src/plugins/cpptools/cpptoolstestcase.cpp b/src/plugins/cpptools/cpptoolstestcase.cpp index 2b6d794955..5ed334b2e8 100644 --- a/src/plugins/cpptools/cpptoolstestcase.cpp +++ b/src/plugins/cpptools/cpptoolstestcase.cpp @@ -340,8 +340,8 @@ static bool copyRecursively(const QString &sourceDirPath, return file.setPermissions(file.permissions() | QFile::WriteUser); }; - return Utils::FileUtils::copyRecursively(Utils::FileName::fromString(sourceDirPath), - Utils::FileName::fromString(targetDirPath), + return Utils::FileUtils::copyRecursively(Utils::FilePath::fromString(sourceDirPath), + Utils::FilePath::fromString(targetDirPath), error, copyHelper); } diff --git a/src/plugins/cpptools/cppworkingcopy.h b/src/plugins/cpptools/cppworkingcopy.h index 6c9e74caa8..1477720553 100644 --- a/src/plugins/cpptools/cppworkingcopy.h +++ b/src/plugins/cpptools/cppworkingcopy.h @@ -41,43 +41,43 @@ public: WorkingCopy(); void insert(const QString &fileName, const QByteArray &source, unsigned revision = 0) - { insert(Utils::FileName::fromString(fileName), source, revision); } + { insert(Utils::FilePath::fromString(fileName), source, revision); } - void insert(const Utils::FileName &fileName, const QByteArray &source, unsigned revision = 0) + void insert(const Utils::FilePath &fileName, const QByteArray &source, unsigned revision = 0) { _elements.insert(fileName, qMakePair(source, revision)); } bool contains(const QString &fileName) const - { return contains(Utils::FileName::fromString(fileName)); } + { return contains(Utils::FilePath::fromString(fileName)); } - bool contains(const Utils::FileName &fileName) const + bool contains(const Utils::FilePath &fileName) const { return _elements.contains(fileName); } QByteArray source(const QString &fileName) const - { return source(Utils::FileName::fromString(fileName)); } + { return source(Utils::FilePath::fromString(fileName)); } - QByteArray source(const Utils::FileName &fileName) const + QByteArray source(const Utils::FilePath &fileName) const { return _elements.value(fileName).first; } unsigned revision(const QString &fileName) const - { return revision(Utils::FileName::fromString(fileName)); } + { return revision(Utils::FilePath::fromString(fileName)); } - unsigned revision(const Utils::FileName &fileName) const + unsigned revision(const Utils::FilePath &fileName) const { return _elements.value(fileName).second; } QPair<QByteArray, unsigned> get(const QString &fileName) const - { return get(Utils::FileName::fromString(fileName)); } + { return get(Utils::FilePath::fromString(fileName)); } - QPair<QByteArray, unsigned> get(const Utils::FileName &fileName) const + QPair<QByteArray, unsigned> get(const Utils::FilePath &fileName) const { return _elements.value(fileName); } - QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > iterator() const - { return QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> >(_elements); } + QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > iterator() const + { return QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> >(_elements); } int size() const { return _elements.size(); } private: - using Table = QHash<Utils::FileName, QPair<QByteArray, unsigned> >; + using Table = QHash<Utils::FilePath, QPair<QByteArray, unsigned> >; Table _elements; }; diff --git a/src/plugins/cpptools/cursorineditor.h b/src/plugins/cpptools/cursorineditor.h index 18097e5dbd..b84633d9bc 100644 --- a/src/plugins/cpptools/cursorineditor.h +++ b/src/plugins/cpptools/cursorineditor.h @@ -36,7 +36,7 @@ namespace CppTools { class CursorInEditor { public: - CursorInEditor(const QTextCursor &cursor, const Utils::FileName &filePath, + CursorInEditor(const QTextCursor &cursor, const Utils::FilePath &filePath, CppEditorWidgetInterface *editorWidget = nullptr) : m_cursor(cursor) , m_filePath(filePath) @@ -44,10 +44,10 @@ public: {} CppEditorWidgetInterface *editorWidget() const { return m_editorWidget; } const QTextCursor &cursor() const { return m_cursor; } - const Utils::FileName &filePath() const { return m_filePath; } + const Utils::FilePath &filePath() const { return m_filePath; } private: QTextCursor m_cursor; - Utils::FileName m_filePath; + Utils::FilePath m_filePath; CppEditorWidgetInterface *m_editorWidget = nullptr; }; diff --git a/src/plugins/cpptools/doxygengenerator.cpp b/src/plugins/cpptools/doxygengenerator.cpp index 764930cbc9..c11cb4d7cb 100644 --- a/src/plugins/cpptools/doxygengenerator.cpp +++ b/src/plugins/cpptools/doxygengenerator.cpp @@ -76,7 +76,7 @@ static int lineBeforeCursor(const QTextCursor &cursor) QString DoxygenGenerator::generate(QTextCursor cursor, const CPlusPlus::Snapshot &snapshot, - const Utils::FileName &documentFilePath) + const Utils::FilePath &documentFilePath) { const QTextCursor initialCursor = cursor; diff --git a/src/plugins/cpptools/doxygengenerator.h b/src/plugins/cpptools/doxygengenerator.h index 780525b65e..7448b12345 100644 --- a/src/plugins/cpptools/doxygengenerator.h +++ b/src/plugins/cpptools/doxygengenerator.h @@ -33,7 +33,7 @@ QT_FORWARD_DECLARE_CLASS(QTextCursor) namespace CPlusPlus { class DeclarationAST; } namespace CPlusPlus { class Snapshot; } -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace CppTools { @@ -56,7 +56,7 @@ public: QString generate(QTextCursor cursor, const CPlusPlus::Snapshot &snapshot, - const Utils::FileName &documentFilePath); + const Utils::FilePath &documentFilePath); QString generate(QTextCursor cursor, CPlusPlus::DeclarationAST *decl); private: diff --git a/src/plugins/cpptools/generatedcodemodelsupport.cpp b/src/plugins/cpptools/generatedcodemodelsupport.cpp index a779e38718..85825ae9ef 100644 --- a/src/plugins/cpptools/generatedcodemodelsupport.cpp +++ b/src/plugins/cpptools/generatedcodemodelsupport.cpp @@ -69,7 +69,7 @@ private: GeneratedCodeModelSupport::GeneratedCodeModelSupport(CppModelManager *modelmanager, ProjectExplorer::ExtraCompiler *generator, - const Utils::FileName &generatedFile) : + const Utils::FilePath &generatedFile) : CppTools::AbstractEditorSupport(modelmanager, generator), m_generatedFileName(generatedFile), m_generator(generator) { @@ -90,7 +90,7 @@ GeneratedCodeModelSupport::~GeneratedCodeModelSupport() qCDebug(log) << "dtor ~generatedcodemodelsupport for" << m_generatedFileName; } -void GeneratedCodeModelSupport::onContentsChanged(const Utils::FileName &file) +void GeneratedCodeModelSupport::onContentsChanged(const Utils::FilePath &file) { if (file == m_generatedFileName) { notifyAboutUpdatedContents(); @@ -124,7 +124,7 @@ void GeneratedCodeModelSupport::update(const QList<ProjectExplorer::ExtraCompile continue; extraCompilerCache.insert(generator); - generator->forEachTarget([mm, generator](const Utils::FileName &generatedFile) { + generator->forEachTarget([mm, generator](const Utils::FilePath &generatedFile) { new GeneratedCodeModelSupport(mm, generator, generatedFile); }); } diff --git a/src/plugins/cpptools/generatedcodemodelsupport.h b/src/plugins/cpptools/generatedcodemodelsupport.h index 818d84e47c..0b471a1268 100644 --- a/src/plugins/cpptools/generatedcodemodelsupport.h +++ b/src/plugins/cpptools/generatedcodemodelsupport.h @@ -48,7 +48,7 @@ class CPPTOOLS_EXPORT GeneratedCodeModelSupport : public AbstractEditorSupport public: GeneratedCodeModelSupport(CppModelManager *modelmanager, ProjectExplorer::ExtraCompiler *generator, - const Utils::FileName &generatedFile); + const Utils::FilePath &generatedFile); ~GeneratedCodeModelSupport() override; /// \returns the contents encoded in UTF-8. @@ -59,8 +59,8 @@ public: static void update(const QList<ProjectExplorer::ExtraCompiler *> &generators); private: - void onContentsChanged(const Utils::FileName &file); - Utils::FileName m_generatedFileName; + void onContentsChanged(const Utils::FilePath &file); + Utils::FilePath m_generatedFileName; ProjectExplorer::ExtraCompiler *m_generator; }; diff --git a/src/plugins/cpptools/headerpathfilter.cpp b/src/plugins/cpptools/headerpathfilter.cpp index 83ad478b0c..e2d1e6a4ca 100644 --- a/src/plugins/cpptools/headerpathfilter.cpp +++ b/src/plugins/cpptools/headerpathfilter.cpp @@ -148,7 +148,7 @@ void HeaderPathFilter::tweakHeaderPaths() void HeaderPathFilter::addPreIncludesPath() { if (projectDirectory.size()) { - const Utils::FileName rootProjectDirectory = Utils::FileName::fromString(projectDirectory) + const Utils::FilePath rootProjectDirectory = Utils::FilePath::fromString(projectDirectory) .pathAppended(".pre_includes"); systemHeaderPaths.push_back( diff --git a/src/plugins/cpptools/indexitem.cpp b/src/plugins/cpptools/indexitem.cpp index b9fb4cdcc5..161a7555cd 100644 --- a/src/plugins/cpptools/indexitem.cpp +++ b/src/plugins/cpptools/indexitem.cpp @@ -88,7 +88,7 @@ QString IndexItem::representDeclaration() const QString IndexItem::shortNativeFilePath() const { - return Utils::FileName::fromString(m_fileName).shortNativePath(); + return Utils::FilePath::fromString(m_fileName).shortNativePath(); } void IndexItem::squeeze() diff --git a/src/plugins/cpptools/modelmanagertesthelper.cpp b/src/plugins/cpptools/modelmanagertesthelper.cpp index 83e27fb237..f1029be36b 100644 --- a/src/plugins/cpptools/modelmanagertesthelper.cpp +++ b/src/plugins/cpptools/modelmanagertesthelper.cpp @@ -37,7 +37,7 @@ using namespace CppTools::Internal; using namespace CppTools::Tests; TestProject::TestProject(const QString &name, QObject *parent) : - ProjectExplorer::Project("x-binary/foo", Utils::FileName()), + ProjectExplorer::Project("x-binary/foo", Utils::FilePath()), m_name(name) { setParent(parent); diff --git a/src/plugins/cpptools/symbolsfindfilter.cpp b/src/plugins/cpptools/symbolsfindfilter.cpp index dd8dc4694d..93f4643587 100644 --- a/src/plugins/cpptools/symbolsfindfilter.cpp +++ b/src/plugins/cpptools/symbolsfindfilter.cpp @@ -129,7 +129,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search) QSet<QString> projectFileNames; if (parameters.scope == SymbolSearcher::SearchProjectsOnly) { for (ProjectExplorer::Project *project : ProjectExplorer::SessionManager::projects()) - projectFileNames += Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString).toSet(); + projectFileNames += Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FilePath::toString).toSet(); } auto watcher = new QFutureWatcher<SearchResultItem>; diff --git a/src/plugins/cpptools/typehierarchybuilder.cpp b/src/plugins/cpptools/typehierarchybuilder.cpp index e54b546068..aee41076d7 100644 --- a/src/plugins/cpptools/typehierarchybuilder.cpp +++ b/src/plugins/cpptools/typehierarchybuilder.cpp @@ -193,9 +193,9 @@ QStringList TypeHierarchyBuilder::filesDependingOn(CPlusPlus::Symbol *symbol) co if (!symbol) return deps; - Utils::FileName file = Utils::FileName::fromUtf8(symbol->fileName(), symbol->fileNameLength()); + Utils::FilePath file = Utils::FilePath::fromUtf8(symbol->fileName(), symbol->fileNameLength()); deps << file.toString(); - foreach (const Utils::FileName &fileName, _snapshot.filesDependingOn(file)) + foreach (const Utils::FilePath &fileName, _snapshot.filesDependingOn(file)) deps.append(fileName.toString()); return deps; } diff --git a/src/plugins/cvs/cvscontrol.cpp b/src/plugins/cvs/cvscontrol.cpp index 602d6764a2..454e95df63 100644 --- a/src/plugins/cvs/cvscontrol.cpp +++ b/src/plugins/cvs/cvscontrol.cpp @@ -55,7 +55,7 @@ Core::Id CvsControl::id() const return Core::Id(VcsBase::Constants::VCS_ID_CVS); } -bool CvsControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool CvsControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { return fileName.toFileInfo().isDir() && !fileName.fileName().compare("CVS", Utils::HostOsInfo::fileNameCaseSensitivity()); @@ -63,7 +63,7 @@ bool CvsControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const bool CvsControl::isConfigured() const { - const Utils::FileName binary = m_plugin->client()->vcsBinary(); + const Utils::FilePath binary = m_plugin->client()->vcsBinary(); if (binary.isEmpty()) return false; QFileInfo fi = binary.toFileInfo(); @@ -137,7 +137,7 @@ QString CvsControl::vcsOpenText() const } Core::ShellCommand *CvsControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/cvs/cvscontrol.h b/src/plugins/cvs/cvscontrol.h index 37370452c9..b988fb6adc 100644 --- a/src/plugins/cvs/cvscontrol.h +++ b/src/plugins/cvs/cvscontrol.h @@ -42,7 +42,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; @@ -60,7 +60,7 @@ public: QString vcsOpenText() const final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 7335ba53ff..1d771ca31f 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -1100,7 +1100,7 @@ CvsResponse CvsPlugin::runCvs(const QString &workingDirectory, unsigned flags, QTextCodec *outputCodec) const { - const FileName executable = client()->vcsBinary(); + const FilePath executable = client()->vcsBinary(); CvsResponse response; if (executable.isEmpty()) { response.result = CvsResponse::OtherError; diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 481c123046..0e015eda58 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -87,7 +87,7 @@ static BreakpointManager *theBreakpointManager = nullptr; class BreakpointMarker : public TextEditor::TextMark { public: - BreakpointMarker(const Breakpoint &bp, const FileName &fileName, int lineNumber) + BreakpointMarker(const Breakpoint &bp, const FilePath &fileName, int lineNumber) : TextMark(fileName, lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_bp(bp) { setColor(Theme::Debugger_Breakpoint_TextMarkColor); @@ -106,7 +106,7 @@ public: gbp->m_params.lineNumber = lineNumber; } - void updateFileName(const FileName &fileName) final + void updateFileName(const FilePath &fileName) final { TextMark::updateFileName(fileName); QTC_ASSERT(m_bp, return); @@ -145,7 +145,7 @@ public: class GlobalBreakpointMarker : public TextEditor::TextMark { public: - GlobalBreakpointMarker(GlobalBreakpoint gbp, const FileName &fileName, int lineNumber) + GlobalBreakpointMarker(GlobalBreakpoint gbp, const FilePath &fileName, int lineNumber) : TextMark(fileName, lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_gbp(gbp) { setColor(Theme::Debugger_Breakpoint_TextMarkColor); @@ -174,7 +174,7 @@ public: m_gbp->update(); } - void updateFileName(const FileName &fileName) final + void updateFileName(const FilePath &fileName) final { TextMark::updateFileName(fileName); QTC_ASSERT(m_gbp, return); @@ -1877,7 +1877,7 @@ void BreakpointItem::updateMarkerIcon() void BreakpointItem::updateMarker() { - FileName file = FileName::fromString(markerFileName()); + FilePath file = FilePath::fromString(markerFileName()); int line = markerLineNumber(); if (m_marker && (file != m_marker->fileName() || line != m_marker->lineNumber())) destroyMarker(); @@ -2298,7 +2298,7 @@ void GlobalBreakpointItem::updateMarker() return; } - const FileName file = FileName::fromString(m_params.fileName); + const FilePath file = FilePath::fromString(m_params.fileName); const int line = m_params.lineNumber; if (m_marker && (file != m_marker->fileName() || line != m_marker->lineNumber())) destroyMarker(); diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index 544f4a509e..83d934034b 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -76,7 +76,7 @@ public: void removeBreakpointFromModel(); void updateLineNumber(int lineNumber); - void updateFileName(const Utils::FileName &fileName); + void updateFileName(const Utils::FilePath &fileName); QString displayName() const; QString markerFileName() const; @@ -191,7 +191,7 @@ public: void deleteGlobalOrThisBreakpoint(); void updateLineNumber(int lineNumber); - void updateFileName(const Utils::FileName &fileName); + void updateFileName(const Utils::FilePath &fileName); const GlobalBreakpoint globalBreakpoint() const; void gotoState(BreakpointState target, BreakpointState assumedCurrent); diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index dd29477deb..b740520ea0 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -526,7 +526,7 @@ void CdbEngine::handleInitialSessionIdle() if (rp.breakOnMain) { BreakpointParameters bp(BreakpointAtMain); if (rp.startMode == StartInternal || rp.startMode == StartExternal) { - const QString &moduleFileName = Utils::FileName::fromString(rp.inferior.executable) + const QString &moduleFileName = Utils::FilePath::fromString(rp.inferior.executable) .fileName(); bp.module = moduleFileName.left(moduleFileName.indexOf('.')); } @@ -2205,7 +2205,7 @@ void CdbEngine::handleExtensionMessage(char t, int token, const QString &what, c if (!isDebuggerWinException(exception.exceptionCode)) { const Task::TaskType type = isFatalWinException(exception.exceptionCode) ? Task::Error : Task::Warning; - const FileName fileName = FileName::fromUserInput(exception.file); + const FilePath fileName = FilePath::fromUserInput(exception.file); const QString taskEntry = tr("Debugger encountered an exception: %1").arg( exception.toString(false).trimmed()); TaskHub::addTask(type, taskEntry, diff --git a/src/plugins/debugger/cdb/cdbparsehelpers.cpp b/src/plugins/debugger/cdb/cdbparsehelpers.cpp index 577776f8fb..2590a47a09 100644 --- a/src/plugins/debugger/cdb/cdbparsehelpers.cpp +++ b/src/plugins/debugger/cdb/cdbparsehelpers.cpp @@ -84,7 +84,7 @@ static inline QString cdbBreakPointFileName(const BreakpointParameters ¶ms, if (params.fileName.isEmpty()) return params.fileName; if (params.pathUsage == BreakpointUseShortPath) - return Utils::FileName::fromString(params.fileName).fileName(); + return Utils::FilePath::fromString(params.fileName).fileName(); return cdbSourcePathMapping(QDir::toNativeSeparators(params.fileName), sourcePathMapping, SourceToDebugger); } diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index aa5cd1b1ab..4024ceb8ae 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -172,7 +172,7 @@ QString StartApplicationParameters::displayName() const { const int maxLength = 60; - QString name = FileName::fromString(runnable.executable).fileName() + QString name = FilePath::fromString(runnable.executable).fileName() + ' ' + runnable.commandLineArguments; if (name.size() > 60) { int index = name.lastIndexOf(' ', maxLength); diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index a492b4eaed..6b94e5025d 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -173,7 +173,7 @@ Location::Location(const StackFrame &frame, bool marker) } -LocationMark::LocationMark(DebuggerEngine *engine, const FileName &file, int line) +LocationMark::LocationMark(DebuggerEngine *engine, const FilePath &file, int line) : TextMark(file, line, Constants::TEXT_MARK_CATEGORY_LOCATION), m_engine(engine) { setPriority(TextMark::HighPriority); @@ -1065,7 +1065,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true); if (loc.needsMarker()) { - d->m_locationMark.reset(new LocationMark(this, FileName::fromString(file), line)); + d->m_locationMark.reset(new LocationMark(this, FilePath::fromString(file), line)); d->m_locationMark->setToolTip(tr("Current debugger location of %1").arg(displayName())); } } @@ -2583,7 +2583,7 @@ QString DebuggerEngine::formatStartParameters() const if (!sp.projectSourceDirectory.isEmpty()) { str << "Project: " << sp.projectSourceDirectory.toUserOutput() << '\n'; str << "Additional Search Directories:"; - for (const FileName &dir : sp.additionalSearchDirectories) + for (const FilePath &dir : sp.additionalSearchDirectories) str << ' ' << dir; str << '\n'; } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 54eb9fa22a..78826dd518 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -147,13 +147,13 @@ public: // Used by Android to avoid false positives on warnOnRelease bool skipExecutableValidation = false; bool useTargetAsync = false; - Utils::FileNameList additionalSearchDirectories; + Utils::FilePathList additionalSearchDirectories; // Used by iOS. QString platform; QString deviceSymbolsRoot; bool continueAfterAttach = false; - Utils::FileName sysRoot; + Utils::FilePath sysRoot; // Used by general core file debugging. Public access requested in QTCREATORBUG-17158. QString coreFile; @@ -177,8 +177,8 @@ public: bool isSnapshot = false; // Set if created internally. ProjectExplorer::Abi toolChainAbi; - Utils::FileName projectSourceDirectory; - Utils::FileNameList projectSourceFiles; + Utils::FilePath projectSourceDirectory; + Utils::FilePathList projectSourceFiles; // Used by Script debugging QString interpreter; @@ -567,7 +567,7 @@ public: class LocationMark : public TextEditor::TextMark { public: - LocationMark(DebuggerEngine *engine, const Utils::FileName &file, int line); + LocationMark(DebuggerEngine *engine, const Utils::FilePath &file, int line); void removedFromEditor() override { updateLineNumber(0); } void updateIcon(); diff --git a/src/plugins/debugger/debuggeritem.cpp b/src/plugins/debugger/debuggeritem.cpp index 2c073b1d54..c17766361c 100644 --- a/src/plugins/debugger/debuggeritem.cpp +++ b/src/plugins/debugger/debuggeritem.cpp @@ -106,8 +106,8 @@ DebuggerItem::DebuggerItem(const QVariant &id) DebuggerItem::DebuggerItem(const QVariantMap &data) { m_id = data.value(DEBUGGER_INFORMATION_ID).toString(); - m_command = FileName::fromUserInput(data.value(DEBUGGER_INFORMATION_COMMAND).toString()); - m_workingDirectory = FileName::fromUserInput(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY).toString()); + m_command = FilePath::fromUserInput(data.value(DEBUGGER_INFORMATION_COMMAND).toString()); + m_workingDirectory = FilePath::fromUserInput(data.value(DEBUGGER_INFORMATION_WORKINGDIRECTORY).toString()); m_unexpandedDisplayName = data.value(DEBUGGER_INFORMATION_DISPLAYNAME).toString(); m_isAutoDetected = data.value(DEBUGGER_INFORMATION_AUTODETECTED, false).toBool(); m_version = data.value(DEBUGGER_INFORMATION_VERSION).toString(); @@ -323,7 +323,7 @@ void DebuggerItem::setEngineType(const DebuggerEngineType &engineType) m_engineType = engineType; } -void DebuggerItem::setCommand(const FileName &command) +void DebuggerItem::setCommand(const FilePath &command) { m_command = command; } diff --git a/src/plugins/debugger/debuggeritem.h b/src/plugins/debugger/debuggeritem.h index c065700d96..77e18bff46 100644 --- a/src/plugins/debugger/debuggeritem.h +++ b/src/plugins/debugger/debuggeritem.h @@ -72,8 +72,8 @@ public: DebuggerEngineType engineType() const { return m_engineType; } void setEngineType(const DebuggerEngineType &engineType); - Utils::FileName command() const { return m_command; } - void setCommand(const Utils::FileName &command); + Utils::FilePath command() const { return m_command; } + void setCommand(const Utils::FilePath &command); bool isAutoDetected() const { return m_isAutoDetected; } void setAutoDetected(bool isAutoDetected); @@ -99,8 +99,8 @@ public: void reinitializeFromFile(); - Utils::FileName workingDirectory() const { return m_workingDirectory; } - void setWorkingDirectory(const Utils::FileName &workingPath) { m_workingDirectory = workingPath; } + Utils::FilePath workingDirectory() const { return m_workingDirectory; } + void setWorkingDirectory(const Utils::FilePath &workingPath) { m_workingDirectory = workingPath; } private: DebuggerItem(const QVariant &id); @@ -109,8 +109,8 @@ private: QVariant m_id; QString m_unexpandedDisplayName; DebuggerEngineType m_engineType = NoEngineType; - Utils::FileName m_command; - Utils::FileName m_workingDirectory; + Utils::FilePath m_command; + Utils::FilePath m_workingDirectory; bool m_isAutoDetected = false; QString m_version; ProjectExplorer::Abis m_abis; diff --git a/src/plugins/debugger/debuggeritemmanager.cpp b/src/plugins/debugger/debuggeritemmanager.cpp index da5ceae2fe..6d1e14cff8 100644 --- a/src/plugins/debugger/debuggeritemmanager.cpp +++ b/src/plugins/debugger/debuggeritemmanager.cpp @@ -89,7 +89,7 @@ public: void addDebugger(const DebuggerItem &item); QVariant registerDebugger(const DebuggerItem &item); - void readDebuggers(const FileName &fileName, bool isSystem); + void readDebuggers(const FilePath &fileName, bool isSystem); void autoDetectCdbDebuggers(); void autoDetectGdbOrLldbDebuggers(); QString uniqueDisplayName(const QString &base); @@ -624,7 +624,7 @@ void DebuggerOptionsPage::finish() void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() { - FileNameList cdbs; + FilePathList cdbs; const QStringList programDirs = { QString::fromLocal8Bit(qgetenv("ProgramFiles")), @@ -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)) { - const FileName filePath = FileName::fromFileInfo(fi).pathAppended("cdb.exe"); + const FilePath filePath = FilePath::fromFileInfo(fi).pathAppended("cdb.exe"); if (!cdbs.contains(filePath)) cdbs.append(filePath); } @@ -676,13 +676,13 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers() const QString path = kitFolderFi.absoluteFilePath(); const QFileInfo cdb32(path + "/Debuggers/x86/cdb.exe"); if (cdb32.isExecutable()) - cdbs.append(FileName::fromString(cdb32.absoluteFilePath())); + cdbs.append(FilePath::fromString(cdb32.absoluteFilePath())); const QFileInfo cdb64(path + "/Debuggers/x64/cdb.exe"); if (cdb64.isExecutable()) - cdbs.append(FileName::fromString(cdb64.absoluteFilePath())); + cdbs.append(FilePath::fromString(cdb64.absoluteFilePath())); } - for (const FileName &cdb : qAsConst(cdbs)) { + for (const FilePath &cdb : qAsConst(cdbs)) { if (DebuggerItemManager::findByCommand(cdb)) continue; DebuggerItem item; @@ -721,7 +721,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers() } */ - FileNameList suspects; + FilePathList suspects; if (HostOsInfo::isMacHost()) { SynchronousProcess lldbInfo; @@ -733,23 +733,23 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers() if (!lPath.isEmpty()) { const QFileInfo fi(lPath); if (fi.exists() && fi.isExecutable() && !fi.isDir()) - suspects.append(FileName::fromString(fi.absoluteFilePath())); + suspects.append(FilePath::fromString(fi.absoluteFilePath())); } } } - Utils::FileNameList path = Environment::systemEnvironment().path(); + Utils::FilePathList path = Environment::systemEnvironment().path(); path = Utils::filteredUnique(path); QDir dir; dir.setNameFilters(filters); dir.setFilter(QDir::Files | QDir::Executable); - foreach (const Utils::FileName &base, path) { + foreach (const Utils::FilePath &base, path) { dir.setPath(base.toFileInfo().absoluteFilePath()); foreach (const QString &entry, dir.entryList()) - suspects.append(FileName::fromString(dir.absoluteFilePath(entry))); + suspects.append(FilePath::fromString(dir.absoluteFilePath(entry))); } - foreach (const FileName &command, suspects) { + foreach (const FilePath &command, suspects) { const auto commandMatches = [command](const DebuggerTreeItem *titem) { return titem->m_item.command() == command; }; @@ -772,9 +772,9 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers() } } -static FileName userSettingsFileName() +static FilePath userSettingsFileName() { - return FileName::fromString(ICore::userResourcePath() + DEBUGGER_FILENAME); + return FilePath::fromString(ICore::userResourcePath() + DEBUGGER_FILENAME); } DebuggerItemManagerPrivate::DebuggerItemManagerPrivate() @@ -825,7 +825,7 @@ QVariant DebuggerItemManagerPrivate::registerDebugger(const DebuggerItem &item) return di.id(); } -void DebuggerItemManagerPrivate::readDebuggers(const FileName &fileName, bool isSystem) +void DebuggerItemManagerPrivate::readDebuggers(const FilePath &fileName, bool isSystem) { PersistentSettingsReader reader; if (!reader.load(fileName)) @@ -870,7 +870,7 @@ void DebuggerItemManagerPrivate::readDebuggers(const FileName &fileName, bool is void DebuggerItemManagerPrivate::restoreDebuggers() { // Read debuggers from SDK - readDebuggers(FileName::fromString(ICore::installerResourcePath() + DEBUGGER_FILENAME), true); + readDebuggers(FilePath::fromString(ICore::installerResourcePath() + DEBUGGER_FILENAME), true); // Read all debuggers from user file. readDebuggers(userSettingsFileName(), false); @@ -926,7 +926,7 @@ const QList<DebuggerItem> DebuggerItemManager::debuggers() return result; } -const DebuggerItem *DebuggerItemManager::findByCommand(const FileName &command) +const DebuggerItem *DebuggerItemManager::findByCommand(const FilePath &command) { return findDebugger([command](const DebuggerItem &item) { return item.command() == command; diff --git a/src/plugins/debugger/debuggeritemmanager.h b/src/plugins/debugger/debuggeritemmanager.h index ec2d74c928..1b2c21e052 100644 --- a/src/plugins/debugger/debuggeritemmanager.h +++ b/src/plugins/debugger/debuggeritemmanager.h @@ -33,7 +33,7 @@ #include <QString> #include <QCoreApplication> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Debugger { @@ -52,7 +52,7 @@ public: static QVariant registerDebugger(const DebuggerItem &item); static void deregisterDebugger(const QVariant &id); - static const DebuggerItem *findByCommand(const Utils::FileName &command); + static const DebuggerItem *findByCommand(const Utils::FilePath &command); static const DebuggerItem *findById(const QVariant &id); static const DebuggerItem *findByEngineType(DebuggerEngineType engineType); }; diff --git a/src/plugins/debugger/debuggerkitinformation.cpp b/src/plugins/debugger/debuggerkitinformation.cpp index 39a14097ff..412d54b33c 100644 --- a/src/plugins/debugger/debuggerkitinformation.cpp +++ b/src/plugins/debugger/debuggerkitinformation.cpp @@ -218,7 +218,7 @@ void DebuggerKitAspect::setup(Kit *k) } } else { // We have an executable path. - FileName fileName = FileName::fromUserInput(binary); + FilePath fileName = FilePath::fromUserInput(binary); if (item.command() == fileName) { // And it's is the path of this item. level = std::min(item.matchTarget(tcAbi), DebuggerItem::MatchesSomewhat); @@ -270,7 +270,7 @@ void DebuggerKitAspect::fix(Kit *k) return; } - FileName fileName = FileName::fromUserInput(binary); + FilePath fileName = FilePath::fromUserInput(binary); const DebuggerItem *item = DebuggerItemManager::findByCommand(fileName); if (!item) { qWarning("Debugger command %s invalid in kit %s", @@ -357,25 +357,25 @@ Tasks DebuggerKitAspect::validateDebugger(const Kit *k) const Core::Id id = ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM; if (errors & NoDebugger) - result << Task(Task::Warning, tr("No debugger set up."), FileName(), -1, id); + result << Task(Task::Warning, tr("No debugger set up."), FilePath(), -1, id); if (errors & DebuggerNotFound) result << Task(Task::Error, tr("Debugger \"%1\" not found.").arg(path), - FileName(), -1, id); + FilePath(), -1, id); if (errors & DebuggerNotExecutable) - result << Task(Task::Error, tr("Debugger \"%1\" not executable.").arg(path), FileName(), -1, id); + result << Task(Task::Error, tr("Debugger \"%1\" not executable.").arg(path), FilePath(), -1, id); if (errors & DebuggerNeedsAbsolutePath) { const QString message = tr("The debugger location must be given as an " "absolute path (%1).").arg(path); - result << Task(Task::Error, message, FileName(), -1, id); + result << Task(Task::Error, message, FilePath(), -1, id); } if (errors & DebuggerDoesNotMatch) { const QString message = tr("The ABI of the selected debugger does not " "match the toolchain ABI."); - result << Task(Task::Warning, message, FileName(), -1, id); + result << Task(Task::Warning, message, FilePath(), -1, id); } return result; } diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index d72b3f1aee..a4f12ee20a 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -674,7 +674,7 @@ public: message = tr("0x%1 hit").arg(data.address, 0, 16); } else { //: Message tracepoint: %1 file, %2 line %3 function hit. - message = tr("%1:%2 %3() hit").arg(FileName::fromString(data.fileName).fileName()). + message = tr("%1:%2 %3() hit").arg(FilePath::fromString(data.fileName).fileName()). arg(data.lineNumber). arg(cppFunctionAt(data.fileName, data.lineNumber)); } @@ -885,7 +885,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, } } if (!kit) - kit = guessKitFromAbis(Abi::abisOfBinary(FileName::fromString(executable))); + kit = guessKitFromAbis(Abi::abisOfBinary(FilePath::fromString(executable))); auto runControl = new RunControl(ProjectExplorer::Constants::DEBUG_RUN_MODE); runControl->setKit(kit); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index af933ac8c5..8a70795f23 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -311,7 +311,7 @@ void DebuggerRunTool::setAttachPid(qint64 pid) m_runParameters.attachPID = ProcessHandle(pid); } -void DebuggerRunTool::setSysRoot(const Utils::FileName &sysRoot) +void DebuggerRunTool::setSysRoot(const Utils::FilePath &sysRoot) { m_runParameters.sysRoot = sysRoot; } @@ -517,7 +517,7 @@ void DebuggerRunTool::addExpectedSignal(const QString &signal) m_runParameters.expectedSignals.append(signal); } -void DebuggerRunTool::addSearchDirectory(const Utils::FileName &dir) +void DebuggerRunTool::addSearchDirectory(const Utils::FilePath &dir) { m_runParameters.additionalSearchDirectories.append(dir); } diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h index 6315d57a1b..cf2227e7a1 100644 --- a/src/plugins/debugger/debuggerruncontrol.h +++ b/src/plugins/debugger/debuggerruncontrol.h @@ -84,7 +84,7 @@ public: void setCrashParameter(const QString &event); void addExpectedSignal(const QString &signal); - void addSearchDirectory(const Utils::FileName &dir); + void addSearchDirectory(const Utils::FilePath &dir); void setStartMode(DebuggerStartMode startMode); void setCloseMode(DebuggerCloseMode closeMode); @@ -92,7 +92,7 @@ public: void setAttachPid(Utils::ProcessHandle pid); void setAttachPid(qint64 pid); - void setSysRoot(const Utils::FileName &sysRoot); + void setSysRoot(const Utils::FilePath &sysRoot); void setSymbolFile(const QString &symbolFile); void setRemoteChannel(const QString &channel); void setRemoteChannel(const QString &host, int port); diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index fe1a5f541a..8652ff10f8 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -401,7 +401,7 @@ void DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged() } // Find Qt installation by running qmake -static QString findQtInstallPath(const FileName &qmakePath) +static QString findQtInstallPath(const FilePath &qmakePath) { if (qmakePath.isEmpty()) return QString(); @@ -438,7 +438,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap DebuggerSourcePathMappingWidget::mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in) { - const FileName qmake = BuildableHelperLibrary::findSystemQt(sp.inferior.environment); + const FilePath qmake = BuildableHelperLibrary::findSystemQt(sp.inferior.environment); // FIXME: Get this from the profile? // We could query the QtVersion for this information directly, but then we // will need to add a dependency on QtSupport to the debugger. diff --git a/src/plugins/debugger/debuggertooltipmanager.cpp b/src/plugins/debugger/debuggertooltipmanager.cpp index 5821f43a11..2ad12ff682 100644 --- a/src/plugins/debugger/debuggertooltipmanager.cpp +++ b/src/plugins/debugger/debuggertooltipmanager.cpp @@ -721,8 +721,8 @@ DebuggerToolTipContext::DebuggerToolTipContext() static bool filesMatch(const QString &file1, const QString &file2) { - return FileName::fromString(QFileInfo(file1).canonicalFilePath()) - == FileName::fromString(QFileInfo(file2).canonicalFilePath()); + return FilePath::fromString(QFileInfo(file1).canonicalFilePath()) + == FilePath::fromString(QFileInfo(file2).canonicalFilePath()); } bool DebuggerToolTipContext::matchesFrame(const StackFrame &frame) const diff --git a/src/plugins/debugger/disassembleragent.cpp b/src/plugins/debugger/disassembleragent.cpp index 8e65cec051..d8a083b8d5 100644 --- a/src/plugins/debugger/disassembleragent.cpp +++ b/src/plugins/debugger/disassembleragent.cpp @@ -66,7 +66,7 @@ class DisassemblerBreakpointMarker : public TextMark { public: DisassemblerBreakpointMarker(const Breakpoint &bp, int lineNumber) - : TextMark(Utils::FileName(), lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_bp(bp) + : TextMark(Utils::FilePath(), lineNumber, Constants::TEXT_MARK_CATEGORY_BREAKPOINT), m_bp(bp) { setIcon(bp->icon()); setPriority(TextMark::NormalPriority); @@ -141,7 +141,7 @@ public: DisassemblerAgentPrivate::DisassemblerAgentPrivate(DebuggerEngine *engine) : document(nullptr), engine(engine), - locationMark(engine, Utils::FileName(), 0), + locationMark(engine, Utils::FilePath(), 0), mimeType("text/x-qtcreator-generic-asm"), resetLocationScheduled(false) {} diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b51dc1f33c..b763d951fd 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -355,7 +355,7 @@ void GdbEngine::handleResponse(const QString &buff) Task task(Task::Warning, tr("Missing debug information for %1\nTry: %2") .arg(m_lastMissingDebugInfo).arg(cmd), - FileName(), 0, Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO); + FilePath(), 0, Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO); TaskHub::addTask(task); Internal::addDebugInfoTask(task.taskId, cmd); @@ -1629,7 +1629,7 @@ QString GdbEngine::cleanupFullName(const QString &fileName) } cleanFilePath.clear(); - const QString base = FileName::fromString(fileName).fileName(); + const QString base = FilePath::fromString(fileName).fileName(); QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.constFind(base); while (jt != m_baseNameToFullName.constEnd() && jt.key() == base) { @@ -1700,7 +1700,7 @@ void GdbEngine::setLinuxOsAbi() const DebuggerRunParameters &rp = runParameters(); bool isElf = (rp.toolChainAbi.binaryFormat() == Abi::ElfFormat); if (!isElf && !rp.inferior.executable.isEmpty()) { - isElf = Utils::anyOf(Abi::abisOfBinary(FileName::fromString(rp.inferior.executable)), + isElf = Utils::anyOf(Abi::abisOfBinary(FilePath::fromString(rp.inferior.executable)), [](const Abi &abi) { return abi.binaryFormat() == Abi::ElfFormat; }); @@ -2077,7 +2077,7 @@ QString GdbEngine::breakLocation(const QString &file) const { QString where = m_fullToShortName.value(file); if (where.isEmpty()) - return FileName::fromString(file).fileName(); + return FilePath::fromString(file).fileName(); return where; } diff --git a/src/plugins/debugger/loadcoredialog.cpp b/src/plugins/debugger/loadcoredialog.cpp index 82d26e4ae7..075cefd595 100644 --- a/src/plugins/debugger/loadcoredialog.cpp +++ b/src/plugins/debugger/loadcoredialog.cpp @@ -370,9 +370,9 @@ void AttachCoreDialog::coreFileChanged(const QString &core) Runnable debugger = DebuggerKitAspect::runnable(k); CoreInfo cinfo = CoreInfo::readExecutableNameFromCore(debugger, core); if (!cinfo.foundExecutableName.isEmpty()) - d->symbolFileName->setFileName(FileName::fromString(cinfo.foundExecutableName)); + d->symbolFileName->setFileName(FilePath::fromString(cinfo.foundExecutableName)); else if (!d->symbolFileName->isValid() && !cinfo.rawStringFromCore.isEmpty()) - d->symbolFileName->setFileName(FileName::fromString(cinfo.rawStringFromCore)); + d->symbolFileName->setFileName(FilePath::fromString(cinfo.rawStringFromCore)); } changed(); } diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 7f5971e2be..255052936e 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -1419,7 +1419,7 @@ void QmlEnginePrivate::setBreakpoint(const QString type, const QString target, cmd.arg(ENABLED, enabled); if (type == SCRIPTREGEXP) - cmd.arg(TARGET, Utils::FileName::fromString(target).fileName()); + cmd.arg(TARGET, Utils::FilePath::fromString(target).fileName()); else cmd.arg(TARGET, target); diff --git a/src/plugins/debugger/sourceagent.cpp b/src/plugins/debugger/sourceagent.cpp index 074806c5bb..565144dac4 100644 --- a/src/plugins/debugger/sourceagent.cpp +++ b/src/plugins/debugger/sourceagent.cpp @@ -104,7 +104,7 @@ void SourceAgent::setContent(const QString &filePath, const QString &content) if (!d->editor) { QString titlePattern = d->producer + ": " - + Utils::FileName::fromString(filePath).fileName(); + + Utils::FilePath::fromString(filePath).fileName(); d->editor = qobject_cast<BaseTextEditor *>( EditorManager::openEditorWithContents( CppEditor::Constants::CPPEDITOR_ID, @@ -137,7 +137,7 @@ void SourceAgent::updateLocationMarker() if (d->engine->stackHandler()->currentFrame().file == d->path) { int lineNumber = d->engine->stackHandler()->currentFrame().line; - d->locationMark = new TextMark(Utils::FileName(), lineNumber, + d->locationMark = new TextMark(Utils::FilePath(), lineNumber, Constants::TEXT_MARK_CATEGORY_LOCATION); d->locationMark->setIcon(Icons::LOCATION.icon()); d->locationMark->setPriority(TextMark::HighPriority); diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 4d134792bd..bd57ea0c6d 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -112,7 +112,7 @@ QVariant StackHandler::data(const QModelIndex &index, int role) const case StackFunctionNameColumn: return simplifyType(frame.function); case StackFileNameColumn: - return frame.file.isEmpty() ? frame.module : FileName::fromString(frame.file).fileName(); + return frame.file.isEmpty() ? frame.module : FilePath::fromString(frame.file).fileName(); case StackLineNumberColumn: return frame.line > 0 ? QVariant(frame.line) : QVariant(); case StackAddressColumn: diff --git a/src/plugins/designer/codemodelhelpers.cpp b/src/plugins/designer/codemodelhelpers.cpp index 9f376a114a..52bb38f5d1 100644 --- a/src/plugins/designer/codemodelhelpers.cpp +++ b/src/plugins/designer/codemodelhelpers.cpp @@ -47,7 +47,7 @@ static const char setupUiC[] = "setupUi"; static QString generatedHeaderOf(const QString &uiFileName) { if (const ProjectExplorer::Project *uiProject = - ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(uiFileName))) { + ProjectExplorer::SessionManager::projectForFile(Utils::FilePath::fromString(uiFileName))) { QStringList files = uiProject->filesGeneratedFrom(uiFileName); if (!files.isEmpty()) // There should be at most one header generated from a .ui return files.front(); diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index a35e8e14f2..f84b9e197b 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -97,7 +97,7 @@ Core::IDocument::OpenResult FormWindowFile::open(QString *errorString, const QSt form->setDirty(fileName != realFileName); syncXmlFromFormWindow(); - setFilePath(Utils::FileName::fromString(absfileName)); + setFilePath(Utils::FilePath::fromString(absfileName)); setShouldAutoSave(false); resourceHandler()->updateProjectResources(); @@ -106,7 +106,7 @@ Core::IDocument::OpenResult FormWindowFile::open(QString *errorString, const QSt bool FormWindowFile::save(QString *errorString, const QString &name, bool autoSave) { - const FileName actualName = name.isEmpty() ? filePath() : FileName::fromString(name); + const FilePath actualName = name.isEmpty() ? filePath() : FilePath::fromString(name); if (Designer::Constants::Internal::debug) qDebug() << Q_FUNC_INFO << name << "->" << actualName; @@ -175,7 +175,7 @@ bool FormWindowFile::setContents(const QByteArray &contents) return true; } -void FormWindowFile::setFilePath(const FileName &newName) +void FormWindowFile::setFilePath(const FilePath &newName) { m_formWindow->setFileName(newName.toString()); IDocument::setFilePath(newName); diff --git a/src/plugins/designer/formwindowfile.h b/src/plugins/designer/formwindowfile.h index d9129c88b9..d5791e7461 100644 --- a/src/plugins/designer/formwindowfile.h +++ b/src/plugins/designer/formwindowfile.h @@ -69,7 +69,7 @@ public: QString formWindowContents() const; ResourceHandler *resourceHandler() const; - void setFilePath(const Utils::FileName &) override; + void setFilePath(const Utils::FilePath &) override; void setShouldAutoSave(bool sad = true) { m_shouldAutoSave = sad; } void updateIsModified(); diff --git a/src/plugins/designer/qtcreatorintegration.cpp b/src/plugins/designer/qtcreatorintegration.cpp index f8e9cf6642..d004f4a661 100644 --- a/src/plugins/designer/qtcreatorintegration.cpp +++ b/src/plugins/designer/qtcreatorintegration.cpp @@ -491,7 +491,7 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, { typedef QMap<int, Document::Ptr> DocumentMap; - const Utils::FileName currentUiFile = FormEditorW::activeEditor()->document()->filePath(); + const Utils::FilePath currentUiFile = FormEditorW::activeEditor()->document()->filePath(); #if 0 return Designer::Internal::navigateToSlot(currentUiFile.toString(), objectName, signalSignature, parameterNames, errorMessage); @@ -518,12 +518,12 @@ bool QtCreatorIntegration::navigateToSlot(const QString &objectName, } else { const CppTools::WorkingCopy workingCopy = CppTools::CppModelManager::instance()->workingCopy(); - const Utils::FileName configFileName = - Utils::FileName::fromString(CppTools::CppModelManager::configurationFileName()); - QHashIterator<Utils::FileName, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); + const Utils::FilePath configFileName = + Utils::FilePath::fromString(CppTools::CppModelManager::configurationFileName()); + QHashIterator<Utils::FilePath, QPair<QByteArray, unsigned> > it = workingCopy.iterator(); while (it.hasNext()) { it.next(); - const Utils::FileName &fileName = it.key(); + const Utils::FilePath &fileName = it.key(); if (fileName != configFileName) newDocTable.insert(docTable.document(fileName)); } diff --git a/src/plugins/designer/resourcehandler.cpp b/src/plugins/designer/resourcehandler.cpp index 73064f62bf..0f7029a0e2 100644 --- a/src/plugins/designer/resourcehandler.cpp +++ b/src/plugins/designer/resourcehandler.cpp @@ -88,7 +88,7 @@ void ResourceHandler::updateResourcesHelper(bool updateProjectResources) qDebug() << "ResourceHandler::updateResources()" << fileName; // Filename could change in the meantime. - Project *project = SessionManager::projectForFile(Utils::FileName::fromUserInput(fileName)); + Project *project = SessionManager::projectForFile(Utils::FilePath::fromUserInput(fileName)); const bool dirty = m_form->property("_q_resourcepathchanged").toBool(); if (dirty) m_form->setDirty(true); diff --git a/src/plugins/diffeditor/diffeditor.cpp b/src/plugins/diffeditor/diffeditor.cpp index 21aadbc3c3..0c1d6563dd 100644 --- a/src/plugins/diffeditor/diffeditor.cpp +++ b/src/plugins/diffeditor/diffeditor.cpp @@ -317,8 +317,8 @@ void DiffEditor::documentHasChanged() for (const FileData &diffFile : diffFileList) { const DiffFileInfo &leftEntry = diffFile.leftFileInfo; const DiffFileInfo &rightEntry = diffFile.rightFileInfo; - const QString leftShortFileName = Utils::FileName::fromString(leftEntry.fileName).fileName(); - const QString rightShortFileName = Utils::FileName::fromString(rightEntry.fileName).fileName(); + const QString leftShortFileName = Utils::FilePath::fromString(leftEntry.fileName).fileName(); + const QString rightShortFileName = Utils::FilePath::fromString(rightEntry.fileName).fileName(); QString itemText; QString itemToolTip; if (leftEntry.fileName == rightEntry.fileName) { diff --git a/src/plugins/diffeditor/diffeditordocument.cpp b/src/plugins/diffeditor/diffeditordocument.cpp index eb1a00a451..8c24d09424 100644 --- a/src/plugins/diffeditor/diffeditordocument.cpp +++ b/src/plugins/diffeditor/diffeditordocument.cpp @@ -216,7 +216,7 @@ bool DiffEditorDocument::save(QString *errorString, const QString &fileName, boo const QFileInfo fi(fileName); setTemporary(false); - setFilePath(FileName::fromString(fi.absoluteFilePath())); + setFilePath(FilePath::fromString(fi.absoluteFilePath())); setPreferredDisplayName(QString()); emit temporaryStateChanged(); @@ -263,7 +263,7 @@ Core::IDocument::OpenResult DiffEditorDocument::open(QString *errorString, const const QFileInfo fi(fileName); setTemporary(false); emit temporaryStateChanged(); - setFilePath(FileName::fromString(fi.absoluteFilePath())); + setFilePath(FilePath::fromString(fi.absoluteFilePath())); setDiffFiles(fileDataList, fi.absolutePath()); } endReload(ok); diff --git a/src/plugins/genericprojectmanager/filesselectionwizardpage.cpp b/src/plugins/genericprojectmanager/filesselectionwizardpage.cpp index 0f82ba8d6e..c7f839c06e 100644 --- a/src/plugins/genericprojectmanager/filesselectionwizardpage.cpp +++ b/src/plugins/genericprojectmanager/filesselectionwizardpage.cpp @@ -59,8 +59,8 @@ FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *g void FilesSelectionWizardPage::initializePage() { - m_filesWidget->resetModel(Utils::FileName::fromString(m_genericProjectWizardDialog->path()), - Utils::FileNameList()); + m_filesWidget->resetModel(Utils::FilePath::fromString(m_genericProjectWizardDialog->path()), + Utils::FilePathList()); } void FilesSelectionWizardPage::cleanupPage() @@ -73,12 +73,12 @@ bool FilesSelectionWizardPage::isComplete() const return m_filesWidget->hasFilesSelected(); } -Utils::FileNameList FilesSelectionWizardPage::selectedPaths() const +Utils::FilePathList FilesSelectionWizardPage::selectedPaths() const { return m_filesWidget->selectedPaths(); } -Utils::FileNameList FilesSelectionWizardPage::selectedFiles() const +Utils::FilePathList FilesSelectionWizardPage::selectedFiles() const { return m_filesWidget->selectedFiles(); } diff --git a/src/plugins/genericprojectmanager/filesselectionwizardpage.h b/src/plugins/genericprojectmanager/filesselectionwizardpage.h index 721f1d4cd5..eddf4a9c21 100644 --- a/src/plugins/genericprojectmanager/filesselectionwizardpage.h +++ b/src/plugins/genericprojectmanager/filesselectionwizardpage.h @@ -45,8 +45,8 @@ public: bool isComplete() const override; void initializePage() override; void cleanupPage() override; - Utils::FileNameList selectedFiles() const; - Utils::FileNameList selectedPaths() const; + Utils::FilePathList selectedFiles() const; + Utils::FilePathList selectedPaths() const; private: GenericProjectWizardDialog *m_genericProjectWizardDialog; diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp index 2823c2efab..4c94efab5b 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.cpp @@ -94,14 +94,14 @@ QList<BuildInfo> GenericBuildConfigurationFactory::availableBuilds(const Target QList<BuildInfo> GenericBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const { - BuildInfo info = createBuildInfo(k, Project::projectDirectory(Utils::FileName::fromString(projectPath))); + BuildInfo info = createBuildInfo(k, Project::projectDirectory(Utils::FilePath::fromString(projectPath))); //: The name of the build configuration created by default for a generic project. info.displayName = tr("Default"); return {info}; } BuildInfo GenericBuildConfigurationFactory::createBuildInfo(const Kit *k, - const Utils::FileName &buildDir) const + const Utils::FilePath &buildDir) const { BuildInfo info(this); info.typeName = tr("Build"); diff --git a/src/plugins/genericprojectmanager/genericbuildconfiguration.h b/src/plugins/genericprojectmanager/genericbuildconfiguration.h index 494ab96e14..fdd97c36cf 100644 --- a/src/plugins/genericprojectmanager/genericbuildconfiguration.h +++ b/src/plugins/genericprojectmanager/genericbuildconfiguration.h @@ -27,7 +27,7 @@ #include <projectexplorer/buildconfiguration.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace GenericProjectManager { namespace Internal { @@ -57,7 +57,7 @@ private: QList<ProjectExplorer::BuildInfo> availableSetups(const ProjectExplorer::Kit *k, const QString &projectPath) const override; - ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FileName &buildDir) const; + ProjectExplorer::BuildInfo createBuildInfo(const ProjectExplorer::Kit *k, const Utils::FilePath &buildDir) const; }; } // namespace Internal diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp index d1edc12eb3..faeb2cf702 100644 --- a/src/plugins/genericprojectmanager/genericproject.cpp +++ b/src/plugins/genericprojectmanager/genericproject.cpp @@ -82,7 +82,7 @@ namespace Internal { class GenericProjectFile : public Core::IDocument { public: - GenericProjectFile(GenericProject *parent, const FileName &fileName, + GenericProjectFile(GenericProject *parent, const FilePath &fileName, GenericProject::RefreshOptions options) : m_project(parent), m_options(options) @@ -170,7 +170,7 @@ static bool writeFile(const QString &filePath, const QString &contents) return saver.write(contents.toUtf8()) && saver.finalize(); } -GenericProject::GenericProject(const Utils::FileName &fileName) : +GenericProject::GenericProject(const Utils::FilePath &fileName) : Project(Constants::GENERICMIMETYPE, fileName, [this]() { refresh(Everything); }), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater), m_deployFileWatcher(new FileSystemWatcher(this)) @@ -201,19 +201,19 @@ GenericProject::GenericProject(const Utils::FileName &fileName) : } m_filesIDocument - = new ProjectDocument(Constants::GENERICMIMETYPE, FileName::fromString(m_filesFileName), + = new ProjectDocument(Constants::GENERICMIMETYPE, FilePath::fromString(m_filesFileName), [this]() { refresh(Files); }); m_includesIDocument - = new ProjectDocument(Constants::GENERICMIMETYPE, FileName::fromString(m_includesFileName), + = new ProjectDocument(Constants::GENERICMIMETYPE, FilePath::fromString(m_includesFileName), [this]() { refresh(Configuration); }); m_configIDocument - = new ProjectDocument(Constants::GENERICMIMETYPE, FileName::fromString(m_configFileName), + = new ProjectDocument(Constants::GENERICMIMETYPE, FilePath::fromString(m_configFileName), [this]() { refresh(Configuration); }); m_cxxFlagsIDocument - = new ProjectDocument(Constants::GENERICMIMETYPE, FileName::fromString(m_cxxflagsFileName), + = new ProjectDocument(Constants::GENERICMIMETYPE, FilePath::fromString(m_cxxflagsFileName), [this]() { refresh(Configuration); }); m_cFlagsIDocument - = new ProjectDocument(Constants::GENERICMIMETYPE, FileName::fromString(m_cflagsFileName), + = new ProjectDocument(Constants::GENERICMIMETYPE, FilePath::fromString(m_cflagsFileName), [this]() { refresh(Configuration); }); connect(m_deployFileWatcher, &FileSystemWatcher::fileChanged, @@ -408,24 +408,24 @@ void GenericProject::refresh(RefreshOptions options) auto newRoot = std::make_unique<GenericProjectNode>(this); // find the common base directory of all source files - Utils::FileName baseDir = FileName::fromFileInfo(QFileInfo(findCommonSourceRoot(m_files))); + Utils::FilePath baseDir = FilePath::fromFileInfo(QFileInfo(findCommonSourceRoot(m_files))); for (const QString &f : m_files) { FileType fileType = FileType::Source; // ### FIXME if (f.endsWith(".qrc")) fileType = FileType::Resource; - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(f), fileType), baseDir); + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(f), fileType), baseDir); } - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_filesFileName), + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(m_filesFileName), FileType::Project)); - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_includesFileName), + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(m_includesFileName), FileType::Project)); - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_configFileName), + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(m_configFileName), FileType::Project)); - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_cxxflagsFileName), + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(m_cxxflagsFileName), FileType::Project)); - newRoot->addNestedNode(std::make_unique<FileNode>(FileName::fromString(m_cflagsFileName), + newRoot->addNestedNode(std::make_unique<FileNode>(FilePath::fromString(m_cflagsFileName), FileType::Project)); newRoot->compress(); @@ -471,7 +471,7 @@ QStringList GenericProject::processEntries(const QStringList &paths, trimmedPath = buildEnv.expandVariables(trimmedPath); trimmedPath = expander->expand(trimmedPath); - trimmedPath = Utils::FileName::fromUserInput(trimmedPath).toString(); + trimmedPath = Utils::FilePath::fromUserInput(trimmedPath).toString(); fileInfo.setFile(projectDir, trimmedPath); if (fileInfo.exists()) { @@ -506,7 +506,7 @@ void GenericProject::refreshCppCodeModel() void GenericProject::updateDeploymentData() { static const QString fileName("QtCreatorDeployment.txt"); - Utils::FileName deploymentFilePath; + Utils::FilePath deploymentFilePath; if (activeTarget() && activeTarget()->activeBuildConfiguration()) { deploymentFilePath = activeTarget()->activeBuildConfiguration()->buildDirectory() .pathAppended(fileName); diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h index f713bdb24b..d914ddc149 100644 --- a/src/plugins/genericprojectmanager/genericproject.h +++ b/src/plugins/genericprojectmanager/genericproject.h @@ -38,7 +38,7 @@ class GenericProject : public ProjectExplorer::Project Q_OBJECT public: - explicit GenericProject(const Utils::FileName &filename); + explicit GenericProject(const Utils::FilePath &filename); ~GenericProject() override; bool addFiles(const QStringList &filePaths); diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.cpp b/src/plugins/genericprojectmanager/genericprojectplugin.cpp index c92b728f10..73183ffb13 100644 --- a/src/plugins/genericprojectmanager/genericprojectplugin.cpp +++ b/src/plugins/genericprojectmanager/genericprojectplugin.cpp @@ -101,7 +101,7 @@ GenericProjectPluginPrivate::GenericProjectPluginPrivate() genericProject->files(Project::AllFiles), ICore::mainWindow()); if (sfd.exec() == QDialog::Accepted) - genericProject->setFiles(Utils::transform(sfd.selectedFiles(), &Utils::FileName::toString)); + genericProject->setFiles(Utils::transform(sfd.selectedFiles(), &Utils::FilePath::toString)); }); } diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.cpp b/src/plugins/genericprojectmanager/genericprojectwizard.cpp index ce8e4034ee..204a6e4f43 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.cpp +++ b/src/plugins/genericprojectmanager/genericprojectwizard.cpp @@ -83,12 +83,12 @@ QString GenericProjectWizardDialog::path() const return m_firstPage->path(); } -Utils::FileNameList GenericProjectWizardDialog::selectedPaths() const +Utils::FilePathList GenericProjectWizardDialog::selectedPaths() const { return m_secondPage->selectedPaths(); } -Utils::FileNameList GenericProjectWizardDialog::selectedFiles() const +Utils::FilePathList GenericProjectWizardDialog::selectedFiles() const { return m_secondPage->selectedFiles(); } @@ -151,7 +151,7 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w, const QString configFileName = QFileInfo(dir, projectName + QLatin1String(".config")).absoluteFilePath(); const QString cxxflagsFileName = QFileInfo(dir, projectName + QLatin1String(".cxxflags")).absoluteFilePath(); const QString cflagsFileName = QFileInfo(dir, projectName + QLatin1String(".cflags")).absoluteFilePath(); - const QStringList paths = Utils::transform(wizard->selectedPaths(), &Utils::FileName::toString); + const QStringList paths = Utils::transform(wizard->selectedPaths(), &Utils::FilePath::toString); Utils::MimeType headerTy = Utils::mimeTypeForName(QLatin1String("text/x-chdr")); @@ -175,7 +175,7 @@ Core::GeneratedFiles GenericProjectWizard::generateFiles(const QWizard *w, generatedCreatorFile.setContents(QLatin1String("[General]\n")); generatedCreatorFile.setAttributes(Core::GeneratedFile::OpenProjectAttribute); - QStringList sources = Utils::transform(wizard->selectedFiles(), &Utils::FileName::toString); + QStringList sources = Utils::transform(wizard->selectedFiles(), &Utils::FilePath::toString); for (int i = 0; i < sources.length(); ++i) sources[i] = dir.relativeFilePath(sources[i]); Utils::sort(sources); diff --git a/src/plugins/genericprojectmanager/genericprojectwizard.h b/src/plugins/genericprojectmanager/genericprojectwizard.h index fbe8590faa..5de68be69c 100644 --- a/src/plugins/genericprojectmanager/genericprojectwizard.h +++ b/src/plugins/genericprojectmanager/genericprojectwizard.h @@ -46,8 +46,8 @@ public: QString path() const; void setPath(const QString &path); - Utils::FileNameList selectedFiles() const; - Utils::FileNameList selectedPaths() const; + Utils::FilePathList selectedFiles() const; + Utils::FilePathList selectedPaths() const; QString projectName() const; diff --git a/src/plugins/git/changeselectiondialog.h b/src/plugins/git/changeselectiondialog.h index b87ce10eed..1de142ac7d 100644 --- a/src/plugins/git/changeselectiondialog.h +++ b/src/plugins/git/changeselectiondialog.h @@ -79,7 +79,7 @@ private: Ui::ChangeSelectionDialog *m_ui; QProcess *m_process = nullptr; - Utils::FileName m_gitExecutable; + Utils::FilePath m_gitExecutable; QProcessEnvironment m_gitEnvironment; ChangeCommand m_command = NoCommand; QStringListModel *m_changeModel = nullptr; diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp index 27946a2dec..ea3e311b52 100644 --- a/src/plugins/git/gerrit/gerritmodel.cpp +++ b/src/plugins/git/gerrit/gerritmodel.cpp @@ -315,7 +315,7 @@ void QueryContext::start() m_progress.reportStarted(); // Order: synchronous call to error handling if something goes wrong. VcsOutputWindow::appendCommand( - m_process.workingDirectory(), Utils::FileName::fromString(m_binary), m_arguments); + m_process.workingDirectory(), Utils::FilePath::fromString(m_binary), m_arguments); m_timer.start(); m_process.start(m_binary, m_arguments); m_process.closeWriteChannel(); diff --git a/src/plugins/git/gerrit/gerritparameters.cpp b/src/plugins/git/gerrit/gerritparameters.cpp index b2897d4094..7cbe62dbab 100644 --- a/src/plugins/git/gerrit/gerritparameters.cpp +++ b/src/plugins/git/gerrit/gerritparameters.cpp @@ -57,10 +57,10 @@ static inline QString detectApp(const char *defaultExe) if (!app.isEmpty() || !HostOsInfo::isWindowsHost()) return app; // Windows: Use app.exe from git if it cannot be found. - const FileName gitBinDir = GerritPlugin::gitBinDirectory(); + const FilePath gitBinDir = GerritPlugin::gitBinDirectory(); if (gitBinDir.isEmpty()) return QString(); - FileName path = gitBinDir.pathAppended(defaultApp); + FilePath path = gitBinDir.pathAppended(defaultApp); if (path.exists()) return path.toString(); diff --git a/src/plugins/git/gerrit/gerritplugin.cpp b/src/plugins/git/gerrit/gerritplugin.cpp index a18a0492bf..7dfdc5de61 100644 --- a/src/plugins/git/gerrit/gerritplugin.cpp +++ b/src/plugins/git/gerrit/gerritplugin.cpp @@ -91,7 +91,7 @@ class FetchContext : public QObject Q_OBJECT public: FetchContext(const QSharedPointer<GerritChange> &change, - const QString &repository, const Utils::FileName &git, + const QString &repository, const Utils::FilePath &git, const GerritServer &server, FetchMode fm, QObject *parent = nullptr); ~FetchContext() override; @@ -119,7 +119,7 @@ private: const QSharedPointer<GerritChange> m_change; const QString m_repository; const FetchMode m_fetchMode; - const Utils::FileName m_git; + const Utils::FilePath m_git; const GerritServer m_server; State m_state; QProcess m_process; @@ -128,7 +128,7 @@ private: }; FetchContext::FetchContext(const QSharedPointer<GerritChange> &change, - const QString &repository, const Utils::FileName &git, + const QString &repository, const Utils::FilePath &git, const GerritServer &server, FetchMode fm, QObject *parent) : QObject(parent) @@ -375,7 +375,7 @@ void GerritPlugin::push() push(currentRepository()); } -Utils::FileName GerritPlugin::gitBinDirectory() +Utils::FilePath GerritPlugin::gitBinDirectory() { return GitPlugin::client()->gitBinDirectory(); } @@ -389,7 +389,7 @@ QString GerritPlugin::branch(const QString &repository) void GerritPlugin::fetch(const QSharedPointer<GerritChange> &change, int mode) { // Locate git. - const Utils::FileName git = GitPlugin::client()->vcsBinary(); + const Utils::FilePath git = GitPlugin::client()->vcsBinary(); if (git.isEmpty()) { VcsBase::VcsOutputWindow::appendError(tr("Git is not available.")); return; @@ -493,7 +493,7 @@ QString GerritPlugin::findLocalRepository(QString project, const QString &branch branchRegexp.reset(); // Oops. } for (const QString &repository : gitRepositories) { - const QString fileName = Utils::FileName::fromString(repository).fileName(); + const QString fileName = Utils::FilePath::fromString(repository).fileName(); if ((!branchRegexp.isNull() && branchRegexp->exactMatch(fileName)) || fileName == project) { // Perform a check on the branch. diff --git a/src/plugins/git/gerrit/gerritplugin.h b/src/plugins/git/gerrit/gerritplugin.h index 5151235496..3c6ebb5335 100644 --- a/src/plugins/git/gerrit/gerritplugin.h +++ b/src/plugins/git/gerrit/gerritplugin.h @@ -57,7 +57,7 @@ public: bool initialize(Core::ActionContainer *ac); - static Utils::FileName gitBinDirectory(); + static Utils::FilePath gitBinDirectory(); static QString branch(const QString &repository); void addToLocator(Core::CommandLocator *locator); void push(const QString &topLevel); diff --git a/src/plugins/git/gerrit/gerritserver.cpp b/src/plugins/git/gerrit/gerritserver.cpp index 9e85606c76..c07f22adcc 100644 --- a/src/plugins/git/gerrit/gerritserver.cpp +++ b/src/plugins/git/gerrit/gerritserver.cpp @@ -243,7 +243,7 @@ int GerritServer::testConnection() static GitClient *const client = GitPlugin::client(); const QStringList arguments = curlArguments() << (url(RestUrl) + accountUrlC); const SynchronousProcessResponse resp = client->vcsFullySynchronousExec( - QString(), FileName::fromString(curlBinary), arguments, + QString(), FilePath::fromString(curlBinary), arguments, Core::ShellCommand::NoOutput); if (resp.result == SynchronousProcessResponse::Finished) { QString output = resp.stdOut(); @@ -345,7 +345,7 @@ void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) arguments << p.portFlag << QString::number(port); arguments << hostArgument() << "gerrit" << "version"; const SynchronousProcessResponse resp = client->vcsFullySynchronousExec( - QString(), FileName::fromString(p.ssh), arguments, + QString(), FilePath::fromString(p.ssh), arguments, Core::ShellCommand::NoOutput); QString stdOut = resp.stdOut().trimmed(); stdOut.remove("gerrit version "); @@ -353,7 +353,7 @@ void GerritServer::resolveVersion(const GerritParameters &p, bool forceReload) } else { const QStringList arguments = curlArguments() << (url(RestUrl) + versionUrlC); const SynchronousProcessResponse resp = client->vcsFullySynchronousExec( - QString(), FileName::fromString(curlBinary), arguments, + QString(), FilePath::fromString(curlBinary), arguments, Core::ShellCommand::NoOutput); // REST endpoint for version is only available from 2.8 and up. Do not consider invalid // if it fails. diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 79622646f0..f95cda6e00 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -780,9 +780,9 @@ QString GitClient::findRepositoryForDirectory(const QString &directory) const return QString(); // QFileInfo is outside loop, because it is faster this way QFileInfo fileInfo; - FileName parent; - for (FileName dir = FileName::fromString(directory); !dir.isEmpty(); dir = dir.parentDir()) { - const FileName gitName = dir.pathAppended(GIT_DIRECTORY); + FilePath parent; + for (FilePath dir = FilePath::fromString(directory); !dir.isEmpty(); dir = dir.parentDir()) { + const FilePath gitName = dir.pathAppended(GIT_DIRECTORY); if (!gitName.exists()) continue; // parent might exist fileInfo.setFile(gitName.toString()); @@ -2340,7 +2340,7 @@ void GitClient::launchGitK(const QString &workingDirectory, const QString &fileN } Environment sysEnv = Environment::systemEnvironment(); - const FileName exec = sysEnv.searchInPath("gitk"); + const FilePath exec = sysEnv.searchInPath("gitk"); if (!exec.isEmpty() && tryLauchingGitK(env, workingDirectory, fileName, exec.parentDir().toString())) { @@ -2377,7 +2377,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env, arguments.append(QtcProcess::splitArgs(gitkOpts, HostOsInfo::hostOs())); if (!fileName.isEmpty()) arguments << "--" << fileName; - VcsOutputWindow::appendCommand(workingDirectory, FileName::fromString(binary), arguments); + VcsOutputWindow::appendCommand(workingDirectory, FilePath::fromString(binary), arguments); // This should always use QProcess::startDetached (as not to kill // the child), but that does not have an environment parameter. bool success = false; @@ -2401,7 +2401,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env, bool GitClient::launchGitGui(const QString &workingDirectory) { bool success = true; - FileName gitBinary = vcsBinary(); + FilePath gitBinary = vcsBinary(); if (gitBinary.isEmpty()) { success = false; } else { @@ -2415,11 +2415,11 @@ bool GitClient::launchGitGui(const QString &workingDirectory) { return success; } -FileName GitClient::gitBinDirectory() +FilePath GitClient::gitBinDirectory() { const QString git = vcsBinary().toString(); if (git.isEmpty()) - return FileName(); + return FilePath(); // Is 'git\cmd' in the path (folder containing .bats)? QString path = QFileInfo(git).absolutePath(); @@ -2439,15 +2439,15 @@ FileName GitClient::gitBinDirectory() path = usrBinPath; } } - return FileName::fromString(path); + return FilePath::fromString(path); } -FileName GitClient::vcsBinary() const +FilePath GitClient::vcsBinary() const { bool ok; - Utils::FileName binary = static_cast<GitSettings &>(settings()).gitExecutable(&ok); + Utils::FilePath binary = static_cast<GitSettings &>(settings()).gitExecutable(&ok); if (!ok) - return Utils::FileName(); + return Utils::FilePath(); return binary; } @@ -2612,7 +2612,7 @@ bool GitClient::getCommitData(const QString &workingDirectory, if (!QFile::exists(templateFilename)) templateFilename = gitDirectory.absoluteFilePath("SQUASH_MSG"); if (!QFile::exists(templateFilename)) { - FileName templateName = FileName::fromUserInput( + FilePath templateName = FilePath::fromUserInput( readConfigValue(workingDirectory, "commit.template")); templateFilename = templateName.toString(); } @@ -3259,7 +3259,7 @@ QString GitClient::readOneLine(const QString &workingDirectory, const QStringLis // determine version as '(major << 16) + (minor << 8) + patch' or 0. unsigned GitClient::gitVersion(QString *errorMessage) const { - const FileName newGitBinary = vcsBinary(); + const FilePath newGitBinary = vcsBinary(); if (m_gitVersionForBinary != newGitBinary && !newGitBinary.isEmpty()) { // Do not execute repeatedly if that fails (due to git // not being installed) until settings are changed. diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 103e269824..abde02f40d 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -121,7 +121,7 @@ public: explicit GitClient(); - Utils::FileName vcsBinary() const override; + Utils::FilePath vcsBinary() const override; unsigned gitVersion(QString *errorMessage = nullptr) const; VcsBase::VcsCommand *vcsExecAbortable(const QString &workingDirectory, @@ -306,7 +306,7 @@ public: void launchGitK(const QString &workingDirectory, const QString &fileName); void launchGitK(const QString &workingDirectory) { launchGitK(workingDirectory, QString()); } bool launchGitGui(const QString &workingDirectory); - Utils::FileName gitBinDirectory(); + Utils::FilePath gitBinDirectory(); void launchRepositoryBrowser(const QString &workingDirectory); @@ -369,7 +369,7 @@ private: QString msgBoxText, const QString &buttonName, const QString &gitCommand, ContinueCommandMode continueMode); - mutable Utils::FileName m_gitVersionForBinary; + mutable Utils::FilePath m_gitVersionForBinary; mutable unsigned m_cachedGitVersion; QString m_gitQtcEditor; diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index eee7dfaefa..fbe90448d7 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -368,7 +368,7 @@ QString GitEditorWidget::fileNameForLine(int line) const QString GitEditorWidget::sourceWorkingDirectory() const { - Utils::FileName path = Utils::FileName::fromString(source()); + Utils::FilePath path = Utils::FilePath::fromString(source()); if (!path.isEmpty() && !path.toFileInfo().isDir()) path = path.parentDir(); while (!path.isEmpty() && !path.exists()) diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index cc84fade0e..ee47d3075e 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -69,7 +69,7 @@ GitSettings::GitSettings() declareKey(lastResetIndexKey, 0); } -Utils::FileName GitSettings::gitExecutable(bool *ok, QString *errorMessage) const +Utils::FilePath GitSettings::gitExecutable(bool *ok, QString *errorMessage) const { // Locate binary in path if one is specified, otherwise default // to pathless binary @@ -78,7 +78,7 @@ Utils::FileName GitSettings::gitExecutable(bool *ok, QString *errorMessage) cons if (errorMessage) errorMessage->clear(); - Utils::FileName binPath = binaryPath(); + Utils::FilePath binPath = binaryPath(); if (binPath.isEmpty()) { if (ok) *ok = false; diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index 4a33bdc876..b6778dfca5 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -58,7 +58,7 @@ public: static const QLatin1String firstParentKey; static const QLatin1String lastResetIndexKey; - Utils::FileName gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const; + Utils::FilePath gitExecutable(bool *ok = nullptr, QString *errorMessage = nullptr) const; GitSettings &operator = (const GitSettings &s); }; diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index e36a22239e..379eb67c64 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -76,7 +76,7 @@ Core::Id GitVersionControl::id() const return Core::Id(VcsBase::Constants::VCS_ID_GIT); } -bool GitVersionControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool GitVersionControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { if (fileName.fileName().compare(".git", Utils::HostOsInfo::fileNameCaseSensitivity())) return false; @@ -150,7 +150,7 @@ QString GitVersionControl::vcsTopic(const QString &directory) } Core::ShellCommand *GitVersionControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/git/gitversioncontrol.h b/src/plugins/git/gitversioncontrol.h index 2df3c7c856..1e1025864d 100644 --- a/src/plugins/git/gitversioncontrol.h +++ b/src/plugins/git/gitversioncontrol.h @@ -42,7 +42,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &directory, QString *topLevel) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; @@ -59,7 +59,7 @@ public: QString vcsTopic(const QString &directory) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp index c1fd1ec2df..8558163dfc 100644 --- a/src/plugins/git/mergetool.cpp +++ b/src/plugins/git/mergetool.cpp @@ -61,7 +61,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files) m_process->setWorkingDirectory(workingDirectory); m_process->setProcessEnvironment(env); m_process->setProcessChannelMode(QProcess::MergedChannels); - const Utils::FileName binary = GitPlugin::client()->vcsBinary(); + const Utils::FilePath binary = GitPlugin::client()->vcsBinary(); VcsOutputWindow::appendCommand(workingDirectory, binary, arguments); m_process->start(binary.toString(), arguments); if (m_process->waitForStarted()) { diff --git a/src/plugins/imageviewer/exportdialog.cpp b/src/plugins/imageviewer/exportdialog.cpp index f0c52aeebe..f0ac5a694e 100644 --- a/src/plugins/imageviewer/exportdialog.cpp +++ b/src/plugins/imageviewer/exportdialog.cpp @@ -196,7 +196,7 @@ QString ExportDialog::exportFileName() const void ExportDialog::setExportFileName(const QString &f) { - m_pathChooser->setFileName(Utils::FileName::fromString(f)); + m_pathChooser->setFileName(Utils::FilePath::fromString(f)); } ExportData ExportDialog::exportData() const diff --git a/src/plugins/imageviewer/imageviewerfile.cpp b/src/plugins/imageviewer/imageviewerfile.cpp index 5909d92af0..2845b840ef 100644 --- a/src/plugins/imageviewer/imageviewerfile.cpp +++ b/src/plugins/imageviewer/imageviewerfile.cpp @@ -141,7 +141,7 @@ Core::IDocument::OpenResult ImageViewerFile::openImpl(QString *errorString, cons emit imageSizeChanged(m_pixmap->size()); } - setFilePath(Utils::FileName::fromString(fileName)); + setFilePath(Utils::FilePath::fromString(fileName)); setMimeType(Utils::mimeTypeForFile(fileName).name()); return OpenResult::Success; } diff --git a/src/plugins/imageviewer/multiexportdialog.cpp b/src/plugins/imageviewer/multiexportdialog.cpp index bdbcfc40bf..b47c52aaeb 100644 --- a/src/plugins/imageviewer/multiexportdialog.cpp +++ b/src/plugins/imageviewer/multiexportdialog.cpp @@ -339,7 +339,7 @@ void MultiExportDialog::setExportFileName(QString f) const int lastDot = f.lastIndexOf('.'); if (lastDot != -1) f.insert(lastDot, "-%1"); - m_pathChooser->setFileName(Utils::FileName::fromString(f)); + m_pathChooser->setFileName(Utils::FilePath::fromString(f)); } } // namespace Internal diff --git a/src/plugins/ios/iosbuildstep.cpp b/src/plugins/ios/iosbuildstep.cpp index 18616684ad..0fbcb44305 100644 --- a/src/plugins/ios/iosbuildstep.cpp +++ b/src/plugins/ios/iosbuildstep.cpp @@ -91,7 +91,7 @@ bool IosBuildStep::init() Utils::Environment env = bc->environment(); Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); - pp->setCommand(Utils::FileName::fromString(buildCommand())); + pp->setCommand(Utils::FilePath::fromString(buildCommand())); pp->setArguments(Utils::QtcProcess::joinArgs(allArguments())); pp->resolveAll(); @@ -253,7 +253,7 @@ void IosBuildStepConfigWidget::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(bc->buildDirectory()); param.setEnvironment(bc->environment()); - param.setCommand(Utils::FileName::fromString(m_buildStep->buildCommand())); + param.setCommand(Utils::FilePath::fromString(m_buildStep->buildCommand())); param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->allArguments())); setSummaryText(param.summary(displayName())); diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 2354df2e87..6b4c244386 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -136,7 +136,7 @@ static ToolChainPair findToolChainForPlatform(const XcodePlatform &platform, const QList<ClangToolChain *> &toolChains) { ToolChainPair platformToolChains; - auto toolchainMatch = [](ClangToolChain *toolChain, const Utils::FileName &compilerPath, const QStringList &flags) { + auto toolchainMatch = [](ClangToolChain *toolChain, const Utils::FilePath &compilerPath, const QStringList &flags) { return compilerPath == toolChain->compilerCommand() && flags == toolChain->platformCodeGenFlags() && flags == toolChain->platformLinkerFlags(); @@ -181,7 +181,7 @@ static void printKits(const QSet<Kit *> &kits) } static void setupKit(Kit *kit, Core::Id pDeviceType, const ToolChainPair& toolChains, - const QVariant &debuggerId, const Utils::FileName &sdkPath, BaseQtVersion *qtVersion) + const QVariant &debuggerId, const Utils::FilePath &sdkPath, BaseQtVersion *qtVersion) { DeviceTypeKitAspect::setDeviceTypeId(kit, pDeviceType); if (toolChains.first) @@ -212,9 +212,9 @@ static void setupKit(Kit *kit, Core::Id pDeviceType, const ToolChainPair& toolCh SysRootKitAspect::setSysRoot(kit, sdkPath); } -static QVersionNumber findXcodeVersion(const Utils::FileName &developerPath) +static QVersionNumber findXcodeVersion(const Utils::FilePath &developerPath) { - const FileName xcodeInfo = developerPath.parentDir().pathAppended("Info.plist"); + const FilePath xcodeInfo = developerPath.parentDir().pathAppended("Info.plist"); if (xcodeInfo.exists()) { QSettings settings(xcodeInfo.toString(), QSettings::NativeFormat); return QVersionNumber::fromString(settings.value("CFBundleShortVersionString").toString()); @@ -357,7 +357,7 @@ void IosConfigurations::setIgnoreAllDevices(bool ignoreDevices) } } -void IosConfigurations::setScreenshotDir(const FileName &path) +void IosConfigurations::setScreenshotDir(const FilePath &path) { if (m_instance->m_screenshotDir != path) { m_instance->m_screenshotDir = path; @@ -365,12 +365,12 @@ void IosConfigurations::setScreenshotDir(const FileName &path) } } -FileName IosConfigurations::screenshotDir() +FilePath IosConfigurations::screenshotDir() { return m_instance->m_screenshotDir; } -FileName IosConfigurations::developerPath() +FilePath IosConfigurations::developerPath() { return m_instance->m_developerPath; } @@ -402,11 +402,11 @@ void IosConfigurations::load() QSettings *settings = Core::ICore::settings(); settings->beginGroup(SettingsGroup); m_ignoreAllDevices = settings->value(ignoreAllDevicesKey, false).toBool(); - m_screenshotDir = FileName::fromString(settings->value(screenshotDirPathKey).toString()); + m_screenshotDir = FilePath::fromString(settings->value(screenshotDirPathKey).toString()); if (!m_screenshotDir.exists()) { QString defaultDir = QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).constFirst(); - m_screenshotDir = FileName::fromString(defaultDir); + m_screenshotDir = FilePath::fromString(defaultDir); } settings->endGroup(); @@ -425,7 +425,7 @@ void IosConfigurations::updateSimulators() SimulatorControl::updateAvailableSimulators(); } -void IosConfigurations::setDeveloperPath(const FileName &devPath) +void IosConfigurations::setDeveloperPath(const FilePath &devPath) { static bool hasDevPath = false; if (devPath != m_instance->m_developerPath) { diff --git a/src/plugins/ios/iosconfigurations.h b/src/plugins/ios/iosconfigurations.h index eaafc9eb08..cddf0a5806 100644 --- a/src/plugins/ios/iosconfigurations.h +++ b/src/plugins/ios/iosconfigurations.h @@ -112,11 +112,11 @@ public: static void initialize(); static bool ignoreAllDevices(); static void setIgnoreAllDevices(bool ignoreDevices); - static void setScreenshotDir(const Utils::FileName &path); - static Utils::FileName screenshotDir(); - static Utils::FileName developerPath(); + static void setScreenshotDir(const Utils::FilePath &path); + static Utils::FilePath screenshotDir(); + static Utils::FilePath developerPath(); static QVersionNumber xcodeVersion(); - static Utils::FileName lldbPath(); + static Utils::FilePath lldbPath(); static void updateAutomaticKitList(); static const DevelopmentTeams &developmentTeams(); static DevelopmentTeamPtr developmentTeam(const QString &teamID); @@ -132,12 +132,12 @@ private: void save(); void kitsRestored(); void updateSimulators(); - static void setDeveloperPath(const Utils::FileName &devPath); + static void setDeveloperPath(const Utils::FilePath &devPath); void initializeProvisioningData(); void loadProvisioningData(bool notify = true); - Utils::FileName m_developerPath; - Utils::FileName m_screenshotDir; + Utils::FilePath m_developerPath; + Utils::FilePath m_screenshotDir; QVersionNumber m_xcodeVersion; bool m_ignoreAllDevices; QFileSystemWatcher *m_provisioningDataWatcher = nullptr; diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index e43eabb260..2a0da618af 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -230,7 +230,7 @@ QString IosDeployStep::deviceId() const void IosDeployStep::raiseError(const QString &errorString) { - emit addTask(Task(Task::Error, errorString, Utils::FileName::fromString(QString()), -1, + emit addTask(Task(Task::Error, errorString, Utils::FilePath::fromString(QString()), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT)); } @@ -245,7 +245,7 @@ void IosDeployStep::checkProvisioningProfile() if (device.isNull()) return; - const FileName provisioningFilePath = m_bundlePath.pathAppended("embedded.mobileprovision"); + const FilePath provisioningFilePath = m_bundlePath.pathAppended("embedded.mobileprovision"); // the file is a signed plist stored in DER format // we simply search for start and end of the plist instead of decoding the DER payload @@ -285,7 +285,7 @@ void IosDeployStep::checkProvisioningProfile() "does not cover the device %3 (%4). Deployment to it will fail.") .arg(provisioningProfile, provisioningUid, device->displayName(), targetId), - Utils::FileName(), /* filename */ + Utils::FilePath(), /* filename */ -1, /* line */ ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task); diff --git a/src/plugins/ios/iosdeploystep.h b/src/plugins/ios/iosdeploystep.h index ca2b64fbc5..77b386583e 100644 --- a/src/plugins/ios/iosdeploystep.h +++ b/src/plugins/ios/iosdeploystep.h @@ -83,7 +83,7 @@ private: TransferStatus m_transferStatus = NoTransfer; IosToolHandler *m_toolHandler = nullptr; ProjectExplorer::IDevice::ConstPtr m_device; - Utils::FileName m_bundlePath; + Utils::FilePath m_bundlePath; IosDeviceType m_deviceType; static const Core::Id Id; bool m_expectFail = false; diff --git a/src/plugins/ios/iosdsymbuildstep.cpp b/src/plugins/ios/iosdsymbuildstep.cpp index 16a396c545..d238bcfb95 100644 --- a/src/plugins/ios/iosdsymbuildstep.cpp +++ b/src/plugins/ios/iosdsymbuildstep.cpp @@ -72,7 +72,7 @@ bool IosDsymBuildStep::init() Utils::Environment env = bc->environment(); Utils::Environment::setupEnglishOutput(&env); pp->setEnvironment(env); - pp->setCommand(Utils::FileName::fromString(command())); + pp->setCommand(Utils::FilePath::fromString(command())); pp->setArguments(Utils::QtcProcess::joinArgs(arguments())); pp->resolveAll(); @@ -146,7 +146,7 @@ QStringList IosDsymBuildStep::defaultCleanCmdList() const QStringList IosDsymBuildStep::defaultCmdList() const { QString dsymutilCmd = "dsymutil"; - const Utils::FileName dsymUtilPath = IosConfigurations::developerPath() + const Utils::FilePath dsymUtilPath = IosConfigurations::developerPath() .pathAppended("Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil"); if (dsymUtilPath.exists()) dsymutilCmd = dsymUtilPath.toUserOutput(); @@ -270,7 +270,7 @@ void IosDsymBuildStepConfigWidget::updateDetails() param.setMacroExpander(bc->macroExpander()); param.setWorkingDirectory(bc->buildDirectory()); param.setEnvironment(bc->environment()); - param.setCommand(Utils::FileName::fromString(m_buildStep->command())); + param.setCommand(Utils::FilePath::fromString(m_buildStep->command())); param.setArguments(Utils::QtcProcess::joinArgs(m_buildStep->arguments())); setSummaryText(param.summary(displayName())); diff --git a/src/plugins/ios/iosprobe.cpp b/src/plugins/ios/iosprobe.cpp index b67bfd4f78..8e19eecc4f 100644 --- a/src/plugins/ios/iosprobe.cpp +++ b/src/plugins/ios/iosprobe.cpp @@ -87,15 +87,15 @@ void XcodeProbe::setupDefaultToolchains(const QString &devPath) }; XcodePlatform clangProfile; - clangProfile.developerPath = Utils::FileName::fromString(devPath); + clangProfile.developerPath = Utils::FilePath::fromString(devPath); const QFileInfo clangCInfo = getClangInfo("clang"); if (clangCInfo.exists()) - clangProfile.cCompilerPath = Utils::FileName::fromFileInfo(clangCInfo); + clangProfile.cCompilerPath = Utils::FilePath::fromFileInfo(clangCInfo); const QFileInfo clangCppInfo = getClangInfo("clang++"); if (clangCppInfo.exists()) - clangProfile.cxxCompilerPath = Utils::FileName::fromFileInfo(clangCppInfo); + clangProfile.cxxCompilerPath = Utils::FilePath::fromFileInfo(clangCppInfo); QSet<QString> allArchitectures; static const std::map<QString, QStringList> sdkConfigs { @@ -111,7 +111,7 @@ void XcodeProbe::setupDefaultToolchains(const QString &devPath) for (const auto &sdkConfig : sdkConfigs) { XcodePlatform::SDK sdk; sdk.directoryName = sdkConfig.first; - sdk.path = Utils::FileName::fromString(devPath + sdk.path = Utils::FilePath::fromString(devPath + QString(QLatin1String("/Platforms/%1.platform/Developer/SDKs/%1.sdk")).arg( sdk.directoryName)); sdk.architectures = sdkConfig.second; diff --git a/src/plugins/ios/iosprobe.h b/src/plugins/ios/iosprobe.h index ccaddcc5cc..52cf3015c5 100644 --- a/src/plugins/ios/iosprobe.h +++ b/src/plugins/ios/iosprobe.h @@ -39,7 +39,7 @@ public: { public: QString directoryName; - Utils::FileName path; + Utils::FilePath path; QStringList architectures; }; class ToolchainTarget @@ -51,9 +51,9 @@ public: bool operator==(const ToolchainTarget &other) const; }; - Utils::FileName developerPath; - Utils::FileName cxxCompilerPath; - Utils::FileName cCompilerPath; + Utils::FilePath developerPath; + Utils::FilePath cxxCompilerPath; + Utils::FilePath cCompilerPath; std::vector<ToolchainTarget> targets; std::vector<SDK> sdks; @@ -67,7 +67,7 @@ uint qHash(const XcodePlatform::ToolchainTarget &target); class XcodeProbe { public: - static Utils::FileName sdkPath(const QString &devPath, const QString &platformName); + static Utils::FilePath sdkPath(const QString &devPath, const QString &platformName); static QMap<QString, XcodePlatform> detectPlatforms(const QString &devPath = QString()); private: diff --git a/src/plugins/ios/iosrunconfiguration.cpp b/src/plugins/ios/iosrunconfiguration.cpp index 233abbd26f..e0c5b629a6 100644 --- a/src/plugins/ios/iosrunconfiguration.cpp +++ b/src/plugins/ios/iosrunconfiguration.cpp @@ -163,7 +163,7 @@ QString IosRunConfiguration::applicationName() const return QString(); } -FileName IosRunConfiguration::bundleDirectory() const +FilePath IosRunConfiguration::bundleDirectory() const { Core::Id devType = DeviceTypeKitAspect::deviceTypeId(target()->kit()); bool isDevice = (devType == Constants::IOS_DEVICE_TYPE); @@ -171,11 +171,11 @@ FileName IosRunConfiguration::bundleDirectory() const qCWarning(iosLog) << "unexpected device type in bundleDirForTarget: " << devType.toString(); return {}; } - FileName res; + FilePath res; if (BuildConfiguration *bc = target()->activeBuildConfiguration()) { Project *project = target()->project(); if (ProjectNode *node = project->findNodeForBuildKey(buildKey())) - res = FileName::fromString(node->data(Constants::IosBuildDir).toString()); + res = FilePath::fromString(node->data(Constants::IosBuildDir).toString()); if (res.isEmpty()) res = bc->buildDirectory(); switch (bc->buildType()) { @@ -201,7 +201,7 @@ FileName IosRunConfiguration::bundleDirectory() const return res.pathAppended(applicationName() + ".app"); } -FileName IosRunConfiguration::localExecutable() const +FilePath IosRunConfiguration::localExecutable() const { return bundleDirectory().pathAppended(applicationName()); } diff --git a/src/plugins/ios/iosrunconfiguration.h b/src/plugins/ios/iosrunconfiguration.h index 3265f24267..a5072abddf 100644 --- a/src/plugins/ios/iosrunconfiguration.h +++ b/src/plugins/ios/iosrunconfiguration.h @@ -44,10 +44,10 @@ class IosRunConfiguration : public ProjectExplorer::RunConfiguration public: IosRunConfiguration(ProjectExplorer::Target *target, Core::Id id); - Utils::FileName profilePath() const; + Utils::FilePath profilePath() const; QString applicationName() const; - Utils::FileName bundleDirectory() const; - Utils::FileName localExecutable() const; + Utils::FilePath bundleDirectory() const; + Utils::FilePath localExecutable() const; QString disabledReason() const override; IosDeviceType deviceType() const; diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index e66ce35e2e..5c34309921 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -442,14 +442,14 @@ void IosDebugSupport::start() setStartMode(AttachToRemoteProcess); setIosPlatform("remote-ios"); QString osVersion = dev->osVersion(); - FileName deviceSdk1 = FileName::fromString(QDir::homePath() + FilePath deviceSdk1 = FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/" + osVersion + "/Symbols"); QString deviceSdk; if (deviceSdk1.toFileInfo().isDir()) { deviceSdk = deviceSdk1.toString(); } else { - const FileName deviceSdk2 = IosConfigurations::developerPath() + const FilePath deviceSdk2 = IosConfigurations::developerPath() .pathAppended("Platforms/iPhoneOS.platform/DeviceSupport/" + osVersion + "/Symbols"); if (deviceSdk2.toFileInfo().isDir()) { @@ -485,7 +485,7 @@ void IosDebugSupport::start() QString bundlePath = iosRunConfig->bundleDirectory().toString(); bundlePath.chop(4); - FileName dsymPath = FileName::fromString(bundlePath.append(".dSYM")); + FilePath dsymPath = FilePath::fromString(bundlePath.append(".dSYM")); if (dsymPath.exists() && dsymPath.toFileInfo().lastModified() < QFileInfo(iosRunConfig->localExecutable().toUserOutput()).lastModified()) { TaskHub::addTask(Task::Warning, diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index f3ed0667b0..646183db05 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -657,7 +657,7 @@ IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &de if (k.startsWith(QLatin1String("DYLD_"))) env.remove(k); QStringList frameworkPaths; - const Utils::FileName libPath = IosConfigurations::developerPath().pathAppended("Platforms/iPhoneSimulator.platform/Developer/Library"); + const Utils::FilePath libPath = IosConfigurations::developerPath().pathAppended("Platforms/iPhoneSimulator.platform/Developer/Library"); for (const auto framework : {"PrivateFrameworks", "OtherFrameworks", "SharedFrameworks"}) { const QString frameworkPath = libPath.pathAppended(QLatin1String(framework)).toFileInfo().canonicalFilePath(); @@ -853,7 +853,7 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath, m_deviceId = m_devType.identifier; m_runKind = runType; - Utils::FileName appBundle = Utils::FileName::fromString(m_bundlePath); + Utils::FilePath appBundle = Utils::FilePath::fromString(m_bundlePath); if (!appBundle.exists()) { errorMsg(IosToolHandler::tr("Application launch on simulator failed. Invalid bundle path %1") .arg(m_bundlePath)); @@ -927,13 +927,13 @@ void IosSimulatorToolHandlerPrivate::installAppOnSimulator() }; isTransferringApp(m_bundlePath, m_deviceId, 20, 100, ""); - auto installFuture = simCtl->installApp(m_deviceId, Utils::FileName::fromString(m_bundlePath)); + auto installFuture = simCtl->installApp(m_deviceId, Utils::FilePath::fromString(m_bundlePath)); futureList << Utils::onResultReady(installFuture, onResponseAppInstall); } void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &extraArgs) { - const Utils::FileName appBundle = Utils::FileName::fromString(m_bundlePath); + const Utils::FilePath appBundle = Utils::FilePath::fromString(m_bundlePath); const QString bundleId = SimulatorControl::bundleIdentifier(appBundle); const bool debugRun = m_runKind == IosToolHandler::DebugRun; bool captureConsole = IosConfigurations::xcodeVersion() >= QVersionNumber(8); diff --git a/src/plugins/ios/simulatorcontrol.cpp b/src/plugins/ios/simulatorcontrol.cpp index 354c7ed230..baecf63a9c 100644 --- a/src/plugins/ios/simulatorcontrol.cpp +++ b/src/plugins/ios/simulatorcontrol.cpp @@ -172,12 +172,12 @@ private: ~SimulatorControlPrivate(); static SimulatorInfo deviceInfo(const QString &simUdid); - static QString bundleIdentifier(const Utils::FileName &bundlePath); - static QString bundleExecutable(const Utils::FileName &bundlePath); + static QString bundleIdentifier(const Utils::FilePath &bundlePath); + static QString bundleExecutable(const Utils::FilePath &bundlePath); void startSimulator(QFutureInterface<SimulatorControl::ResponseData> &fi, const QString &simUdid); void installApp(QFutureInterface<SimulatorControl::ResponseData> &fi, const QString &simUdid, - const Utils::FileName &bundlePath); + const Utils::FilePath &bundlePath); void launchApp(QFutureInterface<SimulatorControl::ResponseData> &fi, const QString &simUdid, const QString &bundleIdentifier, bool waitForDebugger, const QStringList &extraArgs, const QString &stdoutPath, @@ -291,12 +291,12 @@ bool SimulatorControl::isSimulatorRunning(const QString &simUdid) return SimulatorControlPrivate::deviceInfo(simUdid).isBooted(); } -QString SimulatorControl::bundleIdentifier(const Utils::FileName &bundlePath) +QString SimulatorControl::bundleIdentifier(const Utils::FilePath &bundlePath) { return SimulatorControlPrivate::bundleIdentifier(bundlePath); } -QString SimulatorControl::bundleExecutable(const Utils::FileName &bundlePath) +QString SimulatorControl::bundleExecutable(const Utils::FilePath &bundlePath) { return SimulatorControlPrivate::bundleExecutable(bundlePath); } @@ -307,7 +307,7 @@ QFuture<SimulatorControl::ResponseData> SimulatorControl::startSimulator(const Q } QFuture<SimulatorControl::ResponseData> -SimulatorControl::installApp(const QString &simUdid, const Utils::FileName &bundlePath) const +SimulatorControl::installApp(const QString &simUdid, const Utils::FilePath &bundlePath) const { return Utils::runAsync(&SimulatorControlPrivate::installApp, d, simUdid, bundlePath); } @@ -372,7 +372,7 @@ SimulatorInfo SimulatorControlPrivate::deviceInfo(const QString &simUdid) return device; } -QString SimulatorControlPrivate::bundleIdentifier(const Utils::FileName &bundlePath) +QString SimulatorControlPrivate::bundleIdentifier(const Utils::FilePath &bundlePath) { QString bundleID; #ifdef Q_OS_MAC @@ -392,7 +392,7 @@ QString SimulatorControlPrivate::bundleIdentifier(const Utils::FileName &bundleP return bundleID; } -QString SimulatorControlPrivate::bundleExecutable(const Utils::FileName &bundlePath) +QString SimulatorControlPrivate::bundleExecutable(const Utils::FilePath &bundlePath) { QString executable; #ifdef Q_OS_MAC @@ -470,7 +470,7 @@ void SimulatorControlPrivate::startSimulator(QFutureInterface<SimulatorControl:: } void SimulatorControlPrivate::installApp(QFutureInterface<SimulatorControl::ResponseData> &fi, - const QString &simUdid, const Utils::FileName &bundlePath) + const QString &simUdid, const Utils::FilePath &bundlePath) { QTC_CHECK(bundlePath.exists()); diff --git a/src/plugins/ios/simulatorcontrol.h b/src/plugins/ios/simulatorcontrol.h index c21469cd17..5d4351ae50 100644 --- a/src/plugins/ios/simulatorcontrol.h +++ b/src/plugins/ios/simulatorcontrol.h @@ -100,12 +100,12 @@ public: static QList<SimulatorInfo> availableSimulators(); static QFuture<QList<SimulatorInfo> > updateAvailableSimulators(); static bool isSimulatorRunning(const QString &simUdid); - static QString bundleIdentifier(const Utils::FileName &bundlePath); - static QString bundleExecutable(const Utils::FileName &bundlePath); + static QString bundleIdentifier(const Utils::FilePath &bundlePath); + static QString bundleExecutable(const Utils::FilePath &bundlePath); public: QFuture<ResponseData> startSimulator(const QString &simUdid) const; - QFuture<ResponseData> installApp(const QString &simUdid, const Utils::FileName &bundlePath) const; + QFuture<ResponseData> installApp(const QString &simUdid, const Utils::FilePath &bundlePath) const; QFuture<ResponseData> launchApp(const QString &simUdid, const QString &bundleIdentifier, bool waitForDebugger, const QStringList &extraArgs, const QString& stdoutPath = QString(), diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index 4f1333981d..3acea15080 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -68,7 +68,7 @@ static Q_LOGGING_CATEGORY(LOGLSPCLIENT, "qtc.languageclient.client", QtWarningMs class TextMark : public TextEditor::TextMark { public: - TextMark(const Utils::FileName &fileName, const Diagnostic &diag) + TextMark(const Utils::FilePath &fileName, const Diagnostic &diag) : TextEditor::TextMark(fileName, diag.range().start().line() + 1, "lspmark") , m_diagnostic(diag) { @@ -107,10 +107,10 @@ Client::Client(BaseClientInterface *clientInterface) connect(clientInterface, &BaseClientInterface::finished, this, &Client::finished); } -static void updateEditorToolBar(QList<Utils::FileName> files) +static void updateEditorToolBar(QList<Utils::FilePath> files) { QList<Core::IEditor *> editors = Core::DocumentModel::editorsForDocuments( - Utils::transform(files, [](Utils::FileName &file) { + Utils::transform(files, [](Utils::FilePath &file) { return Core::DocumentModel::documentForFilePath(file.toString()); })); for (auto editor : editors) @@ -271,7 +271,7 @@ bool Client::openDocument(Core::IDocument *document) using namespace TextEditor; if (!isSupportedDocument(document)) return false; - const FileName &filePath = document->filePath(); + const FilePath &filePath = document->filePath(); const QString method(DidOpenTextDocumentNotification::methodName); if (Utils::optional<bool> registered = m_dynamicCapabilities.isRegistered(method)) { if (!registered.value()) @@ -410,7 +410,7 @@ void Client::documentContentsSaved(Core::IDocument *document) void Client::documentWillSave(Core::IDocument *document) { - const FileName &filePath = document->filePath(); + const FilePath &filePath = document->filePath(); if (!m_openedDocument.contains(filePath)) return; bool sendMessage = true; @@ -510,7 +510,7 @@ static bool sendTextDocumentPositionParamsRequest(Client *client, if (sendMessage) { const TextDocumentRegistrationOptions option(dynamicCapabilities.option(Request::methodName)); if (option.isValid(nullptr)) - sendMessage = option.filterApplies(FileName::fromString(QUrl(uri).adjusted(QUrl::PreferLocalFile).toString())); + sendMessage = option.filterApplies(FilePath::fromString(QUrl(uri).adjusted(QUrl::PreferLocalFile).toString())); else sendMessage = supportedFile; } else { @@ -546,7 +546,7 @@ void Client::requestDocumentSymbols(TextEditor::TextDocument *document) { // TODO: Do not use this information for highlighting but the overview model return; - const FileName &filePath = document->filePath(); + const FilePath &filePath = document->filePath(); bool sendMessage = m_dynamicCapabilities.isRegistered(DocumentSymbolsRequest::methodName).value_or(false); if (sendMessage) { const TextDocumentRegistrationOptions option(m_dynamicCapabilities.option(DocumentSymbolsRequest::methodName)); @@ -688,7 +688,7 @@ void Client::cursorPositionChanged(TextEditor::TextEditorWidget *widget) void Client::requestCodeActions(const DocumentUri &uri, const QList<Diagnostic> &diagnostics) { - const Utils::FileName fileName = uri.toFileName(); + const Utils::FilePath fileName = uri.toFileName(); TextEditor::TextDocument *doc = TextEditor::TextDocument::textDocumentForFileName(fileName); if (!doc) return; @@ -716,7 +716,7 @@ void Client::requestCodeActions(const CodeActionRequest &request) if (!request.isValid(nullptr)) return; - const Utils::FileName fileName + const Utils::FilePath fileName = request.params().value_or(CodeActionParams()).textDocument().uri().toFileName(); const QString method(CodeActionRequest::methodName); @@ -831,7 +831,7 @@ bool Client::isSupportedDocument(const Core::IDocument *document) const return m_languagFilter.isSupported(document); } -bool Client::isSupportedFile(const Utils::FileName &filePath, const QString &mimeType) const +bool Client::isSupportedFile(const Utils::FilePath &filePath, const QString &mimeType) const { return m_languagFilter.isSupported(filePath, mimeType); } diff --git a/src/plugins/languageclient/client.h b/src/plugins/languageclient/client.h index 0f57907a8c..9746607e62 100644 --- a/src/plugins/languageclient/client.h +++ b/src/plugins/languageclient/client.h @@ -129,7 +129,7 @@ public: void setSupportedLanguage(const LanguageFilter &filter); bool isSupportedDocument(const Core::IDocument *document) const; - bool isSupportedFile(const Utils::FileName &filePath, const QString &mimeType) const; + bool isSupportedFile(const Utils::FilePath &filePath, const QString &mimeType) const; bool isSupportedUri(const LanguageServerProtocol::DocumentUri &uri) const; void setName(const QString &name) { m_displayName = name; } @@ -196,7 +196,7 @@ private: QHash<QByteArray, ContentHandler> m_contentHandler; QString m_displayName; LanguageFilter m_languagFilter; - QMap<Utils::FileName, QString> m_openedDocument; + QMap<Utils::FilePath, QString> m_openedDocument; Core::Id m_id; LanguageServerProtocol::ServerCapabilities m_serverCapabilities; DynamicCapabilities m_dynamicCapabilities; diff --git a/src/plugins/languageclient/languageclientcompletionassist.cpp b/src/plugins/languageclient/languageclientcompletionassist.cpp index 3c13109412..a036f7beb3 100644 --- a/src/plugins/languageclient/languageclientcompletionassist.cpp +++ b/src/plugins/languageclient/languageclientcompletionassist.cpp @@ -330,7 +330,7 @@ IAssistProposal *LanguageClientCompletionAssistProcessor::perform(const AssistIn params.setPosition({line, column}); params.setContext(context); params.setTextDocument( - DocumentUri::fromFileName(Utils::FileName::fromString(interface->fileName()))); + DocumentUri::fromFileName(Utils::FilePath::fromString(interface->fileName()))); completionRequest.setResponseCallback([this](auto response) { this->handleCompletionResponse(response); }); diff --git a/src/plugins/languageclient/languageclientfunctionhint.cpp b/src/plugins/languageclient/languageclientfunctionhint.cpp index f2aed1f72c..9a1fe6fc8e 100644 --- a/src/plugins/languageclient/languageclientfunctionhint.cpp +++ b/src/plugins/languageclient/languageclientfunctionhint.cpp @@ -82,7 +82,7 @@ IAssistProposal *FunctionHintProcessor::perform(const AssistInterface *interface m_pos = interface->position(); QTextCursor cursor(interface->textDocument()); cursor.setPosition(m_pos); - auto uri = DocumentUri::fromFileName(Utils::FileName::fromString(interface->fileName())); + auto uri = DocumentUri::fromFileName(Utils::FilePath::fromString(interface->fileName())); SignatureHelpRequest request; request.setParams(TextDocumentPositionParams(TextDocumentIdentifier(uri), Position(cursor))); request.setResponseCallback([this](auto response) { this->handleSignatureResponse(response); }); diff --git a/src/plugins/languageclient/languageclientmanager.cpp b/src/plugins/languageclient/languageclientmanager.cpp index b519c13fef..4c5ec02a59 100644 --- a/src/plugins/languageclient/languageclientmanager.cpp +++ b/src/plugins/languageclient/languageclientmanager.cpp @@ -240,7 +240,7 @@ void LanguageClientManager::applySettings() case BaseSettings::RequiresProject: { for (Core::IDocument *doc : Core::DocumentModel::openedDocuments()) { if (setting->m_languageFilter.isSupported(doc)) { - const Utils::FileName filePath = doc->filePath(); + const Utils::FilePath filePath = doc->filePath(); for (ProjectExplorer::Project *project : ProjectExplorer::SessionManager::projects()) { if (project->isKnownFile(filePath)) @@ -376,7 +376,7 @@ void LanguageClientManager::documentOpened(Core::IDocument *document) if (setting->isValid() && setting->m_enabled && setting->m_languageFilter.isSupported(document)) { if (setting->m_startBehavior == BaseSettings::RequiresProject) { - const Utils::FileName filePath = document->filePath(); + const Utils::FilePath filePath = document->filePath(); for (ProjectExplorer::Project *project : ProjectExplorer::SessionManager::projects()) { // check whether file is part of this project @@ -421,7 +421,7 @@ void LanguageClientManager::documentWillSave(Core::IDocument *document) interface->documentContentsSaved(document); } -void LanguageClientManager::findLinkAt(const Utils::FileName &filePath, +void LanguageClientManager::findLinkAt(const Utils::FilePath &filePath, const QTextCursor &cursor, Utils::ProcessLinkCallback callback) { @@ -485,7 +485,7 @@ QList<Core::SearchResultItem> generateSearchResultItems(const LanguageClientArra return result; } -void LanguageClientManager::findUsages(const Utils::FileName &filePath, const QTextCursor &cursor) +void LanguageClientManager::findUsages(const Utils::FilePath &filePath, const QTextCursor &cursor) { const DocumentUri uri = DocumentUri::fromFileName(filePath); const TextDocumentIdentifier document(uri); diff --git a/src/plugins/languageclient/languageclientmanager.h b/src/plugins/languageclient/languageclientmanager.h index a39d88f3c3..6be720697f 100644 --- a/src/plugins/languageclient/languageclientmanager.h +++ b/src/plugins/languageclient/languageclientmanager.h @@ -89,9 +89,9 @@ private: void documentClosed(Core::IDocument *document); void documentContentsSaved(Core::IDocument *document); void documentWillSave(Core::IDocument *document); - void findLinkAt(const Utils::FileName &filePath, const QTextCursor &cursor, + void findLinkAt(const Utils::FilePath &filePath, const QTextCursor &cursor, Utils::ProcessLinkCallback callback); - void findUsages(const Utils::FileName &filePath, const QTextCursor &cursor); + void findUsages(const Utils::FilePath &filePath, const QTextCursor &cursor); void projectAdded(ProjectExplorer::Project *project); void projectRemoved(ProjectExplorer::Project *project); diff --git a/src/plugins/languageclient/languageclientquickfix.cpp b/src/plugins/languageclient/languageclientquickfix.cpp index def01b17d8..70db31b871 100644 --- a/src/plugins/languageclient/languageclientquickfix.cpp +++ b/src/plugins/languageclient/languageclientquickfix.cpp @@ -111,7 +111,7 @@ IAssistProposal *LanguageClientQuickFixAssistProcessor::perform(const AssistInte cursor.select(QTextCursor::LineUnderCursor); Range range(cursor); params.setRange(range); - auto uri = DocumentUri::fromFileName(Utils::FileName::fromString(interface->fileName())); + auto uri = DocumentUri::fromFileName(Utils::FilePath::fromString(interface->fileName())); params.setTextDocument(uri); CodeActionParams::CodeActionContext context; context.setDiagnostics(m_client->diagnosticsAt(uri, range)); diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index 1de86b6802..50465770d9 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -782,7 +782,7 @@ QString StdIOSettingsWidget::arguments() const return m_arguments->text(); } -bool LanguageFilter::isSupported(const Utils::FileName &filePath, const QString &mimeType) const +bool LanguageFilter::isSupported(const Utils::FilePath &filePath, const QString &mimeType) const { if (mimeTypes.isEmpty() && filePattern.isEmpty()) return true; diff --git a/src/plugins/languageclient/languageclientsettings.h b/src/plugins/languageclient/languageclientsettings.h index aed2bf585a..1036348cb7 100644 --- a/src/plugins/languageclient/languageclientsettings.h +++ b/src/plugins/languageclient/languageclientsettings.h @@ -39,7 +39,7 @@ class QLineEdit; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; class PathChooser; } // namespace Utils @@ -57,7 +57,7 @@ struct LanguageFilter { QStringList mimeTypes; QStringList filePattern; - bool isSupported(const Utils::FileName &filePath, const QString &mimeType) const; + bool isSupported(const Utils::FilePath &filePath, const QString &mimeType) const; bool isSupported(const Core::IDocument *document) const; }; diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index f311d824c3..7d9b8dd209 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -440,7 +440,7 @@ void MercurialClient::revertAll(const QString &workingDir, const QString &revisi QStringList(extraOptions) << QLatin1String("--all")); } -bool MercurialClient::isVcsDirectory(const FileName &fileName) const +bool MercurialClient::isVcsDirectory(const FilePath &fileName) const { return fileName.toFileInfo().isDir() && !fileName.fileName().compare(Constants::MERCURIALREPO, HostOsInfo::fileNameCaseSensitivity()); diff --git a/src/plugins/mercurial/mercurialclient.h b/src/plugins/mercurial/mercurialclient.h index 4c1ecc52df..ce317dcfa9 100644 --- a/src/plugins/mercurial/mercurialclient.h +++ b/src/plugins/mercurial/mercurialclient.h @@ -74,7 +74,7 @@ public: void revertAll(const QString &workingDir, const QString &revision = QString(), const QStringList &extraOptions = QStringList()) override; - bool isVcsDirectory(const Utils::FileName &fileName) const; + bool isVcsDirectory(const Utils::FilePath &fileName) const; QString findTopLevelForFile(const QFileInfo &file) const override; void view(const QString &source, const QString &id, diff --git a/src/plugins/mercurial/mercurialcontrol.cpp b/src/plugins/mercurial/mercurialcontrol.cpp index d244b8ff8f..48395ad488 100644 --- a/src/plugins/mercurial/mercurialcontrol.cpp +++ b/src/plugins/mercurial/mercurialcontrol.cpp @@ -78,7 +78,7 @@ Core::Id MercurialControl::id() const return {VcsBase::Constants::VCS_ID_MERCURIAL}; } -bool MercurialControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool MercurialControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { return mercurialClient->isVcsDirectory(fileName); } @@ -99,7 +99,7 @@ bool MercurialControl::managesFile(const QString &workingDirectory, const QStrin bool MercurialControl::isConfigured() const { - const Utils::FileName binary = mercurialClient->vcsBinary(); + const Utils::FilePath binary = mercurialClient->vcsBinary(); if (binary.isEmpty()) return false; QFileInfo fi = binary.toFileInfo(); @@ -164,7 +164,7 @@ bool MercurialControl::vcsAnnotate(const QString &file, int line) } Core::ShellCommand *MercurialControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/mercurial/mercurialcontrol.h b/src/plugins/mercurial/mercurialcontrol.h index f96979e0c8..4d96a32a9a 100644 --- a/src/plugins/mercurial/mercurialcontrol.h +++ b/src/plugins/mercurial/mercurialcontrol.h @@ -47,7 +47,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &filename, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; @@ -61,7 +61,7 @@ public: bool vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; diff --git a/src/plugins/modeleditor/modeldocument.cpp b/src/plugins/modeleditor/modeldocument.cpp index e47c0d1a97..875a8bc5c3 100644 --- a/src/plugins/modeleditor/modeldocument.cpp +++ b/src/plugins/modeleditor/modeldocument.cpp @@ -96,7 +96,7 @@ bool ModelDocument::save(QString *errorString, const QString &name, bool autoSav if (autoSave) { d->documentController->projectController()->setModified(); } else { - setFilePath(Utils::FileName::fromString(d->documentController->projectController()->project()->fileName())); + setFilePath(Utils::FilePath::fromString(d->documentController->projectController()->project()->fileName())); emit changed(); } @@ -152,7 +152,7 @@ Core::IDocument::OpenResult ModelDocument::load(QString *errorString, const QStr try { d->documentController->loadProject(fileName); - setFilePath(Utils::FileName::fromString(d->documentController->projectController()->project()->fileName())); + setFilePath(Utils::FilePath::fromString(d->documentController->projectController()->project()->fileName())); } catch (const qmt::FileNotFoundException &ex) { *errorString = ex.errorMessage(); return OpenResult::ReadError; diff --git a/src/plugins/modeleditor/modelindexer.cpp b/src/plugins/modeleditor/modelindexer.cpp index 3fa1703ea9..e03fb4eb03 100644 --- a/src/plugins/modeleditor/modelindexer.cpp +++ b/src/plugins/modeleditor/modelindexer.cpp @@ -392,11 +392,11 @@ void ModelIndexer::scanProject(ProjectExplorer::Project *project) return; // TODO harmonize following code with findFirstModel()? - const Utils::FileNameList files = project->files(ProjectExplorer::Project::SourceFiles); + const Utils::FilePathList files = project->files(ProjectExplorer::Project::SourceFiles); QQueue<QueuedFile> filesQueue; QSet<QueuedFile> filesSet; - for (const Utils::FileName &file : files) { + for (const Utils::FilePath &file : files) { QFileInfo fileInfo = file.toFileInfo(); Utils::MimeType mimeType = Utils::mimeTypeForFile(fileInfo); if (mimeType.name() == QLatin1String(Constants::MIME_TYPE_MODEL)) { @@ -474,10 +474,10 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode) void ModelIndexer::forgetProject(ProjectExplorer::Project *project) { - const Utils::FileNameList files = project->files(ProjectExplorer::Project::SourceFiles); + const Utils::FilePathList files = project->files(ProjectExplorer::Project::SourceFiles); QMutexLocker locker(&d->indexerMutex); - for (const Utils::FileName &file : files) { + for (const Utils::FilePath &file : files) { const QString fileString = file.toString(); // remove file from queue QueuedFile queuedFile(fileString, project); diff --git a/src/plugins/nim/editor/nimcompletionassistprovider.cpp b/src/plugins/nim/editor/nimcompletionassistprovider.cpp index ec7544bfed..9fcf30c4b0 100644 --- a/src/plugins/nim/editor/nimcompletionassistprovider.cpp +++ b/src/plugins/nim/editor/nimcompletionassistprovider.cpp @@ -158,7 +158,7 @@ private: static Suggest::NimSuggest *nimSuggestInstance(const AssistInterface *interface) { - auto filename = Utils::FileName::fromString(interface->fileName()); + auto filename = Utils::FilePath::fromString(interface->fileName()); return Nim::Suggest::NimSuggestCache::instance().get(filename); } @@ -170,7 +170,7 @@ private: int line = 0, column = 0; Utils::Text::convertPosition(interface->textDocument(), pos, &line, &column); QTC_ASSERT(column >= 1, return nullptr); - auto filename = Utils::FileName::fromString(interface->fileName()); + auto filename = Utils::FilePath::fromString(interface->fileName()); return suggest->sug(filename.toString(), line, column - 1, dirtyFile); } diff --git a/src/plugins/nim/project/nimbuildconfiguration.cpp b/src/plugins/nim/project/nimbuildconfiguration.cpp index ef5fedda09..0827a29327 100644 --- a/src/plugins/nim/project/nimbuildconfiguration.cpp +++ b/src/plugins/nim/project/nimbuildconfiguration.cpp @@ -51,7 +51,7 @@ using namespace Utils; namespace Nim { -static FileName defaultBuildDirectory(const Kit *k, +static FilePath defaultBuildDirectory(const Kit *k, const QString &projectFilePath, const QString &bc, BuildConfiguration::BuildType buildType) @@ -62,9 +62,9 @@ static FileName defaultBuildDirectory(const Kit *k, QString buildDirectory = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate()); if (FileUtils::isAbsolutePath(buildDirectory)) - return FileName::fromString(buildDirectory); + return FilePath::fromString(buildDirectory); - auto projectDir = FileName::fromString(projectFileInfo.absoluteDir().absolutePath()); + auto projectDir = FilePath::fromString(projectFileInfo.absoluteDir().absolutePath()); return projectDir.pathAppended(buildDirectory); } @@ -106,7 +106,7 @@ void NimBuildConfiguration::initialize(const BuildInfo &info) break; } nimCompilerBuildStep->setDefaultCompilerOptions(defaultOption); - Utils::FileNameList nimFiles = project->nimFiles(); + Utils::FilePathList nimFiles = project->nimFiles(); if (!nimFiles.isEmpty()) nimCompilerBuildStep->setTargetNimFile(nimFiles.first()); buildSteps->appendStep(nimCompilerBuildStep); @@ -124,15 +124,15 @@ BuildConfiguration::BuildType NimBuildConfiguration::buildType() const return BuildConfiguration::Unknown; } -FileName NimBuildConfiguration::cacheDirectory() const +FilePath NimBuildConfiguration::cacheDirectory() const { return buildDirectory().pathAppended("nimcache"); } -FileName NimBuildConfiguration::outFilePath() const +FilePath NimBuildConfiguration::outFilePath() const { const NimCompilerBuildStep *step = nimCompilerBuildStep(); - QTC_ASSERT(step, return FileName()); + QTC_ASSERT(step, return FilePath()); return step->outFilePath(); } diff --git a/src/plugins/nim/project/nimbuildconfiguration.h b/src/plugins/nim/project/nimbuildconfiguration.h index 5a8fcf86b1..3c1819e01d 100644 --- a/src/plugins/nim/project/nimbuildconfiguration.h +++ b/src/plugins/nim/project/nimbuildconfiguration.h @@ -43,11 +43,11 @@ class NimBuildConfiguration : public ProjectExplorer::BuildConfiguration ProjectExplorer::BuildConfiguration::BuildType buildType() const override; public: - Utils::FileName cacheDirectory() const; - Utils::FileName outFilePath() const; + Utils::FilePath cacheDirectory() const; + Utils::FilePath outFilePath() const; signals: - void outFilePathChanged(const Utils::FileName &outFilePath); + void outFilePathChanged(const Utils::FilePath &outFilePath); private: void setupBuild(const ProjectExplorer::BuildInfo *info); diff --git a/src/plugins/nim/project/nimcompilerbuildstep.cpp b/src/plugins/nim/project/nimcompilerbuildstep.cpp index be93d4e61b..1ecc7e8c63 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstep.cpp @@ -91,7 +91,7 @@ private: Task task(type, message, - Utils::FileName::fromUserInput(filename), + Utils::FilePath::fromUserInput(filename), lineNumber, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task); @@ -135,7 +135,7 @@ bool NimCompilerBuildStep::fromMap(const QVariantMap &map) AbstractProcessStep::fromMap(map); m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split('|'); m_defaultOptions = static_cast<DefaultBuildOptions>(map[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS].toInt()); - m_targetNimFile = FileName::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString()); + m_targetNimFile = FilePath::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString()); updateProcessParameters(); return true; } @@ -175,12 +175,12 @@ void NimCompilerBuildStep::setDefaultCompilerOptions(NimCompilerBuildStep::Defau updateProcessParameters(); } -FileName NimCompilerBuildStep::targetNimFile() const +FilePath NimCompilerBuildStep::targetNimFile() const { return m_targetNimFile; } -void NimCompilerBuildStep::setTargetNimFile(const FileName &targetNimFile) +void NimCompilerBuildStep::setTargetNimFile(const FilePath &targetNimFile) { if (targetNimFile == m_targetNimFile) return; @@ -189,12 +189,12 @@ void NimCompilerBuildStep::setTargetNimFile(const FileName &targetNimFile) updateProcessParameters(); } -FileName NimCompilerBuildStep::outFilePath() const +FilePath NimCompilerBuildStep::outFilePath() const { return m_outFilePath; } -void NimCompilerBuildStep::setOutFilePath(const FileName &outFilePath) +void NimCompilerBuildStep::setOutFilePath(const FilePath &outFilePath) { if (outFilePath == m_outFilePath) return; @@ -282,7 +282,7 @@ void NimCompilerBuildStep::updateTargetNimFile() { if (!m_targetNimFile.isEmpty()) return; - const Utils::FileNameList nimFiles = static_cast<NimProject *>(project())->nimFiles(); + const Utils::FilePathList nimFiles = static_cast<NimProject *>(project())->nimFiles(); if (!nimFiles.isEmpty()) setTargetNimFile(nimFiles.at(0)); } @@ -338,7 +338,7 @@ void NimPlugin::testNimParser_data() << QString("") << QString("main.nim(23, 1) Error: undeclared identifier: 'x'\n") << Tasks({Task(Task::Error, "Error: undeclared identifier: 'x'", - Utils::FileName::fromUserInput("main.nim"), 23, + Utils::FilePath::fromUserInput("main.nim"), 23, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)}) << QString(); @@ -348,7 +348,7 @@ void NimPlugin::testNimParser_data() << QString("") << QString("lib/pure/parseopt.nim(56, 34) Warning: quoteIfContainsWhite is deprecated [Deprecated]\n") << Tasks({Task(Task::Warning, "Warning: quoteIfContainsWhite is deprecated [Deprecated]", - Utils::FileName::fromUserInput("lib/pure/parseopt.nim"), 56, + Utils::FilePath::fromUserInput("lib/pure/parseopt.nim"), 56, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)}) << QString(); } diff --git a/src/plugins/nim/project/nimcompilerbuildstep.h b/src/plugins/nim/project/nimcompilerbuildstep.h index c370a6ba50..a866694c9a 100644 --- a/src/plugins/nim/project/nimcompilerbuildstep.h +++ b/src/plugins/nim/project/nimcompilerbuildstep.h @@ -53,20 +53,20 @@ public: DefaultBuildOptions defaultCompilerOptions() const; void setDefaultCompilerOptions(DefaultBuildOptions options); - Utils::FileName targetNimFile() const; - void setTargetNimFile(const Utils::FileName &targetNimFile); + Utils::FilePath targetNimFile() const; + void setTargetNimFile(const Utils::FilePath &targetNimFile); - Utils::FileName outFilePath() const; + Utils::FilePath outFilePath() const; signals: void userCompilerOptionsChanged(const QStringList &options); void defaultCompilerOptionsChanged(DefaultBuildOptions options); - void targetNimFileChanged(const Utils::FileName &targetNimFile); + void targetNimFileChanged(const Utils::FilePath &targetNimFile); void processParametersChanged(); - void outFilePathChanged(const Utils::FileName &outFilePath); + void outFilePathChanged(const Utils::FilePath &outFilePath); private: - void setOutFilePath(const Utils::FileName &outFilePath); + void setOutFilePath(const Utils::FilePath &outFilePath); void updateOutFilePath(); void updateProcessParameters(); @@ -79,8 +79,8 @@ private: DefaultBuildOptions m_defaultOptions; QStringList m_userCompilerOptions; - Utils::FileName m_targetNimFile; - Utils::FileName m_outFilePath; + Utils::FilePath m_targetNimFile; + Utils::FilePath m_outFilePath; }; class NimCompilerBuildStepFactory : public ProjectExplorer::BuildStepFactory diff --git a/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp b/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp index d9e7b5beb7..be16d37a5b 100644 --- a/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp +++ b/src/plugins/nim/project/nimcompilerbuildstepconfigwidget.cpp @@ -76,7 +76,7 @@ void NimCompilerBuildStepConfigWidget::onTargetChanged(int index) { Q_UNUSED(index); auto data = m_ui->targetComboBox->currentData(); - FileName path = FileName::fromString(data.toString()); + FilePath path = FilePath::fromString(data.toString()); m_buildStep->setTargetNimFile(path); } @@ -124,7 +124,7 @@ void NimCompilerBuildStepConfigWidget::updateTargetComboBox() // Re enter the files m_ui->targetComboBox->clear(); - foreach (const FileName &file, project->nimFiles()) + foreach (const FilePath &file, project->nimFiles()) m_ui->targetComboBox->addItem(file.fileName(), file.toString()); const int index = m_ui->targetComboBox->findData(m_buildStep->targetNimFile().toString()); diff --git a/src/plugins/nim/project/nimcompilercleanstep.cpp b/src/plugins/nim/project/nimcompilercleanstep.cpp index f07f501106..b802582108 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.cpp +++ b/src/plugins/nim/project/nimcompilercleanstep.cpp @@ -54,7 +54,7 @@ BuildStepConfigWidget *NimCompilerCleanStep::createConfigWidget() bool NimCompilerCleanStep::init() { - FileName buildDir = buildConfiguration()->buildDirectory(); + FilePath buildDir = buildConfiguration()->buildDirectory(); bool result = buildDir.exists(); if (result) m_buildDir = buildDir; diff --git a/src/plugins/nim/project/nimcompilercleanstep.h b/src/plugins/nim/project/nimcompilercleanstep.h index e250d88f45..2cbde61beb 100644 --- a/src/plugins/nim/project/nimcompilercleanstep.h +++ b/src/plugins/nim/project/nimcompilercleanstep.h @@ -48,7 +48,7 @@ private: bool removeCacheDirectory(); bool removeOutFilePath(); - Utils::FileName m_buildDir; + Utils::FilePath m_buildDir; }; class NimCompilerCleanStepFactory : public ProjectExplorer::BuildStepFactory diff --git a/src/plugins/nim/project/nimproject.cpp b/src/plugins/nim/project/nimproject.cpp index 2691398356..a6cad1657f 100644 --- a/src/plugins/nim/project/nimproject.cpp +++ b/src/plugins/nim/project/nimproject.cpp @@ -60,7 +60,7 @@ namespace Nim { const int MIN_TIME_BETWEEN_PROJECT_SCANS = 4500; -NimProject::NimProject(const FileName &fileName) : Project(Constants::C_NIM_MIMETYPE, fileName) +NimProject::NimProject(const FilePath &fileName) : Project(Constants::C_NIM_MIMETYPE, fileName) { setId(Constants::C_NIMPROJECT_ID); setDisplayName(fileName.toFileInfo().completeBaseName()); @@ -117,10 +117,10 @@ void NimProject::collectProjectFiles() { m_lastProjectScan.start(); QTC_ASSERT(!m_futureWatcher.future().isRunning(), return); - FileName prjDir = projectDirectory(); + FilePath prjDir = projectDirectory(); QFuture<QList<ProjectExplorer::FileNode *>> future = Utils::runAsync([prjDir, excluded = m_excludedFiles] { - return FileNode::scanForFiles(prjDir, [excluded](const FileName & fn) -> FileNode * { + return FileNode::scanForFiles(prjDir, [excluded](const FilePath & fn) -> FileNode * { const QString fileName = fn.fileName(); if (excluded.contains(fn.toString()) || fileName.endsWith(".nimproject", HostOsInfo::fileNameCaseSensitivity()) @@ -164,7 +164,7 @@ Tasks NimProject::projectIssues(const Kit *k) const return result; } -FileNameList NimProject::nimFiles() const +FilePathList NimProject::nimFiles() const { return files([](const ProjectExplorer::Node *n) { return AllFiles(n) && n->filePath().endsWith(".nim"); diff --git a/src/plugins/nim/project/nimproject.h b/src/plugins/nim/project/nimproject.h index c7bee38de5..d0143de2fd 100644 --- a/src/plugins/nim/project/nimproject.h +++ b/src/plugins/nim/project/nimproject.h @@ -39,10 +39,10 @@ class NimProject : public ProjectExplorer::Project Q_OBJECT public: - explicit NimProject(const Utils::FileName &fileName); + explicit NimProject(const Utils::FilePath &fileName); ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; - Utils::FileNameList nimFiles() const; + Utils::FilePathList nimFiles() const; QVariantMap toMap() const final; bool addFiles(const QStringList &filePaths); diff --git a/src/plugins/nim/project/nimprojectnode.cpp b/src/plugins/nim/project/nimprojectnode.cpp index 1993004a2c..6a6385b67e 100644 --- a/src/plugins/nim/project/nimprojectnode.cpp +++ b/src/plugins/nim/project/nimprojectnode.cpp @@ -32,7 +32,7 @@ using namespace Utils; namespace Nim { NimProjectNode::NimProjectNode(NimProject &project, - const FileName &projectFilePath) + const FilePath &projectFilePath) : ProjectNode(projectFilePath) , m_project(project) {} diff --git a/src/plugins/nim/project/nimprojectnode.h b/src/plugins/nim/project/nimprojectnode.h index 317d4be555..6a950bdf4f 100644 --- a/src/plugins/nim/project/nimprojectnode.h +++ b/src/plugins/nim/project/nimprojectnode.h @@ -27,7 +27,7 @@ #include <projectexplorer/projectnodes.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace Nim { @@ -36,7 +36,7 @@ class NimProject; class NimProjectNode : public ProjectExplorer::ProjectNode { public: - NimProjectNode(NimProject &project, const Utils::FileName &projectFilePath); + NimProjectNode(NimProject &project, const Utils::FilePath &projectFilePath); bool supportsAction(ProjectExplorer::ProjectAction action, const Node *node) const override; bool addFiles(const QStringList &filePaths, QStringList *) override; diff --git a/src/plugins/nim/project/nimrunconfiguration.cpp b/src/plugins/nim/project/nimrunconfiguration.cpp index 8ccfb83aab..7849f4dc19 100644 --- a/src/plugins/nim/project/nimrunconfiguration.cpp +++ b/src/plugins/nim/project/nimrunconfiguration.cpp @@ -66,9 +66,9 @@ void NimRunConfiguration::updateConfiguration() QTC_ASSERT(buildConfiguration, return); setActiveBuildConfiguration(buildConfiguration); const QFileInfo outFileInfo = buildConfiguration->outFilePath().toFileInfo(); - aspect<ExecutableAspect>()->setExecutable(FileName::fromString(outFileInfo.absoluteFilePath())); + aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(outFileInfo.absoluteFilePath())); const QString workingDirectory = outFileInfo.absoluteDir().absolutePath(); - aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(FileName::fromString(workingDirectory)); + aspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(FilePath::fromString(workingDirectory)); } void NimRunConfiguration::setActiveBuildConfiguration(NimBuildConfiguration *activeBuildConfiguration) diff --git a/src/plugins/nim/project/nimtoolchain.cpp b/src/plugins/nim/project/nimtoolchain.cpp index 43104154ae..3e7fcbef72 100644 --- a/src/plugins/nim/project/nimtoolchain.cpp +++ b/src/plugins/nim/project/nimtoolchain.cpp @@ -45,7 +45,7 @@ NimToolChain::NimToolChain() NimToolChain::NimToolChain(Core::Id typeId) : ToolChain(typeId) - , m_compilerCommand(FileName()) + , m_compilerCommand(FilePath()) , m_version(std::make_tuple(-1,-1,-1)) { setLanguage(Constants::C_NIMLANGUAGE_ID); @@ -102,7 +102,7 @@ ToolChain::BuiltInHeaderPathsRunner NimToolChain::createBuiltInHeaderPathsRunner return ToolChain::BuiltInHeaderPathsRunner(); } -HeaderPaths NimToolChain::builtInHeaderPaths(const QStringList &, const FileName &) const +HeaderPaths NimToolChain::builtInHeaderPaths(const QStringList &, const FilePath &) const { return {}; } @@ -113,18 +113,18 @@ void NimToolChain::addToEnvironment(Environment &env) const env.prependOrSetPath(compilerCommand().parentDir().toString()); } -FileName NimToolChain::makeCommand(const Environment &env) const +FilePath NimToolChain::makeCommand(const Environment &env) const { - const FileName tmp = env.searchInPath("make"); - return tmp.isEmpty() ? FileName::fromString("make") : tmp; + const FilePath tmp = env.searchInPath("make"); + return tmp.isEmpty() ? FilePath::fromString("make") : tmp; } -FileName NimToolChain::compilerCommand() const +FilePath NimToolChain::compilerCommand() const { return m_compilerCommand; } -void NimToolChain::setCompilerCommand(const FileName &compilerCommand) +void NimToolChain::setCompilerCommand(const FilePath &compilerCommand) { m_compilerCommand = compilerCommand; parseVersion(compilerCommand, m_version); @@ -161,11 +161,11 @@ bool NimToolChain::fromMap(const QVariantMap &data) { if (!ToolChain::fromMap(data)) return false; - setCompilerCommand(FileName::fromString(data.value(Constants::C_NIMTOOLCHAIN_COMPILER_COMMAND_KEY).toString())); + setCompilerCommand(FilePath::fromString(data.value(Constants::C_NIMTOOLCHAIN_COMPILER_COMMAND_KEY).toString())); return true; } -bool NimToolChain::parseVersion(const FileName &path, std::tuple<int, int, int> &result) +bool NimToolChain::parseVersion(const FilePath &path, std::tuple<int, int, int> &result) { QProcess process; process.start(path.toString(), {"--version"}); diff --git a/src/plugins/nim/project/nimtoolchain.h b/src/plugins/nim/project/nimtoolchain.h index 8b84b3d5c1..b35e073ccd 100644 --- a/src/plugins/nim/project/nimtoolchain.h +++ b/src/plugins/nim/project/nimtoolchain.h @@ -47,24 +47,24 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override; ProjectExplorer::HeaderPaths builtInHeaderPaths(const QStringList &flags, - const Utils::FileName &sysRoot) const final; + const Utils::FilePath &sysRoot) const final; void addToEnvironment(Utils::Environment &env) const final; - Utils::FileName makeCommand(const Utils::Environment &env) const final; - Utils::FileName compilerCommand() const final; + Utils::FilePath makeCommand(const Utils::Environment &env) const final; + Utils::FilePath compilerCommand() const final; QString compilerVersion() const; - void setCompilerCommand(const Utils::FileName &compilerCommand); + void setCompilerCommand(const Utils::FilePath &compilerCommand); ProjectExplorer::IOutputParser *outputParser() const final; std::unique_ptr<ProjectExplorer::ToolChainConfigWidget> createConfigurationWidget() final; QVariantMap toMap() const final; bool fromMap(const QVariantMap &data) final; - static bool parseVersion(const Utils::FileName &path, std::tuple<int, int, int> &version); + static bool parseVersion(const Utils::FilePath &path, std::tuple<int, int, int> &version); private: NimToolChain(const NimToolChain &other); - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; std::tuple<int, int, int> m_version; }; diff --git a/src/plugins/nim/project/nimtoolchainfactory.cpp b/src/plugins/nim/project/nimtoolchainfactory.cpp index 953ad569b1..5fc94c4926 100644 --- a/src/plugins/nim/project/nimtoolchainfactory.cpp +++ b/src/plugins/nim/project/nimtoolchainfactory.cpp @@ -54,7 +54,7 @@ QList<ToolChain *> NimToolChainFactory::autoDetect(const QList<ToolChain *> &alr QList<ToolChain *> result; Environment systemEnvironment = Environment::systemEnvironment(); - const FileName compilerPath = systemEnvironment.searchInPath("nim"); + const FilePath compilerPath = systemEnvironment.searchInPath("nim"); if (compilerPath.isEmpty()) return result; @@ -73,7 +73,7 @@ QList<ToolChain *> NimToolChainFactory::autoDetect(const QList<ToolChain *> &alr return result; } -QList<ToolChain *> NimToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> NimToolChainFactory::autoDetect(const FilePath &compilerPath, const Core::Id &language) { QList<ToolChain *> result; if (language == Constants::C_NIMLANGUAGE_ID) { @@ -143,7 +143,7 @@ void NimToolChainConfigWidget::onCompilerCommandChanged(const QString &path) { auto tc = static_cast<NimToolChain *>(toolChain()); Q_ASSERT(tc); - tc->setCompilerCommand(FileName::fromString(path)); + tc->setCompilerCommand(FilePath::fromString(path)); fillUI(); } diff --git a/src/plugins/nim/project/nimtoolchainfactory.h b/src/plugins/nim/project/nimtoolchainfactory.h index ed40bfeb62..70a49cbb37 100644 --- a/src/plugins/nim/project/nimtoolchainfactory.h +++ b/src/plugins/nim/project/nimtoolchainfactory.h @@ -42,7 +42,7 @@ public: NimToolChainFactory(); QList<ProjectExplorer::ToolChain *> autoDetect(const QList<ProjectExplorer::ToolChain *> &alreadyKnown) final; - QList<ProjectExplorer::ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final; + QList<ProjectExplorer::ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) final; }; class NimToolChainConfigWidget : public ProjectExplorer::ToolChainConfigWidget diff --git a/src/plugins/nim/suggest/nimsuggestcache.cpp b/src/plugins/nim/suggest/nimsuggestcache.cpp index 6953883608..dafeffb39e 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.cpp +++ b/src/plugins/nim/suggest/nimsuggestcache.cpp @@ -42,7 +42,7 @@ NimSuggestCache &NimSuggestCache::instance() NimSuggestCache::~NimSuggestCache() = default; -NimSuggest *NimSuggestCache::get(const Utils::FileName &filename) +NimSuggest *NimSuggestCache::get(const Utils::FilePath &filename) { auto it = m_nimSuggestInstances.find(filename); if (it == m_nimSuggestInstances.end()) { diff --git a/src/plugins/nim/suggest/nimsuggestcache.h b/src/plugins/nim/suggest/nimsuggestcache.h index c7b632e82e..cccd136b46 100644 --- a/src/plugins/nim/suggest/nimsuggestcache.h +++ b/src/plugins/nim/suggest/nimsuggestcache.h @@ -45,7 +45,7 @@ class NimSuggestCache : public QObject public: static NimSuggestCache &instance(); - NimSuggest *get(const Utils::FileName &filename); + NimSuggest *get(const Utils::FilePath &filename); QString executablePath() const; void setExecutablePath(const QString &path); @@ -57,7 +57,7 @@ private: void onEditorOpened(Core::IEditor *editor); void onEditorClosed(Core::IEditor *editor); - std::unordered_map<Utils::FileName, std::unique_ptr<Suggest::NimSuggest>> m_nimSuggestInstances; + std::unordered_map<Utils::FilePath, std::unique_ptr<Suggest::NimSuggest>> m_nimSuggestInstances; QString m_executablePath; }; diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index e7325fc1fb..580c52d78f 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -1118,7 +1118,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir, actualArgs.append(args); if (flags & CommandToWindow) - VcsOutputWindow::appendCommand(workingDir, FileName::fromString(settings().p4BinaryPath()), actualArgs); + VcsOutputWindow::appendCommand(workingDir, FilePath::fromString(settings().p4BinaryPath()), actualArgs); if (flags & ShowBusyCursor) QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index e027a8ef26..87d08806b5 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -49,7 +49,7 @@ Core::Id PerforceVersionControl::id() const return Core::Id(VcsBase::Constants::VCS_ID_PERFORCE); } -bool PerforceVersionControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool PerforceVersionControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { Q_UNUSED(fileName); return false; // Perforce does not seem to litter its files into the source tree. diff --git a/src/plugins/perforce/perforceversioncontrol.h b/src/plugins/perforce/perforceversioncontrol.h index fa3b0c1d12..410e9a749a 100644 --- a/src/plugins/perforce/perforceversioncontrol.h +++ b/src/plugins/perforce/perforceversioncontrol.h @@ -41,7 +41,7 @@ public: QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; diff --git a/src/plugins/perfprofiler/perfprofilertool.cpp b/src/plugins/perfprofiler/perfprofilertool.cpp index d719884ccd..5af097a9ec 100644 --- a/src/plugins/perfprofiler/perfprofilertool.cpp +++ b/src/plugins/perfprofiler/perfprofilertool.cpp @@ -553,29 +553,29 @@ void PerfProfilerTool::gotoSourceLocation(QString filePath, int lineNumber, int } -static Utils::FileNameList collectQtIncludePaths(const ProjectExplorer::Kit *kit) +static Utils::FilePathList collectQtIncludePaths(const ProjectExplorer::Kit *kit) { QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(kit); if (qt == nullptr) - return Utils::FileNameList(); - Utils::FileNameList paths{qt->headerPath()}; + return Utils::FilePathList(); + Utils::FilePathList paths{qt->headerPath()}; QDirIterator dit(paths.first().toString(), QStringList(), QDir::Dirs | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); while (dit.hasNext()) { dit.next(); - paths << Utils::FileName::fromString(dit.filePath()); + paths << Utils::FilePath::fromString(dit.filePath()); } return paths; } -static Utils::FileName sysroot(const Kit *kit) +static Utils::FilePath sysroot(const Kit *kit) { return SysRootKitAspect::sysRoot(kit); } -static Utils::FileNameList sourceFiles(const Project *currentProject = nullptr) +static Utils::FilePathList sourceFiles(const Project *currentProject = nullptr) { - Utils::FileNameList sourceFiles; + Utils::FilePathList sourceFiles; // Have the current project first. if (currentProject) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index a719bc3ee0..e4e4c13e64 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -983,7 +983,7 @@ Abi Abi::hostAbi() } //! Extract available ABIs from a binary using heuristics. -Abis Abi::abisOfBinary(const Utils::FileName &path) +Abis Abi::abisOfBinary(const Utils::FilePath &path) { Abis tmp; if (path.isEmpty()) @@ -1233,7 +1233,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testAbiOfBinary() QFETCH(QString, file); QFETCH(QStringList, abis); - const Abis result = Abi::abisOfBinary(Utils::FileName::fromString(file)); + const Abis result = Abi::abisOfBinary(Utils::FilePath::fromString(file)); QCOMPARE(result.count(), abis.count()); for (int i = 0; i < abis.count(); ++i) QCOMPARE(result.at(i).toString(), abis.at(i)); diff --git a/src/plugins/projectexplorer/abi.h b/src/plugins/projectexplorer/abi.h index 7097e03629..ddca225896 100644 --- a/src/plugins/projectexplorer/abi.h +++ b/src/plugins/projectexplorer/abi.h @@ -34,7 +34,7 @@ #include <vector> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { @@ -160,7 +160,7 @@ public: static Abi fromString(const QString &abiString); static Abi hostAbi(); - static Abis abisOfBinary(const Utils::FileName &path); + static Abis abisOfBinary(const Utils::FilePath &path); private: diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp index 6073a168e6..106f58b006 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.cpp +++ b/src/plugins/projectexplorer/abstractprocessstep.cpp @@ -432,7 +432,7 @@ void AbstractProcessStep::taskAdded(const Task &task, int linkedOutputLines, int while (filePath.startsWith("../")) filePath.remove(0, 3); bool found = false; - const Utils::FileNameList candidates + const Utils::FilePathList candidates = d->m_fileFinder.findFile(QUrl::fromLocalFile(filePath), &found); if (found && candidates.size() == 1) editable.file = candidates.first(); diff --git a/src/plugins/projectexplorer/abstractprocessstep.h b/src/plugins/projectexplorer/abstractprocessstep.h index df31a99eb1..b21a6bdb25 100644 --- a/src/plugins/projectexplorer/abstractprocessstep.h +++ b/src/plugins/projectexplorer/abstractprocessstep.h @@ -29,7 +29,7 @@ #include <QProcess> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { class IOutputParser; diff --git a/src/plugins/projectexplorer/addrunconfigdialog.cpp b/src/plugins/projectexplorer/addrunconfigdialog.cpp index dacdbac678..647959eb15 100644 --- a/src/plugins/projectexplorer/addrunconfigdialog.cpp +++ b/src/plugins/projectexplorer/addrunconfigdialog.cpp @@ -54,7 +54,7 @@ class CandidateTreeItem : public TreeItem { Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::AddRunConfigDialog) public: - CandidateTreeItem(const RunConfigurationCreationInfo &rci, const FileName &projectRoot) + CandidateTreeItem(const RunConfigurationCreationInfo &rci, const FilePath &projectRoot) : m_creationInfo(rci), m_projectRoot(projectRoot) { } @@ -69,7 +69,7 @@ private: if (column == 0 && role == Qt::DisplayRole) return m_creationInfo.displayName; if (column == 1 && role == Qt::DisplayRole) { - FileName displayPath = m_creationInfo.projectFilePath.relativeChildPath(m_projectRoot); + FilePath displayPath = m_creationInfo.projectFilePath.relativeChildPath(m_projectRoot); if (displayPath.isEmpty()) { displayPath = m_creationInfo.projectFilePath; QTC_CHECK(displayPath.isEmpty()); @@ -80,7 +80,7 @@ private: } const RunConfigurationCreationInfo m_creationInfo; - const FileName m_projectRoot; + const FilePath m_projectRoot; }; class CandidatesModel : public TreeModel<TreeItem, CandidateTreeItem> diff --git a/src/plugins/projectexplorer/allprojectsfilter.cpp b/src/plugins/projectexplorer/allprojectsfilter.cpp index 24371ad4e1..ab17127d73 100644 --- a/src/plugins/projectexplorer/allprojectsfilter.cpp +++ b/src/plugins/projectexplorer/allprojectsfilter.cpp @@ -59,7 +59,7 @@ void AllProjectsFilter::prepareSearch(const QString &entry) if (!fileIterator()) { QStringList paths; for (Project *project : SessionManager::projects()) - paths.append(Utils::transform(project->files(Project::AllFiles), &Utils::FileName::toString)); + paths.append(Utils::transform(project->files(Project::AllFiles), &Utils::FilePath::toString)); Utils::sort(paths); setFileIterator(new BaseFileFilter::ListIterator(paths)); } diff --git a/src/plugins/projectexplorer/allprojectsfind.cpp b/src/plugins/projectexplorer/allprojectsfind.cpp index aa0d7c6fbc..d41f21f1b7 100644 --- a/src/plugins/projectexplorer/allprojectsfind.cpp +++ b/src/plugins/projectexplorer/allprojectsfind.cpp @@ -88,7 +88,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi QTextCodec *projectCodec = config->useGlobalSettings() ? Core::EditorManager::defaultTextCodec() : config->textCodec(); - const QStringList filteredFiles = filterFiles(Utils::transform(project->files(Project::AllFiles), &Utils::FileName::toString)); + const QStringList filteredFiles = filterFiles(Utils::transform(project->files(Project::AllFiles), &Utils::FilePath::toString)); for (const QString &fileName : filteredFiles) { QTextCodec *codec = openEditorEncodings.value(fileName); if (!codec) diff --git a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp index cb0734f226..14551d1d44 100644 --- a/src/plugins/projectexplorer/baseprojectwizarddialog.cpp +++ b/src/plugins/projectexplorer/baseprojectwizarddialog.cpp @@ -142,7 +142,7 @@ void BaseProjectWizardDialog::slotAccepted() { if (d->introPage->useAsDefaultPath()) { // Store the path as default path for new projects if desired. - Core::DocumentManager::setProjectsDirectory(Utils::FileName::fromString(path())); + Core::DocumentManager::setProjectsDirectory(Utils::FilePath::fromString(path())); Core::DocumentManager::setUseProjectsDirectory(true); } } diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp index 45dee444cf..e267822b97 100644 --- a/src/plugins/projectexplorer/buildconfiguration.cpp +++ b/src/plugins/projectexplorer/buildconfiguration.cpp @@ -102,19 +102,19 @@ BuildConfiguration::BuildConfiguration(Target *target, Core::Id id) }); } -Utils::FileName BuildConfiguration::buildDirectory() const +Utils::FilePath BuildConfiguration::buildDirectory() const { QString path = environment().expandVariables(m_buildDirectoryAspect->value().trimmed()); path = QDir::cleanPath(macroExpander()->expand(path)); - return Utils::FileName::fromString(QDir::cleanPath(QDir(target()->project()->projectDirectory().toString()).absoluteFilePath(path))); + return Utils::FilePath::fromString(QDir::cleanPath(QDir(target()->project()->projectDirectory().toString()).absoluteFilePath(path))); } -Utils::FileName BuildConfiguration::rawBuildDirectory() const +Utils::FilePath BuildConfiguration::rawBuildDirectory() const { return m_buildDirectoryAspect->fileName(); } -void BuildConfiguration::setBuildDirectory(const Utils::FileName &dir) +void BuildConfiguration::setBuildDirectory(const Utils::FilePath &dir) { if (dir == m_buildDirectoryAspect->fileName()) return; @@ -382,7 +382,7 @@ void BuildConfiguration::prependCompilerPathToEnvironment(Kit *k, Utils::Environ if (!tc) return; - const Utils::FileName compilerDir = tc->compilerCommand().parentDir(); + const Utils::FilePath compilerDir = tc->compilerCommand().parentDir(); if (!compilerDir.isEmpty()) env.prependOrSetPath(compilerDir.toString()); } diff --git a/src/plugins/projectexplorer/buildconfiguration.h b/src/plugins/projectexplorer/buildconfiguration.h index fb16fa0cd6..c9ba394946 100644 --- a/src/plugins/projectexplorer/buildconfiguration.h +++ b/src/plugins/projectexplorer/buildconfiguration.h @@ -51,9 +51,9 @@ protected: explicit BuildConfiguration(Target *target, Core::Id id); public: - Utils::FileName buildDirectory() const; - Utils::FileName rawBuildDirectory() const; - void setBuildDirectory(const Utils::FileName &dir); + Utils::FilePath buildDirectory() const; + Utils::FilePath rawBuildDirectory() const; + void setBuildDirectory(const Utils::FilePath &dir); virtual NamedWidget *createConfigWidget(); virtual QList<NamedWidget *> createSubConfigWidgets(); @@ -120,7 +120,7 @@ private: QList<Utils::EnvironmentItem> m_userEnvironmentChanges; QList<BuildStepList *> m_stepLists; ProjectExplorer::BaseStringAspect *m_buildDirectoryAspect = nullptr; - Utils::FileName m_lastEmmitedBuildDirectory; + Utils::FilePath m_lastEmmitedBuildDirectory; mutable Utils::Environment m_cachedEnvironment; QString m_configWidgetDisplayName; bool m_configWidgetHasFrame = false; diff --git a/src/plugins/projectexplorer/buildinfo.h b/src/plugins/projectexplorer/buildinfo.h index e135959352..41dfd78180 100644 --- a/src/plugins/projectexplorer/buildinfo.h +++ b/src/plugins/projectexplorer/buildinfo.h @@ -46,7 +46,7 @@ public: QString displayName; QString typeName; - Utils::FileName buildDirectory; + Utils::FilePath buildDirectory; Core::Id kitId; BuildConfiguration::BuildType buildType = BuildConfiguration::Unknown; diff --git a/src/plugins/projectexplorer/buildtargetinfo.h b/src/plugins/projectexplorer/buildtargetinfo.h index 1658ff54ad..28af0330a4 100644 --- a/src/plugins/projectexplorer/buildtargetinfo.h +++ b/src/plugins/projectexplorer/buildtargetinfo.h @@ -42,9 +42,9 @@ public: QString displayName; QString displayNameUniquifier; - Utils::FileName targetFilePath; - Utils::FileName projectFilePath; - Utils::FileName workingDirectory; + Utils::FilePath targetFilePath; + Utils::FilePath projectFilePath; + Utils::FilePath workingDirectory; bool isQtcRunnable = true; bool usesTerminal = false; diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index ced5bda3a2..1859f25896 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -68,7 +68,7 @@ void ClangParser::stdError(const QString &line) m_expectSnippet = true; Task task(taskType(match.captured(3)), match.captured(4), - Utils::FileName(), /* filename */ + Utils::FilePath(), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE); newTask(task); @@ -80,7 +80,7 @@ void ClangParser::stdError(const QString &line) m_expectSnippet = true; newTask(Task(Task::Unknown, lne.trimmed(), - Utils::FileName::fromUserInput(match.captured(2)), /* filename */ + Utils::FilePath::fromUserInput(match.captured(2)), /* filename */ match.captured(3).toInt(), /* line */ Constants::TASK_CATEGORY_COMPILE)); return; @@ -95,7 +95,7 @@ void ClangParser::stdError(const QString &line) lineNo = match.captured(5).toInt(&ok); Task task(taskType(match.captured(7)), match.captured(8), - Utils::FileName::fromUserInput(match.captured(1)), /* filename */ + Utils::FilePath::fromUserInput(match.captured(1)), /* filename */ lineNo, Core::Id(Constants::TASK_CATEGORY_COMPILE)); newTask(task); @@ -107,7 +107,7 @@ void ClangParser::stdError(const QString &line) m_expectSnippet = true; Task task(Task::Error, match.captured(1), - Utils::FileName(), + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_COMPILE)); newTask(task); @@ -164,7 +164,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << (Tasks() << Task(Task::Warning, QLatin1String("argument unused during compilation: '-mthreads'"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("clang++ error") @@ -174,7 +174,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << (Tasks() << Task(Task::Error, QLatin1String("no input files [err_drv_no_input_files]"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("complex warning") @@ -187,13 +187,13 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:"), - Utils::FileName::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h")), 45, + Utils::FilePath::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h")), 45, categoryCompile) << Task(Task::Warning, QLatin1String("unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n" "class Q_CORE_EXPORT QSysInfo {\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h")), 1425, + Utils::FilePath::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h")), 1425, categoryCompile)) << QString(); QTest::newRow("note") @@ -207,7 +207,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() QLatin1String("instantiated from:\n" "# define Q_CORE_EXPORT Q_DECL_IMPORT\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h")), 1289, + Utils::FilePath::fromUserInput(QLatin1String("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h")), 1289, categoryCompile)) << QString(); QTest::newRow("fatal error") @@ -221,7 +221,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() QLatin1String("'bits/c++config.h' file not found\n" "#include <bits/c++config.h>\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String("/usr/include/c++/4.6/utility")), 68, + Utils::FilePath::fromUserInput(QLatin1String("/usr/include/c++/4.6/utility")), 68, categoryCompile)) << QString(); @@ -236,7 +236,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() QLatin1String("?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n" " int x = option->rect.x() + horizontal ? 2 : 6;\n" " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp")), 567, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp")), 567, categoryCompile)) << QString(); QTest::newRow("code sign error") @@ -248,11 +248,11 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << (Tasks() << Task(Task::Error, QLatin1String("No matching provisioning profiles found: No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found."), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) << Task(Task::Error, QLatin1String("code signing is required for product type 'Application' in SDK 'iOS 7.0'"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("moc note") @@ -262,7 +262,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << (Tasks() << Task(Task::Unknown, QLatin1String("Note: No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, categoryCompile) ) << QString(); diff --git a/src/plugins/projectexplorer/currentprojectfilter.cpp b/src/plugins/projectexplorer/currentprojectfilter.cpp index 13c0d308db..0e924eeb2a 100644 --- a/src/plugins/projectexplorer/currentprojectfilter.cpp +++ b/src/plugins/projectexplorer/currentprojectfilter.cpp @@ -58,7 +58,7 @@ void CurrentProjectFilter::prepareSearch(const QString &entry) if (!fileIterator()) { QStringList paths; if (m_project) - paths = Utils::transform(m_project->files(Project::AllFiles), &Utils::FileName::toString); + paths = Utils::transform(m_project->files(Project::AllFiles), &Utils::FilePath::toString); setFileIterator(new BaseFileFilter::ListIterator(paths)); } BaseFileFilter::prepareSearch(entry); diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp index 562b7f6560..957b742474 100644 --- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp +++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp @@ -145,7 +145,7 @@ CustomExecutableDialog::CustomExecutableDialog(RunConfiguration *rc) void CustomExecutableDialog::accept() { - auto executable = FileName::fromString(m_executableChooser->path()); + auto executable = FilePath::fromString(m_executableChooser->path()); m_rc->aspect<ExecutableAspect>()->setExecutable(executable); copyAspect(&m_arguments, m_rc->aspect<ArgumentsAspect>()); copyAspect(&m_workingDirectory, m_rc->aspect<WorkingDirectoryAspect>()); @@ -251,7 +251,7 @@ bool CustomExecutableRunConfiguration::isConfigured() const Runnable CustomExecutableRunConfiguration::runnable() const { - FileName workingDirectory = + FilePath workingDirectory = aspect<WorkingDirectoryAspect>()->workingDirectory(macroExpander()); Runnable r; diff --git a/src/plugins/projectexplorer/customparser.cpp b/src/plugins/projectexplorer/customparser.cpp index dfdb71c4d4..c408dfc2c6 100644 --- a/src/plugins/projectexplorer/customparser.cpp +++ b/src/plugins/projectexplorer/customparser.cpp @@ -150,12 +150,12 @@ Core::Id CustomParser::id() return Core::Id("ProjectExplorer.OutputParser.Custom"); } -FileName CustomParser::absoluteFilePath(const QString &filePath) const +FilePath CustomParser::absoluteFilePath(const QString &filePath) const { if (m_workingDirectory.isEmpty()) - return FileName::fromUserInput(filePath); + return FilePath::fromUserInput(filePath); - return FileName::fromString(FileUtils::resolvePath(m_workingDirectory, filePath)); + return FilePath::fromString(FileUtils::resolvePath(m_workingDirectory, filePath)); } bool CustomParser::hasMatch(const QString &line, CustomParserExpression::CustomParserChannel channel, @@ -171,7 +171,7 @@ bool CustomParser::hasMatch(const QString &line, CustomParserExpression::CustomP if (!match.hasMatch()) return false; - const FileName fileName = absoluteFilePath(match.captured(expression.fileNameCap())); + const FilePath fileName = absoluteFilePath(match.captured(expression.fileNameCap())); const int lineNumber = match.captured(expression.lineNumberCap()).toInt(); const QString message = match.captured(expression.messageCap()); @@ -220,7 +220,7 @@ void ProjectExplorerPlugin::testCustomOutputParsers_data() const Core::Id categoryCompile = Constants::TASK_CATEGORY_COMPILE; const QString simplePattern = "^([a-z]+\\.[a-z]+):(\\d+): error: ([^\\s].+)$"; - const FileName fileName = FileName::fromUserInput("main.c"); + const FilePath fileName = FilePath::fromUserInput("main.c"); QTest::newRow("empty patterns") << QString::fromLatin1("Sometext") @@ -272,7 +272,7 @@ void ProjectExplorerPlugin::testCustomOutputParsers_data() const QString pathPattern = "^([a-z\\./]+):(\\d+): error: ([^\\s].+)$"; QString workingDir = "/home/src/project"; - FileName expandedFileName = FileName::fromString("/home/src/project/main.c"); + FilePath expandedFileName = FilePath::fromString("/home/src/project/main.c"); QTest::newRow("simple error with expanded path") << "main.c:9: error: `sfasdf' undeclared (first use this function)" @@ -285,7 +285,7 @@ void ProjectExplorerPlugin::testCustomOutputParsers_data() << Tasks{Task(Task::Error, message, expandedFileName, 9, categoryCompile)} << QString(); - expandedFileName = FileName::fromString("/home/src/project/subdir/main.c"); + expandedFileName = FilePath::fromString("/home/src/project/subdir/main.c"); QTest::newRow("simple error with subdir path") << "subdir/main.c:9: error: `sfasdf' undeclared (first use this function)" << workingDir @@ -432,7 +432,7 @@ void ProjectExplorerPlugin::testCustomOutputParsers_data() << QString(); const QString unitTestError = "../LedDriver/LedDriverTest.c:63: FAIL: Expected 0x0080 Was 0xffff"; - const FileName unitTestFileName = FileName::fromUserInput("../LedDriver/LedDriverTest.c"); + const FilePath unitTestFileName = FilePath::fromUserInput("../LedDriver/LedDriverTest.c"); const QString unitTestMessage = "Expected 0x0080 Was 0xffff"; const QString unitTestPattern = "^([^:]+):(\\d+): FAIL: ([^\\s].+)$"; const int unitTestLineNumber = 63; diff --git a/src/plugins/projectexplorer/customparser.h b/src/plugins/projectexplorer/customparser.h index b7c70d4759..dafb0e8da1 100644 --- a/src/plugins/projectexplorer/customparser.h +++ b/src/plugins/projectexplorer/customparser.h @@ -96,7 +96,7 @@ public: static Core::Id id(); private: - Utils::FileName absoluteFilePath(const QString &filePath) const; + Utils::FilePath absoluteFilePath(const QString &filePath) const; bool hasMatch(const QString &line, CustomParserExpression::CustomParserChannel channel, const CustomParserExpression &expression, Task::TaskType taskType); bool parseLine(const QString &rawLine, CustomParserExpression::CustomParserChannel channel); diff --git a/src/plugins/projectexplorer/customtoolchain.cpp b/src/plugins/projectexplorer/customtoolchain.cpp index 1432a0e2dc..e1175963ea 100644 --- a/src/plugins/projectexplorer/customtoolchain.cpp +++ b/src/plugins/projectexplorer/customtoolchain.cpp @@ -176,7 +176,7 @@ ToolChain::BuiltInHeaderPathsRunner CustomToolChain::createBuiltInHeaderPathsRun } HeaderPaths CustomToolChain::builtInHeaderPaths(const QStringList &cxxFlags, - const FileName &fileName) const + const FilePath &fileName) const { return createBuiltInHeaderPathsRunner()(cxxFlags, fileName.toString(), ""); } @@ -184,9 +184,9 @@ HeaderPaths CustomToolChain::builtInHeaderPaths(const QStringList &cxxFlags, void CustomToolChain::addToEnvironment(Environment &env) const { if (!m_compilerCommand.isEmpty()) { - FileName path = m_compilerCommand.parentDir(); + FilePath path = m_compilerCommand.parentDir(); env.prependOrSetPath(path.toString()); - FileName makePath = m_makeCommand.parentDir(); + FilePath makePath = m_makeCommand.parentDir(); if (makePath != path) env.prependOrSetPath(makePath.toString()); } @@ -229,7 +229,7 @@ void CustomToolChain::setHeaderPaths(const QStringList &list) toolChainUpdated(); } -void CustomToolChain::setCompilerCommand(const FileName &path) +void CustomToolChain::setCompilerCommand(const FilePath &path) { if (path == m_compilerCommand) return; @@ -237,12 +237,12 @@ void CustomToolChain::setCompilerCommand(const FileName &path) toolChainUpdated(); } -FileName CustomToolChain::compilerCommand() const +FilePath CustomToolChain::compilerCommand() const { return m_compilerCommand; } -void CustomToolChain::setMakeCommand(const FileName &path) +void CustomToolChain::setMakeCommand(const FilePath &path) { if (path == m_makeCommand) return; @@ -250,7 +250,7 @@ void CustomToolChain::setMakeCommand(const FileName &path) toolChainUpdated(); } -FileName CustomToolChain::makeCommand(const Environment &) const +FilePath CustomToolChain::makeCommand(const Environment &) const { return m_makeCommand; } @@ -315,8 +315,8 @@ bool CustomToolChain::fromMap(const QVariantMap &data) if (!ToolChain::fromMap(data)) return false; - m_compilerCommand = FileName::fromString(data.value(QLatin1String(compilerCommandKeyC)).toString()); - m_makeCommand = FileName::fromString(data.value(QLatin1String(makeCommandKeyC)).toString()); + m_compilerCommand = FilePath::fromString(data.value(QLatin1String(compilerCommandKeyC)).toString()); + m_makeCommand = FilePath::fromString(data.value(QLatin1String(makeCommandKeyC)).toString()); m_targetAbi = Abi::fromString(data.value(QLatin1String(targetAbiKeyC)).toString()); const QStringList macros = data.value(QLatin1String(predefinedMacrosKeyC)).toStringList(); m_predefinedMacros = Macro::toMacros(macros.join('\n').toUtf8()); diff --git a/src/plugins/projectexplorer/customtoolchain.h b/src/plugins/projectexplorer/customtoolchain.h index 9746271179..415cf89abd 100644 --- a/src/plugins/projectexplorer/customtoolchain.h +++ b/src/plugins/projectexplorer/customtoolchain.h @@ -80,7 +80,7 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override; HeaderPaths builtInHeaderPaths(const QStringList &cxxFlags, - const Utils::FileName &) const override; + const Utils::FilePath &) const override; void addToEnvironment(Utils::Environment &env) const override; QStringList suggestedMkspecList() const override; IOutputParser *outputParser() const override; @@ -94,10 +94,10 @@ public: bool operator ==(const ToolChain &) const override; - void setCompilerCommand(const Utils::FileName &); - Utils::FileName compilerCommand() const override; - void setMakeCommand(const Utils::FileName &); - Utils::FileName makeCommand(const Utils::Environment &environment) const override; + void setCompilerCommand(const Utils::FilePath &); + Utils::FilePath compilerCommand() const override; + void setMakeCommand(const Utils::FilePath &); + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; void setCxx11Flags(const QStringList &); const QStringList &cxx11Flags() const; @@ -114,8 +114,8 @@ public: private: CustomToolChain(); - Utils::FileName m_compilerCommand; - Utils::FileName m_makeCommand; + Utils::FilePath m_compilerCommand; + Utils::FilePath m_makeCommand; Abi m_targetAbi; Macros m_predefinedMacros; diff --git a/src/plugins/projectexplorer/deployablefile.cpp b/src/plugins/projectexplorer/deployablefile.cpp index 1d7b6132c1..d8ea6cd33a 100644 --- a/src/plugins/projectexplorer/deployablefile.cpp +++ b/src/plugins/projectexplorer/deployablefile.cpp @@ -34,10 +34,10 @@ using namespace Utils; namespace ProjectExplorer { DeployableFile::DeployableFile(const QString &localFilePath, const QString &remoteDir, Type type) - : m_localFilePath(FileName::fromUserInput(localFilePath)), m_remoteDir(remoteDir), m_type(type) + : m_localFilePath(FilePath::fromUserInput(localFilePath)), m_remoteDir(remoteDir), m_type(type) { } -DeployableFile::DeployableFile(const FileName &localFilePath, const QString &remoteDir, Type type) +DeployableFile::DeployableFile(const FilePath &localFilePath, const QString &remoteDir, Type type) : m_localFilePath(localFilePath), m_remoteDir(remoteDir), m_type(type) { } diff --git a/src/plugins/projectexplorer/deployablefile.h b/src/plugins/projectexplorer/deployablefile.h index 70d05c29e8..b1a6c6a1d6 100644 --- a/src/plugins/projectexplorer/deployablefile.h +++ b/src/plugins/projectexplorer/deployablefile.h @@ -45,10 +45,10 @@ public: DeployableFile() = default; DeployableFile(const QString &m_localFilePath, const QString &m_remoteDir, Type type = TypeNormal); - DeployableFile(const Utils::FileName &localFilePath, const QString &remoteDir, + DeployableFile(const Utils::FilePath &localFilePath, const QString &remoteDir, Type type = TypeNormal); - Utils::FileName localFilePath() const { return m_localFilePath; } + Utils::FilePath localFilePath() const { return m_localFilePath; } QString remoteDirectory() const { return m_remoteDir; } QString remoteFilePath() const; @@ -57,7 +57,7 @@ public: bool isExecutable() const; private: - Utils::FileName m_localFilePath; + Utils::FilePath m_localFilePath; QString m_remoteDir; Type m_type = TypeNormal; }; diff --git a/src/plugins/projectexplorer/deploymentdata.cpp b/src/plugins/projectexplorer/deploymentdata.cpp index c34b6a4044..7cdc4a1185 100644 --- a/src/plugins/projectexplorer/deploymentdata.cpp +++ b/src/plugins/projectexplorer/deploymentdata.cpp @@ -33,7 +33,7 @@ namespace ProjectExplorer { -void DeploymentData::setLocalInstallRoot(const Utils::FileName &installRoot) +void DeploymentData::setLocalInstallRoot(const Utils::FilePath &installRoot) { m_localInstallRoot = installRoot; } diff --git a/src/plugins/projectexplorer/deploymentdata.h b/src/plugins/projectexplorer/deploymentdata.h index d9e05a1d83..e45427ebf8 100644 --- a/src/plugins/projectexplorer/deploymentdata.h +++ b/src/plugins/projectexplorer/deploymentdata.h @@ -39,7 +39,7 @@ enum class DeploymentKnowledge { Perfect, Approximative, Bad }; class PROJECTEXPLORER_EXPORT MakeInstallCommand { public: - Utils::FileName command; + Utils::FilePath command; QStringList arguments; Utils::Environment environment; }; @@ -50,8 +50,8 @@ public: void setFileList(const QList<DeployableFile> &files) { m_files = files; } QList<DeployableFile> allFiles() const { return m_files; } - void setLocalInstallRoot(const Utils::FileName &installRoot); - Utils::FileName localInstallRoot() const { return m_localInstallRoot; } + void setLocalInstallRoot(const Utils::FilePath &installRoot); + Utils::FilePath localInstallRoot() const { return m_localInstallRoot; } void addFile(const DeployableFile &file); void addFile(const QString &localFilePath, const QString &remoteDirectory, @@ -66,7 +66,7 @@ public: private: QList<DeployableFile> m_files; - Utils::FileName m_localInstallRoot; + Utils::FilePath m_localInstallRoot; }; inline bool operator!=(const DeploymentData &d1, const DeploymentData &d2) { return !(d1 == d2); } diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 205752fe3d..cd6e7421aa 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp @@ -221,14 +221,14 @@ QVariantMap DeviceManager::toMap() const return map; } -Utils::FileName DeviceManager::settingsFilePath(const QString &extension) +Utils::FilePath DeviceManager::settingsFilePath(const QString &extension) { - return Utils::FileName::fromString(Core::ICore::userResourcePath() + extension); + return Utils::FilePath::fromString(Core::ICore::userResourcePath() + extension); } -Utils::FileName DeviceManager::systemSettingsFilePath(const QString &deviceFileRelativePath) +Utils::FilePath DeviceManager::systemSettingsFilePath(const QString &deviceFileRelativePath) { - return Utils::FileName::fromString(Core::ICore::installerResourcePath() + return Utils::FilePath::fromString(Core::ICore::installerResourcePath() + deviceFileRelativePath); } diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.h b/src/plugins/projectexplorer/devicesupport/devicemanager.h index bd9c2b606e..6f286845dd 100644 --- a/src/plugins/projectexplorer/devicesupport/devicemanager.h +++ b/src/plugins/projectexplorer/devicesupport/devicemanager.h @@ -33,7 +33,7 @@ #include <memory> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { class IDevice; @@ -96,8 +96,8 @@ private: static void replaceInstance(); static void removeClonedInstance(); - static Utils::FileName settingsFilePath(const QString &extension); - static Utils::FileName systemSettingsFilePath(const QString &deviceFileRelativePath); + static Utils::FilePath settingsFilePath(const QString &extension); + static Utils::FilePath systemSettingsFilePath(const QString &deviceFileRelativePath); static void copy(const DeviceManager *source, DeviceManager *target, bool deep); const std::unique_ptr<Internal::DeviceManagerPrivate> d; diff --git a/src/plugins/projectexplorer/devicesupport/sshsettingspage.cpp b/src/plugins/projectexplorer/devicesupport/sshsettingspage.cpp index 32b6b3e83e..152467c93e 100644 --- a/src/plugins/projectexplorer/devicesupport/sshsettingspage.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshsettingspage.cpp @@ -58,7 +58,7 @@ private: void setupSftpPathChooser(); void setupAskpassPathChooser(); void setupKeygenPathChooser(); - void setupPathChooser(PathChooser &chooser, const FileName &initialPath, bool &changedFlag); + void setupPathChooser(PathChooser &chooser, const FilePath &initialPath, bool &changedFlag); void updateCheckboxEnabled(); void updateSpinboxEnabled(); @@ -170,7 +170,7 @@ void SshSettingsWidget::setupKeygenPathChooser() setupPathChooser(m_keygenChooser, SshSettings::keygenFilePath(), m_keygenPathChanged); } -void SshSettingsWidget::setupPathChooser(PathChooser &chooser, const FileName &initialPath, +void SshSettingsWidget::setupPathChooser(PathChooser &chooser, const FilePath &initialPath, bool &changedFlag) { chooser.setExpectedKind(PathChooser::ExistingCommand); diff --git a/src/plugins/projectexplorer/editorconfiguration.cpp b/src/plugins/projectexplorer/editorconfiguration.cpp index 43f7b79c69..40e08d368e 100644 --- a/src/plugins/projectexplorer/editorconfiguration.cpp +++ b/src/plugins/projectexplorer/editorconfiguration.cpp @@ -395,7 +395,7 @@ TabSettings actualTabSettings(const QString &fileName, { if (baseTextdocument) return baseTextdocument->tabSettings(); - if (Project *project = SessionManager::projectForFile(Utils::FileName::fromString(fileName))) + if (Project *project = SessionManager::projectForFile(Utils::FilePath::fromString(fileName))) return project->editorConfiguration()->codeStyle()->tabSettings(); return TextEditorSettings::codeStyle()->tabSettings(); } diff --git a/src/plugins/projectexplorer/extraabi.cpp b/src/plugins/projectexplorer/extraabi.cpp index a1da2193fd..434994125c 100644 --- a/src/plugins/projectexplorer/extraabi.cpp +++ b/src/plugins/projectexplorer/extraabi.cpp @@ -65,7 +65,7 @@ AbiFlavorAccessor::AbiFlavorAccessor() : QCoreApplication::translate("ProjectExplorer::ToolChainManager", "ABI"), Core::Constants::IDE_DISPLAY_NAME) { - setBaseFilePath(FileName::fromString(Core::ICore::installerResourcePath() + "/abi.xml")); + setBaseFilePath(FilePath::fromString(Core::ICore::installerResourcePath() + "/abi.xml")); addVersionUpgrader(std::make_unique<AbiFlavorUpgraderV0>()); } diff --git a/src/plugins/projectexplorer/extracompiler.cpp b/src/plugins/projectexplorer/extracompiler.cpp index 85fabdf623..adcc8f180e 100644 --- a/src/plugins/projectexplorer/extracompiler.cpp +++ b/src/plugins/projectexplorer/extracompiler.cpp @@ -57,7 +57,7 @@ class ExtraCompilerPrivate { public: const Project *project; - Utils::FileName source; + Utils::FilePath source; FileNameToContentsHash contents; Tasks issues; QDateTime compileTime; @@ -70,13 +70,13 @@ public: void updateIssues(); }; -ExtraCompiler::ExtraCompiler(const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent) : +ExtraCompiler::ExtraCompiler(const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent) : QObject(parent), d(std::make_unique<ExtraCompilerPrivate>()) { d->project = project; d->source = source; - foreach (const Utils::FileName &target, targets) + foreach (const Utils::FilePath &target, targets) d->contents.insert(target, QByteArray()); d->timer.setSingleShot(true); @@ -104,7 +104,7 @@ ExtraCompiler::ExtraCompiler(const Project *project, const Utils::FileName &sour // Use existing target files, where possible. Otherwise run the compiler. QDateTime sourceTime = d->source.toFileInfo().lastModified(); - foreach (const Utils::FileName &target, targets) { + foreach (const Utils::FilePath &target, targets) { QFileInfo targetFileInfo(target.toFileInfo()); if (!targetFileInfo.exists()) { d->dirty = true; @@ -136,22 +136,22 @@ const Project *ExtraCompiler::project() const return d->project; } -Utils::FileName ExtraCompiler::source() const +Utils::FilePath ExtraCompiler::source() const { return d->source; } -QByteArray ExtraCompiler::content(const Utils::FileName &file) const +QByteArray ExtraCompiler::content(const Utils::FilePath &file) const { return d->contents.value(file); } -Utils::FileNameList ExtraCompiler::targets() const +Utils::FilePathList ExtraCompiler::targets() const { return d->contents.keys(); } -void ExtraCompiler::forEachTarget(std::function<void (const Utils::FileName &)> func) +void ExtraCompiler::forEachTarget(std::function<void (const Utils::FilePath &)> func) { for (auto it = d->contents.constBegin(), end = d->contents.constEnd(); it != end; ++it) func(it.key()); @@ -183,7 +183,7 @@ void ExtraCompiler::onTargetsBuilt(Project *project) if (d->compileTime.isValid() && d->compileTime >= sourceTime) return; - forEachTarget([&](const Utils::FileName &target) { + forEachTarget([&](const Utils::FilePath &target) { QFileInfo fi(target.toFileInfo()); QDateTime generateTime = fi.exists() ? fi.lastModified() : QDateTime(); if (generateTime.isValid() && (generateTime > sourceTime)) { @@ -299,7 +299,7 @@ void ExtraCompilerPrivate::updateIssues() widget->setExtraSelections(TextEditor::TextEditorWidget::CodeWarningsSelection, selections); } -void ExtraCompiler::setContent(const Utils::FileName &file, const QByteArray &contents) +void ExtraCompiler::setContent(const Utils::FilePath &file, const QByteArray &contents) { auto it = d->contents.find(file); if (it != d->contents.end()) { @@ -322,8 +322,8 @@ ExtraCompilerFactory::~ExtraCompilerFactory() } void ExtraCompilerFactory::annouceCreation(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) + const Utils::FilePath &source, + const Utils::FilePathList &targets) { for (ExtraCompilerFactoryObserver *observer : *observers) observer->newExtraCompiler(project, source, targets); @@ -334,8 +334,8 @@ QList<ExtraCompilerFactory *> ExtraCompilerFactory::extraCompilerFactories() return *factories(); } -ProcessExtraCompiler::ProcessExtraCompiler(const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent) : +ProcessExtraCompiler::ProcessExtraCompiler(const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent) : ExtraCompiler(project, source, targets, parent) { } @@ -353,7 +353,7 @@ void ProcessExtraCompiler::run(const QByteArray &sourceContents) runImpl(contents); } -void ProcessExtraCompiler::run(const Utils::FileName &fileName) +void ProcessExtraCompiler::run(const Utils::FilePath &fileName) { ContentProvider contents = [fileName]() { QFile file(fileName.toString()); @@ -364,9 +364,9 @@ void ProcessExtraCompiler::run(const Utils::FileName &fileName) runImpl(contents); } -Utils::FileName ProcessExtraCompiler::workingDirectory() const +Utils::FilePath ProcessExtraCompiler::workingDirectory() const { - return Utils::FileName(); + return Utils::FilePath(); } QStringList ProcessExtraCompiler::arguments() const @@ -403,7 +403,7 @@ void ProcessExtraCompiler::runImpl(const ContentProvider &provider) void ProcessExtraCompiler::runInThread( QFutureInterface<FileNameToContentsHash> &futureInterface, - const Utils::FileName &cmd, const Utils::FileName &workDir, + const Utils::FilePath &cmd, const Utils::FilePath &workDir, const QStringList &args, const ContentProvider &provider, const Utils::Environment &env) { diff --git a/src/plugins/projectexplorer/extracompiler.h b/src/plugins/projectexplorer/extracompiler.h index d5732470d4..ba9c6774f7 100644 --- a/src/plugins/projectexplorer/extracompiler.h +++ b/src/plugins/projectexplorer/extracompiler.h @@ -47,27 +47,27 @@ QT_FORWARD_DECLARE_CLASS(QThreadPool); namespace ProjectExplorer { class ExtraCompilerPrivate; -using FileNameToContentsHash = QHash<Utils::FileName, QByteArray>; +using FileNameToContentsHash = QHash<Utils::FilePath, QByteArray>; class PROJECTEXPLORER_EXPORT ExtraCompiler : public QObject { Q_OBJECT public: - ExtraCompiler(const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent = nullptr); + ExtraCompiler(const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent = nullptr); ~ExtraCompiler() override; const Project *project() const; - Utils::FileName source() const; + Utils::FilePath source() const; // You can set the contents from the outside. This is done if the file has been (re)created by // the regular build process. - void setContent(const Utils::FileName &file, const QByteArray &content); - QByteArray content(const Utils::FileName &file) const; + void setContent(const Utils::FilePath &file, const QByteArray &content); + QByteArray content(const Utils::FilePath &file) const; - Utils::FileNameList targets() const; - void forEachTarget(std::function<void(const Utils::FileName &)> func); + Utils::FilePathList targets() const; + void forEachTarget(std::function<void(const Utils::FilePath &)> func); void setCompileTime(const QDateTime &time); QDateTime compileTime() const; @@ -75,7 +75,7 @@ public: static QThreadPool *extraCompilerThreadPool(); signals: - void contentsChanged(const Utils::FileName &file); + void contentsChanged(const Utils::FilePath &file); protected: Utils::Environment buildEnvironment() const; @@ -88,7 +88,7 @@ private: void setDirty(); // This method may not block! virtual void run(const QByteArray &sourceContent) = 0; - virtual void run(const Utils::FileName &file) = 0; + virtual void run(const Utils::FilePath &file) = 0; const std::unique_ptr<ExtraCompilerPrivate> d; }; @@ -98,8 +98,8 @@ class PROJECTEXPLORER_EXPORT ProcessExtraCompiler : public ExtraCompiler Q_OBJECT public: - ProcessExtraCompiler(const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent = nullptr); + ProcessExtraCompiler(const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent = nullptr); ~ProcessExtraCompiler() override; protected: @@ -109,11 +109,11 @@ protected: // * prepareToRun returns true // * The process is not yet running void run(const QByteArray &sourceContents) override; - void run(const Utils::FileName &fileName) override; + void run(const Utils::FilePath &fileName) override; // Information about the process to run: - virtual Utils::FileName workingDirectory() const; - virtual Utils::FileName command() const = 0; + virtual Utils::FilePath workingDirectory() const; + virtual Utils::FilePath command() const = 0; virtual QStringList arguments() const; virtual bool prepareToRun(const QByteArray &sourceContents); @@ -129,7 +129,7 @@ private: using ContentProvider = std::function<QByteArray()>; void runImpl(const ContentProvider &sourceContents); void runInThread(QFutureInterface<FileNameToContentsHash> &futureInterface, - const Utils::FileName &cmd, const Utils::FileName &workDir, + const Utils::FilePath &cmd, const Utils::FilePath &workDir, const QStringList &args, const ContentProvider &provider, const Utils::Environment &env); void cleanUp(); @@ -146,8 +146,8 @@ protected: ~ExtraCompilerFactoryObserver(); virtual void newExtraCompiler(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) + const Utils::FilePath &source, + const Utils::FilePathList &targets) = 0; }; @@ -162,13 +162,13 @@ public: virtual QString sourceTag() const = 0; virtual ExtraCompiler *create(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) + const Utils::FilePath &source, + const Utils::FilePathList &targets) = 0; void annouceCreation(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets); + const Utils::FilePath &source, + const Utils::FilePathList &targets); static QList<ExtraCompilerFactory *> extraCompilerFactories(); }; diff --git a/src/plugins/projectexplorer/fileinsessionfinder.cpp b/src/plugins/projectexplorer/fileinsessionfinder.cpp index 667cbdd22e..e4c62e405f 100644 --- a/src/plugins/projectexplorer/fileinsessionfinder.cpp +++ b/src/plugins/projectexplorer/fileinsessionfinder.cpp @@ -42,7 +42,7 @@ class FileInSessionFinder : public QObject public: FileInSessionFinder(); - FileNameList doFindFile(const FileName &filePath); + FilePathList doFindFile(const FilePath &filePath); void invalidateFinder() { m_finderIsUpToDate = false; } private: @@ -64,13 +64,13 @@ FileInSessionFinder::FileInSessionFinder() }); } -FileNameList FileInSessionFinder::doFindFile(const FileName &filePath) +FilePathList FileInSessionFinder::doFindFile(const FilePath &filePath) { if (!m_finderIsUpToDate) { m_finder.setProjectDirectory(SessionManager::startupProject() ? SessionManager::startupProject()->projectDirectory() - : FileName()); - FileNameList allFiles; + : FilePath()); + FilePathList allFiles; for (const Project * const p : SessionManager::projects()) allFiles << p->files(Project::AllFiles); m_finder.setProjectFiles(allFiles); @@ -79,7 +79,7 @@ FileNameList FileInSessionFinder::doFindFile(const FileName &filePath) return m_finder.findFile(QUrl::fromLocalFile(filePath.toString())); } -FileNameList findFileInSession(const FileName &filePath) +FilePathList findFileInSession(const FilePath &filePath) { static FileInSessionFinder finder; return finder.doFindFile(filePath); diff --git a/src/plugins/projectexplorer/fileinsessionfinder.h b/src/plugins/projectexplorer/fileinsessionfinder.h index 4f08e67d93..f14b3708f3 100644 --- a/src/plugins/projectexplorer/fileinsessionfinder.h +++ b/src/plugins/projectexplorer/fileinsessionfinder.h @@ -30,7 +30,7 @@ namespace ProjectExplorer { namespace Internal { -Utils::FileNameList findFileInSession(const Utils::FileName &filePath); +Utils::FilePathList findFileInSession(const Utils::FilePath &filePath); } // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/foldernavigationwidget.cpp b/src/plugins/projectexplorer/foldernavigationwidget.cpp index 9bcde3a6eb..6ff9c9719a 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.cpp +++ b/src/plugins/projectexplorer/foldernavigationwidget.cpp @@ -168,7 +168,7 @@ bool FolderSortProxyModel::lessThan(const QModelIndex &source_left, const QModel } const QString leftName = src->data(source_left, QFileSystemModel::FileNameRole).toString(); const QString rightName = src->data(source_right, QFileSystemModel::FileNameRole).toString(); - return Utils::FileName::fromString(leftName) < Utils::FileName::fromString(rightName); + return Utils::FilePath::fromString(leftName) < Utils::FilePath::fromString(rightName); } FolderNavigationModel::FolderNavigationModel(QObject *parent) : QFileSystemModel(parent) @@ -196,8 +196,8 @@ Qt::ItemFlags FolderNavigationModel::flags(const QModelIndex &index) const return QFileSystemModel::flags(index); } -static QVector<FolderNode *> renamableFolderNodes(const Utils::FileName &before, - const Utils::FileName &after) +static QVector<FolderNode *> renamableFolderNodes(const Utils::FilePath &before, + const Utils::FilePath &after) { QVector<FolderNode *> folderNodes; ProjectTree::forEachNode([&](Node *node) { @@ -236,8 +236,8 @@ bool FolderNavigationModel::setData(const QModelIndex &index, const QVariant &va if (success && fileInfo(index).isFile()) { Core::DocumentManager::renamedFile(beforeFilePath, afterFilePath); const QVector<FolderNode *> folderNodes - = renamableFolderNodes(Utils::FileName::fromString(beforeFilePath), - Utils::FileName::fromString(afterFilePath)); + = renamableFolderNodes(Utils::FilePath::fromString(beforeFilePath), + Utils::FilePath::fromString(afterFilePath)); QVector<FolderNode *> failedNodes; for (FolderNode *folder : folderNodes) { if (!folder->renameFile(beforeFilePath, afterFilePath)) @@ -383,7 +383,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent this, [this](const QModelIndex &index) { const QModelIndex sourceIndex = m_sortProxyModel->mapToSource(index); - const auto filePath = Utils::FileName::fromString( + const auto filePath = Utils::FilePath::fromString( m_fileSystemModel->filePath(sourceIndex)); // QTimer::singleShot only posts directly onto the event loop if you use the SLOT("...") // notation, so using a singleShot with a lambda would flicker @@ -391,9 +391,9 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent QMetaObject::invokeMethod(this, "setCrumblePath", Qt::QueuedConnection, - Q_ARG(Utils::FileName, filePath)); + Q_ARG(Utils::FilePath, filePath)); }); - connect(m_crumbLabel, &Utils::FileCrumbLabel::pathClicked, [this](const Utils::FileName &path) { + connect(m_crumbLabel, &Utils::FileCrumbLabel::pathClicked, [this](const Utils::FilePath &path) { const QModelIndex rootIndex = m_sortProxyModel->mapToSource(m_listView->rootIndex()); const QModelIndex fileIndex = m_fileSystemModel->index(path.toString()); if (!isChildOf(fileIndex, rootIndex)) @@ -422,7 +422,7 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int index) { - const auto directory = m_rootSelector->itemData(index).value<Utils::FileName>(); + const auto directory = m_rootSelector->itemData(index).value<Utils::FilePath>(); m_rootSelector->setToolTip(directory.toString()); setRootDirectory(directory); const QModelIndex rootIndex = m_sortProxyModel->mapToSource(m_listView->rootIndex()); @@ -512,8 +512,8 @@ void FolderNavigationWidget::addNewItem() const QModelIndex current = m_sortProxyModel->mapToSource(m_listView->currentIndex()); if (!current.isValid()) return; - const auto filePath = Utils::FileName::fromString(m_fileSystemModel->filePath(current)); - const Utils::FileName path = filePath.toFileInfo().isDir() ? filePath : filePath.parentDir(); + const auto filePath = Utils::FilePath::fromString(m_fileSystemModel->filePath(current)); + const Utils::FilePath path = filePath.toFileInfo().isDir() ? filePath : filePath.parentDir(); Core::ICore::showNewItemDialog(ProjectExplorerPlugin::tr("New File", "Title of dialog"), Utils::filtered(Core::IWizardFactory::allWizardFactories(), Utils::equal(&Core::IWizardFactory::kind, @@ -528,7 +528,7 @@ void FolderNavigationWidget::editCurrentItem() m_listView->edit(current); } -static QVector<FolderNode *> removableFolderNodes(const Utils::FileName &filePath) +static QVector<FolderNode *> removableFolderNodes(const Utils::FilePath &filePath) { QVector<FolderNode *> folderNodes; ProjectTree::forEachNode([&](Node *node) { @@ -552,7 +552,7 @@ void FolderNavigationWidget::removeCurrentItem() dialog.setDeleteFileVisible(false); if (dialog.exec() == QDialog::Accepted) { const QVector<FolderNode *> folderNodes = removableFolderNodes( - Utils::FileName::fromString(filePath)); + Utils::FilePath::fromString(filePath)); const QVector<FolderNode *> failedNodes = Utils::filtered(folderNodes, [filePath](FolderNode *folder) { return !folder->removeFiles( @@ -606,19 +606,19 @@ void FolderNavigationWidget::handleCurrentEditorChanged(Core::IEditor *editor) if (!m_autoSync || !editor || editor->document()->filePath().isEmpty() || editor->document()->isTemporary()) return; - const Utils::FileName filePath = editor->document()->filePath(); + const Utils::FilePath filePath = editor->document()->filePath(); if (m_rootAutoSync) selectBestRootForFile(filePath); selectFile(filePath); } -void FolderNavigationWidget::selectBestRootForFile(const Utils::FileName &filePath) +void FolderNavigationWidget::selectBestRootForFile(const Utils::FilePath &filePath) { const int bestRootIndex = bestRootForFile(filePath); m_rootSelector->setCurrentIndex(bestRootIndex); } -void FolderNavigationWidget::selectFile(const Utils::FileName &filePath) +void FolderNavigationWidget::selectFile(const Utils::FilePath &filePath) { const QModelIndex fileIndex = m_sortProxyModel->mapFromSource( m_fileSystemModel->index(filePath.toString())); @@ -642,19 +642,19 @@ void FolderNavigationWidget::selectFile(const Utils::FileName &filePath) } } -void FolderNavigationWidget::setRootDirectory(const Utils::FileName &directory) +void FolderNavigationWidget::setRootDirectory(const Utils::FilePath &directory) { const QModelIndex index = m_sortProxyModel->mapFromSource( m_fileSystemModel->setRootPath(directory.toString())); m_listView->setRootIndex(index); } -int FolderNavigationWidget::bestRootForFile(const Utils::FileName &filePath) +int FolderNavigationWidget::bestRootForFile(const Utils::FilePath &filePath) { int index = 0; // Computer is default int commonLength = 0; 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::FilePath>(); if (filePath.isChildOf(root) && root.toString().size() > commonLength) { index = i; commonLength = root.toString().size(); @@ -697,12 +697,12 @@ void FolderNavigationWidget::createNewFolder(const QModelIndex &parent) static const QString baseName = tr("New Folder"); // find non-existing name const QDir dir(m_fileSystemModel->filePath(parent)); - const QSet<Utils::FileName> existingItems + const QSet<Utils::FilePath> existingItems = Utils::transform<QSet>(dir.entryList({baseName + '*'}, QDir::AllEntries), [](const QString &entry) { - return Utils::FileName::fromString(entry); + return Utils::FilePath::fromString(entry); }); - const Utils::FileName name = Utils::makeUniquelyNumbered(Utils::FileName::fromString(baseName), + const Utils::FilePath name = Utils::makeUniquelyNumbered(Utils::FilePath::fromString(baseName), existingItems); // create directory and edit const QModelIndex index = m_sortProxyModel->mapFromSource( @@ -713,7 +713,7 @@ void FolderNavigationWidget::createNewFolder(const QModelIndex &parent) m_listView->edit(index); } -void FolderNavigationWidget::setCrumblePath(const Utils::FileName &filePath) +void FolderNavigationWidget::setCrumblePath(const Utils::FilePath &filePath) { const QModelIndex index = m_fileSystemModel->index(filePath.toString()); const int width = m_crumbLabel->width(); @@ -752,9 +752,9 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev) QAction *actionOpenAsProject = nullptr; QAction *newFolder = nullptr; const bool isDir = m_fileSystemModel->isDir(current); - const Utils::FileName filePath = hasCurrentItem ? Utils::FileName::fromString( + const Utils::FilePath filePath = hasCurrentItem ? Utils::FilePath::fromString( m_fileSystemModel->filePath(current)) - : Utils::FileName(); + : Utils::FilePath(); if (hasCurrentItem) { const QString fileName = m_fileSystemModel->fileName(current); if (isDir) { @@ -763,7 +763,7 @@ void FolderNavigationWidget::contextMenuEvent(QContextMenuEvent *ev) actionOpenProjects->setEnabled(false); } else { actionOpenFile = menu.addAction(tr("Open \"%1\"").arg(fileName)); - if (ProjectExplorerPlugin::isProjectFile(Utils::FileName::fromString(fileName))) + if (ProjectExplorerPlugin::isProjectFile(Utils::FilePath::fromString(fileName))) actionOpenAsProject = menu.addAction(tr("Open Project \"%1\"").arg(fileName)); } } @@ -866,12 +866,12 @@ FolderNavigationWidgetFactory::FolderNavigationWidgetFactory() insertRootDirectory({QLatin1String("A.Computer"), 0 /*sortValue*/, FolderNavigationWidget::tr("Computer"), - Utils::FileName(), + Utils::FilePath(), Icons::DESKTOP_DEVICE_SMALL.icon()}); insertRootDirectory({QLatin1String("A.Home"), 10 /*sortValue*/, FolderNavigationWidget::tr("Home"), - Utils::FileName::fromString(QDir::homePath()), + Utils::FilePath::fromString(QDir::homePath()), Utils::Icons::HOME.icon()}); updateProjectsDirectoryRoot(); connect(Core::DocumentManager::instance(), diff --git a/src/plugins/projectexplorer/foldernavigationwidget.h b/src/plugins/projectexplorer/foldernavigationwidget.h index b741de7cfe..b6268b66d6 100644 --- a/src/plugins/projectexplorer/foldernavigationwidget.h +++ b/src/plugins/projectexplorer/foldernavigationwidget.h @@ -63,7 +63,7 @@ public: QString id; int sortValue; QString displayName; - Utils::FileName path; + Utils::FilePath path; QIcon icon; }; @@ -119,17 +119,17 @@ protected: void contextMenuEvent(QContextMenuEvent *ev) override; private slots: - void setCrumblePath(const Utils::FileName &filePath); + void setCrumblePath(const Utils::FilePath &filePath); private: bool rootAutoSynchronization() const; void setRootAutoSynchronization(bool sync); void setHiddenFilesFilter(bool filter); - void selectBestRootForFile(const Utils::FileName &filePath); + void selectBestRootForFile(const Utils::FilePath &filePath); void handleCurrentEditorChanged(Core::IEditor *editor); - void selectFile(const Utils::FileName &filePath); - void setRootDirectory(const Utils::FileName &directory); - int bestRootForFile(const Utils::FileName &filePath); + void selectFile(const Utils::FilePath &filePath); + void setRootDirectory(const Utils::FilePath &directory); + int bestRootForFile(const Utils::FilePath &filePath); void openItem(const QModelIndex &index); QStringList projectsInDirectory(const QModelIndex &index) const; void openProjectsInDirectory(const QModelIndex &index); diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 6f18cf6c54..fff0606889 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -77,7 +77,7 @@ void GccParser::stdError(const QString &line) lne == QLatin1String("* cpp failed")) { newTask(Task(Task::Error, lne /* description */, - Utils::FileName() /* filename */, + Utils::FilePath() /* filename */, -1 /* linenumber */, Constants::TASK_CATEGORY_COMPILE)); return; @@ -93,7 +93,7 @@ void GccParser::stdError(const QString &line) } else if (description.startsWith(QLatin1String("fatal: "))) { description = description.mid(7); } - Task task(type, description, Utils::FileName(), /* filename */ + Task task(type, description, Utils::FilePath(), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE); newTask(task); return; @@ -101,7 +101,7 @@ void GccParser::stdError(const QString &line) match = m_regExp.match(lne); if (match.hasMatch()) { - Utils::FileName filename = Utils::FileName::fromUserInput(match.captured(1)); + Utils::FilePath filename = Utils::FilePath::fromUserInput(match.captured(1)); int lineno = match.captured(3).toInt(); Task::TaskType type = Task::Unknown; QString description = match.captured(8); @@ -125,7 +125,7 @@ void GccParser::stdError(const QString &line) if (match.hasMatch()) { newTask(Task(Task::Unknown, lne.trimmed() /* description */, - Utils::FileName::fromUserInput(match.captured(1)) /* filename */, + Utils::FilePath::fromUserInput(match.captured(1)) /* filename */, match.captured(3).toInt() /* linenumber */, Constants::TASK_CATEGORY_COMPILE)); return; @@ -230,15 +230,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In function `int main(int, char**)':"), - Utils::FileName::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), -1, categoryCompile) << Task(Task::Error, QLatin1String("`sfasdf' undeclared (first use this function)"), - Utils::FileName::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 9, + Utils::FilePath::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 9, categoryCompile) << Task(Task::Error, QLatin1String("(Each undeclared identifier is reported only once for each function it appears in.)"), - Utils::FileName::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 9, + Utils::FilePath::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 9, categoryCompile) ) << QString(); @@ -249,7 +249,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("inline function `QDebug qDebug()' used but never defined"), - Utils::FileName::fromUserInput(QLatin1String("/src/corelib/global/qglobal.h")), 1635, + Utils::FilePath::fromUserInput(QLatin1String("/src/corelib/global/qglobal.h")), 1635, categoryCompile)) << QString(); QTest::newRow("warning") @@ -258,7 +258,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << QString() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("Some warning"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 7, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 7, categoryCompile)) << QString(); QTest::newRow("GCCE #error") @@ -268,7 +268,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("#error Symbian error"), - Utils::FileName::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8\\main.cpp")), 7, + Utils::FilePath::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8\\main.cpp")), 7, categoryCompile)) << QString(); // Symbian reports #warning(s) twice (using different syntax). @@ -279,7 +279,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("#warning Symbian warning"), - Utils::FileName::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8\\main.cpp")), 8, + Utils::FilePath::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8\\main.cpp")), 8, categoryCompile)) << QString(); QTest::newRow("GCCE #warning2") @@ -289,7 +289,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("#warning Symbian warning"), - Utils::FileName::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 8, + Utils::FilePath::fromUserInput(QLatin1String("/temp/test/untitled8/main.cpp")), 8, categoryCompile)) << QString(); QTest::newRow("Undefined reference (debug)") @@ -301,15 +301,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In function `main':"), - Utils::FileName::fromUserInput(QLatin1String("main.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("main.o")), -1, categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), - Utils::FileName::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8/main.cpp")), 8, + Utils::FilePath::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8/main.cpp")), 8, categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -322,15 +322,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In function `main':"), - Utils::FileName::fromUserInput(QLatin1String("main.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("main.o")), -1, categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), - Utils::FileName::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("C:\\temp\\test\\untitled8/main.cpp")), -1, categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -341,7 +341,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("file not recognized: File format not recognized"), - Utils::FileName::fromUserInput(QLatin1String("c:\\Qt\\4.6\\lib/QtGuid4.dll")), -1, + Utils::FilePath::fromUserInput(QLatin1String("c:\\Qt\\4.6\\lib/QtGuid4.dll")), -1, categoryCompile)) << QString(); QTest::newRow("Invalid rpath") @@ -351,7 +351,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("/usr/local/lib: No such file or directory"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -364,15 +364,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In member function 'void Debugger::Internal::GdbEngine::handleBreakInsert2(const Debugger::Internal::GdbResponse&)':"), - Utils::FileName::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), -1, categoryCompile) << Task(Task::Warning, QLatin1String("unused variable 'index'"), - Utils::FileName::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), 2114, + Utils::FilePath::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), 2114, categoryCompile) << Task(Task::Warning, QLatin1String("unused variable 'handler'"), - Utils::FileName::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), 2115, + Utils::FilePath::fromUserInput(QLatin1String("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp")), 2115, categoryCompile)) << QString(); QTest::newRow("gnumakeparser.cpp errors") @@ -384,15 +384,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), -1, categoryCompile) << Task(Task::Error, QLatin1String("expected primary-expression before ':' token"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), 264, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), 264, categoryCompile) << Task(Task::Error, QLatin1String("expected ';' before ':' token"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), 264, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp")), 264, categoryCompile)) << QString(); QTest::newRow("distcc error(QTCREATORBUG-904)") @@ -410,7 +410,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Warning, QLatin1String("Core::IEditor* QVariant::value<Core::IEditor*>() const has different visibility (hidden) in .obj/debug-shared/openeditorsview.o and (default) in .obj/debug-shared/editormanager.o"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("ld fatal") @@ -420,7 +420,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Error, QLatin1String("Symbol referencing errors. No output written to testproject"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("Teambuilder issues") @@ -436,7 +436,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("initialized from here"), - Utils::FileName::fromUserInput(QLatin1String("/home/dev/creator/share/qtcreator/debugger/dumper.cpp")), 1079, + Utils::FilePath::fromUserInput(QLatin1String("/home/dev/creator/share/qtcreator/debugger/dumper.cpp")), 1079, categoryCompile)) << QString(); QTest::newRow("static member function") @@ -447,11 +447,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':"), - Utils::FileName::fromUserInput(QLatin1String("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c")), -1, categoryCompile) << Task(Task::Warning, QLatin1String("suggest explicit braces to avoid ambiguous 'else'"), - Utils::FileName::fromUserInput(QLatin1String("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c")), 194, + Utils::FilePath::fromUserInput(QLatin1String("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c")), 194, categoryCompile)) << QString(); QTest::newRow("rm false positive") @@ -467,7 +467,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Error, QLatin1String("cannot find -ldoesnotexist"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); QTest::newRow("In function") @@ -479,15 +479,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In function void foo(i) [with i = double]:"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 22, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 22, categoryCompile) << Task(Task::Warning, QLatin1String("unused variable c"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 8, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 8, categoryCompile)) << QString(); QTest::newRow("instanciated from here") @@ -497,7 +497,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("instantiated from here"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 10, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 10, categoryCompile)) << QString(); QTest::newRow("In constructor") @@ -507,7 +507,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In constructor 'Find::BaseTextFind::BaseTextFind(QTextEdit*)':"), - Utils::FileName::fromUserInput(QLatin1String("/dev/creator/src/plugins/find/basetextfind.h")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/dev/creator/src/plugins/find/basetextfind.h")), -1, categoryCompile)) << QString(); @@ -522,23 +522,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("At global scope:"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("In instantiation of void bar(i) [with i = double]:"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from void foo(i) [with i = double]"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 8, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 8, categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 22, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 22, categoryCompile) << Task(Task::Warning, QLatin1String("unused parameter v"), - Utils::FileName::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 5, + Utils::FilePath::fromUserInput(QLatin1String("../../scriptbug/main.cpp")), 5, categoryCompile)) << QString(); @@ -549,7 +549,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Error, QLatin1String("test.moc: No such file or directory"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/test.cpp")), 54, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/test.cpp")), 54, categoryCompile)) << QString(); @@ -563,19 +563,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In function `QPlotAxis':"), - Utils::FileName::fromUserInput(QLatin1String("debug/qplotaxis.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("debug/qplotaxis.o")), -1, categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `vtable for QPlotAxis'"), - Utils::FileName::fromUserInput(QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp")), 26, + Utils::FilePath::fromUserInput(QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp")), 26, categoryCompile) << Task(Task::Error, QLatin1String("undefined reference to `vtable for QPlotAxis'"), - Utils::FileName::fromUserInput(QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp")), 26, + Utils::FilePath::fromUserInput(QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp")), 26, categoryCompile) << Task(Task::Error, QLatin1String("collect2: ld returned 1 exit status"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile)) << QString(); @@ -590,23 +590,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator<Point>]:"), - Utils::FileName::fromUserInput(QLatin1String("../stl/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../stl/main.cpp")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), - Utils::FileName::fromUserInput(QLatin1String("../stl/main.cpp")), 38, + Utils::FilePath::fromUserInput(QLatin1String("../stl/main.cpp")), 38, categoryCompile) << Task(Task::Warning, QLatin1String("returning reference to temporary"), - Utils::FileName::fromUserInput(QLatin1String("../stl/main.cpp")), 31, + Utils::FilePath::fromUserInput(QLatin1String("../stl/main.cpp")), 31, categoryCompile) << Task(Task::Unknown, QLatin1String("At global scope:"), - Utils::FileName::fromUserInput(QLatin1String("../stl/main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../stl/main.cpp")), -1, categoryCompile) << Task(Task::Warning, QLatin1String("unused parameter index"), - Utils::FileName::fromUserInput(QLatin1String("../stl/main.cpp")), 31, + Utils::FilePath::fromUserInput(QLatin1String("../stl/main.cpp")), 31, categoryCompile)) << QString(); @@ -620,19 +620,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,"), - Utils::FileName::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.h")), 6792, + Utils::FilePath::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.h")), 6792, categoryCompile) << Task(Task::Unknown, QLatin1String("from C:/Symbian_SDK/epoc32/include/e32std.h:25,"), - Utils::FileName::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32std.h")), 25, + Utils::FilePath::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32std.h")), 25, categoryCompile) << Task(Task::Unknown, QLatin1String("In member function 'SSecureId::operator const TSecureId&() const':"), - Utils::FileName::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl")), -1, + Utils::FilePath::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl")), -1, categoryCompile) << Task(Task::Warning, QLatin1String("returning reference to temporary"), - Utils::FileName::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl")), 7094, + Utils::FilePath::fromUserInput(QLatin1String("C:/Symbian_SDK/epoc32/include/e32cmn.inl")), 7094, categoryCompile)) << QString(); @@ -643,7 +643,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("At top level:"), - Utils::FileName::fromUserInput(QLatin1String("../../../src/XmlUg/targetdelete.c")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../../src/XmlUg/targetdelete.c")), -1, categoryCompile)) << QString(); @@ -656,15 +656,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In file included from /Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h:15,"), - Utils::FileName::fromUserInput(QLatin1String("/Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h")), 15, + Utils::FilePath::fromUserInput(QLatin1String("/Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h")), 15, categoryCompile) << Task(Task::Unknown, QLatin1String("from <command line>:26:"), - Utils::FileName::fromUserInput(QLatin1String("<command line>")), 26, + Utils::FilePath::fromUserInput(QLatin1String("<command line>")), 26, categoryCompile) << Task(Task::Warning, QLatin1String("no newline at end of file"), - Utils::FileName::fromUserInput(QLatin1String("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh")), 1134, + Utils::FilePath::fromUserInput(QLatin1String("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh")), 1134, categoryCompile)) << QString(); @@ -675,7 +675,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Error, QLatin1String("undefined reference to `MainWindow::doSomething()'"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), -1, categoryCompile)) << QString(); @@ -687,11 +687,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':"), - Utils::FileName::fromUserInput(QLatin1String("../../../src/shared/proparser/profileevaluator.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("../../../src/shared/proparser/profileevaluator.cpp")), -1, categoryCompile) << Task(Task::Warning, QLatin1String("case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'"), - Utils::FileName::fromUserInput(QLatin1String("../../../src/shared/proparser/profileevaluator.cpp")), 2817, + Utils::FilePath::fromUserInput(QLatin1String("../../../src/shared/proparser/profileevaluator.cpp")), 2817, categoryCompile)) << QString(); @@ -703,11 +703,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In file included from <command-line>:0:0:"), - Utils::FileName::fromUserInput(QLatin1String("<command-line>")), 0, + Utils::FilePath::fromUserInput(QLatin1String("<command-line>")), 0, categoryCompile) << Task(Task::Warning, QLatin1String("\"STUPID_DEFINE\" redefined"), - Utils::FileName::fromUserInput(QLatin1String("./mw.h")), 4, + Utils::FilePath::fromUserInput(QLatin1String("./mw.h")), 4, categoryCompile)) << QString(); QTest::newRow("instanciation with line:column info") @@ -719,15 +719,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':"), - Utils::FileName::fromUserInput(QLatin1String("file.h")), -1, + Utils::FilePath::fromUserInput(QLatin1String("file.h")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("instantiated from here"), - Utils::FileName::fromUserInput(QLatin1String("file.cpp")), 87, + Utils::FilePath::fromUserInput(QLatin1String("file.cpp")), 87, categoryCompile) << Task(Task::Warning, QLatin1String("comparison between signed and unsigned integer expressions [-Wsign-compare]"), - Utils::FileName::fromUserInput(QLatin1String("file.h")), 21, + Utils::FilePath::fromUserInput(QLatin1String("file.h")), 21, categoryCompile)) << QString(); QTest::newRow("linker error") // QTCREATORBUG-3107 @@ -737,7 +737,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Error, QLatin1String("undefined reference to `CNS5kINSPacket::SOH_BYTE'"), - Utils::FileName::fromUserInput(QLatin1String("cns5k_ins_parser_tests.cpp")), -1, + Utils::FilePath::fromUserInput(QLatin1String("cns5k_ins_parser_tests.cpp")), -1, categoryCompile)) << QString(); @@ -748,7 +748,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Warning, QLatin1String("The name 'pushButton' (QPushButton) is already in use, defaulting to 'pushButton1'."), - Utils::FileName::fromUserInput(QLatin1String("mainwindow.ui")), -1, + Utils::FilePath::fromUserInput(QLatin1String("mainwindow.ui")), -1, Constants::TASK_CATEGORY_COMPILE)) << QString(); @@ -759,7 +759,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Warning, QLatin1String("warning: feupdateenv is not implemented and will always fail"), - Utils::FileName::fromUserInput(QLatin1String("libimf.so")), -1, + Utils::FilePath::fromUserInput(QLatin1String("libimf.so")), -1, Constants::TASK_CATEGORY_COMPILE)) << QString(); @@ -773,13 +773,13 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In file included from /home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp:31:0:"), - Utils::FileName::fromUserInput(QLatin1String("/home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp")), 31, + Utils::FilePath::fromUserInput(QLatin1String("/home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp")), 31, categoryCompile) << Task(Task::Error, QLatin1String("QtGui/QAction: No such file or directory\n" " #include <QtGui/QAction>\n" " ^"), - Utils::FileName::fromUserInput(QLatin1String(".uic/ui_pluginerrorview.h")), 14, + Utils::FilePath::fromUserInput(QLatin1String(".uic/ui_pluginerrorview.h")), 14, categoryCompile)) << QString(); @@ -794,23 +794,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << ( Tasks() << Task(Task::Unknown, QLatin1String("In file included from /usr/include/qt4/QtCore/QString:1:0,"), - Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/QString")), 1, + Utils::FilePath::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/QString")), 1, categoryCompile) << Task(Task::Unknown, QLatin1String("from main.cpp:3:"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 3, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 3, categoryCompile) << Task(Task::Unknown, QLatin1String("In function 'void foo()':"), - Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), -1, categoryCompile) << Task(Task::Error, QLatin1String("'QString::QString(const char*)' is private"), - Utils::FileName::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), 597, + Utils::FilePath::fromUserInput(QLatin1String("/usr/include/qt4/QtCore/qstring.h")), 597, categoryCompile) << Task(Task::Error, QLatin1String("within this context"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 7, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 7, categoryCompile)) << QString(); @@ -824,19 +824,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("In function `foo()':"), - Utils::FileName::fromUserInput(QLatin1String("foo.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("foo.o")), -1, categoryCompile) << Task(Task::Error, QLatin1String("multiple definition of `foo()'"), - Utils::FileName::fromUserInput(QLatin1String("/home/user/test/foo.cpp")), 2, + Utils::FilePath::fromUserInput(QLatin1String("/home/user/test/foo.cpp")), 2, categoryCompile) << Task(Task::Unknown, QLatin1String("first defined here"), - Utils::FileName::fromUserInput(QLatin1String("/home/user/test/bar.cpp")), 4, + Utils::FilePath::fromUserInput(QLatin1String("/home/user/test/bar.cpp")), 4, categoryCompile) << Task(Task::Error, QLatin1String("collect2: error: ld returned 1 exit status"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -850,15 +850,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("multiple definition of `foo'"), - Utils::FileName::fromUserInput(QLatin1String("foo.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("foo.o")), -1, categoryCompile) << Task(Task::Unknown, QLatin1String("first defined here"), - Utils::FileName::fromUserInput(QLatin1String("bar.o")), -1, + Utils::FilePath::fromUserInput(QLatin1String("bar.o")), -1, categoryCompile) << Task(Task::Error, QLatin1String("collect2: error: ld returned 1 exit status"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -870,7 +870,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("error: undefined reference to 'llvm::DisableABIBreakingChecks'"), - Utils::FileName::fromString("gtest-clang-printing.cpp"), -1, + Utils::FilePath::fromString("gtest-clang-printing.cpp"), -1, categoryCompile) ) << QString(); @@ -882,7 +882,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("file: lib/libtest.a(Test0.cpp.o) has no symbols"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -893,7 +893,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("file: lib/libtest.a(Test0.cpp.o) has no symbols"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryCompile) ) << QString(); @@ -904,7 +904,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("Note: No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, categoryCompile) ) << QString(); diff --git a/src/plugins/projectexplorer/gcctoolchain.cpp b/src/plugins/projectexplorer/gcctoolchain.cpp index f88a980cf5..a48b21fe7a 100644 --- a/src/plugins/projectexplorer/gcctoolchain.cpp +++ b/src/plugins/projectexplorer/gcctoolchain.cpp @@ -77,7 +77,7 @@ static const char supportedAbisKeyC[] = "ProjectExplorer.GccToolChain.SupportedA static const char parentToolChainIdKeyC[] = "ProjectExplorer.ClangToolChain.ParentToolChainId"; static const char binaryRegexp[] = "(?:^|-|\\b)(?:gcc|g\\+\\+|clang(?:\\+\\+)?)(?:-([\\d.]+))?$"; -static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, const QStringList &env) +static QByteArray runGcc(const FilePath &gcc, const QStringList &arguments, const QStringList &env) { if (gcc.isEmpty() || !gcc.toFileInfo().isExecutable()) return QByteArray(); @@ -98,7 +98,7 @@ static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, cons return response.allOutput().toUtf8(); } -static ProjectExplorer::Macros gccPredefinedMacros(const FileName &gcc, +static ProjectExplorer::Macros gccPredefinedMacros(const FilePath &gcc, const QStringList &args, const QStringList &env) { @@ -124,7 +124,7 @@ static ProjectExplorer::Macros gccPredefinedMacros(const FileName &gcc, return predefinedMacros; } -HeaderPaths GccToolChain::gccHeaderPaths(const FileName &gcc, const QStringList &arguments, +HeaderPaths GccToolChain::gccHeaderPaths(const FilePath &gcc, const QStringList &arguments, const QStringList &env) { HeaderPaths builtInHeaderPaths; @@ -207,7 +207,7 @@ static Abis guessGccAbi(const QString &m, const ProjectExplorer::Macros ¯os) } -static GccToolChain::DetectedAbisResult guessGccAbi(const FileName &path, const QStringList &env, +static GccToolChain::DetectedAbisResult guessGccAbi(const FilePath &path, const QStringList &env, const ProjectExplorer::Macros ¯os, const QStringList &extraArgs = QStringList()) { @@ -222,7 +222,7 @@ static GccToolChain::DetectedAbisResult guessGccAbi(const FileName &path, const return GccToolChain::DetectedAbisResult(guessGccAbi(machine, macros), machine); } -static QString gccVersion(const FileName &path, const QStringList &env) +static QString gccVersion(const FilePath &path, const QStringList &env) { QStringList arguments("-dumpversion"); return QString::fromLocal8Bit(runGcc(path, arguments, env)).trimmed(); @@ -240,7 +240,7 @@ GccToolChain::GccToolChain(Core::Id typeId) : ToolChain(typeId) { } -void GccToolChain::setCompilerCommand(const FileName &path) +void GccToolChain::setCompilerCommand(const FilePath &path) { if (path == m_compilerCommand) return; @@ -341,7 +341,7 @@ static bool isNetworkCompiler(const QString &dirPath) return dirPath.contains("icecc") || dirPath.contains("distcc"); } -static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath, +static Utils::FilePath findLocalCompiler(const Utils::FilePath &compilerPath, const Environment &env) { // Find the "real" compiler if icecc, distcc or similar are in use. Ignore ccache, since that @@ -353,13 +353,13 @@ static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath, return compilerPath; // Filter out network compilers - const FileNameList pathComponents = Utils::filtered(env.path(), [] (const FileName &dirPath) { + const FilePathList pathComponents = Utils::filtered(env.path(), [] (const FilePath &dirPath) { return !isNetworkCompiler(dirPath.toString()); }); // This effectively searches the PATH twice, once via pathComponents and once via PATH itself: // searchInPath filters duplicates, so that will not hurt. - const Utils::FileName path = env.searchInPath(compilerPath.fileName(), pathComponents); + const Utils::FilePath path = env.searchInPath(compilerPath.fileName(), pathComponents); return path.isEmpty() ? compilerPath : path; } @@ -369,7 +369,7 @@ ToolChain::MacroInspectionRunner GccToolChain::createMacroInspectionRunner() con // Using a clean environment breaks ccache/distcc/etc. Environment env = Environment::systemEnvironment(); addToEnvironment(env); - const Utils::FileName compilerCommand = m_compilerCommand; + const Utils::FilePath compilerCommand = m_compilerCommand; const QStringList platformCodeGenFlags = m_platformCodeGenFlags; OptionsReinterpreter reinterpretOptions = m_optionsReinterpreter; QTC_CHECK(reinterpretOptions); @@ -561,7 +561,7 @@ void GccToolChain::initExtraHeaderPathsFunction(ExtraHeaderPathsFunction &&extra } HeaderPaths GccToolChain::builtInHeaderPaths(const Utils::Environment &env, - const Utils::FileName &compilerCommand, + const Utils::FilePath &compilerCommand, const QStringList &platformCodeGenFlags, OptionsReinterpreter reinterpretOptions, HeaderPathsCache headerCache, @@ -631,7 +631,7 @@ ToolChain::BuiltInHeaderPathsRunner GccToolChain::createBuiltInHeaderPathsRunner } HeaderPaths GccToolChain::builtInHeaderPaths(const QStringList &flags, - const FileName &sysRootPath) const + const FilePath &sysRootPath) const { return createBuiltInHeaderPathsRunner()(flags, sysRootPath.isEmpty() ? sysRoot() @@ -639,9 +639,9 @@ HeaderPaths GccToolChain::builtInHeaderPaths(const QStringList &flags, originalTargetTriple()); } -void GccToolChain::addCommandPathToEnvironment(const FileName &command, Environment &env) +void GccToolChain::addCommandPathToEnvironment(const FilePath &command, Environment &env) { - const Utils::FileName compilerDir = command.parentDir(); + const Utils::FilePath compilerDir = command.parentDir(); if (!compilerDir.isEmpty()) env.prependOrSetPath(compilerDir.toString()); } @@ -692,10 +692,10 @@ QStringList GccToolChain::suggestedMkspecList() const return {}; } -FileName GccToolChain::makeCommand(const Environment &environment) const +FilePath GccToolChain::makeCommand(const Environment &environment) const { - const FileName tmp = environment.searchInPath("make"); - return tmp.isEmpty() ? FileName::fromString("make") : tmp; + const FilePath tmp = environment.searchInPath("make"); + return tmp.isEmpty() ? FilePath::fromString("make") : tmp; } IOutputParser *GccToolChain::outputParser() const @@ -703,7 +703,7 @@ IOutputParser *GccToolChain::outputParser() const return new GccParser; } -void GccToolChain::resetToolChain(const FileName &path) +void GccToolChain::resetToolChain(const FilePath &path) { bool resetDisplayName = (displayName() == defaultDisplayName()); @@ -728,7 +728,7 @@ void GccToolChain::resetToolChain(const FileName &path) toolChainUpdated(); } -FileName GccToolChain::compilerCommand() const +FilePath GccToolChain::compilerCommand() const { return m_compilerCommand; } @@ -789,7 +789,7 @@ bool GccToolChain::fromMap(const QVariantMap &data) if (!ToolChain::fromMap(data)) return false; - m_compilerCommand = FileName::fromString(data.value(compilerCommandKeyC).toString()); + m_compilerCommand = FilePath::fromString(data.value(compilerCommandKeyC).toString()); m_platformCodeGenFlags = data.value(compilerPlatformCodeGenFlagsKeyC).toStringList(); m_platformLinkerFlags = data.value(compilerPlatformLinkerFlagsKeyC).toStringList(); const QString targetAbiString = data.value(targetAbiKeyC).toString(); @@ -887,7 +887,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetect(const QList<ToolChain *> &alr return tcs; } -QList<ToolChain *> GccToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> GccToolChainFactory::autoDetect(const FilePath &compilerPath, const Core::Id &language) { const QString fileName = compilerPath.fileName(); if ((language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc") @@ -905,14 +905,14 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains( const Core::Id requiredTypeId, const QList<ToolChain *> &alreadyKnown, const ToolchainChecker &checker) { - FileNameList compilerPaths; + FilePathList compilerPaths; QFileInfo fi(compilerName); if (fi.isAbsolute()) { if (fi.isFile()) - compilerPaths << FileName::fromString(compilerName); + compilerPaths << FilePath::fromString(compilerName); } else { - const FileNameList searchPaths = Environment::systemEnvironment().path(); - for (const FileName &dir : searchPaths) { + const FilePathList searchPaths = Environment::systemEnvironment().path(); + for (const FilePath &dir : searchPaths) { static const QRegularExpression regexp(binaryRegexp); QDir binDir(dir.toString()); QStringList nameFilters(compilerName); @@ -935,7 +935,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains( !regexp.match(QFileInfo(fileName).completeBaseName()).hasMatch()) { continue; } - compilerPaths << FileName::fromString(binDir.filePath(fileName)); + compilerPaths << FilePath::fromString(binDir.filePath(fileName)); } } } @@ -951,7 +951,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains( return true; }); QList<ToolChain *> result; - for (const FileName &compilerPath : compilerPaths) { + for (const FilePath &compilerPath : compilerPaths) { bool alreadyExists = false; for (ToolChain * const existingTc : existingCandidates) { // We have a match if the existing toolchain ultimately refers to the same file @@ -960,7 +960,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains( // - clang++ is often a soft link to clang, but behaves differently. // - ccache and icecc also create soft links that must not be followed here. bool existingTcMatches = false; - const FileName existingCommand = existingTc->compilerCommand(); + const FilePath existingCommand = existingTc->compilerCommand(); if ((requiredTypeId == Constants::CLANG_TOOLCHAIN_TYPEID && language == Constants::CXX_LANGUAGE_ID && !existingCommand.fileName().contains("clang++")) @@ -990,7 +990,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains( return result; } -QList<ToolChain *> GccToolChainFactory::autoDetectToolChain(const FileName &compilerPath, +QList<ToolChain *> GccToolChainFactory::autoDetectToolChain(const FilePath &compilerPath, const Core::Id language, const ToolchainChecker &checker) { @@ -998,7 +998,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolChain(const FileName &comp Environment systemEnvironment = Environment::systemEnvironment(); GccToolChain::addCommandPathToEnvironment(compilerPath, systemEnvironment); - const FileName localCompilerPath = findLocalCompiler(compilerPath, systemEnvironment); + const FilePath localCompilerPath = findLocalCompiler(compilerPath, systemEnvironment); Macros macros = gccPredefinedMacros(localCompilerPath, gccPredefinedMacrosOptions(language), systemEnvironment.toStringList()); @@ -1154,7 +1154,7 @@ void GccToolChainConfigWidget::handleCompilerCommandChange() bool haveCompiler = false; Abi currentAbi = m_abiWidget->currentAbi(); bool customAbi = m_abiWidget->isCustomAbi() && m_abiWidget->isEnabled(); - FileName path = m_compilerCommand->fileName(); + FilePath path = m_compilerCommand->fileName(); Abis abiList; if (!path.isEmpty()) { @@ -1166,7 +1166,7 @@ void GccToolChainConfigWidget::handleCompilerCommandChange() GccToolChain::addCommandPathToEnvironment(path, env); QStringList args = gccPredefinedMacrosOptions(Constants::CXX_LANGUAGE_ID) + splitString(m_platformCodeGenFlagsLineEdit->text()); - const FileName localCompilerPath = findLocalCompiler(path, env); + const FilePath localCompilerPath = findLocalCompiler(path, env); m_macros = gccPredefinedMacros(localCompilerPath, args, env.toStringList()); abiList = guessGccAbi(localCompilerPath, env.toStringList(), m_macros, splitString(m_platformCodeGenFlagsLineEdit->text())).supportedAbis; @@ -1287,18 +1287,18 @@ QString ClangToolChain::typeDisplayName() const return ClangToolChainFactory::tr("Clang"); } -FileName ClangToolChain::makeCommand(const Environment &environment) const +FilePath ClangToolChain::makeCommand(const Environment &environment) const { const QStringList makes = HostOsInfo::isWindowsHost() ? QStringList({"mingw32-make.exe", "make.exe"}) : QStringList({"make"}); - FileName tmp; + FilePath tmp; for (const QString &make : makes) { tmp = environment.searchInPath(make); if (!tmp.isEmpty()) return tmp; } - return FileName::fromString(makes.first()); + return FilePath::fromString(makes.first()); } /** @@ -1367,7 +1367,7 @@ QString ClangToolChain::sysRoot() const if (!parentTC) return QString(); - const FileName mingwCompiler = parentTC->compilerCommand(); + const FilePath mingwCompiler = parentTC->compilerCommand(); return mingwCompiler.parentDir().parentDir().toString(); } @@ -1455,9 +1455,9 @@ QList<ToolChain *> ClangToolChainFactory::autoDetect(const QList<ToolChain *> &a Constants::CLANG_TOOLCHAIN_TYPEID, alreadyKnown)); known.append(tcs); - const FileName compilerPath = FileName::fromString(Core::ICore::clangExecutable(CLANG_BINDIR)); + const FilePath compilerPath = FilePath::fromString(Core::ICore::clangExecutable(CLANG_BINDIR)); if (!compilerPath.isEmpty()) { - const FileName clang = compilerPath.parentDir().pathAppended( + const FilePath clang = compilerPath.parentDir().pathAppended( HostOsInfo::withExecutableSuffix("clang")); tcs.append(autoDetectToolchains(clang.toString(), DetectVariants::No, Constants::C_LANGUAGE_ID, Constants::CLANG_TOOLCHAIN_TYPEID, @@ -1467,7 +1467,7 @@ QList<ToolChain *> ClangToolChainFactory::autoDetect(const QList<ToolChain *> &a return tcs; } -QList<ToolChain *> ClangToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> ClangToolChainFactory::autoDetect(const FilePath &compilerPath, const Core::Id &language) { const QString fileName = compilerPath.fileName(); if ((language == Constants::C_LANGUAGE_ID && fileName.startsWith("clang") && !fileName.startsWith("clang++")) @@ -1613,18 +1613,18 @@ QStringList MingwToolChain::suggestedMkspecList() const return {}; } -FileName MingwToolChain::makeCommand(const Environment &environment) const +FilePath MingwToolChain::makeCommand(const Environment &environment) const { const QStringList makes = HostOsInfo::isWindowsHost() ? QStringList({"mingw32-make.exe", "make.exe"}) : QStringList({"make"}); - FileName tmp; + FilePath tmp; foreach (const QString &make, makes) { tmp = environment.searchInPath(make); if (!tmp.isEmpty()) return tmp; } - return FileName::fromString(makes.first()); + return FilePath::fromString(makes.first()); } // -------------------------------------------------------------------------- @@ -1654,7 +1654,7 @@ QList<ToolChain *> MingwToolChainFactory::autoDetect(const QList<ToolChain *> &a return result; } -QList<ToolChain *> MingwToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> MingwToolChainFactory::autoDetect(const FilePath &compilerPath, const Core::Id &language) { const QString fileName = compilerPath.fileName(); if ((language == Constants::C_LANGUAGE_ID && (fileName.startsWith("gcc") @@ -1734,7 +1734,7 @@ QList<ToolChain *> LinuxIccToolChainFactory::autoDetect(const QList<ToolChain *> return result; } -QList<ToolChain *> LinuxIccToolChainFactory::autoDetect(const FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> LinuxIccToolChainFactory::autoDetect(const FilePath &compilerPath, const Core::Id &language) { const QString fileName = compilerPath.fileName(); if ((language == Constants::CXX_LANGUAGE_ID && fileName.startsWith("icpc")) || diff --git a/src/plugins/projectexplorer/gcctoolchain.h b/src/plugins/projectexplorer/gcctoolchain.h index 695a322608..240ae34247 100644 --- a/src/plugins/projectexplorer/gcctoolchain.h +++ b/src/plugins/projectexplorer/gcctoolchain.h @@ -85,10 +85,10 @@ public: BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override; HeaderPaths builtInHeaderPaths(const QStringList &flags, - const Utils::FileName &sysRootPath) const override; + const Utils::FilePath &sysRootPath) const override; void addToEnvironment(Utils::Environment &env) const override; - Utils::FileName makeCommand(const Utils::Environment &environment) const override; + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; QStringList suggestedMkspecList() const override; IOutputParser *outputParser() const override; @@ -99,15 +99,15 @@ public: bool operator ==(const ToolChain &) const override; - void resetToolChain(const Utils::FileName &); - Utils::FileName compilerCommand() const override; + void resetToolChain(const Utils::FilePath &); + Utils::FilePath compilerCommand() const override; void setPlatformCodeGenFlags(const QStringList &); QStringList extraCodeModelFlags() const override; QStringList platformCodeGenFlags() const; void setPlatformLinkerFlags(const QStringList &); QStringList platformLinkerFlags() const; - static void addCommandPathToEnvironment(const Utils::FileName &command, Utils::Environment &env); + static void addCommandPathToEnvironment(const Utils::FilePath &command, Utils::Environment &env); class DetectedAbisResult { public: @@ -125,7 +125,7 @@ protected: using CacheItem = QPair<QStringList, Macros>; using GccCache = QVector<CacheItem>; - void setCompilerCommand(const Utils::FileName &path); + void setCompilerCommand(const Utils::FilePath &path); void setSupportedAbis(const Abis &abis); void setOriginalTargetTriple(const QString &targetTriple); void setMacroCache(const QStringList &allCxxflags, const Macros ¯oCache) const; @@ -146,7 +146,7 @@ protected: void initExtraHeaderPathsFunction(ExtraHeaderPathsFunction &&extraHeaderPathsFunction) const; static HeaderPaths builtInHeaderPaths(const Utils::Environment &env, - const Utils::FileName &compilerCommand, + const Utils::FilePath &compilerCommand, const QStringList &platformCodeGenFlags, OptionsReinterpreter reinterpretOptions, HeaderPathsCache headerCache, @@ -156,7 +156,7 @@ protected: const QString &sysRoot, const QString &originalTargetTriple); - static HeaderPaths gccHeaderPaths(const Utils::FileName &gcc, const QStringList &args, + static HeaderPaths gccHeaderPaths(const Utils::FilePath &gcc, const QStringList &args, const QStringList &env); class WarningFlagAdder @@ -184,7 +184,7 @@ private: OptionsReinterpreter reinterpretOptions); protected: - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; QStringList m_platformCodeGenFlags; QStringList m_platformLinkerFlags; @@ -215,7 +215,7 @@ public: ~ClangToolChain() override; QString typeDisplayName() const override; - Utils::FileName makeCommand(const Utils::Environment &environment) const override; + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; WarningFlags warningFlags(const QStringList &cflags) const override; @@ -257,7 +257,7 @@ class PROJECTEXPLORER_EXPORT MingwToolChain : public GccToolChain { public: QString typeDisplayName() const override; - Utils::FileName makeCommand(const Utils::Environment &environment) const override; + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; QStringList suggestedMkspecList() const override; diff --git a/src/plugins/projectexplorer/gcctoolchainfactories.h b/src/plugins/projectexplorer/gcctoolchainfactories.h index 90d76ea734..e33ebcaa03 100644 --- a/src/plugins/projectexplorer/gcctoolchainfactories.h +++ b/src/plugins/projectexplorer/gcctoolchainfactories.h @@ -55,7 +55,7 @@ public: GccToolChainFactory(); QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override; - QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) override; + QList<ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) override; protected: enum class DetectVariants { Yes, No }; @@ -65,7 +65,7 @@ protected: const Core::Id requiredTypeId, const QList<ToolChain *> &alreadyKnown, const ToolchainChecker &checker = {}); QList<ToolChain *> autoDetectToolChain( - const Utils::FileName &compilerPath, const Core::Id language, + const Utils::FilePath &compilerPath, const Core::Id language, const ToolchainChecker &checker = {}); }; @@ -138,7 +138,7 @@ public: ClangToolChainFactory(); QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override; - QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final; + QList<ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) final; }; // -------------------------------------------------------------------------- @@ -153,7 +153,7 @@ public: MingwToolChainFactory(); QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override; - QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final; + QList<ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) final; }; // -------------------------------------------------------------------------- @@ -168,7 +168,7 @@ public: LinuxIccToolChainFactory(); QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown) override; - QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) final; + QList<ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) final; }; } // namespace Internal diff --git a/src/plugins/projectexplorer/gnumakeparser.cpp b/src/plugins/projectexplorer/gnumakeparser.cpp index 12eb8823b3..dc14301117 100644 --- a/src/plugins/projectexplorer/gnumakeparser.cpp +++ b/src/plugins/projectexplorer/gnumakeparser.cpp @@ -133,7 +133,7 @@ void GnuMakeParser::stdError(const QString &line) ++m_fatalErrorCount; if (!m_suppressIssues) { taskAdded(Task(res.type, res.description, - Utils::FileName::fromUserInput(match.captured(1)) /* filename */, + Utils::FilePath::fromUserInput(match.captured(1)) /* filename */, match.captured(4).toInt(), /* line */ Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)), 1, 0); } @@ -147,7 +147,7 @@ void GnuMakeParser::stdError(const QString &line) ++m_fatalErrorCount; if (!m_suppressIssues) { Task task = Task(res.type, res.description, - Utils::FileName() /* filename */, -1, /* line */ + Utils::FilePath() /* filename */, -1, /* line */ Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); taskAdded(task, 1, 0); } @@ -190,7 +190,7 @@ void GnuMakeParser::taskAdded(const Task &task, int linkedLines, int skippedLine } } if (possibleFiles.size() == 1) - editable.file = Utils::FileName::fromFileInfo(possibleFiles.first()); + editable.file = Utils::FilePath::fromFileInfo(possibleFiles.first()); // Let the Makestep apply additional heuristics (based on // files in ther project) if we cannot uniquely // identify the file! @@ -297,7 +297,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("No rule to make target `hello.c', needed by `hello.o'. Stop."), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -311,7 +311,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("[.obj/debug-shared/gnumakeparser.o] Error 1"), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -323,7 +323,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("missing separator (did you mean TAB instead of 8 spaces?). Stop."), - Utils::FileName::fromUserInput(QLatin1String("Makefile")), 360, + Utils::FilePath::fromUserInput(QLatin1String("Makefile")), 360, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -336,7 +336,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("[debug/qplotaxis.o] Error 1"), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -348,7 +348,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("[dynlib.inst] Error -1073741819"), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -360,7 +360,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Warning, QString::fromLatin1("jobserver unavailable: using -j1. Add `+' to parent make rule."), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -380,7 +380,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("[sis] Error 2"), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -392,7 +392,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Error, QString::fromLatin1("g++: Command not found"), - Utils::FileName(), -1, + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -404,7 +404,7 @@ void ProjectExplorerPlugin::testGnuMakeParserParsing_data() << (Tasks() << Task(Task::Warning, QString::fromLatin1("overriding commands for target `xxxx.app/Contents/Info.plist'"), - Utils::FileName::fromString(QLatin1String("Makefile")), 794, + Utils::FilePath::fromString(QLatin1String("Makefile")), 794, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))) << QString() << QStringList(); @@ -467,12 +467,12 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() << QStringList() << Task(Task::Error, QLatin1String("no filename, no mangling"), - Utils::FileName(), + Utils::FilePath(), -1, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Error, QLatin1String("no filename, no mangling"), - Utils::FileName(), + Utils::FilePath(), -1, Constants::TASK_CATEGORY_COMPILE); QTest::newRow("no mangling") @@ -480,12 +480,12 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() << QStringList() << Task(Task::Error, QLatin1String("unknown filename, no mangling"), - Utils::FileName::fromUserInput(QLatin1String("some/path/unknown.cpp")), + Utils::FilePath::fromUserInput(QLatin1String("some/path/unknown.cpp")), -1, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Error, QLatin1String("unknown filename, no mangling"), - Utils::FileName::fromUserInput(QLatin1String("some/path/unknown.cpp")), + Utils::FilePath::fromUserInput(QLatin1String("some/path/unknown.cpp")), -1, Constants::TASK_CATEGORY_COMPILE); QTest::newRow("find file") @@ -493,12 +493,12 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data() << QStringList("test") << Task(Task::Error, QLatin1String("mangling"), - Utils::FileName::fromUserInput(QLatin1String("file.cpp")), + Utils::FilePath::fromUserInput(QLatin1String("file.cpp")), 10, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Error, QLatin1String("mangling"), - Utils::FileName::fromUserInput(QLatin1String("$TMPDIR/test/file.cpp")), + Utils::FilePath::fromUserInput(QLatin1String("$TMPDIR/test/file.cpp")), 10, Constants::TASK_CATEGORY_COMPILE); } @@ -541,7 +541,7 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling() // fix up output task file: QString filePath = outputTask.file.toString(); if (filePath.startsWith(QLatin1String("$TMPDIR/"))) - outputTask.file = Utils::FileName::fromString(filePath.replace(QLatin1String("$TMPDIR/"), tempdir)); + outputTask.file = Utils::FilePath::fromString(filePath.replace(QLatin1String("$TMPDIR/"), tempdir)); // test mangling: testbench.testTaskMangling(inputTask, outputTask); diff --git a/src/plugins/projectexplorer/importwidget.cpp b/src/plugins/projectexplorer/importwidget.cpp index d9bd629179..369e59b60b 100644 --- a/src/plugins/projectexplorer/importwidget.cpp +++ b/src/plugins/projectexplorer/importwidget.cpp @@ -64,7 +64,7 @@ ImportWidget::ImportWidget(QWidget *parent) : detailsWidget->setWidget(widget); } -void ImportWidget::setCurrentDirectory(const Utils::FileName &dir) +void ImportWidget::setCurrentDirectory(const Utils::FilePath &dir) { m_pathChooser->setBaseFileName(dir); m_pathChooser->setFileName(dir); @@ -72,7 +72,7 @@ void ImportWidget::setCurrentDirectory(const Utils::FileName &dir) void ImportWidget::handleImportRequest() { - Utils::FileName dir = m_pathChooser->fileName(); + Utils::FilePath dir = m_pathChooser->fileName(); emit importFrom(dir); m_pathChooser->setFileName(m_pathChooser->baseFileName()); diff --git a/src/plugins/projectexplorer/importwidget.h b/src/plugins/projectexplorer/importwidget.h index 9a55f64e1b..b9ecdd16ac 100644 --- a/src/plugins/projectexplorer/importwidget.h +++ b/src/plugins/projectexplorer/importwidget.h @@ -29,7 +29,7 @@ namespace Utils { class PathChooser; -class FileName; +class FilePath; } // namespace Utils namespace ProjectExplorer { @@ -42,10 +42,10 @@ class ImportWidget : public QWidget public: explicit ImportWidget(QWidget *parent = nullptr); - void setCurrentDirectory(const Utils::FileName &dir); + void setCurrentDirectory(const Utils::FilePath &dir); signals: - void importFrom(const Utils::FileName &dir); + void importFrom(const Utils::FilePath &dir); private: void handleImportRequest(); diff --git a/src/plugins/projectexplorer/ioutputparser.cpp b/src/plugins/projectexplorer/ioutputparser.cpp index 112bac4a22..8dd6d99264 100644 --- a/src/plugins/projectexplorer/ioutputparser.cpp +++ b/src/plugins/projectexplorer/ioutputparser.cpp @@ -207,7 +207,7 @@ void IOutputParser::setWorkingDirectory(const QString &workingDirectory) m_parser->setWorkingDirectory(workingDirectory); } -void IOutputParser::setWorkingDirectory(const Utils::FileName &fn) +void IOutputParser::setWorkingDirectory(const Utils::FilePath &fn) { setWorkingDirectory(fn.toString()); } diff --git a/src/plugins/projectexplorer/ioutputparser.h b/src/plugins/projectexplorer/ioutputparser.h index 91fbc4c30d..1872461cbb 100644 --- a/src/plugins/projectexplorer/ioutputparser.h +++ b/src/plugins/projectexplorer/ioutputparser.h @@ -53,7 +53,7 @@ public: virtual bool hasFatalErrors() const; virtual void setWorkingDirectory(const QString &workingDirectory); - void setWorkingDirectory(const Utils::FileName &fn); + void setWorkingDirectory(const Utils::FilePath &fn); void flush(); // flush out pending tasks diff --git a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp index 5faa5c3642..7501521be7 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonkitspage.cpp @@ -107,7 +107,7 @@ void JsonKitsPage::setupProjectFiles(const JsonWizard::GeneratorFiles &files) const QFileInfo fi(f.file.path()); const QString path = fi.absoluteFilePath(); Project *project = ProjectManager::openProject(Utils::mimeTypeForFile(fi), - Utils::FileName::fromString(path)); + Utils::FilePath::fromString(path)); if (project) { if (setupProject(project)) project->saveSettings(); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp index 45f332a2de..fcddd7ffd8 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonprojectpage.cpp @@ -52,7 +52,7 @@ bool JsonProjectPage::validatePage() { if (isComplete() && useAsDefaultPath()) { // Store the path as default path for new projects if desired. - Core::DocumentManager::setProjectsDirectory(Utils::FileName::fromString(path())); + Core::DocumentManager::setProjectsDirectory(Utils::FilePath::fromString(path())); Core::DocumentManager::setUseProjectsDirectory(true); } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp index 6939d0863e..a1d9c7d6f0 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizard.cpp @@ -503,7 +503,7 @@ void JsonWizard::openProjectForNode(Node *node) QTC_ASSERT(projNode, return); - Utils::optional<FileName> projFilePath = projNode->visibleAfterAddFileAction(); + Utils::optional<FilePath> projFilePath = projNode->visibleAfterAddFileAction(); if (projFilePath && !Core::EditorManager::openEditor(projFilePath.value().toString())) { auto errorMessage = QCoreApplication::translate("ProjectExplorer::JsonWizard", diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp index 6acc26a10e..530ace9ca7 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.cpp @@ -211,7 +211,7 @@ QList<Core::IWizardFactory *> JsonWizardFactory::createWizardFactories() const QString wizardFileName = QLatin1String(WIZARD_FILE); QList <Core::IWizardFactory *> result; - foreach (const Utils::FileName &path, searchPaths()) { + foreach (const Utils::FilePath &path, searchPaths()) { if (path.isEmpty()) continue; @@ -334,20 +334,20 @@ static QStringList environmentTemplatesPaths() return paths; } -Utils::FileNameList &JsonWizardFactory::searchPaths() +Utils::FilePathList &JsonWizardFactory::searchPaths() { - static Utils::FileNameList m_searchPaths = Utils::FileNameList() - << Utils::FileName::fromString(Core::ICore::userResourcePath() + QLatin1Char('/') + + static Utils::FilePathList m_searchPaths = Utils::FilePathList() + << Utils::FilePath::fromString(Core::ICore::userResourcePath() + QLatin1Char('/') + QLatin1String(WIZARD_PATH)) - << Utils::FileName::fromString(Core::ICore::resourcePath() + QLatin1Char('/') + + << Utils::FilePath::fromString(Core::ICore::resourcePath() + QLatin1Char('/') + QLatin1String(WIZARD_PATH)); for (const QString &environmentTemplateDirName : environmentTemplatesPaths()) - m_searchPaths << Utils::FileName::fromString(environmentTemplateDirName); + m_searchPaths << Utils::FilePath::fromString(environmentTemplateDirName); return m_searchPaths; } -void JsonWizardFactory::addWizardPath(const Utils::FileName &path) +void JsonWizardFactory::addWizardPath(const Utils::FilePath &path) { searchPaths().append(path); } diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h index 06af1ebae8..5573bb2979 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardfactory.h @@ -55,7 +55,7 @@ class PROJECTEXPLORER_EXPORT JsonWizardFactory : public Core::IWizardFactory public: // Add search paths for wizard.json files. All subdirs are going to be checked. - static void addWizardPath(const Utils::FileName &path); + static void addWizardPath(const Utils::FilePath &path); // actual interface of the wizard factory: class Generator { @@ -96,7 +96,7 @@ private: static QList<IWizardFactory *> createWizardFactories(); static JsonWizardFactory *createWizardFactory(const QVariantMap &data, const QDir &baseDir, QString *errorMessage); - static Utils::FileNameList &searchPaths(); + static Utils::FilePathList &searchPaths(); static void setVerbose(int level); static int verbose(); diff --git a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp index e0a06c824e..cf84f8b5e4 100644 --- a/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp +++ b/src/plugins/projectexplorer/jsonwizard/jsonwizardgeneratorfactory.cpp @@ -98,7 +98,7 @@ bool JsonWizardGenerator::formatFile(const JsonWizard *wizard, GeneratedFile *fi Indenter *indenter = nullptr; if (factory) { indenter = factory->createIndenter(&doc); - indenter->setFileName(Utils::FileName::fromString(file->path())); + indenter->setFileName(Utils::FilePath::fromString(file->path())); } if (!indenter) indenter = new NormalIndenter(&doc); diff --git a/src/plugins/projectexplorer/kit.cpp b/src/plugins/projectexplorer/kit.cpp index 670c2eb801..7f58bf4a13 100644 --- a/src/plugins/projectexplorer/kit.cpp +++ b/src/plugins/projectexplorer/kit.cpp @@ -123,7 +123,7 @@ public: bool m_hasValidityInfo = false; bool m_mustNotify = false; QIcon m_cachedIcon; - FileName m_iconPath; + FilePath m_iconPath; Id m_deviceTypeForIcon; QHash<Id, QVariant> m_data; @@ -162,7 +162,7 @@ Kit::Kit(const QVariantMap &data) : d->m_unexpandedDisplayName = data.value(QLatin1String(DISPLAYNAME_KEY), d->m_unexpandedDisplayName).toString(); d->m_fileSystemFriendlyName = data.value(QLatin1String(FILESYSTEMFRIENDLYNAME_KEY)).toString(); - d->m_iconPath = FileName::fromString(data.value(QLatin1String(ICON_KEY), + d->m_iconPath = FilePath::fromString(data.value(QLatin1String(ICON_KEY), d->m_iconPath.toString()).toString()); d->m_deviceTypeForIcon = Id::fromSetting(data.value(DEVICE_TYPE_FOR_ICON_KEY)); const auto it = data.constFind(IRRELEVANT_ASPECTS_KEY); @@ -400,12 +400,12 @@ QIcon Kit::icon() const return d->m_cachedIcon; } -FileName Kit::iconPath() const +FilePath Kit::iconPath() const { return d->m_iconPath; } -void Kit::setIconPath(const FileName &path) +void Kit::setIconPath(const FilePath &path) { if (d->m_iconPath == path) return; diff --git a/src/plugins/projectexplorer/kit.h b/src/plugins/projectexplorer/kit.h index 935db0aa8b..9f0fc91623 100644 --- a/src/plugins/projectexplorer/kit.h +++ b/src/plugins/projectexplorer/kit.h @@ -97,8 +97,8 @@ public: int weight() const; QIcon icon() const; - Utils::FileName iconPath() const; - void setIconPath(const Utils::FileName &path); + Utils::FilePath iconPath() const; + void setIconPath(const Utils::FilePath &path); void setDeviceTypeForIcon(Core::Id deviceType); QList<Core::Id> allKeys() const; diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index ed3be721e0..4ca258df1a 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -125,7 +125,7 @@ SysRootKitAspect::SysRootKitAspect() Tasks SysRootKitAspect::validate(const Kit *k) const { Tasks result; - const Utils::FileName dir = SysRootKitAspect::sysRoot(k); + const Utils::FilePath dir = SysRootKitAspect::sysRoot(k); if (dir.isEmpty()) return result; @@ -136,13 +136,13 @@ Tasks SysRootKitAspect::validate(const Kit *k) const if (!fi.exists()) { result << Task(Task::Warning, tr("Sys Root \"%1\" does not exist in the file system.").arg(dir.toUserOutput()), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } else if (!fi.isDir()) { result << Task(Task::Warning, tr("Sys Root \"%1\" is not a directory.").arg(dir.toUserOutput()), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } else if (QDir(dir.toString()).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty()) { result << Task(Task::Warning, tr("Sys Root \"%1\" is empty.").arg(dir.toUserOutput()), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } return result; } @@ -173,23 +173,23 @@ Core::Id SysRootKitAspect::id() return "PE.Profile.SysRoot"; } -Utils::FileName SysRootKitAspect::sysRoot(const Kit *k) +Utils::FilePath SysRootKitAspect::sysRoot(const Kit *k) { if (!k) - return Utils::FileName(); + return Utils::FilePath(); if (!k->value(SysRootKitAspect::id()).toString().isEmpty()) - return Utils::FileName::fromString(k->value(SysRootKitAspect::id()).toString()); + return Utils::FilePath::fromString(k->value(SysRootKitAspect::id()).toString()); for (ToolChain *tc : ToolChainKitAspect::toolChains(k)) { if (!tc->sysRoot().isEmpty()) - return Utils::FileName::fromString(tc->sysRoot()); + return Utils::FilePath::fromString(tc->sysRoot()); } - return Utils::FileName(); + return Utils::FilePath(); } -void SysRootKitAspect::setSysRoot(Kit *k, const Utils::FileName &v) +void SysRootKitAspect::setSysRoot(Kit *k, const Utils::FilePath &v) { if (!k) return; @@ -376,7 +376,7 @@ Tasks ToolChainKitAspect::validate(const Kit *k) const const QList<ToolChain*> tcList = toolChains(k); if (tcList.isEmpty()) { result << Task(Task::Warning, ToolChainKitAspect::msgNoToolChainInTarget(), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } else { QSet<Abi> targetAbis; foreach (ToolChain *tc, tcList) { @@ -386,7 +386,7 @@ Tasks ToolChainKitAspect::validate(const Kit *k) const if (targetAbis.count() != 1) { result << Task(Task::Error, tr("Compilers produce code for different ABIs: %1") .arg(Utils::transform(targetAbis, &Abi::toString).toList().join(", ")), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM)); } } return result; @@ -977,10 +977,10 @@ Tasks DeviceKitAspect::validate(const Kit *k) const Tasks result; if (dev.isNull()) result.append(Task(Task::Warning, tr("No device set."), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); else if (!dev->isCompatibleWith(k)) result.append(Task(Task::Error, tr("Device is incompatible with this kit."), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); return result; } @@ -1242,7 +1242,7 @@ Tasks EnvironmentKitAspect::validate(const Kit *k) const const QVariant variant = k->value(EnvironmentKitAspect::id()); if (!variant.isNull() && !variant.canConvert(QVariant::List)) { result.append(Task(Task::Error, tr("The environment setting value is invalid."), - Utils::FileName(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); + Utils::FilePath(), -1, Core::Id(Constants::TASK_CATEGORY_BUILDSYSTEM))); } return result; } diff --git a/src/plugins/projectexplorer/kitinformation.h b/src/plugins/projectexplorer/kitinformation.h index 104d3a1eb2..037b4b9394 100644 --- a/src/plugins/projectexplorer/kitinformation.h +++ b/src/plugins/projectexplorer/kitinformation.h @@ -56,8 +56,8 @@ public: void addToMacroExpander(Kit *kit, Utils::MacroExpander *expander) const override; static Core::Id id(); - static Utils::FileName sysRoot(const Kit *k); - static void setSysRoot(Kit *k, const Utils::FileName &v); + static Utils::FilePath sysRoot(const Kit *k); + static void setSysRoot(Kit *k, const Utils::FilePath &v); }; // -------------------------------------------------------------------------- diff --git a/src/plugins/projectexplorer/kitmanager.cpp b/src/plugins/projectexplorer/kitmanager.cpp index 94353071be..91d04b6f5d 100644 --- a/src/plugins/projectexplorer/kitmanager.cpp +++ b/src/plugins/projectexplorer/kitmanager.cpp @@ -61,7 +61,7 @@ public: std::vector<std::unique_ptr<Kit>> kits; }; -static KitList restoreKitsHelper(const Utils::FileName &fileName); +static KitList restoreKitsHelper(const Utils::FilePath &fileName); namespace Internal { @@ -72,9 +72,9 @@ const char KIT_DEFAULT_KEY[] = "Profile.Default"; const char KIT_IRRELEVANT_ASPECTS_KEY[] = "Kit.IrrelevantAspects"; const char KIT_FILENAME[] = "/profiles.xml"; -static FileName settingsFileName() +static FilePath settingsFileName() { - return FileName::fromString(ICore::userResourcePath() + KIT_FILENAME); + return FilePath::fromString(ICore::userResourcePath() + KIT_FILENAME); } // -------------------------------------------------------------------------- @@ -184,7 +184,7 @@ void KitManager::restoreKits() // read all kits from SDK { KitList system = restoreKitsHelper - (FileName::fromString(ICore::installerResourcePath() + KIT_FILENAME)); + (FilePath::fromString(ICore::installerResourcePath() + KIT_FILENAME)); // SDK kits need to get updated with the user-provided extra settings: for (auto ¤t : system.kits) { @@ -397,7 +397,7 @@ QList<Kit *> KitManager::sortKits(const QList<Kit *> &kits) return Utils::transform(sortList, &QPair<QString, Kit *>::second); } -static KitList restoreKitsHelper(const FileName &fileName) +static KitList restoreKitsHelper(const FilePath &fileName) { KitList result; diff --git a/src/plugins/projectexplorer/kitmanager.h b/src/plugins/projectexplorer/kitmanager.h index d1ad022dfc..4cc80230c6 100644 --- a/src/plugins/projectexplorer/kitmanager.h +++ b/src/plugins/projectexplorer/kitmanager.h @@ -44,7 +44,7 @@ QT_END_NAMESPACE namespace Utils { class Environment; -class FileName; +class FilePath; class MacroExpander; } // namespace Utils diff --git a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp index f032073665..bcf5c472b8 100644 --- a/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp +++ b/src/plugins/projectexplorer/kitmanagerconfigwidget.cpp @@ -213,7 +213,7 @@ QString KitManagerConfigWidget::validityMessage() const { Tasks tmp; if (!m_hasUniqueName) { - tmp.append(Task(Task::Warning, tr("Display name is not unique."), Utils::FileName(), -1, + tmp.append(Task(Task::Warning, tr("Display name is not unique."), Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)); } return m_modifiedKit->toHtml(tmp); @@ -349,7 +349,7 @@ void KitManagerConfigWidget::setIcon() if (icon.isNull()) return; m_iconButton->setIcon(icon); - m_modifiedKit->setIconPath(Utils::FileName::fromString(path)); + m_modifiedKit->setIconPath(Utils::FilePath::fromString(path)); emit dirty(); }); iconMenu.exec(mapToGlobal(m_iconButton->pos())); @@ -357,7 +357,7 @@ void KitManagerConfigWidget::setIcon() void KitManagerConfigWidget::resetIcon() { - m_modifiedKit->setIconPath(Utils::FileName()); + m_modifiedKit->setIconPath(Utils::FilePath()); emit dirty(); } diff --git a/src/plugins/projectexplorer/ldparser.cpp b/src/plugins/projectexplorer/ldparser.cpp index 6da77cee9c..9ce56bf7dd 100644 --- a/src/plugins/projectexplorer/ldparser.cpp +++ b/src/plugins/projectexplorer/ldparser.cpp @@ -68,7 +68,7 @@ void LdParser::stdError(const QString &line) if (lne.startsWith(QLatin1String("collect2:"))) { Task task = Task(Task::Error, lne /* description */, - Utils::FileName() /* filename */, + Utils::FilePath() /* filename */, -1 /* linenumber */, Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); @@ -79,7 +79,7 @@ void LdParser::stdError(const QString &line) if (match.hasMatch()) { QString description = match.captured(2); Task task(Task::Warning, description, - Utils::FileName(), -1, + Utils::FilePath(), -1, Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); return; @@ -95,7 +95,7 @@ void LdParser::stdError(const QString &line) } else if (description.startsWith(QLatin1String("fatal: "))) { description = description.mid(7); } - Task task(type, description, Utils::FileName() /* filename */, -1 /* line */, + Task task(type, description, Utils::FilePath() /* filename */, -1 /* line */, Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); return; @@ -107,12 +107,12 @@ void LdParser::stdError(const QString &line) int lineno = match.captured(7).toInt(&ok); if (!ok) lineno = -1; - Utils::FileName filename = Utils::FileName::fromUserInput(match.captured(1)); + Utils::FilePath filename = Utils::FilePath::fromUserInput(match.captured(1)); const QString sourceFileName = match.captured(4); if (!sourceFileName.isEmpty() && !sourceFileName.startsWith(QLatin1String("(.text")) && !sourceFileName.startsWith(QLatin1String("(.data"))) { - filename = Utils::FileName::fromUserInput(sourceFileName); + filename = Utils::FilePath::fromUserInput(sourceFileName); } QString description = match.captured(8).trimmed(); Task::TaskType type = Task::Error; diff --git a/src/plugins/projectexplorer/linuxiccparser.cpp b/src/plugins/projectexplorer/linuxiccparser.cpp index 22682a2688..6572f47d66 100644 --- a/src/plugins/projectexplorer/linuxiccparser.cpp +++ b/src/plugins/projectexplorer/linuxiccparser.cpp @@ -81,7 +81,7 @@ void LinuxIccParser::stdError(const QString &line) else if (category == QLatin1String("warning")) type = Task::Warning; m_temporary = Task(type, m_firstLine.cap(6).trimmed(), - Utils::FileName::fromUserInput(m_firstLine.cap(1)), + Utils::FilePath::fromUserInput(m_firstLine.cap(1)), m_firstLine.cap(2).toInt(), Constants::TASK_CATEGORY_COMPILE); @@ -172,7 +172,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("identifier \"f\" is undefined\nf(0);"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 13, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 13, Constants::TASK_CATEGORY_COMPILE)) << QString(); @@ -188,7 +188,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("identifier \"f\" is undefined\nf(0);"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 13, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 13, Constants::TASK_CATEGORY_COMPILE)) << QString(); @@ -203,7 +203,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("function \"AClass::privatefunc\" (declared at line 4 of \"main.h\") is inaccessible\nb.privatefunc();"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 53, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 53, Constants::TASK_CATEGORY_COMPILE)) << QString(); @@ -217,7 +217,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("use of \"=\" where \"==\" may have been intended\nwhile (a = true)"), - Utils::FileName::fromUserInput(QLatin1String("main.cpp")), 41, + Utils::FilePath::fromUserInput(QLatin1String("main.cpp")), 41, Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc note") @@ -227,7 +227,7 @@ void ProjectExplorerPlugin::testLinuxIccOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("Note: No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, Constants::TASK_CATEGORY_COMPILE) ) << QString(); diff --git a/src/plugins/projectexplorer/makestep.cpp b/src/plugins/projectexplorer/makestep.cpp index e6b19c93bd..fecaacc89c 100644 --- a/src/plugins/projectexplorer/makestep.cpp +++ b/src/plugins/projectexplorer/makestep.cpp @@ -79,7 +79,7 @@ bool MakeStep::init() if (!bc) emit addTask(Task::buildConfigurationMissingTask()); - const FileName make = effectiveMakeCommand(); + const FilePath make = effectiveMakeCommand(); if (make.isEmpty()) emit addTask(makeCommandMissingTask()); @@ -143,14 +143,14 @@ static const QList<ToolChain *> preferredToolChains(const Kit *kit) return tcs; } -FileName MakeStep::defaultMakeCommand() const +FilePath MakeStep::defaultMakeCommand() const { BuildConfiguration *bc = buildConfiguration(); if (!bc) return {}; const Utils::Environment env = environment(bc); for (const ToolChain *tc : preferredToolChains(target()->kit())) { - FileName make = tc->makeCommand(env); + FilePath make = tc->makeCommand(env); if (!make.isEmpty()) return make; } @@ -166,7 +166,7 @@ Task MakeStep::makeCommandMissingTask() { return Task(Task::Error, msgNoMakeCommand(), - Utils::FileName(), + Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); } @@ -260,7 +260,7 @@ Utils::Environment MakeStep::environment(BuildConfiguration *bc) const return env; } -void MakeStep::setMakeCommand(const FileName &command) +void MakeStep::setMakeCommand(const FilePath &command) { m_makeCommand = command; } @@ -286,7 +286,7 @@ bool MakeStep::fromMap(const QVariantMap &map) { m_buildTargets = map.value(id().withSuffix(BUILD_TARGETS_SUFFIX).toString()).toStringList(); m_makeArguments = map.value(id().withSuffix(MAKE_ARGUMENTS_SUFFIX).toString()).toString(); - m_makeCommand = FileName::fromString( + m_makeCommand = FilePath::fromString( map.value(id().withSuffix(MAKE_COMMAND_SUFFIX).toString()).toString()); m_clean = map.value(id().withSuffix(CLEAN_SUFFIX).toString()).toBool(); m_overrideMakeflags = map.value(id().withSuffix(OVERRIDE_MAKEFLAGS_SUFFIX).toString(), false).toBool(); @@ -325,12 +325,12 @@ void MakeStep::setUserArguments(const QString &args) m_makeArguments = args; } -FileName MakeStep::makeCommand() const +FilePath MakeStep::makeCommand() const { return m_makeCommand; } -FileName MakeStep::effectiveMakeCommand() const +FilePath MakeStep::effectiveMakeCommand() const { if (!m_makeCommand.isEmpty()) return m_makeCommand; @@ -505,7 +505,7 @@ void MakeStepConfigWidget::itemChanged(QListWidgetItem *item) void MakeStepConfigWidget::makeLineEditTextEdited() { - m_makeStep->setMakeCommand(FileName::fromString(m_ui->makeLineEdit->rawPath())); + m_makeStep->setMakeCommand(FilePath::fromString(m_ui->makeLineEdit->rawPath())); updateDetails(); } diff --git a/src/plugins/projectexplorer/makestep.h b/src/plugins/projectexplorer/makestep.h index 5cee91237a..e44b52851e 100644 --- a/src/plugins/projectexplorer/makestep.h +++ b/src/plugins/projectexplorer/makestep.h @@ -58,16 +58,16 @@ public: QString allArguments() const; QString userArguments() const; void setUserArguments(const QString &args); - Utils::FileName makeCommand() const; - void setMakeCommand(const Utils::FileName &command); - Utils::FileName effectiveMakeCommand() const; + Utils::FilePath makeCommand() const; + void setMakeCommand(const Utils::FilePath &command); + Utils::FilePath effectiveMakeCommand() const; void setClean(bool clean); bool isClean() const; static QString defaultDisplayName(); - Utils::FileName defaultMakeCommand() const; + Utils::FilePath defaultMakeCommand() const; static QString msgNoMakeCommand(); static Task makeCommandMissingTask(); @@ -93,7 +93,7 @@ private: QStringList m_buildTargets; QStringList m_availableTargets; QString m_makeArguments; - Utils::FileName m_makeCommand; + Utils::FilePath m_makeCommand; int m_userJobCount = 4; bool m_overrideMakeflags = false; bool m_clean = false; diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index 4fe6a379e8..2d3095c168 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -35,11 +35,11 @@ using namespace Utils; // As of MSVC 2015: "foo.cpp(42) :" -> "foo.cpp(42):" static const char FILE_POS_PATTERN[] = "^(?:\\d+>)?(cl|LINK|.+[^ ]) ?: "; -static QPair<FileName, int> parseFileName(const QString &input) +static QPair<FilePath, int> parseFileName(const QString &input) { QString fileName = input; if (fileName.startsWith("LINK") || fileName.startsWith("cl")) - return qMakePair(FileName(), -1); + return qMakePair(FilePath(), -1); // Extract linenumber (if it is there): int linenumber = -1; @@ -59,7 +59,7 @@ static QPair<FileName, int> parseFileName(const QString &input) } } const QString normalized = FileUtils::normalizePathName(fileName); - return qMakePair(FileName::fromUserInput(normalized), linenumber); + return qMakePair(FilePath::fromUserInput(normalized), linenumber); } using namespace ProjectExplorer; @@ -78,7 +78,7 @@ static bool handleNmakeJomMessage(const QString &line, Task *task) *task = Task(Task::Error, line.mid(matchLength).trimmed(), /* description */ - FileName(), /* fileName */ + FilePath(), /* fileName */ -1, /* linenumber */ Constants::TASK_CATEGORY_COMPILE); return true; @@ -146,7 +146,7 @@ void MsvcParser::stdOutput(const QString &line) if (!match.captured(1).isEmpty()) description.chop(1); // Remove trailing quote m_lastTask = Task(Task::Unknown, description, - FileName::fromUserInput(match.captured(2)), /* fileName */ + FilePath::fromUserInput(match.captured(2)), /* fileName */ match.captured(3).toInt(), /* linenumber */ Constants::TASK_CATEGORY_COMPILE); m_lines = 1; @@ -178,7 +178,7 @@ bool MsvcParser::processCompileLine(const QString &line) QRegularExpressionMatch match = m_compileRegExp.match(line); if (match.hasMatch()) { - QPair<FileName, int> position = parseFileName(match.captured(1)); + QPair<FilePath, int> position = parseFileName(match.captured(1)); m_lastTask = Task(taskType(match.captured(2)), match.captured(3) + match.captured(4).trimmed(), // description position.first, position.second, @@ -261,7 +261,7 @@ void ClangClParser::stdError(const QString &lineIn) QRegularExpressionMatch match = m_compileRegExp.match(line); if (match.hasMatch()) { doFlush(); - const QPair<FileName, int> position = parseFileName(match.captured(1)); + const QPair<FilePath, int> position = parseFileName(match.captured(1)); m_lastTask = Task(taskType(match.captured(2)), match.captured(3).trimmed(), position.first, position.second, Constants::TASK_CATEGORY_COMPILE); @@ -328,7 +328,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "C4716: 'findUnresolvedModule' : must return a value", - FileName::fromUserInput("qmlstandalone\\main.cpp"), 54, + FilePath::fromUserInput("qmlstandalone\\main.cpp"), 54, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -339,7 +339,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "C4716: 'findUnresolvedModule' : must return a value", - FileName::fromUserInput("qmlstandalone\\main.cpp"), 54, + FilePath::fromUserInput("qmlstandalone\\main.cpp"), 54, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -350,7 +350,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "C4716: 'findUnresolvedModule' : must return a value", - FileName::fromUserInput("qmlstandalone\\main.cpp"), 54, + FilePath::fromUserInput("qmlstandalone\\main.cpp"), 54, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -361,7 +361,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "C4100: 'something' : unreferenced formal parameter", - FileName::fromUserInput("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69, + FilePath::fromUserInput("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -373,7 +373,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "C4100: 'something' : unreferenced formal parameter", - FileName::fromUserInput("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69, + FilePath::fromUserInput("x:\\src\\plugins\\projectexplorer\\msvcparser.cpp"), 69, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -385,11 +385,11 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'", - FileName::fromUserInput("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50, + FilePath::fromUserInput("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "see declaration of 'TextEditor::CompletionItem'", - FileName::fromUserInput("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39, + FilePath::fromUserInput("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -401,11 +401,11 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "C4099: 'TextEditor::CompletionItem' : type name first seen using 'struct' now seen using 'class'", - FileName::fromUserInput("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50, + FilePath::fromUserInput("x:\\src\\plugins\\texteditor\\icompletioncollector.h"), 50, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "see declaration of 'TextEditor::CompletionItem'", - FileName::fromUserInput("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39, + FilePath::fromUserInput("x:\\src\\plugins\\texteditor\\completionsupport.h"), 39, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -416,7 +416,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "LNK1146: no argument specified with option '/LIBPATH:'", - FileName(), -1, + FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -428,7 +428,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "D9002 : ignoring unknown option '-fopenmp'", - FileName(), -1, + FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; QTest::newRow("complex error") @@ -448,7 +448,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() " _Traits=std::_Tmap_traits<int,double,std::less<int>,std::allocator<std::pair<const int,double>>,false>\n" "]\n" "No constructor could take the source type, or constructor overload resolution was ambiguous", - FileName::fromUserInput("..\\untitled\\main.cpp"), 19, + FilePath::fromUserInput("..\\untitled\\main.cpp"), 19, Constants::TASK_CATEGORY_COMPILE)) << ""; QTest::newRow("Linker error 1") @@ -458,7 +458,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "LNK2019: unresolved external symbol \"public: void __thiscall Data::doit(void)\" (?doit@Data@@QAEXXZ) referenced in function _main", - FileName::fromUserInput("main.obj"), -1, + FilePath::fromUserInput("main.obj"), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; QTest::newRow("Linker error 2") @@ -468,7 +468,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "LNK1120: 1 unresolved externals", - FileName::fromUserInput("debug\\Experimentation.exe"), -1, + FilePath::fromUserInput("debug\\Experimentation.exe"), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -479,7 +479,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "dependent '..\\..\\..\\..\\creator-2.5\\src\\plugins\\coreplugin\\ifile.h' does not exist.", - FileName(), -1, + FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; QTest::newRow("jom error") @@ -489,7 +489,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "dependent 'main.cpp' does not exist.", - FileName(), -1, + FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -507,11 +507,11 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, "C4996: 'std::_Copy_impl': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'", - FileName::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2227, + FilePath::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2227, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "see declaration of 'std::_Copy_impl'", - FileName::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2212, + FilePath::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2212, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "see reference to function template instantiation '_OutIt std::copy<const unsigned char*,unsigned short*>(_InIt,_InIt,_OutIt)' being compiled\n" @@ -520,7 +520,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() " _OutIt=unsigned short *,\n" " _InIt=const unsigned char *\n" "]", - FileName::fromUserInput("symbolgroupvalue.cpp"), 2314, + FilePath::fromUserInput("symbolgroupvalue.cpp"), 2314, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -533,15 +533,15 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "C2872: 'UINT64' : ambiguous symbol", - FileName::fromUserInput("D:\\Project\\file.h"), 98, + FilePath::fromUserInput("D:\\Project\\file.h"), 98, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "could be unsigned __int64 UINT64", - FileName::fromUserInput("C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\basetsd.h"), 83, + FilePath::fromUserInput("C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\include\\basetsd.h"), 83, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "or Types::UINT64", - FileName::fromUserInput("D:\\Project\\types.h"), 71, + FilePath::fromUserInput("D:\\Project\\types.h"), 71, Constants::TASK_CATEGORY_COMPILE)) << ""; QTest::newRow("ignore moc note") @@ -559,11 +559,11 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Error, "C2733: 'func': second C linkage of overloaded function not allowed", - FileName::fromUserInput("main.cpp"), 7, + FilePath::fromUserInput("main.cpp"), 7, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Unknown, "see declaration of 'func'", - FileName::fromUserInput("main.cpp"), 6, + FilePath::fromUserInput("main.cpp"), 6, Constants::TASK_CATEGORY_COMPILE)) << ""; @@ -574,7 +574,7 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << (Tasks() << Task(Task::Warning, QString::fromUtf8("D9025: переопределение \"/MDd\" на \"/MTd\""), - FileName(), -1, Constants::TASK_CATEGORY_COMPILE)) + FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)) << ""; } @@ -645,19 +645,19 @@ void ProjectExplorerPlugin::testClangClOutputParsers_data() << "" << expectedStderr << (Tasks() << Task(Task::Warning, warning1.trimmed(), - FileName::fromUserInput("./qwindowseglcontext.h"), 282, + FilePath::fromUserInput("./qwindowseglcontext.h"), 282, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Warning, warning2.trimmed(), - FileName::fromUserInput(".\\qwindowsclipboard.cpp"), 60, + FilePath::fromUserInput(".\\qwindowsclipboard.cpp"), 60, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Warning, warning3.trimmed(), - FileName::fromUserInput(".\\qwindowsclipboard.cpp"), 61, + FilePath::fromUserInput(".\\qwindowsclipboard.cpp"), 61, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Error, expectedError1, - FileName::fromUserInput(".\\qwindowsgdinativeinterface.cpp"), 48, + FilePath::fromUserInput(".\\qwindowsgdinativeinterface.cpp"), 48, Constants::TASK_CATEGORY_COMPILE) << Task(Task::Error, error2.trimmed(), - FileName::fromUserInput(".\\qwindowsgdinativeinterface.cpp"), 51, + FilePath::fromUserInput(".\\qwindowsgdinativeinterface.cpp"), 51, Constants::TASK_CATEGORY_COMPILE)) << ""; } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 25fef49f1e..350ee1a55d 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -613,7 +613,7 @@ Macros MsvcToolChain::msvcPredefinedMacros(const QStringList &cxxflags, cpp.setEnvironment(env.toStringList()); cpp.setWorkingDirectory(Utils::TemporaryDirectory::masterDirectoryPath()); QStringList arguments; - const Utils::FileName binary = env.searchInPath(QLatin1String("cl.exe")); + const Utils::FilePath binary = env.searchInPath(QLatin1String("cl.exe")); if (binary.isEmpty()) { qWarning("%s: The compiler binary cl.exe could not be found in the path.", Q_FUNC_INFO); return predefinedMacros; @@ -1180,7 +1180,7 @@ ToolChain::BuiltInHeaderPathsRunner MsvcToolChain::createBuiltInHeaderPathsRunne } HeaderPaths MsvcToolChain::builtInHeaderPaths(const QStringList &cxxflags, - const Utils::FileName &sysRoot) const + const Utils::FilePath &sysRoot) const { return createBuiltInHeaderPathsRunner()(cxxflags, sysRoot.toString(), ""); } @@ -1210,17 +1210,17 @@ static QString wrappedMakeCommand(const QString &command) return wrapperPath; } -FileName MsvcToolChain::makeCommand(const Environment &environment) const +FilePath MsvcToolChain::makeCommand(const Environment &environment) const { bool useJom = ProjectExplorerPlugin::projectExplorerSettings().useJom; const QString jom("jom.exe"); const QString nmake("nmake.exe"); - Utils::FileName tmp; + Utils::FilePath tmp; - FileName command; + FilePath command; if (useJom) { tmp = environment.searchInPath(jom, - {Utils::FileName::fromString( + {Utils::FilePath::fromString( QCoreApplication::applicationDirPath())}); if (!tmp.isEmpty()) command = tmp; @@ -1233,15 +1233,15 @@ FileName MsvcToolChain::makeCommand(const Environment &environment) const } if (command.isEmpty()) - command = FileName::fromString(useJom ? jom : nmake); + command = FilePath::fromString(useJom ? jom : nmake); if (environment.hasKey("VSLANG")) - return FileName::fromString(wrappedMakeCommand(command.toString())); + return FilePath::fromString(wrappedMakeCommand(command.toString())); return command; } -Utils::FileName MsvcToolChain::compilerCommand() const +Utils::FilePath MsvcToolChain::compilerCommand() const { return m_compilerCommand; } @@ -1252,7 +1252,7 @@ void MsvcToolChain::rescanForCompiler() addToEnvironment(env); m_compilerCommand - = env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FileName &name) { + = env.searchInPath(QLatin1String("cl.exe"), {}, [](const Utils::FilePath &name) { QDir dir(QDir::cleanPath(name.toFileInfo().absolutePath() + QStringLiteral("/.."))); do { if (QFile::exists(dir.absoluteFilePath(QStringLiteral("vcvarsall.bat"))) @@ -1518,7 +1518,7 @@ void ClangClToolChainConfigWidget::setFromClangClToolChain() if (clangClToolChain->isAutoDetected()) m_llvmDirLabel->setText(QDir::toNativeSeparators(clangClToolChain->clangPath())); else - m_compilerCommand->setFileName(Utils::FileName::fromString(clangClToolChain->clangPath())); + m_compilerCommand->setFileName(Utils::FilePath::fromString(clangClToolChain->clangPath())); } static const MsvcToolChain *findMsvcToolChain(unsigned char wordWidth, Abi::OSFlavor flavor) @@ -1627,7 +1627,7 @@ static QString compilerFromPath(const QString &path) void ClangClToolChainConfigWidget::applyImpl() { - Utils::FileName clangClPath = m_compilerCommand->fileName(); + Utils::FilePath clangClPath = m_compilerCommand->fileName(); auto clangClToolChain = static_cast<ClangClToolChain *>(toolChain()); clangClToolChain->setClangPath(clangClPath.toString()); @@ -1695,9 +1695,9 @@ void ClangClToolChain::addToEnvironment(Utils::Environment &env) const env.prependOrSetPath(path.canonicalPath()); } -Utils::FileName ClangClToolChain::compilerCommand() const +Utils::FilePath ClangClToolChain::compilerCommand() const { - return Utils::FileName::fromString(m_clangPath); + return Utils::FilePath::fromString(m_clangPath); } QString ClangClToolChain::typeDisplayName() const @@ -2020,7 +2020,7 @@ QList<ToolChain *> ClangClToolChainFactory::autoDetect(const QList<ToolChain *> QString qtCreatorsClang = Core::ICore::clangExecutable(CLANG_BINDIR); if (!qtCreatorsClang.isEmpty()) { - qtCreatorsClang = Utils::FileName::fromString(qtCreatorsClang) + qtCreatorsClang = Utils::FilePath::fromString(qtCreatorsClang) .parentDir() .pathAppended("clang-cl.exe") .toString(); @@ -2039,7 +2039,7 @@ QList<ToolChain *> ClangClToolChainFactory::autoDetect(const QList<ToolChain *> } const Utils::Environment systemEnvironment = Utils::Environment::systemEnvironment(); - const Utils::FileName clangClPath = systemEnvironment.searchInPath("clang-cl"); + const Utils::FilePath clangClPath = systemEnvironment.searchInPath("clang-cl"); if (!clangClPath.isEmpty()) results.append(detectClangClToolChainInPath(clangClPath.toString(), known, "")); @@ -2104,7 +2104,7 @@ Utils::optional<QString> MsvcToolChain::generateEnvironmentSettings(const Utils: runEnv.unset(QLatin1String("ORIGINALPATH")); run.setEnvironment(runEnv.toStringList()); run.setTimeoutS(30); - Utils::FileName cmdPath = Utils::FileName::fromUserInput( + Utils::FilePath cmdPath = Utils::FilePath::fromUserInput( QString::fromLocal8Bit(qgetenv("COMSPEC"))); if (cmdPath.isEmpty()) cmdPath = env.searchInPath(QLatin1String("cmd.exe")); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 0dbe9e475d..bc0adb00ba 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -86,11 +86,11 @@ public: WarningFlags warningFlags(const QStringList &cflags) const override; BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override; HeaderPaths builtInHeaderPaths(const QStringList &cxxflags, - const Utils::FileName &sysRoot) const override; + const Utils::FilePath &sysRoot) const override; void addToEnvironment(Utils::Environment &env) const override; - Utils::FileName makeCommand(const Utils::Environment &environment) const override; - Utils::FileName compilerCommand() const override; + Utils::FilePath makeCommand(const Utils::Environment &environment) const override; + Utils::FilePath compilerCommand() const override; IOutputParser *outputParser() const override; QString varsBatArg() const { return m_varsBatArg; } @@ -164,7 +164,7 @@ private: mutable Utils::Environment m_lastEnvironment; // Last checked 'incoming' environment. mutable Utils::Environment m_resultEnvironment; // Resulting environment for VC - Utils::FileName m_compilerCommand; + Utils::FilePath m_compilerCommand; protected: Abi m_abi; @@ -184,7 +184,7 @@ public: QString typeDisplayName() const override; QStringList suggestedMkspecList() const override; void addToEnvironment(Utils::Environment &env) const override; - Utils::FileName compilerCommand() const override; + Utils::FilePath compilerCommand() const override; IOutputParser *outputParser() const override; QVariantMap toMap() const override; bool fromMap(const QVariantMap &data) override; diff --git a/src/plugins/projectexplorer/osparser.cpp b/src/plugins/projectexplorer/osparser.cpp index 9190f45d73..ecbef759ef 100644 --- a/src/plugins/projectexplorer/osparser.cpp +++ b/src/plugins/projectexplorer/osparser.cpp @@ -41,7 +41,7 @@ void OsParser::stdError(const QString &line) if (Utils::HostOsInfo::isLinuxHost()) { const QString trimmed = line.trimmed(); if (trimmed.contains(QLatin1String(": error while loading shared libraries:"))) { - emit addTask(Task(Task::Error, trimmed, Utils::FileName(), -1, + emit addTask(Task(Task::Error, trimmed, Utils::FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)); } } @@ -55,7 +55,7 @@ void OsParser::stdOutput(const QString &line) if (trimmed == QLatin1String("The process cannot access the file because it is being used by another process.")) { emit addTask(Task(Task::Error, tr("The process cannot access the file because it is being used by another process.\n" "Please close all running instances of your application before starting a build."), - Utils::FileName(), -1, Constants::TASK_CATEGORY_COMPILE)); + Utils::FilePath(), -1, Constants::TASK_CATEGORY_COMPILE)); m_hasFatalError = true; } } diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index ee7207f05f..765a087650 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -32,7 +32,7 @@ namespace ProjectExplorer { -static inline QByteArray msgFileComparisonFail(const Utils::FileName &f1, const Utils::FileName &f2) +static inline QByteArray msgFileComparisonFail(const Utils::FilePath &f1, const Utils::FilePath &f2) { const QString result = '"' + f1.toUserOutput() + "\" != \"" + f2.toUserOutput() + '"'; return result.toLocal8Bit(); diff --git a/src/plugins/projectexplorer/processparameters.cpp b/src/plugins/projectexplorer/processparameters.cpp index 6381c028c7..350aa7c90f 100644 --- a/src/plugins/projectexplorer/processparameters.cpp +++ b/src/plugins/projectexplorer/processparameters.cpp @@ -58,7 +58,7 @@ ProcessParameters::ProcessParameters() : Sets the executable to run. */ -void ProcessParameters::setCommand(const Utils::FileName &cmd) +void ProcessParameters::setCommand(const Utils::FilePath &cmd) { m_command = cmd; m_effectiveCommand.clear(); @@ -80,7 +80,7 @@ void ProcessParameters::setArguments(const QString &arguments) Should be called from init(). */ -void ProcessParameters::setWorkingDirectory(const FileName &workingDirectory) +void ProcessParameters::setWorkingDirectory(const FilePath &workingDirectory) { m_workingDirectory = workingDirectory; m_effectiveWorkingDirectory.clear(); @@ -105,14 +105,14 @@ void ProcessParameters::setWorkingDirectory(const FileName &workingDirectory) Gets the fully expanded working directory. */ -FileName ProcessParameters::effectiveWorkingDirectory() const +FilePath ProcessParameters::effectiveWorkingDirectory() const { if (m_effectiveWorkingDirectory.isEmpty()) { QString wds = m_workingDirectory.toString(); if (m_macroExpander) wds = m_macroExpander->expand(wds); m_effectiveWorkingDirectory - = FileName::fromString(QDir::cleanPath(m_environment.expandVariables(wds))); + = FilePath::fromString(QDir::cleanPath(m_environment.expandVariables(wds))); } return m_effectiveWorkingDirectory; } @@ -121,10 +121,10 @@ FileName ProcessParameters::effectiveWorkingDirectory() const Gets the fully expanded command name to run. */ -FileName ProcessParameters::effectiveCommand() const +FilePath ProcessParameters::effectiveCommand() const { if (m_effectiveCommand.isEmpty()) { - FileName cmd = m_command; + FilePath cmd = m_command; if (m_macroExpander) cmd = m_macroExpander->expand(cmd); m_effectiveCommand = @@ -162,7 +162,7 @@ QString ProcessParameters::prettyCommand() const QString cmd = m_command.toString(); if (m_macroExpander) cmd = m_macroExpander->expand(cmd); - return Utils::FileName::fromString(cmd).fileName(); + return Utils::FilePath::fromString(cmd).fileName(); } QString ProcessParameters::prettyArguments() const diff --git a/src/plugins/projectexplorer/processparameters.h b/src/plugins/projectexplorer/processparameters.h index ca19245153..3e08e6bb85 100644 --- a/src/plugins/projectexplorer/processparameters.h +++ b/src/plugins/projectexplorer/processparameters.h @@ -40,14 +40,14 @@ class PROJECTEXPLORER_EXPORT ProcessParameters public: ProcessParameters(); - void setCommand(const Utils::FileName &cmd); - Utils::FileName command() const { return m_command; } + void setCommand(const Utils::FilePath &cmd); + Utils::FilePath command() const { return m_command; } void setArguments(const QString &arguments); QString arguments() const { return m_arguments; } - void setWorkingDirectory(const Utils::FileName &workingDirectory); - Utils::FileName workingDirectory() const { return m_workingDirectory; } + void setWorkingDirectory(const Utils::FilePath &workingDirectory); + Utils::FilePath workingDirectory() const { return m_workingDirectory; } void setEnvironment(const Utils::Environment &env) { m_environment = env; } Utils::Environment environment() const { return m_environment; } @@ -56,9 +56,9 @@ public: Utils::MacroExpander *macroExpander() const { return m_macroExpander; } /// Get the fully expanded working directory: - Utils::FileName effectiveWorkingDirectory() const; + Utils::FilePath effectiveWorkingDirectory() const; /// Get the fully expanded command name to run: - Utils::FileName effectiveCommand() const; + Utils::FilePath effectiveCommand() const; /// Get the fully expanded arguments to use: QString effectiveArguments() const; @@ -72,14 +72,14 @@ public: void resolveAll(); private: - Utils::FileName m_workingDirectory; - Utils::FileName m_command; + Utils::FilePath m_workingDirectory; + Utils::FilePath m_command; QString m_arguments; Utils::Environment m_environment; Utils::MacroExpander *m_macroExpander; - mutable Utils::FileName m_effectiveWorkingDirectory; - mutable Utils::FileName m_effectiveCommand; + mutable Utils::FilePath m_effectiveWorkingDirectory; + mutable Utils::FilePath m_effectiveCommand; mutable QString m_effectiveArguments; mutable bool m_commandMissing; }; diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp index 51ca66dbac..231cb831bb 100644 --- a/src/plugins/projectexplorer/processstep.cpp +++ b/src/plugins/projectexplorer/processstep.cpp @@ -93,8 +93,8 @@ void ProcessStep::setupProcessParameters(ProcessParameters *pp) pp->setMacroExpander(bc ? bc->macroExpander() : Utils::globalMacroExpander()); pp->setEnvironment(bc ? bc->environment() : Utils::Environment::systemEnvironment()); - pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory)); - pp->setCommand(Utils::FileName::fromString(command)); + pp->setWorkingDirectory(Utils::FilePath::fromString(workingDirectory)); + pp->setCommand(Utils::FilePath::fromString(command)); pp->setArguments(arguments); pp->resolveAll(); } diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp index 9bae7c339a..16ae9a38dc 100644 --- a/src/plugins/projectexplorer/project.cpp +++ b/src/plugins/projectexplorer/project.cpp @@ -115,7 +115,7 @@ const Project::NodeMatcher Project::GeneratedFiles = [](const Node *node) { // ProjectDocument: // -------------------------------------------------------------------- -ProjectDocument::ProjectDocument(const QString &mimeType, const Utils::FileName &fileName, +ProjectDocument::ProjectDocument(const QString &mimeType, const Utils::FilePath &fileName, const ProjectDocument::ProjectCallback &callback) : m_callback(callback) { @@ -152,7 +152,7 @@ bool ProjectDocument::reload(QString *errorString, Core::IDocument::ReloadFlag f class ProjectPrivate { public: - ProjectPrivate(const QString &mimeType, const Utils::FileName &fileName, + ProjectPrivate(const QString &mimeType, const Utils::FilePath &fileName, const ProjectDocument::ProjectCallback &callback) { m_document = std::make_unique<ProjectDocument>(mimeType, fileName, callback); @@ -180,7 +180,7 @@ public: Kit::Predicate m_preferredKitPredicate; Utils::MacroExpander m_macroExpander; - Utils::FileName m_rootProjectDirectory; + Utils::FilePath m_rootProjectDirectory; mutable QVector<const Node *> m_sortedNodeList; }; @@ -190,7 +190,7 @@ ProjectPrivate::~ProjectPrivate() std::unique_ptr<ProjectNode> oldNode = std::move(m_rootProjectNode); } -Project::Project(const QString &mimeType, const Utils::FileName &fileName, +Project::Project(const QString &mimeType, const Utils::FilePath &fileName, const ProjectDocument::ProjectCallback &callback) : d(new ProjectPrivate(mimeType, fileName, callback)) { @@ -233,9 +233,9 @@ Core::IDocument *Project::document() const return d->m_document.get(); } -Utils::FileName Project::projectFilePath() const +Utils::FilePath Project::projectFilePath() const { - QTC_ASSERT(document(), return Utils::FileName()); + QTC_ASSERT(document(), return Utils::FilePath()); return document()->filePath(); } @@ -584,19 +584,19 @@ Project::RestoreResult Project::restoreSettings(QString *errorMessage) /*! * Returns a sorted list of all files matching the predicate \a filter. */ -Utils::FileNameList Project::files(const Project::NodeMatcher &filter) const +Utils::FilePathList Project::files(const Project::NodeMatcher &filter) const { - Utils::FileNameList result; + Utils::FilePathList result; if (d->m_sortedNodeList.empty() && filter(containerNode())) result.append(projectFilePath()); - Utils::FileName lastAdded; + Utils::FilePath lastAdded; for (const Node *n : qAsConst(d->m_sortedNodeList)) { if (filter && !filter(n)) continue; // Remove duplicates: - const Utils::FileName path = n->filePath(); + const Utils::FilePath path = n->filePath(); if (path == lastAdded) continue; // skip duplicates lastAdded = path; @@ -639,7 +639,7 @@ QVariantMap Project::toMap() const This includes the absolute path. */ -Utils::FileName Project::projectDirectory() const +Utils::FilePath Project::projectDirectory() const { return projectDirectory(projectFilePath()); } @@ -650,16 +650,16 @@ Utils::FileName Project::projectDirectory() const This includes the absolute path. */ -Utils::FileName Project::projectDirectory(const Utils::FileName &top) +Utils::FilePath Project::projectDirectory(const Utils::FilePath &top) { if (top.isEmpty()) - return Utils::FileName(); - return Utils::FileName::fromString(top.toFileInfo().absoluteDir().path()); + return Utils::FilePath(); + return Utils::FilePath::fromString(top.toFileInfo().absoluteDir().path()); } void Project::changeRootProjectDirectory() { - Utils::FileName rootPath = Utils::FileName::fromString( + Utils::FilePath rootPath = Utils::FilePath::fromString( QFileDialog::getExistingDirectory(Core::ICore::dialogParent(), tr("Select The Root Directory"), rootProjectDirectory().toString(), @@ -675,7 +675,7 @@ void Project::changeRootProjectDirectory() /*! Returns the common root directory that contains all files which belongs to a project. */ -Utils::FileName Project::rootProjectDirectory() const +Utils::FilePath Project::rootProjectDirectory() const { if (!d->m_rootProjectDirectory.isEmpty()) return d->m_rootProjectDirectory; @@ -722,7 +722,7 @@ Project::RestoreResult Project::fromMap(const QVariantMap &map, QString *errorMe createTargetFromMap(map, i); } - d->m_rootProjectDirectory = Utils::FileName::fromString( + d->m_rootProjectDirectory = Utils::FilePath::fromString( namedSettings(Constants::PROJECT_ROOT_PATH_KEY).toString()); return RestoreResult::Ok; @@ -753,7 +753,7 @@ QStringList Project::filesGeneratedFrom(const QString &file) const return QStringList(); } -bool Project::isKnownFile(const Utils::FileName &filename) const +bool Project::isKnownFile(const Utils::FilePath &filename) const { if (d->m_sortedNodeList.empty()) return filename == projectFilePath(); @@ -802,7 +802,7 @@ void Project::projectLoaded() Task Project::createProjectTask(Task::TaskType type, const QString &description) { - return Task(type, description, Utils::FileName(), -1, Core::Id()); + return Task(type, description, Utils::FilePath(), -1, Core::Id()); } Core::Context Project::projectContext() const @@ -959,18 +959,18 @@ void Project::setPreferredKitPredicate(const Kit::Predicate &predicate) namespace ProjectExplorer { -static Utils::FileName constructTestPath(const char *basePath) +static Utils::FilePath constructTestPath(const char *basePath) { - Utils::FileName drive; + Utils::FilePath drive; if (Utils::HostOsInfo::isWindowsHost()) - drive = Utils::FileName::fromString("C:"); + drive = Utils::FilePath::fromString("C:"); return drive + QLatin1String(basePath); } -const Utils::FileName TEST_PROJECT_PATH = constructTestPath("/tmp/foobar/baz.project"); -const Utils::FileName TEST_PROJECT_NONEXISTING_FILE = constructTestPath("/tmp/foobar/nothing.cpp"); -const Utils::FileName TEST_PROJECT_CPP_FILE = constructTestPath("/tmp/foobar/main.cpp"); -const Utils::FileName TEST_PROJECT_GENERATED_FILE = constructTestPath("/tmp/foobar/generated.foo"); +const Utils::FilePath TEST_PROJECT_PATH = constructTestPath("/tmp/foobar/baz.project"); +const Utils::FilePath TEST_PROJECT_NONEXISTING_FILE = constructTestPath("/tmp/foobar/nothing.cpp"); +const Utils::FilePath TEST_PROJECT_CPP_FILE = constructTestPath("/tmp/foobar/main.cpp"); +const Utils::FilePath TEST_PROJECT_GENERATED_FILE = constructTestPath("/tmp/foobar/generated.foo"); const QString TEST_PROJECT_MIMETYPE = "application/vnd.test.qmakeprofile"; const QString TEST_PROJECT_DISPLAYNAME = "testProjectFoo"; const char TEST_PROJECT_ID[] = "Test.Project.Id"; @@ -1128,14 +1128,14 @@ void ProjectExplorerPlugin::testProject_projectTree() QCOMPARE(project.isKnownFile(TEST_PROJECT_CPP_FILE), true); QCOMPARE(project.isKnownFile(TEST_PROJECT_GENERATED_FILE), true); - Utils::FileNameList allFiles = project.files(Project::AllFiles); + Utils::FilePathList allFiles = project.files(Project::AllFiles); QCOMPARE(allFiles.count(), 3); QVERIFY(allFiles.contains(TEST_PROJECT_PATH)); QVERIFY(allFiles.contains(TEST_PROJECT_CPP_FILE)); QVERIFY(allFiles.contains(TEST_PROJECT_GENERATED_FILE)); QCOMPARE(project.files(Project::GeneratedFiles), {TEST_PROJECT_GENERATED_FILE}); - Utils::FileNameList sourceFiles = project.files(Project::SourceFiles); + Utils::FilePathList sourceFiles = project.files(Project::SourceFiles); QCOMPARE(sourceFiles.count(), 2); QVERIFY(sourceFiles.contains(TEST_PROJECT_PATH)); QVERIFY(sourceFiles.contains(TEST_PROJECT_CPP_FILE)); diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h index 6704e47107..e66e049c0c 100644 --- a/src/plugins/projectexplorer/project.h +++ b/src/plugins/projectexplorer/project.h @@ -64,7 +64,7 @@ class PROJECTEXPLORER_EXPORT ProjectDocument : public Core::IDocument public: using ProjectCallback = std::function<void()>; - ProjectDocument(const QString &mimeType, const Utils::FileName &fileName, + ProjectDocument(const QString &mimeType, const Utils::FilePath &fileName, const ProjectCallback &callback = {}); Core::IDocument::ReloadBehavior reloadBehavior(Core::IDocument::ChangeTrigger state, @@ -91,7 +91,7 @@ public: isParsingRole }; - Project(const QString &mimeType, const Utils::FileName &fileName, + Project(const QString &mimeType, const Utils::FilePath &fileName, const ProjectDocument::ProjectCallback &callback = {}); ~Project() override; @@ -101,13 +101,13 @@ public: QString mimeType() const; Core::IDocument *document() const; - Utils::FileName projectFilePath() const; - Utils::FileName projectDirectory() const; - static Utils::FileName projectDirectory(const Utils::FileName &top); + Utils::FilePath projectFilePath() const; + Utils::FilePath projectDirectory() const; + static Utils::FilePath projectDirectory(const Utils::FilePath &top); // This does not affect nodes, only the root path. void changeRootProjectDirectory(); - Utils::FileName rootProjectDirectory() const; + Utils::FilePath rootProjectDirectory() const; virtual ProjectNode *rootProjectNode() const; ContainerNode *containerNode() const; @@ -141,9 +141,9 @@ public: static const NodeMatcher SourceFiles; static const NodeMatcher GeneratedFiles; - Utils::FileNameList files(const NodeMatcher &matcher) const; + Utils::FilePathList files(const NodeMatcher &matcher) const; virtual QStringList filesGeneratedFrom(const QString &sourceFile) const; - bool isKnownFile(const Utils::FileName &filename) const; + bool isKnownFile(const Utils::FilePath &filename) const; virtual QVariantMap toMap() const; diff --git a/src/plugins/projectexplorer/projectconfigurationaspects.cpp b/src/plugins/projectexplorer/projectconfigurationaspects.cpp index 279cf39fa5..d9ad7c4334 100644 --- a/src/plugins/projectexplorer/projectconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/projectconfigurationaspects.cpp @@ -79,7 +79,7 @@ public: QPointer<PathChooser> m_pathChooserDisplay; QPointer<QTextEdit> m_textEditDisplay; QPixmap m_labelPixmap; - Utils::FileName m_baseFileName; + Utils::FilePath m_baseFileName; }; class BaseIntegerAspectPrivate @@ -138,12 +138,12 @@ void BaseStringAspect::toMap(QVariantMap &map) const d->m_checker->toMap(map); } -FileName BaseStringAspect::fileName() const +FilePath BaseStringAspect::fileName() const { - return FileName::fromString(d->m_value); + return FilePath::fromString(d->m_value); } -void BaseStringAspect::setFileName(const FileName &val) +void BaseStringAspect::setFileName(const FilePath &val) { setValue(val.toString()); } @@ -214,7 +214,7 @@ void BaseStringAspect::setEnvironment(const Environment &env) d->m_pathChooserDisplay->setEnvironment(env); } -void BaseStringAspect::setBaseFileName(const FileName &baseFileName) +void BaseStringAspect::setBaseFileName(const FilePath &baseFileName) { d->m_baseFileName = baseFileName; if (d->m_pathChooserDisplay) @@ -292,7 +292,7 @@ void BaseStringAspect::update() const bool enabled = !d->m_checker || d->m_checker->value(); if (d->m_pathChooserDisplay) { - d->m_pathChooserDisplay->setFileName(FileName::fromString(displayedString)); + d->m_pathChooserDisplay->setFileName(FilePath::fromString(displayedString)); d->m_pathChooserDisplay->setEnabled(enabled); } diff --git a/src/plugins/projectexplorer/projectconfigurationaspects.h b/src/plugins/projectexplorer/projectconfigurationaspects.h index 843e7ca461..250482b44e 100644 --- a/src/plugins/projectexplorer/projectconfigurationaspects.h +++ b/src/plugins/projectexplorer/projectconfigurationaspects.h @@ -89,7 +89,7 @@ public: void setHistoryCompleter(const QString &historyCompleterKey); void setExpectedKind(const Utils::PathChooser::Kind expectedKind); void setEnvironment(const Utils::Environment &env); - void setBaseFileName(const Utils::FileName &baseFileName); + void setBaseFileName(const Utils::FilePath &baseFileName); bool isChecked() const; void makeCheckable(const QString &optionalLabel, const QString &optionalBaseKey); @@ -105,8 +105,8 @@ public: void fromMap(const QVariantMap &map) override; void toMap(QVariantMap &map) const override; - Utils::FileName fileName() const; - void setFileName(const Utils::FileName &val); + Utils::FilePath fileName() const; + void setFileName(const Utils::FilePath &val); private: void update(); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 266a262968..cda19816a7 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -477,7 +477,7 @@ public: int m_activeRunControlCount = 0; int m_shutdownWatchDogId = -1; - QHash<QString, std::function<Project *(const Utils::FileName &)>> m_projectCreators; + QHash<QString, std::function<Project *(const Utils::FilePath &)>> m_projectCreators; QList<QPair<QString, QString> > m_recentProjects; // pair of filename, displayname static const int m_maxRecentProjects = 25; @@ -680,7 +680,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er dd, &ProjectExplorerPluginPrivate::updateActions); connect(tree, &ProjectTree::currentProjectChanged, this, [](Project *project) { TextEditor::FindInFiles::instance()->setBaseDirectory(project ? project->projectDirectory() - : Utils::FileName()); + : Utils::FilePath()); }); // For JsonWizard: @@ -1525,7 +1525,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er expander->registerFileVariables(Constants::VAR_CURRENTPROJECT_PREFIX, tr("Current project's main file."), []() -> QString { - Utils::FileName projectFilePath; + Utils::FilePath projectFilePath; if (Project *project = ProjectTree::currentProject()) projectFilePath = project->projectFilePath(); return projectFilePath.toString(); @@ -1795,16 +1795,16 @@ void ProjectExplorerPlugin::extensionsInitialized() QSsh::SshSettings::loadSettings(Core::ICore::settings()); const auto searchPathRetriever = [] { - Utils::FileNameList searchPaths; - searchPaths << Utils::FileName::fromString(Core::ICore::libexecPath()); + Utils::FilePathList searchPaths; + searchPaths << Utils::FilePath::fromString(Core::ICore::libexecPath()); if (Utils::HostOsInfo::isWindowsHost()) { const QString gitBinary = Core::ICore::settings()->value("Git/BinaryPath", "git") .toString(); const QStringList rawGitSearchPaths = Core::ICore::settings()->value("Git/Path") .toString().split(':', QString::SkipEmptyParts); - const Utils::FileNameList gitSearchPaths = Utils::transform(rawGitSearchPaths, - [](const QString &rawPath) { return Utils::FileName::fromString(rawPath); }); - const Utils::FileName fullGitPath = Utils::Environment::systemEnvironment() + const Utils::FilePathList gitSearchPaths = Utils::transform(rawGitSearchPaths, + [](const QString &rawPath) { return Utils::FilePath::fromString(rawPath); }); + const Utils::FilePath fullGitPath = Utils::Environment::systemEnvironment() .searchInPath(gitBinary, gitSearchPaths); if (!fullGitPath.isEmpty()) { searchPaths << fullGitPath.parentDir() @@ -2033,7 +2033,7 @@ ProjectExplorerPlugin::OpenProjectResult ProjectExplorerPlugin::openProjects(con QTC_ASSERT(!fileName.isEmpty(), continue); const QFileInfo fi(fileName); - const auto filePath = Utils::FileName::fromString(fi.absoluteFilePath()); + const auto filePath = Utils::FilePath::fromString(fi.absoluteFilePath()); Project *found = Utils::findOrDefault(SessionManager::projects(), Utils::equal(&Project::projectFilePath, filePath)); if (found) { @@ -2358,7 +2358,7 @@ QList<QPair<QString, QString> > ProjectExplorerPluginPrivate::recentProjects() c static QString pathOrDirectoryFor(const Node *node, bool dir) { - Utils::FileName path = node->filePath(); + Utils::FilePath path = node->filePath(); QString location; const FolderNode *folder = node->asFolderNode(); if (node->isVirtualFolderType() && folder) { @@ -2595,7 +2595,7 @@ int ProjectExplorerPluginPrivate::queue(QList<Project *> projects, QList<Id> ste BuildConfiguration *bc = t ? t->activeBuildConfiguration() : nullptr; if (!bc) return false; - if (!Utils::FileName::fromString(rc->runnable().executable).isChildOf(bc->buildDirectory())) + if (!Utils::FilePath::fromString(rc->runnable().executable).isChildOf(bc->buildDirectory())) return false; IDevice::ConstPtr device = rc->runnable().device; if (device.isNull()) @@ -3341,7 +3341,7 @@ void ProjectExplorerPluginPrivate::updateLocationSubMenus() for (const FolderNode::LocationInfo &li : locations) { const int line = li.line; - const Utils::FileName path = li.path; + const Utils::FilePath path = li.path; auto *action = new QAction(li.displayName, nullptr); connect(action, &QAction::triggered, this, [line, path]() { Core::EditorManager::openEditorAt(path.toString(), line); @@ -3473,12 +3473,12 @@ void ProjectExplorerPluginPrivate::addExistingDirectory() QTC_ASSERT(folderNode, return); - SelectableFilesDialogAddDirectory dialog(Utils::FileName::fromString(directoryFor(node)), - Utils::FileNameList(), ICore::mainWindow()); + SelectableFilesDialogAddDirectory dialog(Utils::FilePath::fromString(directoryFor(node)), + Utils::FilePathList(), ICore::mainWindow()); dialog.setAddFileFilter({}); if (dialog.exec() == QDialog::Accepted) - ProjectExplorerPlugin::addExistingFiles(folderNode, Utils::transform(dialog.selectedFiles(), &Utils::FileName::toString)); + ProjectExplorerPlugin::addExistingFiles(folderNode, Utils::transform(dialog.selectedFiles(), &Utils::FilePath::toString)); } void ProjectExplorerPlugin::addExistingFiles(FolderNode *folderNode, const QStringList &filePaths) @@ -3558,7 +3558,7 @@ void ProjectExplorerPluginPrivate::removeFile() const Node *currentNode = ProjectTree::currentNode(); QTC_ASSERT(currentNode && currentNode->asFileNode(), return); - const Utils::FileName filePath = currentNode->filePath(); + const Utils::FilePath filePath = currentNode->filePath(); Utils::RemoveFileDialog removeFileDialog(filePath.toString(), ICore::mainWindow()); if (removeFileDialog.exec() == QDialog::Accepted) { @@ -3798,7 +3798,7 @@ QStringList ProjectExplorerPlugin::projectFilePatterns() return patterns; } -bool ProjectExplorerPlugin::isProjectFile(const Utils::FileName &filePath) +bool ProjectExplorerPlugin::isProjectFile(const Utils::FilePath &filePath) { Utils::MimeType mt = Utils::mimeTypeForFile(filePath.toString()); for (const QString &mime : dd->m_projectCreators.keys()) { @@ -3839,12 +3839,12 @@ QList<QPair<QString, QString> > ProjectExplorerPlugin::recentProjects() } void ProjectManager::registerProjectCreator(const QString &mimeType, - const std::function<Project *(const Utils::FileName &)> &creator) + const std::function<Project *(const Utils::FilePath &)> &creator) { dd->m_projectCreators[mimeType] = creator; } -Project *ProjectManager::openProject(const Utils::MimeType &mt, const Utils::FileName &fileName) +Project *ProjectManager::openProject(const Utils::MimeType &mt, const Utils::FilePath &fileName) { if (mt.isValid()) { for (const QString &mimeType : dd->m_projectCreators.keys()) { diff --git a/src/plugins/projectexplorer/projectexplorer.h b/src/plugins/projectexplorer/projectexplorer.h index f3c545828f..23c2098216 100644 --- a/src/plugins/projectexplorer/projectexplorer.h +++ b/src/plugins/projectexplorer/projectexplorer.h @@ -45,7 +45,7 @@ class Id; namespace Utils { class ProcessHandle; -class FileName; +class FilePath; } namespace ProjectExplorer { @@ -141,7 +141,7 @@ public: // internal public for FlatModel static void renameFile(Node *node, const QString &newFilePath); static QStringList projectFilePatterns(); - static bool isProjectFile(const Utils::FileName &filePath); + static bool isProjectFile(const Utils::FilePath &filePath); static QList<QPair<QString, QString> > recentProjects(); static bool canRunStartupProject(Core::Id runMode, QString *whyNot = nullptr); diff --git a/src/plugins/projectexplorer/projectexplorersettingspage.cpp b/src/plugins/projectexplorer/projectexplorersettingspage.cpp index 05586ce173..73f622aedf 100644 --- a/src/plugins/projectexplorer/projectexplorersettingspage.cpp +++ b/src/plugins/projectexplorer/projectexplorersettingspage.cpp @@ -205,7 +205,7 @@ void ProjectExplorerSettingsPage::apply() if (m_widget) { ProjectExplorerPlugin::setProjectExplorerSettings(m_widget->settings()); Core::DocumentManager::setProjectsDirectory( - Utils::FileName::fromString(m_widget->projectsDirectory())); + Utils::FilePath::fromString(m_widget->projectsDirectory())); Core::DocumentManager::setUseProjectsDirectory(m_widget->useProjectsDirectory()); } } diff --git a/src/plugins/projectexplorer/projectfilewizardextension.cpp b/src/plugins/projectexplorer/projectfilewizardextension.cpp index 5dab7bbf99..33be4cdcfe 100644 --- a/src/plugins/projectexplorer/projectfilewizardextension.cpp +++ b/src/plugins/projectexplorer/projectfilewizardextension.cpp @@ -256,7 +256,7 @@ void ProjectFileWizardExtension::applyCodeStyle(GeneratedFile *file) const Indenter *indenter = nullptr; if (factory) { indenter = factory->createIndenter(&doc); - indenter->setFileName(Utils::FileName::fromString(file->path())); + indenter->setFileName(Utils::FilePath::fromString(file->path())); } if (!indenter) indenter = new NormalIndenter(&doc); diff --git a/src/plugins/projectexplorer/projectimporter.cpp b/src/plugins/projectexplorer/projectimporter.cpp index 3c6e48733a..4d32dba9d6 100644 --- a/src/plugins/projectexplorer/projectimporter.cpp +++ b/src/plugins/projectexplorer/projectimporter.cpp @@ -71,7 +71,7 @@ static bool hasOtherUsers(Core::Id id, const QVariant &v, Kit *k) }); } -ProjectImporter::ProjectImporter(const Utils::FileName &path) : m_projectPath(path) +ProjectImporter::ProjectImporter(const Utils::FilePath &path) : m_projectPath(path) { useTemporaryKitAspect(ToolChainKitAspect::id(), [this](Kit *k, const QVariantList &vl) { cleanupTemporaryToolChains(k, vl); }, @@ -84,7 +84,7 @@ ProjectImporter::~ProjectImporter() removeProject(k); } -const QList<BuildInfo> ProjectImporter::import(const Utils::FileName &importPath, bool silent) +const QList<BuildInfo> ProjectImporter::import(const Utils::FilePath &importPath, bool silent) { QList<BuildInfo> result; @@ -97,7 +97,7 @@ const QList<BuildInfo> ProjectImporter::import(const Utils::FileName &importPath return result; } - const Utils::FileName absoluteImportPath = Utils::FileName::fromString(fi.absoluteFilePath()); + const Utils::FilePath absoluteImportPath = Utils::FilePath::fromString(fi.absoluteFilePath()); const auto handleFailure = [this, importPath, silent] { if (silent) @@ -367,7 +367,7 @@ bool ProjectImporter::hasKitWithTemporaryData(Core::Id id, const QVariant &data) } static ProjectImporter::ToolChainData -createToolChains(const Utils::FileName &toolChainPath, const Core::Id &language) +createToolChains(const Utils::FilePath &toolChainPath, const Core::Id &language) { ProjectImporter::ToolChainData data; @@ -387,7 +387,7 @@ createToolChains(const Utils::FileName &toolChainPath, const Core::Id &language) } ProjectImporter::ToolChainData -ProjectImporter::findOrCreateToolChains(const Utils::FileName &toolChainPath, +ProjectImporter::findOrCreateToolChains(const Utils::FilePath &toolChainPath, const Core::Id &language) const { ToolChainData result; diff --git a/src/plugins/projectexplorer/projectimporter.h b/src/plugins/projectexplorer/projectimporter.h index 87ee21a7b8..f1cf482607 100644 --- a/src/plugins/projectexplorer/projectimporter.h +++ b/src/plugins/projectexplorer/projectimporter.h @@ -51,13 +51,13 @@ public: bool areTemporary = false; }; - ProjectImporter(const Utils::FileName &path); + ProjectImporter(const Utils::FilePath &path); ~ProjectImporter() override; - const Utils::FileName projectFilePath() const { return m_projectPath; } - const Utils::FileName projectDirectory() const { return m_projectPath.parentDir(); } + const Utils::FilePath projectFilePath() const { return m_projectPath; } + const Utils::FilePath projectDirectory() const { return m_projectPath.parentDir(); } - virtual const QList<BuildInfo> import(const Utils::FileName &importPath, bool silent = false); + virtual const QList<BuildInfo> import(const Utils::FilePath &importPath, bool silent = false); virtual QStringList importCandidates() = 0; virtual Target *preferredTarget(const QList<Target *> &possibleTargets); @@ -88,7 +88,7 @@ protected: }; // importPath is an existing directory at this point! - virtual QList<void *> examineDirectory(const Utils::FileName &importPath) const = 0; + virtual QList<void *> examineDirectory(const Utils::FilePath &importPath) const = 0; // will get one of the results from examineDirectory virtual bool matchKit(void *directoryData, const Kit *k) const = 0; // will get one of the results from examineDirectory @@ -110,7 +110,7 @@ protected: // Does *any* kit feature the requested data yet? bool hasKitWithTemporaryData(Core::Id id, const QVariant &data) const; - ToolChainData findOrCreateToolChains(const Utils::FileName &toolChainPath, const Core::Id &language) const; + ToolChainData findOrCreateToolChains(const Utils::FilePath &toolChainPath, const Core::Id &language) const; private: void markKitAsTemporary(Kit *k) const; @@ -119,7 +119,7 @@ private: void cleanupTemporaryToolChains(ProjectExplorer::Kit *k, const QVariantList &vl); void persistTemporaryToolChains(ProjectExplorer::Kit *k, const QVariantList &vl); - const Utils::FileName m_projectPath; + const Utils::FilePath m_projectPath; mutable bool m_isUpdating = false; class TemporaryInformationHandler { diff --git a/src/plugins/projectexplorer/projectmanager.h b/src/plugins/projectexplorer/projectmanager.h index e504b1968e..c0f91cebc7 100644 --- a/src/plugins/projectexplorer/projectmanager.h +++ b/src/plugins/projectexplorer/projectmanager.h @@ -32,7 +32,7 @@ #include <functional> namespace Utils { -class FileName; +class FilePath; class MimeType; } // Utils @@ -44,19 +44,19 @@ class PROJECTEXPLORER_EXPORT ProjectManager { public: static bool canOpenProjectForMimeType(const Utils::MimeType &mt); - static Project *openProject(const Utils::MimeType &mt, const Utils::FileName &fileName); + static Project *openProject(const Utils::MimeType &mt, const Utils::FilePath &fileName); template <typename T> static void registerProjectType(const QString &mimeType) { - ProjectManager::registerProjectCreator(mimeType, [](const Utils::FileName &fileName) { + ProjectManager::registerProjectCreator(mimeType, [](const Utils::FilePath &fileName) { return new T(fileName); }); } private: static void registerProjectCreator(const QString &mimeType, - const std::function<Project *(const Utils::FileName &)> &); + const std::function<Project *(const Utils::FilePath &)> &); }; } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp index 31f986d864..cfacd27ab6 100644 --- a/src/plugins/projectexplorer/projectmodels.cpp +++ b/src/plugins/projectexplorer/projectmodels.cpp @@ -219,8 +219,8 @@ bool FlatModel::setData(const QModelIndex &index, const QVariant &value, int rol Node *node = nodeForIndex(index); QTC_ASSERT(node, return false); - const Utils::FileName orgFilePath = node->filePath(); - const Utils::FileName newFilePath = orgFilePath.parentDir().pathAppended(value.toString()); + const Utils::FilePath orgFilePath = node->filePath(); + const Utils::FilePath newFilePath = orgFilePath.parentDir().pathAppended(value.toString()); ProjectExplorerPlugin::renameFile(node, newFilePath.toString()); emit renamed(orgFilePath, newFilePath); @@ -453,7 +453,7 @@ class DropFileDialog : public QDialog { Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::Internal::FlatModel) public: - DropFileDialog(const FileName &defaultTargetDir) + DropFileDialog(const FilePath &defaultTargetDir) : m_buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel)), m_buttonGroup(new QButtonGroup(this)) { @@ -516,9 +516,9 @@ public: } DropAction dropAction() const { return static_cast<DropAction>(m_buttonGroup->checkedId()); } - FileName targetDir() const + FilePath targetDir() const { - return m_targetDirChooser ? m_targetDirChooser->fileName() : FileName(); + return m_targetDirChooser ? m_targetDirChooser->fileName() : FilePath(); } private: @@ -576,15 +576,15 @@ bool FlatModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int r // Node weirdness: Sometimes the "file path" is a directory, sometimes it's a file... const auto dirForProjectNode = [](const ProjectNode *pNode) { - const FileName dir = pNode->filePath(); + const FilePath dir = pNode->filePath(); if (dir.toFileInfo().isDir()) return dir; - return FileName::fromString(dir.toFileInfo().path()); + return FilePath::fromString(dir.toFileInfo().path()); }; - FileName targetDir = dirForProjectNode(targetProjectNode); + FilePath targetDir = dirForProjectNode(targetProjectNode); // Ask the user what to do now: Copy or add? With or without file transfer? - DropFileDialog dlg(targetDir == dirForProjectNode(sourceProjectNode) ? FileName() : targetDir); + DropFileDialog dlg(targetDir == dirForProjectNode(sourceProjectNode) ? FilePath() : targetDir); if (dlg.exec() != QDialog::Accepted) return true; if (!dlg.targetDir().isEmpty()) diff --git a/src/plugins/projectexplorer/projectmodels.h b/src/plugins/projectexplorer/projectmodels.h index 5805efe3ea..aa044fc0f0 100644 --- a/src/plugins/projectexplorer/projectmodels.h +++ b/src/plugins/projectexplorer/projectmodels.h @@ -86,7 +86,7 @@ public: void onCollapsed(const QModelIndex &idx); signals: - void renamed(const Utils::FileName &oldName, const Utils::FileName &newName); + void renamed(const Utils::FilePath &oldName, const Utils::FilePath &newName); void requestExpansion(const QModelIndex &index); private: diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index dfc07ec534..e6825e98be 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -52,7 +52,7 @@ namespace ProjectExplorer { -static FolderNode *folderNode(const FolderNode *folder, const Utils::FileName &directory) +static FolderNode *folderNode(const FolderNode *folder, const Utils::FilePath &directory) { return static_cast<FolderNode *>(Utils::findOrDefault(folder->folderNodes(), [&directory](const FolderNode *fn) { @@ -61,13 +61,13 @@ static FolderNode *folderNode(const FolderNode *folder, const Utils::FileName &d } static FolderNode *recursiveFindOrCreateFolderNode(FolderNode *folder, - const Utils::FileName &directory, - const Utils::FileName &overrideBaseDir, + const Utils::FilePath &directory, + const Utils::FilePath &overrideBaseDir, const FolderNode::FolderNodeFactory &factory) { - Utils::FileName path = overrideBaseDir.isEmpty() ? folder->filePath() : overrideBaseDir; + Utils::FilePath path = overrideBaseDir.isEmpty() ? folder->filePath() : overrideBaseDir; - Utils::FileName directoryWithoutPrefix; + Utils::FilePath directoryWithoutPrefix; bool isRelative = false; if (path.isEmpty() || path.toFileInfo().isRoot()) { @@ -126,7 +126,7 @@ void Node::setPriority(int p) m_priority = p; } -void Node::setFilePath(const Utils::FileName &filePath) +void Node::setFilePath(const Utils::FilePath &filePath) { m_filePath = filePath; } @@ -152,7 +152,7 @@ void Node::setIsGenerated(bool g) m_flags = static_cast<NodeFlag>(m_flags & ~FlagIsGenerated); } -void Node::setAbsoluteFilePathAndLine(const Utils::FileName &path, int line) +void Node::setAbsoluteFilePathAndLine(const Utils::FilePath &path, int line) { if (m_filePath == path && m_line == line) return; @@ -215,7 +215,7 @@ const ProjectNode *Node::managingProject() const /*! The path of the file or folder in the filesystem the node represents. */ -const Utils::FileName &Node::filePath() const +const Utils::FilePath &Node::filePath() const { return m_filePath; } @@ -297,7 +297,7 @@ FileType Node::fileTypeForMimeType(const Utils::MimeType &mt) return type; } -FileType Node::fileTypeForFileName(const Utils::FileName &file) +FileType Node::fileTypeForFileName(const Utils::FilePath &file) { return fileTypeForMimeType(Utils::mimeTypeForFile(file.toString(), Utils::MimeMatchMode::MatchExtension)); @@ -313,7 +313,7 @@ FileType Node::fileTypeForFileName(const Utils::FileName &file) \sa ProjectExplorer::FolderNode, ProjectExplorer::ProjectNode */ -FileNode::FileNode(const Utils::FileName &filePath, const FileType fileType) : +FileNode::FileNode(const Utils::FilePath &filePath, const FileType fileType) : m_fileType(fileType) { setFilePath(filePath); @@ -340,8 +340,8 @@ FileType FileNode::fileType() const return m_fileType; } -static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &directory, - const std::function<FileNode *(const Utils::FileName &)> factory, +static QList<FileNode *> scanForFilesRecursively(const Utils::FilePath &directory, + const std::function<FileNode *(const Utils::FilePath &)> factory, QSet<QString> &visited, QFutureInterface<QList<FileNode*>> *future, double progressStart, double progressRange, const QList<Core::IVersionControl*> &versionControls) @@ -364,7 +364,7 @@ static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &director if (future && future->isCanceled()) return result; - const Utils::FileName entryName = Utils::FileName::fromString(entry.absoluteFilePath()); + const Utils::FilePath entryName = Utils::FilePath::fromString(entry.absoluteFilePath()); if (!Utils::contains(versionControls, [&entryName](const Core::IVersionControl *vc) { return vc->isVcsFileOrDirectory(entryName); })) { @@ -388,8 +388,8 @@ static QList<FileNode *> scanForFilesRecursively(const Utils::FileName &director } QList<FileNode *> -FileNode::scanForFiles(const Utils::FileName &directory, - const std::function<FileNode *(const Utils::FileName &)> factory, +FileNode::scanForFiles(const Utils::FilePath &directory, + const std::function<FileNode *(const Utils::FilePath &)> factory, QFutureInterface<QList<FileNode *>> *future) { QSet<QString> visited; @@ -422,7 +422,7 @@ QString FileNode::displayName() const \sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode */ -FolderNode::FolderNode(const Utils::FileName &folderPath) +FolderNode::FolderNode(const Utils::FilePath &folderPath) { setFilePath(folderPath); setPriority(DefaultFolderPriority); @@ -559,7 +559,7 @@ QList<FileNode*> FolderNode::fileNodes() const return result; } -FileNode *FolderNode::fileNode(const Utils::FileName &file) const +FileNode *FolderNode::fileNode(const Utils::FilePath &file) const { return static_cast<FileNode *>(Utils::findOrDefault(m_nodes, [&file](const std::unique_ptr<Node> &n) { @@ -579,7 +579,7 @@ QList<FolderNode*> FolderNode::folderNodes() const } void FolderNode::addNestedNode(std::unique_ptr<FileNode> &&fileNode, - const Utils::FileName &overrideBaseDir, + const Utils::FilePath &overrideBaseDir, const FolderNodeFactory &factory) { FolderNode *folder = recursiveFindOrCreateFolderNode(this, fileNode->filePath().parentDir(), @@ -588,7 +588,7 @@ void FolderNode::addNestedNode(std::unique_ptr<FileNode> &&fileNode, } void FolderNode::addNestedNodes(std::vector<std::unique_ptr<FileNode> > &&files, - const Utils::FileName &overrideBaseDir, + const Utils::FilePath &overrideBaseDir, const FolderNode::FolderNodeFactory &factory) { for (std::unique_ptr<FileNode> &f : files) @@ -776,7 +776,7 @@ bool FolderNode::showWhenEmpty() const \sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode */ -VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath) : +VirtualFolderNode::VirtualFolderNode(const Utils::FilePath &folderPath) : FolderNode(folderPath) { } @@ -794,7 +794,7 @@ VirtualFolderNode::VirtualFolderNode(const Utils::FileName &folderPath) : /*! Creates an uninitialized project node object. */ -ProjectNode::ProjectNode(const Utils::FileName &projectFilePath) : +ProjectNode::ProjectNode(const Utils::FilePath &projectFilePath) : FolderNode(projectFilePath) { setPriority(DefaultProjectPriority); @@ -870,7 +870,7 @@ bool ProjectNode::deploysFolder(const QString &folder) const return false; } -ProjectNode *ProjectNode::projectNode(const Utils::FileName &file) const +ProjectNode *ProjectNode::projectNode(const Utils::FilePath &file) const { for (const std::unique_ptr<Node> &n: m_nodes) { if (ProjectNode *pnode = n->asProjectNode()) diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index b8bd5c3042..ce36882aa9 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -121,7 +121,7 @@ public: // or node->parentProjectNode() for all other cases. const ProjectNode *managingProject() const; // see above. - const Utils::FileName &filePath() const; // file system path + const Utils::FilePath &filePath() const; // file system path int line() const; virtual QString displayName() const; virtual QString tooltip() const; @@ -132,7 +132,7 @@ public: virtual bool supportsAction(ProjectAction action, const Node *node) const; void setEnabled(bool enabled); - void setAbsoluteFilePathAndLine(const Utils::FileName &filePath, int line); + void setAbsoluteFilePathAndLine(const Utils::FilePath &filePath, int line); virtual FileNode *asFileNode() { return nullptr; } virtual const FileNode *asFileNode() const { return nullptr; } @@ -154,18 +154,18 @@ public: void setLine(int line); static FileType fileTypeForMimeType(const Utils::MimeType &mt); - static FileType fileTypeForFileName(const Utils::FileName &file); + static FileType fileTypeForFileName(const Utils::FilePath &file); protected: Node(); Node(const Node &other) = delete; bool operator=(const Node &other) = delete; - void setFilePath(const Utils::FileName &filePath); + void setFilePath(const Utils::FilePath &filePath); private: FolderNode *m_parentFolderNode = nullptr; - Utils::FileName m_filePath; + Utils::FilePath m_filePath; int m_line = -1; int m_priority = DefaultPriority; @@ -181,7 +181,7 @@ private: class PROJECTEXPLORER_EXPORT FileNode : public Node { public: - FileNode(const Utils::FileName &filePath, const FileType fileType); + FileNode(const Utils::FilePath &filePath, const FileType fileType); FileNode *clone() const; @@ -191,8 +191,8 @@ public: const FileNode *asFileNode() const final { return this; } static QList<FileNode *> - scanForFiles(const Utils::FileName &directory, - const std::function<FileNode *(const Utils::FileName &fileName)> factory, + scanForFiles(const Utils::FilePath &directory, + const std::function<FileNode *(const Utils::FilePath &fileName)> factory, QFutureInterface<QList<FileNode *>> *future = nullptr); bool supportsAction(ProjectAction action, const Node *node) const override; QString displayName() const override; @@ -205,7 +205,7 @@ private: class PROJECTEXPLORER_EXPORT FolderNode : public Node { public: - explicit FolderNode(const Utils::FileName &folderPath); + explicit FolderNode(const Utils::FilePath &folderPath); QString displayName() const override; QIcon icon() const; @@ -223,17 +223,17 @@ public: ProjectNode *findProjectNode(const std::function<bool(const ProjectNode *)> &predicate); const QList<Node *> nodes() const; QList<FileNode *> fileNodes() const; - FileNode *fileNode(const Utils::FileName &file) const; + FileNode *fileNode(const Utils::FilePath &file) const; QList<FolderNode *> folderNodes() const; - using FolderNodeFactory = std::function<std::unique_ptr<FolderNode>(const Utils::FileName &)>; + using FolderNodeFactory = std::function<std::unique_ptr<FolderNode>(const Utils::FilePath &)>; void addNestedNodes(std::vector<std::unique_ptr<FileNode>> &&files, - const Utils::FileName &overrideBaseDir = Utils::FileName(), + const Utils::FilePath &overrideBaseDir = Utils::FilePath(), const FolderNodeFactory &factory - = [](const Utils::FileName &fn) { return std::make_unique<FolderNode>(fn); }); + = [](const Utils::FilePath &fn) { return std::make_unique<FolderNode>(fn); }); void addNestedNode(std::unique_ptr<FileNode> &&fileNode, - const Utils::FileName &overrideBaseDir = Utils::FileName(), + const Utils::FilePath &overrideBaseDir = Utils::FilePath(), const FolderNodeFactory &factory - = [](const Utils::FileName &fn) { return std::make_unique<FolderNode>(fn); }); + = [](const Utils::FilePath &fn) { return std::make_unique<FolderNode>(fn); }); void compress(); // takes ownership of newNode. @@ -245,10 +245,10 @@ public: class LocationInfo { public: - LocationInfo(const QString &dn, const Utils::FileName &p, const int l = -1) : + LocationInfo(const QString &dn, const Utils::FilePath &p, const int l = -1) : path(p), line(l), displayName(dn) { } - Utils::FileName path; + Utils::FilePath path; int line = -1; QString displayName; }; @@ -311,7 +311,7 @@ private: class PROJECTEXPLORER_EXPORT VirtualFolderNode : public FolderNode { public: - explicit VirtualFolderNode(const Utils::FileName &folderPath); + explicit VirtualFolderNode(const Utils::FilePath &folderPath); bool isFolderNodeType() const override { return false; } bool isVirtualFolderType() const override { return true; } @@ -321,13 +321,13 @@ public: class PROJECTEXPLORER_EXPORT ProjectNode : public FolderNode { public: - explicit ProjectNode(const Utils::FileName &projectFilePath); + explicit ProjectNode(const Utils::FilePath &projectFilePath); virtual bool canAddSubProject(const QString &proFilePath) const; virtual bool addSubProject(const QString &proFile); virtual QStringList subProjectFileNamePatterns() const; virtual bool removeSubProject(const QString &proFilePath); - virtual Utils::optional<Utils::FileName> visibleAfterAddFileAction() const { + virtual Utils::optional<Utils::FilePath> visibleAfterAddFileAction() const { return Utils::nullopt; } @@ -345,7 +345,7 @@ public: // by default returns false virtual bool deploysFolder(const QString &folder) const; - ProjectNode *projectNode(const Utils::FileName &file) const; + ProjectNode *projectNode(const Utils::FilePath &file) const; ProjectNode *asProjectNode() final { return this; } const ProjectNode *asProjectNode() const final { return this; } diff --git a/src/plugins/projectexplorer/projecttree.cpp b/src/plugins/projectexplorer/projecttree.cpp index ceb6033a42..ca35bcff68 100644 --- a/src/plugins/projectexplorer/projecttree.cpp +++ b/src/plugins/projectexplorer/projecttree.cpp @@ -110,10 +110,10 @@ Node *ProjectTree::currentNode() return s_instance->m_currentNode; } -FileName ProjectTree::currentFilePath() +FilePath ProjectTree::currentFilePath() { Node *node = currentNode(); - return node ? node->filePath() : FileName(); + return node ? node->filePath() : FilePath(); } void ProjectTree::registerWidget(ProjectTreeWidget *widget) @@ -167,7 +167,7 @@ void ProjectTree::updateFromProjectTreeWidget(ProjectTreeWidget *widget) void ProjectTree::updateFromDocumentManager() { if (Core::IDocument *document = Core::EditorManager::currentDocument()) { - const FileName fileName = document->filePath(); + const FilePath fileName = document->filePath(); updateFromNode(ProjectTreeWidget::nodeForFile(fileName)); } else { updateFromNode(nullptr); @@ -302,12 +302,12 @@ void ProjectTree::updateExternalFileWarning() } if (!infoBar->canInfoBeAdded(externalFileId)) return; - const FileName fileName = document->filePath(); + const FilePath fileName = document->filePath(); const QList<Project *> projects = SessionManager::projects(); if (projects.isEmpty()) return; for (Project *project : projects) { - FileName projectDir = project->projectDirectory(); + FilePath projectDir = project->projectDirectory(); if (projectDir.isEmpty()) continue; if (fileName.isChildOf(projectDir)) @@ -315,7 +315,7 @@ void ProjectTree::updateExternalFileWarning() // External file. Test if it under the same VCS QString topLevel; if (Core::VcsManager::findVersionControlForDirectory(projectDir.toString(), &topLevel) - && fileName.isChildOf(FileName::fromString(topLevel))) { + && fileName.isChildOf(FilePath::fromString(topLevel))) { return; } } @@ -423,7 +423,7 @@ Project *ProjectTree::projectForNode(const Node *node) }); } -Node *ProjectTree::nodeForFile(const FileName &fileName) +Node *ProjectTree::nodeForFile(const FilePath &fileName) { Node *node = nullptr; for (const Project *project : SessionManager::projects()) { diff --git a/src/plugins/projectexplorer/projecttree.h b/src/plugins/projectexplorer/projecttree.h index f1a22b0237..4adcaa7571 100644 --- a/src/plugins/projectexplorer/projecttree.h +++ b/src/plugins/projectexplorer/projecttree.h @@ -31,7 +31,7 @@ #include <functional> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { class FileNode; @@ -54,7 +54,7 @@ public: static Project *currentProject(); static Node *currentNode(); - static Utils::FileName currentFilePath(); + static Utils::FilePath currentFilePath(); // Integration with ProjectTreeWidget static void registerWidget(Internal::ProjectTreeWidget *widget); @@ -76,7 +76,7 @@ public: static void forEachNode(const std::function<void(Node *)> &task); static Project *projectForNode(const Node *node); - static Node *nodeForFile(const Utils::FileName &fileName); + static Node *nodeForFile(const Utils::FilePath &fileName); void collapseAll(); void expandAll(); diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 3f8a5e3d83..70d3dc976a 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -350,7 +350,7 @@ void ProjectTreeWidget::rowsInserted(const QModelIndex &parent, int start, int e } } -Node *ProjectTreeWidget::nodeForFile(const FileName &fileName) +Node *ProjectTreeWidget::nodeForFile(const FilePath &fileName) { Node *bestNode = nullptr; int bestNodeExpandCount = INT_MAX; @@ -457,7 +457,7 @@ void ProjectTreeWidget::editCurrentItem() editor->setSelection(0, dotIndex); } -void ProjectTreeWidget::renamed(const FileName &oldPath, const FileName &newPath) +void ProjectTreeWidget::renamed(const FilePath &oldPath, const FilePath &newPath) { update(); Q_UNUSED(oldPath); @@ -474,7 +474,7 @@ void ProjectTreeWidget::renamed(const FileName &oldPath, const FileName &newPath void ProjectTreeWidget::syncFromDocumentManager() { // sync from document manager - FileName fileName; + FilePath fileName; if (IDocument *doc = EditorManager::currentDocument()) fileName = doc->filePath(); if (!currentNode() || currentNode()->filePath() != fileName) diff --git a/src/plugins/projectexplorer/projecttreewidget.h b/src/plugins/projectexplorer/projecttreewidget.h index fb2abfc702..3ab73eeef9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.h +++ b/src/plugins/projectexplorer/projecttreewidget.h @@ -61,7 +61,7 @@ public: void sync(ProjectExplorer::Node *node); void showMessage(ProjectExplorer::Node *node, const QString &message); - static Node *nodeForFile(const Utils::FileName &fileName); + static Node *nodeForFile(const Utils::FilePath &fileName); void toggleAutoSynchronization(); void editCurrentItem(); @@ -80,7 +80,7 @@ private: void setCurrentItem(ProjectExplorer::Node *node); static int expandedCount(Node *node); void rowsInserted(const QModelIndex &parent, int start, int end); - void renamed(const Utils::FileName &oldPath, const Utils::FileName &newPath); + void renamed(const Utils::FilePath &oldPath, const Utils::FilePath &newPath); void syncFromDocumentManager(); @@ -93,7 +93,7 @@ private: QString m_modelId; bool m_autoSync = true; - Utils::FileName m_delayedRename; + Utils::FilePath m_delayedRename; static QList<ProjectTreeWidget *> m_projectTreeWidgets; friend class ProjectTreeWidgetFactory; diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp index 434249bee1..394a63290a 100644 --- a/src/plugins/projectexplorer/projectwindow.cpp +++ b/src/plugins/projectexplorer/projectwindow.cpp @@ -546,7 +546,7 @@ public: QString importDir = QFileDialog::getExistingDirectory(ICore::mainWindow(), ProjectWindow::tr("Import Directory"), dir); - FileName path = FileName::fromString(importDir); + FilePath path = FilePath::fromString(importDir); Target *lastTarget = nullptr; BuildConfiguration *lastBc = nullptr; diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index 508f5a1e88..9eaf136d8b 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -534,7 +534,7 @@ void ProjectWizardPage::setFiles(const QStringList &fileNames) const bool filePath2HasDir = filePath2.contains(QLatin1Char('/')); if (filePath1HasDir == filePath2HasDir) - return FileName::fromString(filePath1) < FileName::fromString(filePath2); + return FilePath::fromString(filePath1) < FilePath::fromString(filePath2); return filePath1HasDir; } ); diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 56b5d68bc2..5c3c6fc0e9 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -204,7 +204,7 @@ RunConfiguration::RunConfiguration(Target *target, Core::Id id) m_executableGetter = [this] { if (const auto executableAspect = aspect<ExecutableAspect>()) return executableAspect->executable(); - return FileName(); + return FilePath(); }; } @@ -229,7 +229,7 @@ QString RunConfiguration::disabledReason() const return tr("The Project is currently being parsed."); if (!target()->project()->hasParsingData()) { QString msg = tr("The project could not be fully parsed."); - const FileName projectFilePath = buildTargetInfo().projectFilePath; + const FilePath projectFilePath = buildTargetInfo().projectFilePath; if (!projectFilePath.exists()) msg += '\n' + tr("The project file \"%1\" does not exist.").arg(projectFilePath.toString()); return msg; @@ -332,7 +332,7 @@ void RunConfiguration::setExecutableGetter(const RunConfiguration::ExecutableGet m_executableGetter = exeGetter; } -FileName RunConfiguration::executable() const +FilePath RunConfiguration::executable() const { return m_executableGetter(); } diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 77b9846471..3e5cbc6b15 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -160,9 +160,9 @@ public: bool fromMap(const QVariantMap &map) override; QVariantMap toMap() const override; - using ExecutableGetter = std::function<Utils::FileName()>; + using ExecutableGetter = std::function<Utils::FilePath()>; void setExecutableGetter(const ExecutableGetter &exeGetter); - Utils::FileName executable() const; + Utils::FilePath executable() const; virtual Runnable runnable() const; @@ -228,7 +228,7 @@ public: QString buildKey; QString displayName; QString displayNameUniquifier; - Utils::FileName projectFilePath; + Utils::FilePath projectFilePath; CreationMode creationMode = AlwaysCreate; bool useTerminal = false; }; diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 134589fe05..697b456758 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -190,8 +190,8 @@ void WorkingDirectoryAspect::resetPath() void WorkingDirectoryAspect::fromMap(const QVariantMap &map) { - m_workingDirectory = FileName::fromString(map.value(settingsKey()).toString()); - m_defaultWorkingDirectory = FileName::fromString(map.value(keyForDefaultWd()).toString()); + m_workingDirectory = FilePath::fromString(map.value(settingsKey()).toString()); + m_defaultWorkingDirectory = FilePath::fromString(map.value(keyForDefaultWd()).toString()); if (m_workingDirectory.isEmpty()) m_workingDirectory = m_defaultWorkingDirectory; @@ -208,32 +208,32 @@ void WorkingDirectoryAspect::toMap(QVariantMap &data) const data.insert(keyForDefaultWd(), m_defaultWorkingDirectory.toString()); } -FileName WorkingDirectoryAspect::workingDirectory(const MacroExpander *expander) const +FilePath WorkingDirectoryAspect::workingDirectory(const MacroExpander *expander) const { const Utils::Environment env = m_envAspect ? m_envAspect->environment() : Utils::Environment::systemEnvironment(); QString workingDir = m_workingDirectory.toUserOutput(); if (expander) workingDir = expander->expandProcessArgs(workingDir); - return FileName::fromString(PathChooser::expandedDirectory(workingDir, env, QString())); + return FilePath::fromString(PathChooser::expandedDirectory(workingDir, env, QString())); } -FileName WorkingDirectoryAspect::defaultWorkingDirectory() const +FilePath WorkingDirectoryAspect::defaultWorkingDirectory() const { return m_defaultWorkingDirectory; } -FileName WorkingDirectoryAspect::unexpandedWorkingDirectory() const +FilePath WorkingDirectoryAspect::unexpandedWorkingDirectory() const { return m_workingDirectory; } -void WorkingDirectoryAspect::setDefaultWorkingDirectory(const FileName &defaultWorkingDir) +void WorkingDirectoryAspect::setDefaultWorkingDirectory(const FilePath &defaultWorkingDir) { if (defaultWorkingDir == m_defaultWorkingDirectory) return; - Utils::FileName oldDefaultDir = m_defaultWorkingDirectory; + Utils::FilePath oldDefaultDir = m_defaultWorkingDirectory; m_defaultWorkingDirectory = defaultWorkingDir; if (m_chooser) m_chooser->setBaseFileName(m_defaultWorkingDirectory); @@ -381,7 +381,7 @@ void ExecutableAspect::makeOverridable(const QString &overridingKey, const QStri this, &ExecutableAspect::changed); } -FileName ExecutableAspect::executable() const +FilePath ExecutableAspect::executable() const { if (m_alternativeExecutable && m_alternativeExecutable->isChecked()) return m_alternativeExecutable->fileName(); @@ -406,7 +406,7 @@ void ExecutableAspect::setPlaceHolderText(const QString &placeHolderText) m_executable.setPlaceHolderText(placeHolderText); } -void ExecutableAspect::setExecutable(const FileName &executable) +void ExecutableAspect::setExecutable(const FilePath &executable) { m_executable.setValue(executable.toString()); } diff --git a/src/plugins/projectexplorer/runconfigurationaspects.h b/src/plugins/projectexplorer/runconfigurationaspects.h index fb8de434ef..77973f65f4 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.h +++ b/src/plugins/projectexplorer/runconfigurationaspects.h @@ -72,10 +72,10 @@ public: void addToConfigurationLayout(QFormLayout *layout) override; void acquaintSiblings(const ProjectConfigurationAspects &) override; - Utils::FileName workingDirectory(const Utils::MacroExpander *expander) const; - Utils::FileName defaultWorkingDirectory() const; - Utils::FileName unexpandedWorkingDirectory() const; - void setDefaultWorkingDirectory(const Utils::FileName &defaultWorkingDir); + Utils::FilePath workingDirectory(const Utils::MacroExpander *expander) const; + Utils::FilePath defaultWorkingDirectory() const; + Utils::FilePath unexpandedWorkingDirectory() const; + void setDefaultWorkingDirectory(const Utils::FilePath &defaultWorkingDir); Utils::PathChooser *pathChooser() const; private: @@ -86,8 +86,8 @@ private: QString keyForDefaultWd() const; EnvironmentAspect *m_envAspect = nullptr; - Utils::FileName m_workingDirectory; - Utils::FileName m_defaultWorkingDirectory; + Utils::FilePath m_workingDirectory; + Utils::FilePath m_defaultWorkingDirectory; QPointer<Utils::PathChooser> m_chooser; QPointer<QToolButton> m_resetButton; }; @@ -141,8 +141,8 @@ public: ExecutableAspect(); ~ExecutableAspect() override; - Utils::FileName executable() const; - void setExecutable(const Utils::FileName &executable); + Utils::FilePath executable() const; + void setExecutable(const Utils::FilePath &executable); void setSettingsKey(const QString &key); void makeOverridable(const QString &overridingKey, const QString &useOverridableKey); diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index 2a0dff0933..28d6f4ef23 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -53,13 +53,13 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel m_root = new Tree; } -void SelectableFilesModel::setInitialMarkedFiles(const Utils::FileNameList &files) +void SelectableFilesModel::setInitialMarkedFiles(const Utils::FilePathList &files) { m_files = files.toSet(); m_allFiles = files.isEmpty(); } -void SelectableFilesFromDirModel::startParsing(const Utils::FileName &baseDir) +void SelectableFilesFromDirModel::startParsing(const Utils::FilePath &baseDir) { m_watcher.cancel(); m_watcher.waitForFinished(); @@ -87,7 +87,7 @@ void SelectableFilesFromDirModel::buildTreeFinished() m_root = m_rootForFuture; m_rootForFuture = nullptr; m_outOfBaseDirFiles - = Utils::filtered(m_files, [this](const Utils::FileName &fn) { return !fn.isChildOf(m_baseDir); }); + = Utils::filtered(m_files, [this](const Utils::FilePath &fn) { return !fn.isChildOf(m_baseDir); }); endResetModel(); emit parsingFinished(); @@ -116,7 +116,7 @@ SelectableFilesModel::FilterState SelectableFilesModel::filter(Tree *t) return Utils::anyOf(m_hideFilesFilter, matchesTreeName) ? FilterState::HIDDEN : FilterState::SHOWN; } -void SelectableFilesFromDirModel::buildTree(const Utils::FileName &baseDir, Tree *tree, +void SelectableFilesFromDirModel::buildTree(const Utils::FilePath &baseDir, Tree *tree, QFutureInterface<void> &fi, int symlinkDepth) { if (symlinkDepth == 0) @@ -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::fromFileInfo(fileInfo); + Utils::FilePath fn = Utils::FilePath::fromFileInfo(fileInfo); if (m_futureCount % 100) { emit parsingProgress(fn); if (fi.isCanceled()) @@ -302,14 +302,14 @@ Qt::ItemFlags SelectableFilesModel::flags(const QModelIndex &index) const return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsUserCheckable; } -Utils::FileNameList SelectableFilesModel::selectedPaths() const +Utils::FilePathList SelectableFilesModel::selectedPaths() const { - Utils::FileNameList result; + Utils::FilePathList result; collectPaths(m_root, &result); return result; } -void SelectableFilesModel::collectPaths(Tree *root, Utils::FileNameList *result) const +void SelectableFilesModel::collectPaths(Tree *root, Utils::FilePathList *result) const { if (root->checked == Qt::Unchecked) return; @@ -318,14 +318,14 @@ void SelectableFilesModel::collectPaths(Tree *root, Utils::FileNameList *result) collectPaths(t, result); } -Utils::FileNameList SelectableFilesModel::selectedFiles() const +Utils::FilePathList SelectableFilesModel::selectedFiles() const { - Utils::FileNameList result = m_outOfBaseDirFiles.toList(); + Utils::FilePathList result = m_outOfBaseDirFiles.toList(); collectFiles(m_root, &result); return result; } -Utils::FileNameList SelectableFilesModel::preservedFiles() const +Utils::FilePathList SelectableFilesModel::preservedFiles() const { return m_outOfBaseDirFiles.toList(); } @@ -335,7 +335,7 @@ bool SelectableFilesModel::hasCheckedFiles() const return m_root->checked != Qt::Unchecked; } -void SelectableFilesModel::collectFiles(Tree *root, Utils::FileNameList *result) const +void SelectableFilesModel::collectFiles(Tree *root, Utils::FilePathList *result) const { if (root->checked == Qt::Unchecked) return; @@ -591,8 +591,8 @@ SelectableFilesWidget::SelectableFilesWidget(QWidget *parent) : layout->addWidget(m_progressLabel, static_cast<int>(SelectableFilesWidgetRows::Progress), 0, 1, 4); } -SelectableFilesWidget::SelectableFilesWidget(const Utils::FileName &path, - const Utils::FileNameList &files, QWidget *parent) : +SelectableFilesWidget::SelectableFilesWidget(const Utils::FilePath &path, + const Utils::FilePathList &files, QWidget *parent) : SelectableFilesWidget(parent) { resetModel(path, files); @@ -615,14 +615,14 @@ void SelectableFilesWidget::setBaseDirEditable(bool edit) m_startParsingButton->setVisible(edit); } -Utils::FileNameList SelectableFilesWidget::selectedFiles() const +Utils::FilePathList SelectableFilesWidget::selectedFiles() const { - return m_model ? m_model->selectedFiles() : Utils::FileNameList(); + return m_model ? m_model->selectedFiles() : Utils::FilePathList(); } -Utils::FileNameList SelectableFilesWidget::selectedPaths() const +Utils::FilePathList SelectableFilesWidget::selectedPaths() const { - return m_model ? m_model->selectedPaths() : Utils::FileNameList(); + return m_model ? m_model->selectedPaths() : Utils::FilePathList(); } bool SelectableFilesWidget::hasFilesSelected() const @@ -630,7 +630,7 @@ bool SelectableFilesWidget::hasFilesSelected() const return m_model ? m_model->hasCheckedFiles() : false; } -void SelectableFilesWidget::resetModel(const Utils::FileName &path, const Utils::FileNameList &files) +void SelectableFilesWidget::resetModel(const Utils::FilePath &path, const Utils::FilePathList &files) { m_view->setModel(nullptr); @@ -689,7 +689,7 @@ void SelectableFilesWidget::baseDirectoryChanged(bool validState) m_startParsingButton->setEnabled(validState); } -void SelectableFilesWidget::startParsing(const Utils::FileName &baseDir) +void SelectableFilesWidget::startParsing(const Utils::FilePath &baseDir) { if (!m_model) return; @@ -699,7 +699,7 @@ void SelectableFilesWidget::startParsing(const Utils::FileName &baseDir) m_model->startParsing(baseDir); } -void SelectableFilesWidget::parsingProgress(const Utils::FileName &fileName) +void SelectableFilesWidget::parsingProgress(const Utils::FilePath &fileName) { m_progressLabel->setText(tr("Generating file list...\n\n%1").arg(fileName.toUserOutput())); } @@ -711,7 +711,7 @@ void SelectableFilesWidget::parsingFinished() smartExpand(m_model->index(0,0, QModelIndex())); - const Utils::FileNameList preservedFiles = m_model->preservedFiles(); + const Utils::FilePathList preservedFiles = m_model->preservedFiles(); m_preservedFilesLabel->setText(tr("Not showing %n files that are outside of the base directory.\n" "These files are preserved.", nullptr, preservedFiles.count())); @@ -735,8 +735,8 @@ void SelectableFilesWidget::smartExpand(const QModelIndex &idx) // SelectableFilesDialogs ////////// -SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::FileName &path, - const Utils::FileNameList &files, +SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::FilePath &path, + const Utils::FilePathList &files, QWidget *parent) : QDialog(parent), m_filesWidget(new SelectableFilesWidget(path, files)) @@ -759,7 +759,7 @@ SelectableFilesDialogEditFiles::SelectableFilesDialogEditFiles(const Utils::File layout->addWidget(buttonBox); } -Utils::FileNameList SelectableFilesDialogEditFiles::selectedFiles() const +Utils::FilePathList SelectableFilesDialogEditFiles::selectedFiles() const { return m_filesWidget->selectedFiles(); } @@ -770,8 +770,8 @@ Utils::FileNameList SelectableFilesDialogEditFiles::selectedFiles() const ////////// -SelectableFilesDialogAddDirectory::SelectableFilesDialogAddDirectory(const Utils::FileName &path, - const Utils::FileNameList &files, +SelectableFilesDialogAddDirectory::SelectableFilesDialogAddDirectory(const Utils::FilePath &path, + const Utils::FilePathList &files, QWidget *parent) : SelectableFilesDialogEditFiles(path, files, parent) { diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index 677329cb92..a04a059ffc 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -64,7 +64,7 @@ public: QList<Tree *> files; QList<Tree *> visibleFiles; QIcon icon; - Utils::FileName fullPath; + Utils::FilePath fullPath; Tree *parent = nullptr; }; @@ -107,7 +107,7 @@ public: SelectableFilesModel(QObject *parent); ~SelectableFilesModel() override; - void setInitialMarkedFiles(const Utils::FileNameList &files); + void setInitialMarkedFiles(const Utils::FilePathList &files); int columnCount(const QModelIndex &parent) const override; int rowCount(const QModelIndex &parent) const override; @@ -118,9 +118,9 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; Qt::ItemFlags flags(const QModelIndex &index) const override; - Utils::FileNameList selectedFiles() const; - Utils::FileNameList selectedPaths() const; - Utils::FileNameList preservedFiles() const; + Utils::FilePathList selectedFiles() const; + Utils::FilePathList selectedPaths() const; + Utils::FilePathList preservedFiles() const; bool hasCheckedFiles() const; @@ -141,14 +141,14 @@ protected: private: QList<Glob> parseFilter(const QString &filter); Qt::CheckState applyFilter(const QModelIndex &idx); - void collectFiles(Tree *root, Utils::FileNameList *result) const; - void collectPaths(Tree *root, Utils::FileNameList *result) const; + void collectFiles(Tree *root, Utils::FilePathList *result) const; + void collectPaths(Tree *root, Utils::FilePathList *result) const; void selectAllFiles(Tree *root); protected: bool m_allFiles = true; - QSet<Utils::FileName> m_outOfBaseDirFiles; - QSet<Utils::FileName> m_files; + QSet<Utils::FilePath> m_outOfBaseDirFiles; + QSet<Utils::FilePath> m_files; Tree *m_root = nullptr; private: @@ -164,15 +164,15 @@ public: SelectableFilesFromDirModel(QObject *parent); ~SelectableFilesFromDirModel() override; - void startParsing(const Utils::FileName &baseDir); + void startParsing(const Utils::FilePath &baseDir); void cancel(); signals: void parsingFinished(); - void parsingProgress(const Utils::FileName &fileName); + void parsingProgress(const Utils::FilePath &fileName); private: - void buildTree(const Utils::FileName &baseDir, + void buildTree(const Utils::FilePath &baseDir, Tree *tree, QFutureInterface<void> &fi, int symlinkDepth); @@ -180,7 +180,7 @@ private: void buildTreeFinished(); // Used in the future thread need to all not used after calling startParsing - Utils::FileName m_baseDir; + Utils::FilePath m_baseDir; QFutureWatcher<void> m_watcher; Tree *m_rootForFuture = nullptr; int m_futureCount = 0; @@ -192,18 +192,18 @@ class PROJECTEXPLORER_EXPORT SelectableFilesWidget : public QWidget public: explicit SelectableFilesWidget(QWidget *parent = nullptr); - SelectableFilesWidget(const Utils::FileName &path, const Utils::FileNameList &files, + SelectableFilesWidget(const Utils::FilePath &path, const Utils::FilePathList &files, QWidget *parent = nullptr); void setAddFileFilter(const QString &filter); void setBaseDirEditable(bool edit); - Utils::FileNameList selectedFiles() const; - Utils::FileNameList selectedPaths() const; + Utils::FilePathList selectedFiles() const; + Utils::FilePathList selectedPaths() const; bool hasFilesSelected() const; - void resetModel(const Utils::FileName &path, const Utils::FileNameList &files); + void resetModel(const Utils::FilePath &path, const Utils::FilePathList &files); void cancelParsing(); void enableFilterHistoryCompletion(const QString &keyPrefix); @@ -216,8 +216,8 @@ private: void applyFilter(); void baseDirectoryChanged(bool validState); - void startParsing(const Utils::FileName &baseDir); - void parsingProgress(const Utils::FileName &fileName); + void startParsing(const Utils::FilePath &baseDir); + void parsingProgress(const Utils::FilePath &fileName); void parsingFinished(); void smartExpand(const QModelIndex &idx); @@ -249,9 +249,9 @@ class PROJECTEXPLORER_EXPORT SelectableFilesDialogEditFiles : public QDialog Q_OBJECT public: - SelectableFilesDialogEditFiles(const Utils::FileName &path, const Utils::FileNameList &files, + SelectableFilesDialogEditFiles(const Utils::FilePath &path, const Utils::FilePathList &files, QWidget *parent); - Utils::FileNameList selectedFiles() const; + Utils::FilePathList selectedFiles() const; void setAddFileFilter(const QString &filter) { m_filesWidget->setAddFileFilter(filter); } @@ -264,7 +264,7 @@ class SelectableFilesDialogAddDirectory : public SelectableFilesDialogEditFiles Q_OBJECT public: - SelectableFilesDialogAddDirectory(const Utils::FileName &path, const Utils::FileNameList &files, + SelectableFilesDialogAddDirectory(const Utils::FilePath &path, const Utils::FilePathList &files, QWidget *parent); }; diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 011107790a..95a8fbd4e6 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -210,7 +210,7 @@ QList<Project *> SessionManager::dependencies(const Project *project) QList<Project *> projects; foreach (const QString &dep, proDeps) { - const Utils::FileName fn = Utils::FileName::fromString(dep); + const Utils::FilePath fn = Utils::FilePath::fromString(dep); Project *pro = Utils::findOrDefault(d->m_projects, [&fn](Project *p) { return p->projectFilePath() == fn; }); if (pro) projects += pro; @@ -558,17 +558,17 @@ QString SessionManagerPrivate::sessionTitle(const QString &filePath) } QString SessionManagerPrivate::locationInProject(const QString &filePath) { - const Project *project = SessionManager::projectForFile(Utils::FileName::fromString(filePath)); + const Project *project = SessionManager::projectForFile(Utils::FilePath::fromString(filePath)); if (!project) return QString(); - const Utils::FileName file = Utils::FileName::fromString(filePath); - const Utils::FileName parentDir = file.parentDir(); + const Utils::FilePath file = Utils::FilePath::fromString(filePath); + const Utils::FilePath parentDir = file.parentDir(); if (parentDir == project->projectDirectory()) return "@ " + project->displayName(); if (file.isChildOf(project->projectDirectory())) { - const Utils::FileName dirInProject = parentDir.relativeChildPath(project->projectDirectory()); + const Utils::FilePath dirInProject = parentDir.relativeChildPath(project->projectDirectory()); return "(" + dirInProject.toUserOutput() + " @ " + project->displayName() + ")"; } @@ -638,7 +638,7 @@ QList<Project *> SessionManager::projectOrder(const Project *project) return result; } -Project *SessionManager::projectForFile(const Utils::FileName &fileName) +Project *SessionManager::projectForFile(const Utils::FilePath &fileName) { return Utils::findOrDefault(SessionManager::projects(), [&fileName](const Project *p) { return p->isKnownFile(fileName); }); @@ -647,7 +647,7 @@ Project *SessionManager::projectForFile(const Utils::FileName &fileName) void SessionManager::configureEditor(IEditor *editor, const QString &fileName) { if (auto textEditor = qobject_cast<TextEditor::BaseTextEditor*>(editor)) { - Project *project = projectForFile(Utils::FileName::fromString(fileName)); + Project *project = projectForFile(Utils::FilePath::fromString(fileName)); // Global settings are the default. if (project) project->editorConfiguration()->configureEditor(textEditor); @@ -761,9 +761,9 @@ QDateTime SessionManager::sessionDateTime(const QString &session) return d->m_sessionDateTimes.value(session); } -FileName SessionManager::sessionNameToFileName(const QString &session) +FilePath SessionManager::sessionNameToFileName(const QString &session) { - return FileName::fromString(ICore::userResourcePath() + QLatin1Char('/') + session + QLatin1String(".qws")); + return FilePath::fromString(ICore::userResourcePath() + QLatin1Char('/') + session + QLatin1String(".qws")); } /*! @@ -947,7 +947,7 @@ bool SessionManager::loadSession(const QString &session) QStringList fileList; // Try loading the file - FileName fileName = sessionNameToFileName(session); + FilePath fileName = sessionNameToFileName(session); PersistentSettingsReader reader; if (fileName.exists()) { if (!reader.load(fileName)) { @@ -1078,7 +1078,7 @@ void SessionManagerPrivate::sessionLoadingProgress() QStringList SessionManager::projectsForSessionName(const QString &session) { - const FileName fileName = sessionNameToFileName(session); + const FilePath fileName = sessionNameToFileName(session); PersistentSettingsReader reader; if (fileName.exists()) { if (!reader.load(fileName)) { diff --git a/src/plugins/projectexplorer/session.h b/src/plugins/projectexplorer/session.h index 21800faa5b..782079f9d7 100644 --- a/src/plugins/projectexplorer/session.h +++ b/src/plugins/projectexplorer/session.h @@ -94,7 +94,7 @@ public: static void setActiveBuildConfiguration(Target *t, BuildConfiguration *bc, SetActive cascade); static void setActiveDeployConfiguration(Target *t, DeployConfiguration *dc, SetActive cascade); - static Utils::FileName sessionNameToFileName(const QString &session); + static Utils::FilePath sessionNameToFileName(const QString &session); static Project *startupProject(); static const QList<Project *> projects(); @@ -111,7 +111,7 @@ public: // NBS rewrite projectOrder (dependency management) static QList<Project *> projectOrder(const Project *project = nullptr); - static Project *projectForFile(const Utils::FileName &fileName); + static Project *projectForFile(const Utils::FilePath &fileName); static QStringList projectsForSessionName(const QString &session); diff --git a/src/plugins/projectexplorer/targetsetuppage.cpp b/src/plugins/projectexplorer/targetsetuppage.cpp index 501e0efc39..ab7d13a76e 100644 --- a/src/plugins/projectexplorer/targetsetuppage.cpp +++ b/src/plugins/projectexplorer/targetsetuppage.cpp @@ -67,10 +67,10 @@ IPotentialKit::~IPotentialKit() } namespace Internal { -static Utils::FileName importDirectory(const QString &projectPath) +static Utils::FilePath importDirectory(const QString &projectPath) { // Setup import widget: - auto path = Utils::FileName::fromString(projectPath); + auto path = Utils::FilePath::fromString(projectPath); path = path.parentDir(); // base dir path = path.parentDir(); // parent dir @@ -210,7 +210,7 @@ TargetSetupPage::TargetSetupPage(QWidget *parent) : connect(km, &KitManager::kitRemoved, this, &TargetSetupPage::handleKitRemoval); connect(km, &KitManager::kitUpdated, this, &TargetSetupPage::handleKitUpdate); connect(m_importWidget, &ImportWidget::importFrom, - this, [this](const Utils::FileName &dir) { import(dir); }); + this, [this](const Utils::FilePath &dir) { import(dir); }); setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Kits")); } @@ -347,7 +347,7 @@ void TargetSetupPage::setupImports() QStringList toImport = m_importer->importCandidates(); foreach (const QString &path, toImport) - import(Utils::FileName::fromString(path), true); + import(Utils::FilePath::fromString(path), true); } void TargetSetupPage::handleKitAddition(Kit *k) @@ -485,7 +485,7 @@ bool TargetSetupPage::isUpdating() const return false; } -void TargetSetupPage::import(const Utils::FileName &path, bool silent) +void TargetSetupPage::import(const Utils::FilePath &path, bool silent) { if (!m_importer) return; diff --git a/src/plugins/projectexplorer/targetsetuppage.h b/src/plugins/projectexplorer/targetsetuppage.h index 86eeb65013..cbd0305c04 100644 --- a/src/plugins/projectexplorer/targetsetuppage.h +++ b/src/plugins/projectexplorer/targetsetuppage.h @@ -40,7 +40,7 @@ QT_FORWARD_DECLARE_CLASS(QSpacerItem) namespace Core { class Id; } -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { class Kit; @@ -105,7 +105,7 @@ private: Internal::TargetSetupWidget *addWidget(Kit *k); void setupImports(); - void import(const Utils::FileName &path, bool silent = false); + void import(const Utils::FilePath &path, bool silent = false); void setupWidgets(const QString &filterText = QString()); void reset(); diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index beac102b90..2a323f0041 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -62,7 +62,7 @@ unsigned int Task::s_nextId = 1; */ Task::Task(TaskType type_, const QString &description_, - const Utils::FileName &file_, int line_, Core::Id category_, + const Utils::FilePath &file_, int line_, Core::Id category_, const QIcon &icon, Options options) : taskId(s_nextId), type(type_), options(options), description(description_), line(line_), movedLine(line_), category(category_), @@ -79,7 +79,7 @@ Task Task::compilerMissingTask() "%1 needs a compiler set up to build. " "Configure a compiler in the kit options.") .arg(Core::Constants::IDE_DISPLAY_NAME), - Utils::FileName(), -1, + Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); } @@ -90,7 +90,7 @@ Task Task::buildConfigurationMissingTask() "%1 needs a build configuration set up to build. " "Configure a build configuration in the project settings.") .arg(Core::Constants::IDE_DISPLAY_NAME), - Utils::FileName(), -1, + Utils::FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM); } @@ -111,7 +111,7 @@ void Task::clear() taskId = 0; type = Task::Unknown; description.clear(); - file = Utils::FileName(); + file = Utils::FilePath(); line = -1; movedLine = -1; category = Core::Id(); @@ -120,11 +120,11 @@ void Task::clear() m_mark.clear(); } -void Task::setFile(const Utils::FileName &file_) +void Task::setFile(const Utils::FilePath &file_) { file = file_; if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) { - Utils::FileNameList possiblePaths = Internal::findFileInSession(file); + Utils::FilePathList possiblePaths = Internal::findFileInSession(file); if (possiblePaths.length() == 1) file = possiblePaths.first(); else diff --git a/src/plugins/projectexplorer/task.h b/src/plugins/projectexplorer/task.h index fddd5e144f..739e90f176 100644 --- a/src/plugins/projectexplorer/task.h +++ b/src/plugins/projectexplorer/task.h @@ -61,7 +61,7 @@ public: Task() = default; Task(TaskType type, const QString &description, - const Utils::FileName &file, int line, Core::Id category, + const Utils::FilePath &file, int line, Core::Id category, const QIcon &icon = QIcon(), Options options = AddTextMark | FlashWorthy); @@ -70,14 +70,14 @@ public: bool isNull() const; void clear(); - void setFile(const Utils::FileName &file); + void setFile(const Utils::FilePath &file); unsigned int taskId = 0; TaskType type = Unknown; Options options = AddTextMark | FlashWorthy; QString description; - Utils::FileName file; - Utils::FileNameList fileCandidates; + Utils::FilePath file; + Utils::FilePathList fileCandidates; int line = -1; int movedLine = -1; // contains a line number if the line was moved in the editor Core::Id category; diff --git a/src/plugins/projectexplorer/taskhub.cpp b/src/plugins/projectexplorer/taskhub.cpp index b68f8dd4df..10b04c4d5b 100644 --- a/src/plugins/projectexplorer/taskhub.cpp +++ b/src/plugins/projectexplorer/taskhub.cpp @@ -79,7 +79,7 @@ public: bool isClickable() const override; void clicked() override; - void updateFileName(const FileName &fileName) override; + void updateFileName(const FilePath &fileName) override; void updateLineNumber(int lineNumber) override; void removedFromEditor() override; private: @@ -92,10 +92,10 @@ void TaskMark::updateLineNumber(int lineNumber) TextMark::updateLineNumber(lineNumber); } -void TaskMark::updateFileName(const FileName &fileName) +void TaskMark::updateFileName(const FilePath &fileName) { TaskHub::updateTaskFileName(m_id, fileName.toString()); - TextMark::updateFileName(FileName::fromString(fileName.toString())); + TextMark::updateFileName(FilePath::fromString(fileName.toString())); } void TaskMark::removedFromEditor() @@ -138,7 +138,7 @@ TaskHub *TaskHub::instance() return m_instance; } -void TaskHub::addTask(Task::TaskType type, const QString &description, Core::Id category, const Utils::FileName &file, int line) +void TaskHub::addTask(Task::TaskType type, const QString &description, Core::Id category, const Utils::FilePath &file, int line) { addTask(Task(type, description, file, line, category)); } diff --git a/src/plugins/projectexplorer/taskhub.h b/src/plugins/projectexplorer/taskhub.h index 80bb6a5219..fc2c489c1a 100644 --- a/src/plugins/projectexplorer/taskhub.h +++ b/src/plugins/projectexplorer/taskhub.h @@ -43,7 +43,7 @@ public: // Convenience overload static void addTask(Task::TaskType type, const QString &description, Core::Id category, - const Utils::FileName &file = Utils::FileName(), + const Utils::FilePath &file = Utils::FilePath(), int line = -1); public slots: diff --git a/src/plugins/projectexplorer/taskmodel.cpp b/src/plugins/projectexplorer/taskmodel.cpp index a2a8d5dca9..3baac2c841 100644 --- a/src/plugins/projectexplorer/taskmodel.cpp +++ b/src/plugins/projectexplorer/taskmodel.cpp @@ -147,7 +147,7 @@ void TaskModel::updateTaskFileName(unsigned int id, const QString &fileName) int i = rowForId(id); QTC_ASSERT(i != -1, return); if (m_tasks.at(i).taskId == id) { - m_tasks[i].file = Utils::FileName::fromString(fileName); + m_tasks[i].file = Utils::FilePath::fromString(fileName); emit dataChanged(index(i, 0), index(i, 0)); } } diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp index 86bae32906..0ae486a695 100644 --- a/src/plugins/projectexplorer/taskwindow.cpp +++ b/src/plugins/projectexplorer/taskwindow.cpp @@ -498,7 +498,7 @@ void TaskWindow::triggerDefaultHandler(const QModelIndex &index) if (!task.file.isEmpty() && !task.file.toFileInfo().isAbsolute() && !task.fileCandidates.empty()) { - const Utils::FileName userChoice = Utils::chooseFileFromList(task.fileCandidates); + const Utils::FilePath userChoice = Utils::chooseFileFromList(task.fileCandidates); if (!userChoice.isEmpty()) { task.file = userChoice; updatedTaskFileName(task.taskId, task.file.toString()); diff --git a/src/plugins/projectexplorer/toolchain.cpp b/src/plugins/projectexplorer/toolchain.cpp index 7d76184894..66c5ac83db 100644 --- a/src/plugins/projectexplorer/toolchain.cpp +++ b/src/plugins/projectexplorer/toolchain.cpp @@ -169,7 +169,7 @@ QStringList ToolChain::suggestedMkspecList() const return {}; } -Utils::FileName ToolChain::suggestedDebugger() const +Utils::FilePath ToolChain::suggestedDebugger() const { return ToolChainManager::defaultDebugger(targetAbi()); } @@ -436,7 +436,7 @@ QList<ToolChain *> ToolChainFactory::autoDetect(const QList<ToolChain *> &alread return QList<ToolChain *>(); } -QList<ToolChain *> ToolChainFactory::autoDetect(const Utils::FileName &compilerPath, const Core::Id &language) +QList<ToolChain *> ToolChainFactory::autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language) { Q_UNUSED(compilerPath); Q_UNUSED(language); diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index b7ff1f30e7..1cbe478691 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -99,7 +99,7 @@ public: QByteArray id() const; virtual QStringList suggestedMkspecList() const; - virtual Utils::FileName suggestedDebugger() const; + virtual Utils::FilePath suggestedDebugger() const; Core::Id typeId() const; virtual QString typeDisplayName() const = 0; @@ -134,13 +134,13 @@ public: const QStringList &cxxflags, const QString &sysRoot, const QString &originalTargetTriple)>; virtual BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const = 0; virtual HeaderPaths builtInHeaderPaths(const QStringList &cxxflags, - const Utils::FileName &sysRoot) const = 0; + const Utils::FilePath &sysRoot) const = 0; virtual void addToEnvironment(Utils::Environment &env) const = 0; - virtual Utils::FileName makeCommand(const Utils::Environment &env) const = 0; + virtual Utils::FilePath makeCommand(const Utils::Environment &env) const = 0; Core::Id language() const; - virtual Utils::FileName compilerCommand() const = 0; + virtual Utils::FilePath compilerCommand() const = 0; virtual IOutputParser *outputParser() const = 0; virtual bool operator ==(const ToolChain &) const; @@ -196,7 +196,7 @@ public: Core::Id supportedToolChainType() const; virtual QList<ToolChain *> autoDetect(const QList<ToolChain *> &alreadyKnown); - virtual QList<ToolChain *> autoDetect(const Utils::FileName &compilerPath, const Core::Id &language); + virtual QList<ToolChain *> autoDetect(const Utils::FilePath &compilerPath, const Core::Id &language); virtual bool canCreate() const; virtual ToolChain *create(); @@ -220,7 +220,7 @@ protected: class Candidate { public: - Utils::FileName compilerPath; + Utils::FilePath compilerPath; QString compilerVersion; bool operator==(const ToolChainFactory::Candidate &other) const { diff --git a/src/plugins/projectexplorer/toolchainmanager.cpp b/src/plugins/projectexplorer/toolchainmanager.cpp index 6dc8703c21..ffea568dbe 100644 --- a/src/plugins/projectexplorer/toolchainmanager.cpp +++ b/src/plugins/projectexplorer/toolchainmanager.cpp @@ -63,7 +63,7 @@ class ToolChainManagerPrivate public: ~ToolChainManagerPrivate(); - QMap<QString, FileName> m_abiToDebugger; + QMap<QString, FilePath> m_abiToDebugger; std::unique_ptr<ToolChainSettingsAccessor> m_accessor; QList<ToolChain *> m_toolChains; // prioritized List @@ -186,7 +186,7 @@ ToolChain *ToolChainManager::findToolChain(const QByteArray &id) return tc; } -FileName ToolChainManager::defaultDebugger(const Abi &abi) +FilePath ToolChainManager::defaultDebugger(const Abi &abi) { return d->m_abiToDebugger.value(abi.toString()); } diff --git a/src/plugins/projectexplorer/toolchainmanager.h b/src/plugins/projectexplorer/toolchainmanager.h index 06178419be..4de51c2b2a 100644 --- a/src/plugins/projectexplorer/toolchainmanager.h +++ b/src/plugins/projectexplorer/toolchainmanager.h @@ -38,7 +38,7 @@ #include <functional> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { @@ -68,7 +68,7 @@ public: static QList<ToolChain *> findToolChains(const Abi &abi); static ToolChain *findToolChain(const QByteArray &id); - static Utils::FileName defaultDebugger(const Abi &abi); + static Utils::FilePath defaultDebugger(const Abi &abi); static bool isLoaded(); diff --git a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp index 83ac914aca..d2c347dd37 100644 --- a/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp +++ b/src/plugins/projectexplorer/toolchainsettingsaccessor.cpp @@ -184,7 +184,7 @@ ToolChainSettingsAccessor::ToolChainSettingsAccessor() : QCoreApplication::translate("ProjectExplorer::ToolChainManager", "Tool Chains"), Core::Constants::IDE_DISPLAY_NAME) { - setBaseFilePath(FileName::fromString(Core::ICore::userResourcePath() + TOOLCHAIN_FILENAME)); + setBaseFilePath(FilePath::fromString(Core::ICore::userResourcePath() + TOOLCHAIN_FILENAME)); addVersionUpgrader(std::make_unique<ToolChainSettingsUpgraderV0>()); } @@ -193,7 +193,7 @@ QList<ToolChain *> ToolChainSettingsAccessor::restoreToolChains(QWidget *parent) { // read all tool chains from SDK const QList<ToolChain *> systemFileTcs - = toolChains(restoreSettings(FileName::fromString(Core::ICore::installerResourcePath() + TOOLCHAIN_FILENAME), + = toolChains(restoreSettings(FilePath::fromString(Core::ICore::installerResourcePath() + TOOLCHAIN_FILENAME), parent)); for (ToolChain * const systemTc : systemFileTcs) systemTc->setDetection(ToolChain::AutoDetectionFromSdk); @@ -321,11 +321,11 @@ public: LanguageExtensions languageExtensions(const QStringList &cxxflags) const override { Q_UNUSED(cxxflags); return LanguageExtension::None; } WarningFlags warningFlags(const QStringList &cflags) const override { Q_UNUSED(cflags); return WarningFlags::NoWarnings; } BuiltInHeaderPathsRunner createBuiltInHeaderPathsRunner() const override { return BuiltInHeaderPathsRunner(); } - HeaderPaths builtInHeaderPaths(const QStringList &cxxflags, const FileName &sysRoot) const override + HeaderPaths builtInHeaderPaths(const QStringList &cxxflags, const FilePath &sysRoot) const override { Q_UNUSED(cxxflags); Q_UNUSED(sysRoot); return {}; } void addToEnvironment(Environment &env) const override { Q_UNUSED(env); } - FileName makeCommand(const Environment &) const override { return FileName::fromString("make"); } - FileName compilerCommand() const override { return Utils::FileName::fromString("/tmp/test/gcc"); } + FilePath makeCommand(const Environment &) const override { return FilePath::fromString("make"); } + FilePath compilerCommand() const override { return Utils::FilePath::fromString("/tmp/test/gcc"); } IOutputParser *outputParser() const override { return nullptr; } std::unique_ptr<ToolChainConfigWidget> createConfigurationWidget() override { return nullptr; } bool operator ==(const ToolChain &other) const override { diff --git a/src/plugins/projectexplorer/treescanner.cpp b/src/plugins/projectexplorer/treescanner.cpp index 9c4803cc9d..7c7f634d1a 100644 --- a/src/plugins/projectexplorer/treescanner.cpp +++ b/src/plugins/projectexplorer/treescanner.cpp @@ -42,7 +42,7 @@ namespace ProjectExplorer { TreeScanner::TreeScanner(QObject *parent) : QObject(parent) { m_factory = TreeScanner::genericFileType; - m_filter = [](const Utils::MimeType &mimeType, const Utils::FileName &fn) { + m_filter = [](const Utils::MimeType &mimeType, const Utils::FilePath &fn) { return isWellKnownBinary(mimeType, fn) && isMimeBinary(mimeType, fn); }; @@ -57,7 +57,7 @@ TreeScanner::~TreeScanner() } } -bool TreeScanner::asyncScanForFiles(const Utils::FileName &directory) +bool TreeScanner::asyncScanForFiles(const Utils::FilePath &directory) { if (!m_futureWatcher.isFinished()) return false; @@ -116,7 +116,7 @@ void TreeScanner::reset() m_scanFuture = Future(); } -bool TreeScanner::isWellKnownBinary(const Utils::MimeType & /*mdb*/, const Utils::FileName &fn) +bool TreeScanner::isWellKnownBinary(const Utils::MimeType & /*mdb*/, const Utils::FilePath &fn) { return fn.endsWith(QLatin1String(".a")) || fn.endsWith(QLatin1String(".o")) || @@ -127,7 +127,7 @@ bool TreeScanner::isWellKnownBinary(const Utils::MimeType & /*mdb*/, const Utils fn.endsWith(QLatin1String(".elf")); } -bool TreeScanner::isMimeBinary(const Utils::MimeType &mimeType, const Utils::FileName &/*fn*/) +bool TreeScanner::isMimeBinary(const Utils::MimeType &mimeType, const Utils::FilePath &/*fn*/) { bool isBinary = false; if (mimeType.isValid()) { @@ -138,12 +138,12 @@ bool TreeScanner::isMimeBinary(const Utils::MimeType &mimeType, const Utils::Fil return isBinary; } -FileType TreeScanner::genericFileType(const Utils::MimeType &mimeType, const Utils::FileName &/*fn*/) +FileType TreeScanner::genericFileType(const Utils::MimeType &mimeType, const Utils::FilePath &/*fn*/) { return Node::fileTypeForMimeType(mimeType); } -void TreeScanner::scanForFiles(FutureInterface *fi, const Utils::FileName& directory, +void TreeScanner::scanForFiles(FutureInterface *fi, const Utils::FilePath& directory, const FileFilter &filter, const FileTypeFactory &factory) { std::unique_ptr<FutureInterface> fip(fi); @@ -151,7 +151,7 @@ void TreeScanner::scanForFiles(FutureInterface *fi, const Utils::FileName& direc Result nodes = FileNode::scanForFiles( directory, - [&filter, &factory](const Utils::FileName &fn) -> FileNode * { + [&filter, &factory](const Utils::FilePath &fn) -> FileNode * { const Utils::MimeType mimeType = Utils::mimeTypeForFile(fn.toString()); // Skip some files during scan. diff --git a/src/plugins/projectexplorer/treescanner.h b/src/plugins/projectexplorer/treescanner.h index f2bb9876a3..e2ad544bde 100644 --- a/src/plugins/projectexplorer/treescanner.h +++ b/src/plugins/projectexplorer/treescanner.h @@ -51,14 +51,14 @@ public: using FutureWatcher = QFutureWatcher<Result>; using FutureInterface = QFutureInterface<Result>; - using FileFilter = std::function<bool(const Utils::MimeType &, const Utils::FileName &)>; - using FileTypeFactory = std::function<ProjectExplorer::FileType(const Utils::MimeType &, const Utils::FileName &)>; + using FileFilter = std::function<bool(const Utils::MimeType &, const Utils::FilePath &)>; + using FileTypeFactory = std::function<ProjectExplorer::FileType(const Utils::MimeType &, const Utils::FilePath &)>; explicit TreeScanner(QObject *parent = nullptr); ~TreeScanner() override; // Start scanning in given directory - bool asyncScanForFiles(const Utils::FileName& directory); + bool asyncScanForFiles(const Utils::FilePath& directory); // Setup filter for ignored files void setFilter(FileFilter filter); @@ -77,17 +77,17 @@ public: void reset(); // Standard filters helpers - static bool isWellKnownBinary(const Utils::MimeType &mimeType, const Utils::FileName &fn); - static bool isMimeBinary(const Utils::MimeType &mimeType, const Utils::FileName &fn); + static bool isWellKnownBinary(const Utils::MimeType &mimeType, const Utils::FilePath &fn); + static bool isMimeBinary(const Utils::MimeType &mimeType, const Utils::FilePath &fn); // Standard file factory - static ProjectExplorer::FileType genericFileType(const Utils::MimeType &mdb, const Utils::FileName& fn); + static ProjectExplorer::FileType genericFileType(const Utils::MimeType &mdb, const Utils::FilePath& fn); signals: void finished(); private: - static void scanForFiles(FutureInterface *fi, const Utils::FileName &directory, + static void scanForFiles(FutureInterface *fi, const Utils::FilePath &directory, const FileFilter &filter, const FileTypeFactory &factory); private: diff --git a/src/plugins/projectexplorer/userfileaccessor.cpp b/src/plugins/projectexplorer/userfileaccessor.cpp index 2a4924fd24..838507e544 100644 --- a/src/plugins/projectexplorer/userfileaccessor.cpp +++ b/src/plugins/projectexplorer/userfileaccessor.cpp @@ -240,14 +240,14 @@ static QString makeRelative(QString path) } // Return complete file path of the .user file. -static FileName externalUserFilePath(const Utils::FileName &projectFilePath, const QString &suffix) +static FilePath externalUserFilePath(const Utils::FilePath &projectFilePath, const QString &suffix) { static const optional<QString> externalUserFileDir = defineExternalUserFileDir(); if (externalUserFileDir) { // Recreate the relative project file hierarchy under the shared directory. // PersistentSettingsWriter::write() takes care of creating the path. - return FileName::fromString(externalUserFileDir.value() + return FilePath::fromString(externalUserFileDir.value() + '/' + makeRelative(projectFilePath.toString()) + suffix); } @@ -266,18 +266,18 @@ public: UserFileBackUpStrategy(UserFileAccessor *accessor) : Utils::VersionedBackUpStrategy(accessor) { } - FileNameList readFileCandidates(const Utils::FileName &baseFileName) const final; + FilePathList readFileCandidates(const Utils::FilePath &baseFileName) const final; }; -FileNameList UserFileBackUpStrategy::readFileCandidates(const FileName &baseFileName) const +FilePathList UserFileBackUpStrategy::readFileCandidates(const FilePath &baseFileName) const { const auto *const ac = static_cast<const UserFileAccessor *>(accessor()); - const FileName externalUser = ac->externalUserFile(); - const FileName projectUser = ac->projectUserFile(); + const FilePath externalUser = ac->externalUserFile(); + const FilePath projectUser = ac->projectUserFile(); QTC_CHECK(!baseFileName.isEmpty()); QTC_CHECK(baseFileName == externalUser || baseFileName == projectUser); - FileNameList result = Utils::VersionedBackUpStrategy::readFileCandidates(projectUser); + FilePathList result = Utils::VersionedBackUpStrategy::readFileCandidates(projectUser); if (!externalUser.isEmpty()) result.append(Utils::VersionedBackUpStrategy::readFileCandidates(externalUser)); @@ -295,8 +295,8 @@ UserFileAccessor::UserFileAccessor(Project *project) : m_project(project) { // Setup: - const FileName externalUser = externalUserFile(); - const FileName projectUser = projectUserFile(); + const FilePath externalUser = externalUserFile(); + const FilePath projectUser = projectUserFile(); setBaseFilePath(externalUser.isEmpty() ? projectUser : externalUser); auto secondary @@ -384,21 +384,21 @@ QVariant UserFileAccessor::retrieveSharedSettings() const return project()->property(SHARED_SETTINGS); } -FileName UserFileAccessor::projectUserFile() const +FilePath UserFileAccessor::projectUserFile() const { static const QString qtcExt = QLatin1String(qgetenv("QTC_EXTENSION")); return m_project->projectFilePath() .stringAppended(generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt)); } -FileName UserFileAccessor::externalUserFile() const +FilePath UserFileAccessor::externalUserFile() const { static const QString qtcExt = QFile::decodeName(qgetenv("QTC_EXTENSION")); return externalUserFilePath(m_project->projectFilePath(), generateSuffix(qtcExt.isEmpty() ? FILE_EXTENSION_STR : qtcExt)); } -FileName UserFileAccessor::sharedFile() const +FilePath UserFileAccessor::sharedFile() const { static const QString qtcExt = QLatin1String(qgetenv("QTC_SHARED_EXTENSION")); return m_project->projectFilePath() @@ -884,7 +884,7 @@ private: class TestProject : public Project { public: - TestProject() : Project("x-test/testproject", Utils::FileName::fromString("/test/project")) { + TestProject() : Project("x-test/testproject", Utils::FilePath::fromString("/test/project")) { setDisplayName("Test Project"); } @@ -981,7 +981,7 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettings() sharedData.insert("shared1", "bar"); sharedData.insert("shared2", "baz"); sharedData.insert("shared3", "foooo"); - TestUserFileAccessor::RestoreData shared(FileName::fromString("/shared/data"), sharedData); + TestUserFileAccessor::RestoreData shared(FilePath::fromString("/shared/data"), sharedData); QVariantMap data; data.insert("Version", accessor.currentVersion()); @@ -990,7 +990,7 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettings() data.insert("shared1", "bar1"); data.insert("unique1", 1234); data.insert("shared3", "foo"); - TestUserFileAccessor::RestoreData user(FileName::fromString("/user/data"), data); + TestUserFileAccessor::RestoreData user(FilePath::fromString("/user/data"), data); TestUserFileAccessor::RestoreData result = accessor.mergeSettings(user, shared); QVERIFY(!result.hasIssue()); @@ -1016,10 +1016,10 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettingsEmptyUser() sharedData.insert("shared1", "bar"); sharedData.insert("shared2", "baz"); sharedData.insert("shared3", "foooo"); - TestUserFileAccessor::RestoreData shared(FileName::fromString("/shared/data"), sharedData); + TestUserFileAccessor::RestoreData shared(FilePath::fromString("/shared/data"), sharedData); QVariantMap data; - TestUserFileAccessor::RestoreData user(FileName::fromString("/shared/data"), data); + TestUserFileAccessor::RestoreData user(FilePath::fromString("/shared/data"), data); TestUserFileAccessor::RestoreData result = accessor.mergeSettings(user, shared); @@ -1033,7 +1033,7 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettingsEmptyShared() TestUserFileAccessor accessor(&project); QVariantMap sharedData; - TestUserFileAccessor::RestoreData shared(FileName::fromString("/shared/data"), sharedData); + TestUserFileAccessor::RestoreData shared(FilePath::fromString("/shared/data"), sharedData); QVariantMap data; data.insert("Version", accessor.currentVersion()); @@ -1043,7 +1043,7 @@ void ProjectExplorerPlugin::testUserFileAccessor_mergeSettingsEmptyShared() data.insert("shared1", "bar1"); data.insert("unique1", 1234); data.insert("shared3", "foo"); - TestUserFileAccessor::RestoreData user(FileName::fromString("/shared/data"), data); + TestUserFileAccessor::RestoreData user(FilePath::fromString("/shared/data"), data); TestUserFileAccessor::RestoreData result = accessor.mergeSettings(user, shared); diff --git a/src/plugins/projectexplorer/userfileaccessor.h b/src/plugins/projectexplorer/userfileaccessor.h index 6544de987e..6b7d42ec1a 100644 --- a/src/plugins/projectexplorer/userfileaccessor.h +++ b/src/plugins/projectexplorer/userfileaccessor.h @@ -47,9 +47,9 @@ public: virtual QVariant retrieveSharedSettings() const; - Utils::FileName projectUserFile() const; - Utils::FileName externalUserFile() const; - Utils::FileName sharedFile() const; + Utils::FilePath projectUserFile() const; + Utils::FilePath externalUserFile() const; + Utils::FilePath sharedFile() const; protected: QVariantMap postprocessMerge(const QVariantMap &main, diff --git a/src/plugins/projectexplorer/xcodebuildparser.cpp b/src/plugins/projectexplorer/xcodebuildparser.cpp index dd9f0c879f..ae551e259c 100644 --- a/src/plugins/projectexplorer/xcodebuildparser.cpp +++ b/src/plugins/projectexplorer/xcodebuildparser.cpp @@ -73,7 +73,7 @@ void XcodebuildParser::stdOutput(const QString &line) Task task(Task::Warning, QCoreApplication::translate("ProjectExplorer::XcodebuildParser", "Replacing signature"), - Utils::FileName::fromString( + Utils::FilePath::fromString( lne.left(lne.size() - QLatin1String(signatureChangeEndsWithPattern).size())), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE); @@ -96,7 +96,7 @@ void XcodebuildParser::stdError(const QString &line) Task task(Task::Error, QCoreApplication::translate("ProjectExplorer::XcodebuildParser", "Xcodebuild failed."), - Utils::FileName(), /* filename */ + Utils::FilePath(), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE); taskAdded(task); @@ -223,7 +223,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data() Task::Error, QCoreApplication::translate("ProjectExplorer::XcodebuildParser", "Xcodebuild failed."), - Utils::FileName(), /* filename */ + Utils::FilePath(), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE)) << QString() @@ -240,7 +240,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data() Task::Error, QCoreApplication::translate("ProjectExplorer::XcodebuildParser", "Xcodebuild failed."), - Utils::FileName(), /* filename */ + Utils::FilePath(), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE)) << QString() @@ -253,7 +253,7 @@ void ProjectExplorerPlugin::testXcodebuildParserParsing_data() << Task(Task::Warning, QCoreApplication::translate("ProjectExplorer::XcodebuildParser", "Replacing signature"), - Utils::FileName::fromString(QLatin1String("/somepath/somefile.app")), /* filename */ + Utils::FilePath::fromString(QLatin1String("/somepath/somefile.app")), /* filename */ -1, /* line */ Constants::TASK_CATEGORY_COMPILE)) << QString() diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp index fe5c7189dc..889880dc86 100644 --- a/src/plugins/pythoneditor/pythoneditorplugin.cpp +++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp @@ -83,7 +83,7 @@ class PythonProject : public Project { Q_OBJECT public: - explicit PythonProject(const Utils::FileName &filename); + explicit PythonProject(const Utils::FilePath &filename); bool addFiles(const QStringList &filePaths); bool removeFiles(const QStringList &filePaths); @@ -178,7 +178,7 @@ private: tc.insertText('\n' + match.captured(1)); tc.insertText(match.captured(2), linkFormat(frm, match.captured(2))); - const auto fileName = FileName::fromString(match.captured(3)); + const auto fileName = FilePath::fromString(match.captured(3)); const int lineNumber = match.capturedRef(4).toInt(); Task task(Task::Warning, QString(), fileName, lineNumber, id); @@ -280,7 +280,7 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id) setOutputFormatter<PythonOutputFormatter>(); setExecutableGetter([this] { - return FileName::fromString(aspect<InterpreterAspect>()->value()); + return FilePath::fromString(aspect<InterpreterAspect>()->value()); }); connect(target, &Target::applicationTargetsChanged, @@ -318,7 +318,7 @@ public: } }; -PythonProject::PythonProject(const FileName &fileName) : +PythonProject::PythonProject(const FilePath &fileName) : Project(Constants::C_PY_MIMETYPE, fileName, [this]() { refresh(); }) { setId(PythonProjectId); @@ -326,7 +326,7 @@ PythonProject::PythonProject(const FileName &fileName) : setDisplayName(fileName.toFileInfo().completeBaseName()); } -static QStringList readLines(const Utils::FileName &projectFile) +static QStringList readLines(const Utils::FilePath &projectFile) { const QString projectFileName = projectFile.fileName(); QSet<QString> visited = { projectFileName }; @@ -350,7 +350,7 @@ static QStringList readLines(const Utils::FileName &projectFile) return lines; } -static QStringList readLinesJson(const Utils::FileName &projectFile, +static QStringList readLinesJson(const Utils::FilePath &projectFile, QString *errorMessage) { const QString projectFileName = projectFile.fileName(); @@ -515,7 +515,7 @@ bool PythonProject::renameFile(const QString &filePath, const QString &newFilePa void PythonProject::parseProject() { m_rawListEntries.clear(); - const Utils::FileName filePath = projectFilePath(); + const Utils::FilePath filePath = projectFilePath(); // The PySide project file is JSON based if (filePath.endsWith(".pyproject")) { QString errorMessage; @@ -537,7 +537,7 @@ void PythonProject::parseProject() class PythonFileNode : public FileNode { public: - PythonFileNode(const Utils::FileName &filePath, const QString &nodeDisplayName, + PythonFileNode(const Utils::FilePath &filePath, const QString &nodeDisplayName, FileType fileType = FileType::Source) : FileNode(filePath, fileType) , m_displayName(nodeDisplayName) @@ -560,12 +560,12 @@ void PythonProject::refresh(Target *target) const QString displayName = baseDir.relativeFilePath(f); const FileType fileType = f.endsWith(".pyproject") || f.endsWith(".pyqtc") ? FileType::Project : FileType::Source; - newRoot->addNestedNode(std::make_unique<PythonFileNode>(FileName::fromString(f), + newRoot->addNestedNode(std::make_unique<PythonFileNode>(FilePath::fromString(f), displayName, fileType)); if (fileType == FileType::Source) { BuildTargetInfo bti; bti.buildKey = f; - bti.targetFilePath = FileName::fromString(f); + bti.targetFilePath = FilePath::fromString(f); bti.projectFilePath = projectFilePath(); appTargets.append(bti); } @@ -621,7 +621,7 @@ QStringList PythonProject::processEntries(const QStringList &paths, expandEnvironmentVariables(env, trimmedPath); - trimmedPath = FileName::fromUserInput(trimmedPath).toString(); + trimmedPath = FilePath::fromUserInput(trimmedPath).toString(); fileInfo.setFile(projectDir, trimmedPath); if (fileInfo.exists()) { @@ -664,11 +664,11 @@ QHash<QString, QStringList> sortFilesIntoPaths(const QString &base, const QSet<Q for (const QString &absoluteFileName : files) { const QFileInfo fileInfo(absoluteFileName); - const FileName absoluteFilePath = FileName::fromString(fileInfo.path()); + const FilePath absoluteFilePath = FilePath::fromString(fileInfo.path()); QString relativeFilePath; if (absoluteFilePath.isChildOf(baseDir)) { - relativeFilePath = absoluteFilePath.relativeChildPath(FileName::fromString(base)).toString(); + relativeFilePath = absoluteFilePath.relativeChildPath(FilePath::fromString(base)).toString(); } else { // 'file' is not part of the project. relativeFilePath = baseDir.relativeFilePath(absoluteFilePath.toString()); diff --git a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp index 07ac4ade38..1444c3d98f 100644 --- a/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp +++ b/src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp @@ -292,11 +292,11 @@ QVariantMap DefaultPropertyProvider::autoGeneratedProperties(const ProjectExplor } } } else { - Utils::FileName cCompilerPath; + Utils::FilePath cCompilerPath; if (tcC) cCompilerPath = tcC->compilerCommand(); - Utils::FileName cxxCompilerPath; + Utils::FilePath cxxCompilerPath; if (tcCxx) cxxCompilerPath = tcCxx->compilerCommand(); diff --git a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp index 04194d818e..758a11aa6a 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildconfiguration.cpp @@ -59,15 +59,15 @@ using namespace Utils; namespace QbsProjectManager { namespace Internal { -static FileName defaultBuildDirectory(const QString &projectFilePath, const Kit *k, +static FilePath defaultBuildDirectory(const QString &projectFilePath, const Kit *k, const QString &bcName, BuildConfiguration::BuildType buildType) { const QString projectName = QFileInfo(projectFilePath).completeBaseName(); ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType); - QString projectDir = Project::projectDirectory(FileName::fromString(projectFilePath)).toString(); + QString projectDir = Project::projectDirectory(FilePath::fromString(projectFilePath)).toString(); QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate()); - return FileName::fromString(FileUtils::resolvePath(projectDir, buildPath)); + return FilePath::fromString(FileUtils::resolvePath(projectDir, buildPath)); } // --------------------------------------------------------------------------- @@ -100,7 +100,7 @@ void QbsBuildConfiguration::initialize(const BuildInfo &info) ? QLatin1String(Constants::QBS_VARIANT_DEBUG) : QLatin1String(Constants::QBS_VARIANT_RELEASE)); - Utils::FileName buildDir = info.buildDirectory; + Utils::FilePath buildDir = info.buildDirectory; if (buildDir.isEmpty()) buildDir = defaultBuildDirectory(target()->project()->projectFilePath().toString(), target()->kit(), info.displayName, info.buildType); @@ -283,7 +283,7 @@ public: return m_qbsBuildStep ? m_qbsBuildStep->maxJobs() : 0; } - Utils::FileName installRoot() const { + Utils::FilePath installRoot() const { const QbsBuildStep *bs = nullptr; if (m_qbsBuildStep) { bs = m_qbsBuildStep; @@ -293,7 +293,7 @@ public: } if (bs && bs->hasCustomInstallRoot()) return bs->installRoot(); - return Utils::FileName(); + return Utils::FilePath(); } private: @@ -346,7 +346,7 @@ QString QbsBuildConfiguration::equivalentCommandLine(const BuildStep *buildStep) Utils::QtcProcess::addArg(&commandLine, QLatin1String("config:") + configurationName()); Utils::QtcProcess::addArg(&commandLine, QLatin1String(Constants::QBS_CONFIG_VARIANT_KEY) + QLatin1Char(':') + buildVariant); - const Utils::FileName installRoot = stepProxy.installRoot(); + const Utils::FilePath installRoot = stepProxy.installRoot(); if (!installRoot.isEmpty()) { Utils::QtcProcess::addArg(&commandLine, QLatin1String(Constants::QBS_INSTALL_ROOT_KEY) + QLatin1Char(':') + installRoot.toUserOutput()); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp index a039be62cb..da09f51c05 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.cpp @@ -257,12 +257,12 @@ bool QbsBuildStep::hasCustomInstallRoot() const return m_qbsConfiguration.contains(Constants::QBS_INSTALL_ROOT_KEY); } -Utils::FileName QbsBuildStep::installRoot(VariableHandling variableHandling) const +Utils::FilePath QbsBuildStep::installRoot(VariableHandling variableHandling) const { const QString root = qbsConfiguration(variableHandling).value(Constants::QBS_INSTALL_ROOT_KEY).toString(); if (!root.isNull()) - return Utils::FileName::fromString(root); + return Utils::FilePath::fromString(root); const QbsBuildConfiguration * const bc = static_cast<QbsBuildConfiguration *>(buildConfiguration()); @@ -399,7 +399,7 @@ void QbsBuildStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, con const QString &file, int line) { ProjectExplorer::Task task = ProjectExplorer::Task(type, message, - Utils::FileName::fromString(file), line, + Utils::FilePath::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); emit addOutput(message, OutputFormat::Stdout); diff --git a/src/plugins/qbsprojectmanager/qbsbuildstep.h b/src/plugins/qbsprojectmanager/qbsbuildstep.h index 8c3622385d..913bf61268 100644 --- a/src/plugins/qbsprojectmanager/qbsbuildstep.h +++ b/src/plugins/qbsprojectmanager/qbsbuildstep.h @@ -66,7 +66,7 @@ public: bool install() const; bool cleanInstallRoot() const; bool hasCustomInstallRoot() const; - Utils::FileName installRoot(VariableHandling variableHandling = ExpandVariables) const; + Utils::FilePath installRoot(VariableHandling variableHandling = ExpandVariables) const; int maxJobs() const; QString buildVariant() const; diff --git a/src/plugins/qbsprojectmanager/qbscleanstep.cpp b/src/plugins/qbsprojectmanager/qbscleanstep.cpp index f648e14aee..167299a0bb 100644 --- a/src/plugins/qbsprojectmanager/qbscleanstep.cpp +++ b/src/plugins/qbsprojectmanager/qbscleanstep.cpp @@ -170,7 +170,7 @@ void QbsCleanStep::updateState() void QbsCleanStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line) { ProjectExplorer::Task task = ProjectExplorer::Task(type, message, - Utils::FileName::fromString(file), line, + Utils::FilePath::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); emit addOutput(message, OutputFormat::Stdout); diff --git a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp index c375c87cac..ddfaadf8df 100644 --- a/src/plugins/qbsprojectmanager/qbsinstallstep.cpp +++ b/src/plugins/qbsprojectmanager/qbsinstallstep.cpp @@ -198,7 +198,7 @@ void QbsInstallStep::createTaskAndOutput(ProjectExplorer::Task::TaskType type, const QString &message, const QString &file, int line) { ProjectExplorer::Task task = ProjectExplorer::Task(type, message, - Utils::FileName::fromString(file), line, + Utils::FilePath::fromString(file), line, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); emit addOutput(message, OutputFormat::Stdout); diff --git a/src/plugins/qbsprojectmanager/qbslogsink.cpp b/src/plugins/qbsprojectmanager/qbslogsink.cpp index c9a2f28d64..9e635c2958 100644 --- a/src/plugins/qbsprojectmanager/qbslogsink.cpp +++ b/src/plugins/qbsprojectmanager/qbslogsink.cpp @@ -70,7 +70,7 @@ void QbsLogSink::doPrintWarning(const qbs::ErrorInfo &warning) foreach (const qbs::ErrorItem &item, warning.items()) emit newTask(Task(Task::Warning, item.description(), - Utils::FileName::fromString(item.codeLocation().filePath()), + Utils::FilePath::fromString(item.codeLocation().filePath()), item.codeLocation().line(), Constants::TASK_CATEGORY_BUILDSYSTEM)); } diff --git a/src/plugins/qbsprojectmanager/qbsnodes.cpp b/src/plugins/qbsprojectmanager/qbsnodes.cpp index 539f4ae828..e5071cabba 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodes.cpp @@ -236,7 +236,7 @@ static bool supportsNodeAction(ProjectAction action, const Node *node) // -------------------------------------------------------------------- QbsGroupNode::QbsGroupNode(const qbs::GroupData &grp, const QString &productPath) : - ProjectNode(Utils::FileName()) + ProjectNode(Utils::FilePath()) { static QIcon groupIcon = QIcon(QString(Constants::QBS_GROUP_ICON)); setIcon(groupIcon); @@ -324,7 +324,7 @@ FolderNode::AddNewInformation QbsGroupNode::addNewInformation(const QStringList // -------------------------------------------------------------------- QbsProductNode::QbsProductNode(const qbs::ProductData &prd) : - ProjectNode(Utils::FileName::fromString(prd.location().filePath())), + ProjectNode(Utils::FilePath::fromString(prd.location().filePath())), m_qbsProductData(prd) { static QIcon productIcon = Core::FileIconProvider::directoryIcon(Constants::QBS_PRODUCT_OVERLAY_ICON); @@ -453,7 +453,7 @@ QVariant QbsProductNode::data(Core::Id role) const // QbsProjectNode: // -------------------------------------------------------------------- -QbsProjectNode::QbsProjectNode(const Utils::FileName &projectDirectory) : +QbsProjectNode::QbsProjectNode(const Utils::FilePath &projectDirectory) : ProjectNode(projectDirectory) { static QIcon projectIcon = Core::FileIconProvider::directoryIcon(ProjectExplorer::Constants::FILEOVERLAY_QT); diff --git a/src/plugins/qbsprojectmanager/qbsnodes.h b/src/plugins/qbsprojectmanager/qbsnodes.h index 622829c976..3d8f90c3df 100644 --- a/src/plugins/qbsprojectmanager/qbsnodes.h +++ b/src/plugins/qbsprojectmanager/qbsnodes.h @@ -88,7 +88,7 @@ private: class QbsProjectNode : public ProjectExplorer::ProjectNode { public: - explicit QbsProjectNode(const Utils::FileName &projectDirectory); + explicit QbsProjectNode(const Utils::FilePath &projectDirectory); virtual QbsProject *project() const; const qbs::Project qbsProject() const; diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp index d3a560ad31..f7f143b025 100644 --- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp +++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp @@ -65,7 +65,7 @@ FileType fileType(const qbs::ArtifactData &artifact) void setupArtifacts(FolderNode *root, const QList<qbs::ArtifactData> &artifacts) { for (const qbs::ArtifactData &ad : artifacts) { - const FileName path = FileName::fromString(ad.filePath()); + const FilePath path = FilePath::fromString(ad.filePath()); const FileType type = fileType(ad); const bool isGenerated = ad.isGenerated(); @@ -93,7 +93,7 @@ buildGroupNodeTree(const qbs::GroupData &grp, const QString &productPath, bool p { QTC_ASSERT(grp.isValid(), return nullptr); - auto fileNode = std::make_unique<FileNode>(FileName::fromString(grp.location().filePath()), + auto fileNode = std::make_unique<FileNode>(FilePath::fromString(grp.location().filePath()), FileType::Project); fileNode->setLine(grp.location().line()); @@ -101,7 +101,7 @@ buildGroupNodeTree(const qbs::GroupData &grp, const QString &productPath, bool p result->setEnabled(productIsEnabled && grp.isEnabled()); result->setAbsoluteFilePathAndLine( - FileName::fromString(grp.location().filePath()).parentDir(), -1); + FilePath::fromString(grp.location().filePath()).parentDir(), -1); result->setDisplayName(grp.name()); result->addNode(std::move(fileNode)); @@ -112,13 +112,13 @@ buildGroupNodeTree(const qbs::GroupData &grp, const QString &productPath, bool p void setupQbsProductData(QbsProductNode *node, const qbs::ProductData &prd) { - auto fileNode = std::make_unique<FileNode>(FileName::fromString(prd.location().filePath()), + auto fileNode = std::make_unique<FileNode>(FilePath::fromString(prd.location().filePath()), FileType::Project); fileNode->setLine(prd.location().line()); node->setEnabled(prd.isEnabled()); node->setDisplayName(prd.fullDisplayName()); - node->setAbsoluteFilePathAndLine(FileName::fromString(prd.location().filePath()).parentDir(), -1); + node->setAbsoluteFilePathAndLine(FilePath::fromString(prd.location().filePath()).parentDir(), -1); node->addNode(std::move(fileNode)); const QString &productPath = QFileInfo(prd.location().filePath()).absolutePath(); @@ -132,7 +132,7 @@ void setupQbsProductData(QbsProductNode *node, const qbs::ProductData &prd) } // Add "Generated Files" Node: - auto genFiles = std::make_unique<VirtualFolderNode>(FileName::fromString(prd.buildDirectory())); + auto genFiles = std::make_unique<VirtualFolderNode>(FilePath::fromString(prd.buildDirectory())); genFiles->setDisplayName(QCoreApplication::translate("QbsProductNode", "Generated files")); setupArtifacts(genFiles.get(), prd.generatedArtifacts()); node->addNode(std::move(genFiles)); @@ -149,14 +149,14 @@ std::unique_ptr<QbsProductNode> buildProductNodeTree(const qbs::ProductData &prd void setupProjectNode(QbsProjectNode *node, const qbs::ProjectData &prjData, const qbs::Project &qbsProject) { - auto fileNode = std::make_unique<FileNode>(FileName::fromString(prjData.location().filePath()), + auto fileNode = std::make_unique<FileNode>(FilePath::fromString(prjData.location().filePath()), FileType::Project); fileNode->setLine(prjData.location().line()); node->addNode(std::move(fileNode)); foreach (const qbs::ProjectData &subData, prjData.subProjects()) { auto subProject = std::make_unique<QbsProjectNode>( - FileName::fromString(subData.location().filePath()).parentDir()); + FilePath::fromString(subData.location().filePath()).parentDir()); setupProjectNode(subProject.get(), subData, qbsProject); node->addNode(std::move(subProject)); } @@ -214,10 +214,10 @@ std::unique_ptr<QbsRootProjectNode> QbsNodeTreeBuilder::buildTree(QbsProject *pr auto buildSystemFiles = std::make_unique<FolderNode>(project->projectDirectory()); buildSystemFiles->setDisplayName(QCoreApplication::translate("QbsRootProjectNode", "Qbs files")); - const FileName base = project->projectDirectory(); + const FilePath base = project->projectDirectory(); const QStringList files = unreferencedBuildSystemFiles(project->qbsProject()); for (const QString &f : files) { - const FileName filePath = FileName::fromString(f); + const FilePath filePath = FilePath::fromString(f); if (filePath.isChildOf(base)) buildSystemFiles->addNestedNode(std::make_unique<FileNode>(filePath, FileType::Project)); } diff --git a/src/plugins/qbsprojectmanager/qbsparser.cpp b/src/plugins/qbsprojectmanager/qbsparser.cpp index 8aa0ed7e96..d6b2339dbb 100644 --- a/src/plugins/qbsprojectmanager/qbsparser.cpp +++ b/src/plugins/qbsprojectmanager/qbsparser.cpp @@ -52,7 +52,7 @@ void QbsParser::taskAdded(const ProjectExplorer::Task &task, int linkedLines, in QString filePath = task.file.toString(); if (!filePath.isEmpty()) - editable.file = Utils::FileName::fromUserInput(m_workingDirectory.absoluteFilePath(filePath)); + editable.file = Utils::FilePath::fromUserInput(m_workingDirectory.absoluteFilePath(filePath)); IOutputParser::taskAdded(editable, linkedLines, skipLines); } diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp index 7d44d03796..209e87b4bc 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.cpp +++ b/src/plugins/qbsprojectmanager/qbsproject.cpp @@ -121,7 +121,7 @@ private: // QbsProject: // -------------------------------------------------------------------- -QbsProject::QbsProject(const FileName &fileName) : +QbsProject::QbsProject(const FilePath &fileName) : Project(Constants::MIME_TYPE, fileName, [this] { delayParsing(); }), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater) { @@ -484,16 +484,16 @@ void QbsProject::updateProjectNodes() rebuildProjectTree(); } -FileName QbsProject::installRoot() +FilePath QbsProject::installRoot() { if (!activeTarget()) - return FileName(); + return FilePath(); const auto * const bc = qobject_cast<QbsBuildConfiguration *>(activeTarget()->activeBuildConfiguration()); if (!bc) - return FileName(); + return FilePath(); const QbsBuildStep * const buildStep = bc->qbsStep(); - return buildStep && buildStep->install() ? buildStep->installRoot() : FileName(); + return buildStep && buildStep->install() ? buildStep->installRoot() : FilePath(); } void QbsProject::handleQbsParsingDone(bool success) @@ -681,7 +681,7 @@ void QbsProject::generateErrors(const qbs::ErrorInfo &e) foreach (const qbs::ErrorItem &item, e.items()) TaskHub::addTask(Task::Error, item.description(), ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM, - FileName::fromString(item.codeLocation().filePath()), + FilePath::fromString(item.codeLocation().filePath()), item.codeLocation().line()); } @@ -763,11 +763,11 @@ void QbsProject::updateDocuments(const QSet<QString> &files) } } QSet<IDocument *> toAdd; - const FileName buildDir = FileName::fromString(m_projectData.buildDirectory()); + const FilePath buildDir = FilePath::fromString(m_projectData.buildDirectory()); for (const QString &f : qAsConst(filesToAdd)) { // A changed qbs file (project, module etc) should trigger a re-parse, but not if // the file was generated by qbs itself, in which case that might cause an infinite loop. - const FileName fp = FileName::fromString(f); + const FilePath fp = FilePath::fromString(f); static const ProjectDocument::ProjectCallback noOpCallback = []{}; const ProjectDocument::ProjectCallback reparseCallback = [this]() { delayParsing(); }; toAdd.insert(new ProjectDocument(Constants::MIME_TYPE, fp, fp.isChildOf(buildDir) @@ -971,7 +971,7 @@ void QbsProject::updateCppCodeModel() list.removeDuplicates(); ProjectExplorer::HeaderPaths grpHeaderPaths; foreach (const QString &p, list) - grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::User}; + grpHeaderPaths += {FilePath::fromUserInput(p).toString(), HeaderPathType::User}; list = props.getModulePropertiesAsStringList(QLatin1String(CONFIG_CPP_MODULE), QLatin1String(CONFIG_FRAMEWORKPATHS)); @@ -979,7 +979,7 @@ void QbsProject::updateCppCodeModel() QLatin1String(CONFIG_SYSTEM_FRAMEWORKPATHS))); list.removeDuplicates(); foreach (const QString &p, list) - grpHeaderPaths += {FileName::fromUserInput(p).toString(), HeaderPathType::Framework}; + grpHeaderPaths += {FilePath::fromUserInput(p).toString(), HeaderPathType::Framework}; rpp.setHeaderPaths(grpHeaderPaths); @@ -1018,12 +1018,12 @@ void QbsProject::updateCppCodeModel() continue; } - const FileNameList fileNames = Utils::transform(generated, + const FilePathList fileNames = Utils::transform(generated, [](const QString &s) { - return Utils::FileName::fromString(s); + return Utils::FilePath::fromString(s); }); m_extraCompilers.append((*i)->create( - this, FileName::fromString(source.filePath()), fileNames)); + this, FilePath::fromString(source.filePath()), fileNames)); } } } @@ -1079,7 +1079,7 @@ void QbsProject::updateQmlJsCodeModel() foreach (const qbs::ProductData &product, m_projectData.allProducts()) { static const QString propertyName = QLatin1String("qmlImportPaths"); foreach (const QString &path, product.properties().value(propertyName).toStringList()) { - projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(path), + projectInfo.importPaths.maybeInsert(Utils::FilePath::fromString(path), QmlJS::Dialect::Qml); } } @@ -1109,8 +1109,8 @@ void QbsProject::updateApplicationTargets() BuildTargetInfo bti; bti.buildKey = QbsProject::uniqueProductName(productData); - bti.targetFilePath = FileName::fromString(targetFile); - bti.projectFilePath = FileName::fromString(projectFile); + bti.targetFilePath = FilePath::fromString(targetFile); + bti.projectFilePath = FilePath::fromString(projectFile); bti.isQtcRunnable = isQtcRunnable; // Fixed up below. bti.usesTerminal = usesTerminal; bti.displayName = productData.fullDisplayName(); diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h index c60172e2ec..f186bb2c13 100644 --- a/src/plugins/qbsprojectmanager/qbsproject.h +++ b/src/plugins/qbsprojectmanager/qbsproject.h @@ -54,7 +54,7 @@ class QbsProject : public ProjectExplorer::Project Q_OBJECT public: - explicit QbsProject(const Utils::FileName &filename); + explicit QbsProject(const Utils::FilePath &filename); ~QbsProject() override; QStringList filesGeneratedFrom(const QString &sourceFile) const override; @@ -128,7 +128,7 @@ private: void updateAfterParse(); void delayedUpdateAfterParse(); void updateProjectNodes(); - Utils::FileName installRoot(); + Utils::FilePath installRoot(); void projectLoaded() override; ProjectExplorer::ProjectImporter *projectImporter() const override; diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp index 6d40a0acc1..69c4e5af1d 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.cpp @@ -54,18 +54,18 @@ namespace Internal { struct BuildGraphData { - FileName bgFilePath; + FilePath bgFilePath; QVariantMap overriddenProperties; - FileName cCompilerPath; - FileName cxxCompilerPath; - FileName qtBinPath; - FileName sysroot; + FilePath cCompilerPath; + FilePath cxxCompilerPath; + FilePath qtBinPath; + FilePath sysroot; QString buildVariant; }; static BuildGraphData extractBgData(const qbs::Project::BuildGraphInfo &bgInfo) { BuildGraphData bgData; - bgData.bgFilePath = FileName::fromString(bgInfo.bgFilePath); + bgData.bgFilePath = FilePath::fromString(bgInfo.bgFilePath); bgData.overriddenProperties = bgInfo.overriddenProperties; const QVariantMap &moduleProps = bgInfo.requestedProperties; const QVariantMap prjCompilerPathByLanguage @@ -73,17 +73,17 @@ static BuildGraphData extractBgData(const qbs::Project::BuildGraphInfo &bgInfo) const QString prjCompilerPath = moduleProps.value("cpp.compilerPath").toString(); const QStringList prjToolchain = moduleProps.value("qbs.toolchain").toStringList(); const bool prjIsMsvc = prjToolchain.contains("msvc"); - bgData.cCompilerPath = FileName::fromString( + bgData.cCompilerPath = FilePath::fromString( prjIsMsvc ? prjCompilerPath : prjCompilerPathByLanguage.value("c").toString()); - bgData.cxxCompilerPath = FileName::fromString( + bgData.cxxCompilerPath = FilePath::fromString( prjIsMsvc ? prjCompilerPath : prjCompilerPathByLanguage.value("cpp").toString()); - bgData.qtBinPath = FileName::fromString(moduleProps.value("Qt.core.binPath").toString()); - bgData.sysroot = FileName::fromString(moduleProps.value("qbs.sysroot").toString()); + bgData.qtBinPath = FilePath::fromString(moduleProps.value("Qt.core.binPath").toString()); + bgData.sysroot = FilePath::fromString(moduleProps.value("qbs.sysroot").toString()); bgData.buildVariant = moduleProps.value("qbs.buildVariant").toString(); return bgData; } -QbsProjectImporter::QbsProjectImporter(const FileName &path) : QtProjectImporter(path) +QbsProjectImporter::QbsProjectImporter(const FilePath &path) : QtProjectImporter(path) { } @@ -93,7 +93,7 @@ static QString buildDir(const QString &projectFilePath, const Kit *k) ProjectMacroExpander expander(projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown); const QString projectDir - = Project::projectDirectory(FileName::fromString(projectFilePath)).toString(); + = Project::projectDirectory(FilePath::fromString(projectFilePath)).toString(); const QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate()); return FileUtils::resolvePath(projectDir, buildPath); } @@ -136,7 +136,7 @@ QStringList QbsProjectImporter::importCandidates() return candidates; } -QList<void *> QbsProjectImporter::examineDirectory(const FileName &importPath) const +QList<void *> QbsProjectImporter::examineDirectory(const FilePath &importPath) const { qCDebug(qbsPmLog) << "examining build directory" << importPath.toUserOutput(); QList<void *> data; @@ -203,7 +203,7 @@ Kit *QbsProjectImporter::createKit(void *directoryData) const qCDebug(qbsPmLog) << "creating kit for imported build" << bgData->bgFilePath.toUserOutput(); QtVersionData qtVersionData; if (!bgData->qtBinPath.isEmpty()) { - const FileName qmakeFilePath = bgData->qtBinPath.pathAppended(HostOsInfo::withExecutableSuffix("qmake")); + const FilePath qmakeFilePath = bgData->qtBinPath.pathAppended(HostOsInfo::withExecutableSuffix("qmake")); qtVersionData = findOrCreateQtVersion(qmakeFilePath); } return createTemporaryKit(qtVersionData,[this, bgData](Kit *k) -> void { diff --git a/src/plugins/qbsprojectmanager/qbsprojectimporter.h b/src/plugins/qbsprojectmanager/qbsprojectimporter.h index 4aa3682a38..345e57522b 100644 --- a/src/plugins/qbsprojectmanager/qbsprojectimporter.h +++ b/src/plugins/qbsprojectmanager/qbsprojectimporter.h @@ -35,11 +35,11 @@ class QbsProjectImporter final : public QtSupport::QtProjectImporter Q_OBJECT public: - QbsProjectImporter(const Utils::FileName &path); + QbsProjectImporter(const Utils::FilePath &path); private: QStringList importCandidates() override; - QList<void *> examineDirectory(const Utils::FileName &importPath) const override; + QList<void *> examineDirectory(const Utils::FilePath &importPath) const override; bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const override; ProjectExplorer::Kit *createKit(void *directoryData) const override; const QList<ProjectExplorer::BuildInfo> buildInfoListForKit(const ProjectExplorer::Kit *k, diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp index a23ebeeee4..d4960b3524 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp @@ -120,16 +120,16 @@ void QbsRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo & updateTargetInformation(); } -Utils::FileName QbsRunConfiguration::executableToRun(const BuildTargetInfo &targetInfo) const +Utils::FilePath QbsRunConfiguration::executableToRun(const BuildTargetInfo &targetInfo) const { - const FileName appInBuildDir = targetInfo.targetFilePath; + const FilePath appInBuildDir = targetInfo.targetFilePath; if (target()->deploymentData().localInstallRoot().isEmpty()) return appInBuildDir; const QString deployedAppFilePath = target()->deploymentData() .deployableForLocalFile(appInBuildDir.toString()).remoteFilePath(); if (deployedAppFilePath.isEmpty()) return appInBuildDir; - const FileName appInLocalInstallDir = target()->deploymentData().localInstallRoot() + const FilePath appInLocalInstallDir = target()->deploymentData().localInstallRoot() + deployedAppFilePath; return appInLocalInstallDir.exists() ? appInLocalInstallDir : appInBuildDir; } @@ -137,7 +137,7 @@ Utils::FileName QbsRunConfiguration::executableToRun(const BuildTargetInfo &targ void QbsRunConfiguration::updateTargetInformation() { BuildTargetInfo bti = buildTargetInfo(); - const FileName executable = executableToRun(bti); + const FilePath executable = executableToRun(bti); auto terminalAspect = aspect<TerminalAspect>(); terminalAspect->setUseTerminalHint(bti.usesTerminal); @@ -147,7 +147,7 @@ void QbsRunConfiguration::updateTargetInformation() QString defaultWorkingDir = QFileInfo(executable.toString()).absolutePath(); if (!defaultWorkingDir.isEmpty()) { auto wdAspect = aspect<WorkingDirectoryAspect>(); - wdAspect->setDefaultWorkingDirectory(FileName::fromString(defaultWorkingDir)); + wdAspect->setDefaultWorkingDirectory(FilePath::fromString(defaultWorkingDir)); } } diff --git a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h index 331df7ce6b..934f676624 100644 --- a/src/plugins/qbsprojectmanager/qbsrunconfiguration.h +++ b/src/plugins/qbsprojectmanager/qbsrunconfiguration.h @@ -42,7 +42,7 @@ public: QbsRunConfiguration(ProjectExplorer::Target *target, Core::Id id); private: - Utils::FileName executableToRun(const ProjectExplorer::BuildTargetInfo &targetInfo) const; + Utils::FilePath executableToRun(const ProjectExplorer::BuildTargetInfo &targetInfo) const; QVariantMap toMap() const final; bool fromMap(const QVariantMap &map) final; void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &rci) final; diff --git a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp index 94f7d7b70d..bfef5875e3 100644 --- a/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp +++ b/src/plugins/qmakeprojectmanager/addlibrarywizard.cpp @@ -54,7 +54,7 @@ QStringList qt_clean_filter_list(const QString &filter) return f.split(QLatin1Char(' '), QString::SkipEmptyParts); } -static bool validateLibraryPath(const Utils::FileName &filePath, +static bool validateLibraryPath(const Utils::FilePath &filePath, const Utils::PathChooser *pathChooser, QString *errorMessage) { diff --git a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp index be08ea5ff2..b93595bba1 100644 --- a/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp +++ b/src/plugins/qmakeprojectmanager/customwidgetwizard/plugingenerator.cpp @@ -130,7 +130,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara QString iconResource; if (!wo.iconFile.isEmpty()) { iconResource = QLatin1String("QLatin1String(\":/"); - iconResource += Utils::FileName::fromString(wo.iconFile).fileName(); + iconResource += Utils::FilePath::fromString(wo.iconFile).fileName(); iconResource += QLatin1String("\")"); } sm.insert(QLatin1String("WIDGET_ICON"),iconResource); diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp index 8c9c7b425c..8cf53db49b 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.cpp @@ -125,14 +125,14 @@ void DesktopQmakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreat updateTargetInformation(); } -FileName DesktopQmakeRunConfiguration::proFilePath() const +FilePath DesktopQmakeRunConfiguration::proFilePath() const { - return FileName::fromString(buildKey()); + return FilePath::fromString(buildKey()); } QString DesktopQmakeRunConfiguration::defaultDisplayName() { - FileName profile = proFilePath(); + FilePath profile = proFilePath(); if (!profile.isEmpty()) return profile.toFileInfo().completeBaseName(); return tr("Qt Run Configuration"); diff --git a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h index e9fdc53711..27bfb430b1 100644 --- a/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h +++ b/src/plugins/qmakeprojectmanager/desktopqmakerunconfiguration.h @@ -45,7 +45,7 @@ private: void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &info) final; QString defaultDisplayName(); - Utils::FileName proFilePath() const; + Utils::FilePath proFilePath() const; }; class DesktopQmakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory diff --git a/src/plugins/qmakeprojectmanager/externaleditors.cpp b/src/plugins/qmakeprojectmanager/externaleditors.cpp index 76f617ec5e..50983370c3 100644 --- a/src/plugins/qmakeprojectmanager/externaleditors.cpp +++ b/src/plugins/qmakeprojectmanager/externaleditors.cpp @@ -168,7 +168,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName, // As fallback check PATH data->workingDirectory.clear(); QVector<QtSupport::BaseQtVersion *> qtVersionsToCheck; // deduplicated after being filled - if (const Project *project = SessionManager::projectForFile(Utils::FileName::fromString(fileName))) { + if (const Project *project = SessionManager::projectForFile(Utils::FilePath::fromString(fileName))) { data->workingDirectory = project->projectDirectory().toString(); // active kit if (const Target *target = project->activeTarget()) { diff --git a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp index 2a26e6716e..1f7a96eee5 100644 --- a/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp +++ b/src/plugins/qmakeprojectmanager/librarydetailscontroller.cpp @@ -860,7 +860,7 @@ QString PackageLibraryDetailsController::snippet() const bool PackageLibraryDetailsController::isLinkPackageGenerated() const { - const Project *project = SessionManager::projectForFile(Utils::FileName::fromString(proFile())); + const Project *project = SessionManager::projectForFile(Utils::FilePath::fromString(proFile())); if (!project) return false; @@ -1010,7 +1010,7 @@ void InternalLibraryDetailsController::updateProFile() libraryDetailsWidget()->libraryComboBox->clear(); const QmakeProject *project - = dynamic_cast<QmakeProject *>(SessionManager::projectForFile(Utils::FileName::fromString(proFile()))); + = dynamic_cast<QmakeProject *>(SessionManager::projectForFile(Utils::FilePath::fromString(proFile()))); if (!project) return; @@ -1092,7 +1092,7 @@ QString InternalLibraryDetailsController::snippet() const const QString proRelavitePath = rootDir.relativeFilePath(proFile()); // project for which we insert the snippet - const Project *project = SessionManager::projectForFile(Utils::FileName::fromString(proFile())); + const Project *project = SessionManager::projectForFile(Utils::FilePath::fromString(proFile())); // the build directory of the active build configuration QDir rootBuildDir = rootDir; // If the project is unconfigured use the project dir diff --git a/src/plugins/qmakeprojectmanager/makefileparse.cpp b/src/plugins/qmakeprojectmanager/makefileparse.cpp index 19a3a02f34..5fd6d5b0be 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.cpp +++ b/src/plugins/qmakeprojectmanager/makefileparse.cpp @@ -39,7 +39,7 @@ using namespace QmakeProjectManager; using namespace Internal; -using Utils::FileName; +using Utils::FilePath; using Utils::QtcProcess; using QtSupport::QtVersionManager; using QtSupport::BaseQtVersion; @@ -242,7 +242,7 @@ void MakeFileParse::parseAssignments(QList<QMakeAssignment> *assignments) } } -static FileName findQMakeBinaryFromMakefile(const QString &makefile) +static FilePath findQMakeBinaryFromMakefile(const QString &makefile) { QFile fi(makefile); if (fi.exists() && fi.open(QFile::ReadOnly)) { @@ -260,11 +260,11 @@ static FileName findQMakeBinaryFromMakefile(const QString &makefile) // Is qmake still installed? QFileInfo fi(qmakePath); if (fi.exists()) - return FileName::fromFileInfo(fi); + return FilePath::fromFileInfo(fi); } } } - return FileName(); + return FilePath(); } MakeFileParse::MakeFileParse(const QString &makefile) @@ -312,7 +312,7 @@ MakeFileParse::MakefileState MakeFileParse::makeFileState() const return m_state; } -Utils::FileName MakeFileParse::qmakePath() const +Utils::FilePath MakeFileParse::qmakePath() const { return m_qmakePath; } diff --git a/src/plugins/qmakeprojectmanager/makefileparse.h b/src/plugins/qmakeprojectmanager/makefileparse.h index 9a2abeb00e..90d3415662 100644 --- a/src/plugins/qmakeprojectmanager/makefileparse.h +++ b/src/plugins/qmakeprojectmanager/makefileparse.h @@ -47,7 +47,7 @@ public: enum MakefileState { MakefileMissing, CouldNotParse, Okay }; MakefileState makeFileState() const; - Utils::FileName qmakePath() const; + Utils::FilePath qmakePath() const; QString srcProFile() const; QMakeStepConfig config() const; @@ -75,7 +75,7 @@ private: }; MakefileState m_state; - Utils::FileName m_qmakePath; + Utils::FilePath m_qmakePath; QString m_srcProFile; QmakeBuildConfig m_qmakeBuildConfig; diff --git a/src/plugins/qmakeprojectmanager/profileeditor.cpp b/src/plugins/qmakeprojectmanager/profileeditor.cpp index 64386a754f..346f119782 100644 --- a/src/plugins/qmakeprojectmanager/profileeditor.cpp +++ b/src/plugins/qmakeprojectmanager/profileeditor.cpp @@ -82,7 +82,7 @@ static bool isValidFileNameChar(const QChar &c) QString ProFileEditorWidget::checkForPrfFile(const QString &baseName) const { - const FileName projectFile = textDocument()->filePath(); + const FilePath projectFile = textDocument()->filePath(); const QmakePriFileNode *projectNode = nullptr; for (const Project * const project : SessionManager::projects()) { if (project->isParsing()) diff --git a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp index 7c7ed00796..0bb6eed49f 100644 --- a/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp +++ b/src/plugins/qmakeprojectmanager/qmakebuildconfiguration.cpp @@ -87,17 +87,17 @@ QString QmakeBuildConfiguration::shadowBuildDirectory(const QString &proFilePath const QString projectName = QFileInfo(proFilePath).completeBaseName(); ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType); - QString projectDir = Project::projectDirectory(FileName::fromString(proFilePath)).toString(); + QString projectDir = Project::projectDirectory(FilePath::fromString(proFilePath)).toString(); QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate()); return FileUtils::resolvePath(projectDir, buildPath); } -static FileName defaultBuildDirectory(const QString &projectPath, +static FilePath defaultBuildDirectory(const QString &projectPath, const Kit *k, const QString &suffix, BuildConfiguration::BuildType type) { - return FileName::fromString(QmakeBuildConfiguration::shadowBuildDirectory(projectPath, k, + return FilePath::fromString(QmakeBuildConfiguration::shadowBuildDirectory(projectPath, k, suffix, type)); } @@ -158,7 +158,7 @@ void QmakeBuildConfiguration::initialize(const BuildInfo &info) setQMakeBuildConfiguration(config); - FileName directory = info.buildDirectory; + FilePath directory = info.buildDirectory; if (directory.isEmpty()) { directory = defaultBuildDirectory(target()->project()->projectFilePath().toString(), target()->kit(), info.displayName, buildType()); @@ -388,7 +388,7 @@ QmakeBuildConfiguration::MakefileState QmakeBuildConfiguration::compareToImportF return MakefileForWrongProject; } - const Utils::FileName projectPath = + const Utils::FilePath projectPath = m_subNodeBuild ? m_subNodeBuild->filePath() : qs->project()->projectFilePath(); if (parse.srcProFile() != projectPath.toString()) { qCDebug(logs) << "**Different profile used to generate the Makefile:" @@ -491,7 +491,7 @@ QString QmakeBuildConfiguration::extractSpecFromArguments(QString *args, const QString &directory, const BaseQtVersion *version, QStringList *outArgs) { - FileName parsedSpec; + FilePath parsedSpec; bool ignoreNext = false; bool nextIsSpec = false; @@ -501,7 +501,7 @@ QString QmakeBuildConfiguration::extractSpecFromArguments(QString *args, ait.deleteArg(); } else if (nextIsSpec) { nextIsSpec = false; - parsedSpec = FileName::fromUserInput(ait.value()); + parsedSpec = FilePath::fromUserInput(ait.value()); ait.deleteArg(); } else if (ait.value() == QLatin1String("-spec") || ait.value() == QLatin1String("-platform")) { nextIsSpec = true; @@ -523,9 +523,9 @@ QString QmakeBuildConfiguration::extractSpecFromArguments(QString *args, if (parsedSpec.isEmpty()) return {}; - FileName baseMkspecDir = FileName::fromUserInput( + FilePath baseMkspecDir = FilePath::fromUserInput( version->qmakeProperty("QT_HOST_DATA") + QLatin1String("/mkspecs")); - baseMkspecDir = FileName::fromString(baseMkspecDir.toFileInfo().canonicalFilePath()); + baseMkspecDir = FilePath::fromString(baseMkspecDir.toFileInfo().canonicalFilePath()); // if the path is relative it can be // relative to the working directory (as found in the Makefiles) @@ -534,21 +534,21 @@ QString QmakeBuildConfiguration::extractSpecFromArguments(QString *args, // for the other one we don't need to do anything if (parsedSpec.toFileInfo().isRelative()) { if (QFileInfo::exists(directory + QLatin1Char('/') + parsedSpec.toString())) - parsedSpec = FileName::fromUserInput(directory + QLatin1Char('/') + parsedSpec.toString()); + parsedSpec = FilePath::fromUserInput(directory + QLatin1Char('/') + parsedSpec.toString()); else - parsedSpec = FileName::fromUserInput(baseMkspecDir.toString() + QLatin1Char('/') + parsedSpec.toString()); + parsedSpec = FilePath::fromUserInput(baseMkspecDir.toString() + QLatin1Char('/') + parsedSpec.toString()); } QFileInfo f2 = parsedSpec.toFileInfo(); while (f2.isSymLink()) { - parsedSpec = FileName::fromString(f2.symLinkTarget()); + parsedSpec = FilePath::fromString(f2.symLinkTarget()); f2.setFile(parsedSpec.toString()); } if (parsedSpec.isChildOf(baseMkspecDir)) { parsedSpec = parsedSpec.relativeChildPath(baseMkspecDir); } else { - FileName sourceMkSpecPath = FileName::fromString(version->sourcePath().toString() + FilePath sourceMkSpecPath = FilePath::fromString(version->sourcePath().toString() + QLatin1String("/mkspecs")); if (parsedSpec.isChildOf(sourceMkSpecPath)) parsedSpec = parsedSpec.relativeChildPath(sourceMkSpecPath); @@ -594,7 +594,7 @@ QmakeBuildConfigurationFactory::QmakeBuildConfigurationFactory() && !QmakeBuildConfiguration::isBuildDirAtSafeLocation( QFileInfo(projectPath).absoluteDir().path(), QDir(buildDir).absolutePath())) { issues.append(Task(Task::Warning, QmakeBuildConfiguration::unalignedBuildDirWarning(), - Utils::FileName(), -1, + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } return issues; @@ -639,7 +639,7 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, info.kitId = k->id(); // check if this project is in the source directory: - FileName projectFilePath = FileName::fromString(projectPath); + FilePath projectFilePath = FilePath::fromString(projectPath); if (version && version->isInSourceDirectory(projectFilePath)) { // assemble build directory QString projectDirectory = projectFilePath.toFileInfo().absolutePath(); @@ -648,7 +648,7 @@ BuildInfo QmakeBuildConfigurationFactory::createBuildInfo(const Kit *k, QString qtBuildDir = version->qmakeProperty("QT_INSTALL_PREFIX"); QString absoluteBuildPath = QDir::cleanPath(qtBuildDir + QLatin1Char('/') + relativeProjectPath); - info.buildDirectory = FileName::fromString(absoluteBuildPath); + info.buildDirectory = FilePath::fromString(absoluteBuildPath); } else { info.buildDirectory = defaultBuildDirectory(projectPath, k, suffix, type); } diff --git a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp index 0f96828a12..623b20a1a4 100644 --- a/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp +++ b/src/plugins/qmakeprojectmanager/qmakekitinformation.cpp @@ -100,10 +100,10 @@ Tasks QmakeKitAspect::validate(const Kit *k) const const QString mkspec = QmakeKitAspect::mkspec(k); if (!version && !mkspec.isEmpty()) result << Task(Task::Warning, tr("No Qt version set, so mkspec is ignored."), - FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); + FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); if (version && !version->hasMkspec(mkspec)) result << Task(Task::Error, tr("Mkspec not found for Qt version."), - FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); + FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); return result; } diff --git a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp index d143637c3f..3b4642a6df 100644 --- a/src/plugins/qmakeprojectmanager/qmakemakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakemakestep.cpp @@ -70,7 +70,7 @@ bool QmakeMakeStep::init() if (!bc) emit addTask(Task::buildConfigurationMissingTask()); - Utils::FileName make = effectiveMakeCommand(); + Utils::FilePath make = effectiveMakeCommand(); if (make.isEmpty()) emit addTask(makeCommandMissingTask()); @@ -91,7 +91,7 @@ bool QmakeMakeStep::init() workingDirectory = bc->subNodeBuild()->buildDir(); else workingDirectory = bc->buildDirectory().toString(); - pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory)); + pp->setWorkingDirectory(Utils::FilePath::fromString(workingDirectory)); pp->setCommand(make); @@ -209,7 +209,7 @@ void QmakeMakeStep::finish(bool success) && QmakeSettings::warnAgainstUnalignedBuildDir()) { const QString msg = tr("The build directory is not at the same level as the source " "directory, which could be the reason for the build failure."); - emit addTask(Task(Task::Warning, msg, Utils::FileName(), -1, + emit addTask(Task(Task::Warning, msg, Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } MakeStep::finish(success); diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.cpp b/src/plugins/qmakeprojectmanager/qmakenodes.cpp index 827985b62f..a71ab8c3d6 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodes.cpp @@ -53,7 +53,7 @@ namespace QmakeProjectManager { */ QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, - const FileName &filePath, QmakePriFile *pf) : + const FilePath &filePath, QmakePriFile *pf) : ProjectNode(filePath), m_project(project), m_qmakeProFileNode(qmakeProFileNode), @@ -227,7 +227,7 @@ FolderNode::AddNewInformation QmakePriFileNode::addNewInformation(const QStringL \class QmakeProFileNode Implements abstract ProjectNode class */ -QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FileName &filePath, QmakeProFile *pf) : +QmakeProFileNode::QmakeProFileNode(QmakeProject *project, const FilePath &filePath, QmakeProFile *pf) : QmakePriFileNode(project, this, filePath, pf) { setIsProduct(); @@ -281,10 +281,10 @@ QVariant QmakeProFileNode::data(Core::Id role) const if (role == Android::Constants::AndroidSoLibPath) { TargetInformation info = targetInformation(); QStringList res = {info.buildDir.toString()}; - Utils::FileName destDir = info.destDir; + Utils::FilePath destDir = info.destDir; if (!destDir.isEmpty()) { if (destDir.toFileInfo().isRelative()) - destDir = Utils::FileName::fromString(QDir::cleanPath(info.buildDir.toString() + destDir = Utils::FilePath::fromString(QDir::cleanPath(info.buildDir.toString() + '/' + destDir.toString())); res.append(destDir.toString()); } @@ -413,10 +413,10 @@ QString QmakeProFileNode::buildDir() const return QString(); } -FileName QmakeProFileNode::buildDir(QmakeBuildConfiguration *bc) const +FilePath QmakeProFileNode::buildDir(QmakeBuildConfiguration *bc) const { const QmakeProFile *pro = proFile(); - return pro ? pro->buildDir(bc) : FileName(); + return pro ? pro->buildDir(bc) : FilePath(); } QString QmakeProFileNode::objectExtension() const diff --git a/src/plugins/qmakeprojectmanager/qmakenodes.h b/src/plugins/qmakeprojectmanager/qmakenodes.h index 0f25f13474..92b84fbcb0 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodes.h +++ b/src/plugins/qmakeprojectmanager/qmakenodes.h @@ -30,7 +30,7 @@ #include <projectexplorer/projectnodes.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace QmakeProjectManager { class QmakeProFileNode; @@ -41,7 +41,7 @@ class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::Proj { public: QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, - const Utils::FileName &filePath, QmakePriFile *pf); + const Utils::FilePath &filePath, QmakePriFile *pf); QmakePriFile *priFile() const; @@ -78,7 +78,7 @@ private: class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode { public: - QmakeProFileNode(QmakeProject *project, const Utils::FileName &filePath, QmakeProFile *pf); + QmakeProFileNode(QmakeProject *project, const Utils::FilePath &filePath, QmakeProFile *pf); QmakeProFile *proFile() const; @@ -104,7 +104,7 @@ public: QmakeProjectManager::ProjectType projectType() const; QString buildDir() const; - Utils::FileName buildDir(QmakeBuildConfiguration *bc) const; + Utils::FilePath buildDir(QmakeBuildConfiguration *bc) const; QStringList variableValue(const Variable var) const; QString singleVariableValue(const Variable var) const; diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index c493be2836..d2fc8051de 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp @@ -128,7 +128,7 @@ void clearQmakeStaticData() namespace QmakeProjectManager { -static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const FileNameList &toExclude) +static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const FilePathList &toExclude) { QTC_ASSERT(pri, return); QTC_ASSERT(node, return); @@ -141,15 +141,15 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi // other normal files: const QVector<QmakeStaticData::FileTypeData> &fileTypes = qmakeStaticData()->fileTypeData; - FileNameList generatedFiles; + FilePathList generatedFiles; const auto proFile = dynamic_cast<const QmakeProFile *>(pri); for (int i = 0; i < fileTypes.size(); ++i) { FileType type = fileTypes.at(i).type; - const QSet<FileName> &newFilePaths = Utils::filtered(pri->files(type), [&toExclude](const Utils::FileName &fn) { - return !Utils::contains(toExclude, [&fn](const Utils::FileName &ex) { return fn.isChildOf(ex); }); + const QSet<FilePath> &newFilePaths = Utils::filtered(pri->files(type), [&toExclude](const Utils::FilePath &fn) { + return !Utils::contains(toExclude, [&fn](const Utils::FilePath &ex) { return fn.isChildOf(ex); }); }); if (proFile) { - for (const FileName &fp : newFilePaths) { + for (const FilePath &fp : newFilePaths) { for (const ExtraCompiler *ec : proFile->extraCompilers()) { if (ec->source() == fp) generatedFiles << ec->targets(); @@ -165,7 +165,7 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi vfolder->setAddFileFilter(fileTypes.at(i).addFileFilter); if (type == FileType::Resource) { - for (const FileName &file : newFilePaths) { + for (const FilePath &file : newFilePaths) { auto vfs = pri->project()->qmakeVfs(); QString contents; QString errorMessage; @@ -186,7 +186,7 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi vfolder->addNode(std::move(topLevel)); } } else { - for (const FileName &fn : newFilePaths) { + for (const FilePath &fn : newFilePaths) { // Qmake will flag everything in SOURCES as source, even when the // qt quick compiler moves qrc files into it:-/ Get better data based on // the filename. @@ -202,13 +202,13 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi if (!generatedFiles.empty()) { QTC_CHECK(proFile); - const FileName baseDir = generatedFiles.size() == 1 ? generatedFiles.first().parentDir() + const FilePath baseDir = generatedFiles.size() == 1 ? generatedFiles.first().parentDir() : proFile->buildDir(); auto genFolder = std::make_unique<VirtualFolderNode>(baseDir); genFolder->setDisplayName(QCoreApplication::translate("QmakeProjectManager::QmakePriFile", "Generated Files")); genFolder->setIsGenerated(true); - for (const FileName &fp : generatedFiles) { + for (const FilePath &fp : generatedFiles) { auto fileNode = std::make_unique<FileNode>(fp, FileNode::fileTypeForFileName(fp)); fileNode->setIsGenerated(true); genFolder->addNestedNode(std::move(fileNode)); @@ -235,7 +235,7 @@ std::unique_ptr<QmakeProFileNode> QmakeNodeTreeBuilder::buildTree(QmakeProject * Kit *k = t ? t->kit() : KitManager::defaultKit(); BaseQtVersion *qt = k ? QtKitAspect::qtVersion(k) : nullptr; - const FileNameList toExclude = qt ? qt->directoriesToIgnoreInProjectTree() : FileNameList(); + const FilePathList toExclude = qt ? qt->directoriesToIgnoreInProjectTree() : FilePathList(); auto root = std::make_unique<QmakeProFileNode>(project, project->projectFilePath(), project->rootProFile()); diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.h b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.h index 2206ac904e..be3240da3c 100644 --- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.h +++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.h @@ -29,7 +29,7 @@ #include "qmakeparsernodes.h" #include "qmakenodes.h" -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace ProjectExplorer { class RunConfiguration; } namespace QmakeProjectManager { diff --git a/src/plugins/qmakeprojectmanager/qmakeparser.cpp b/src/plugins/qmakeprojectmanager/qmakeparser.cpp index 5c706989ab..ed6abf5ca7 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparser.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparser.cpp @@ -59,7 +59,7 @@ void QMakeParser::stdError(const QString &line) type = Task::Error; Task task = Task(type, description, - Utils::FileName::fromUserInput(fileName), + Utils::FilePath::fromUserInput(fileName), m_error.cap(2).toInt() /* line */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); emit addTask(task, 1); @@ -70,7 +70,7 @@ void QMakeParser::stdError(const QString &line) const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2); Task task = Task(Task::Error, description, - Utils::FileName() /* filename */, + Utils::FilePath() /* filename */, -1 /* linenumber */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); emit addTask(task, 1); @@ -81,7 +81,7 @@ void QMakeParser::stdError(const QString &line) const QString description = lne.mid(lne.indexOf(QLatin1Char(':')) + 2); Task task = Task(Task::Warning, description, - Utils::FileName() /* filename */, + Utils::FilePath() /* filename */, -1 /* linenumber */, Core::Id(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); emit addTask(task, 1); @@ -132,7 +132,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("undefined file"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryBuildSystem)) << QString(); @@ -143,7 +143,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Error, QLatin1String("Parse Error ('sth odd')"), - Utils::FileName::fromUserInput(QLatin1String("e:\\project.pro")), + Utils::FilePath::fromUserInput(QLatin1String("e:\\project.pro")), 14, categoryBuildSystem)) << QString(); @@ -155,7 +155,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("bearer module might require ReadUserData capability"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryBuildSystem)) << QString(); @@ -166,7 +166,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("Failure to find: blackberrycreatepackagestepconfigwidget.cpp"), - Utils::FileName(), -1, + Utils::FilePath(), -1, categoryBuildSystem)) << QString(); @@ -177,7 +177,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Warning, QLatin1String("Unescaped backslashes are deprecated."), - Utils::FileName::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1, + Utils::FilePath::fromUserInput(QLatin1String("e:\\QtSDK\\Simulator\\Qt\\msvc2008\\lib\\qtmaind.prl")), 1, categoryBuildSystem)) << QString(); QTest::newRow("moc note") @@ -187,7 +187,7 @@ void QmakeProjectManagerPlugin::testQmakeOutputParsers_data() << (Tasks() << Task(Task::Unknown, QLatin1String("Note: No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, categoryBuildSystem) ) << QString();} diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp index 0a2d4e3a2b..2d91fee7ce 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.cpp @@ -69,7 +69,7 @@ namespace { class QmakePriFileDocument : public Core::IDocument { public: - QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FileName &filePath) : + QmakePriFileDocument(QmakePriFile *qmakePriFile, const Utils::FilePath &filePath) : IDocument(nullptr), m_priFile(qmakePriFile) { setId("Qmake.PriFile"); @@ -111,9 +111,9 @@ class QmakeEvalInput { public: QString projectDir; - FileName projectFilePath; - FileName buildDirectory; - FileName sysroot; + FilePath projectFilePath; + FilePath buildDirectory; + FilePath sysroot; QtSupport::ProFileReader *readerExact; QtSupport::ProFileReader *readerCumulative; QMakeGlobals *qmakeGlobals; @@ -123,18 +123,18 @@ public: class QmakePriFileEvalResult { public: - QSet<FileName> folders; - QSet<FileName> recursiveEnumerateFiles; - QMap<FileType, QSet<FileName>> foundFiles; + QSet<FilePath> folders; + QSet<FilePath> recursiveEnumerateFiles; + QMap<FileType, QSet<FilePath>> foundFiles; }; class QmakeIncludedPriFile { public: ProFile *proFile; - Utils::FileName name; + Utils::FilePath name; QmakePriFileEvalResult result; - QMap<Utils::FileName, QmakeIncludedPriFile *> children; + QMap<Utils::FilePath, QmakeIncludedPriFile *> children; ~QmakeIncludedPriFile() { @@ -150,7 +150,7 @@ public: ProjectType projectType; QStringList subProjectsNotToDeploy; - QSet<FileName> exactSubdirs; + QSet<FilePath> exactSubdirs; QmakeIncludedPriFile includedFiles; TargetInformation targetInformation; InstallsList installsList; @@ -162,7 +162,7 @@ public: } // namespace Internal QmakePriFile::QmakePriFile(QmakeProject *project, QmakeProFile *qmakeProFile, - const FileName &filePath) : + const FilePath &filePath) : m_project(project), m_qmakeProFile(qmakeProFile) { @@ -171,12 +171,12 @@ QmakePriFile::QmakePriFile(QmakeProject *project, QmakeProFile *qmakeProFile, Core::DocumentManager::addDocument(m_priFileDocument.get()); } -FileName QmakePriFile::filePath() const +FilePath QmakePriFile::filePath() const { return m_priFileDocument->filePath(); } -FileName QmakePriFile::directoryPath() const +FilePath QmakePriFile::directoryPath() const { return filePath().parentDir(); } @@ -201,7 +201,7 @@ QVector<QmakePriFile *> QmakePriFile::children() const return m_children; } -QmakePriFile *QmakePriFile::findPriFile(const FileName &fileName) +QmakePriFile *QmakePriFile::findPriFile(const FilePath &fileName) { if (fileName == filePath()) return this; @@ -212,7 +212,7 @@ QmakePriFile *QmakePriFile::findPriFile(const FileName &fileName) return nullptr; } -const QmakePriFile *QmakePriFile::findPriFile(const FileName &fileName) const +const QmakePriFile *QmakePriFile::findPriFile(const FilePath &fileName) const { if (fileName == filePath()) return this; @@ -229,14 +229,14 @@ void QmakePriFile::makeEmpty() m_children.clear(); } -QSet<FileName> QmakePriFile::files(const FileType &type) const +QSet<FilePath> QmakePriFile::files(const FileType &type) const { return m_files.value(type); } -const QSet<FileName> QmakePriFile::collectFiles(const FileType &type) const +const QSet<FilePath> QmakePriFile::collectFiles(const FileType &type) const { - QSet<FileName> allFiles = files(type); + QSet<FilePath> allFiles = files(type); for (const QmakePriFile * const priFile : qAsConst(m_children)) { if (!dynamic_cast<const QmakeProFile *>(priFile)) allFiles.unite(priFile->collectFiles(type)); @@ -281,16 +281,16 @@ QStringList QmakePriFile::fullVPaths(const QStringList &baseVPaths, QtSupport::P return vPaths; } -QSet<FileName> QmakePriFile::recursiveEnumerate(const QString &folder) +QSet<FilePath> QmakePriFile::recursiveEnumerate(const QString &folder) { - QSet<FileName> result; + QSet<FilePath> result; QDir dir(folder); dir.setFilter(dir.filter() | QDir::NoDotAndDotDot); foreach (const QFileInfo &file, dir.entryInfoList()) { if (file.isDir() && !file.isSymLink()) result += recursiveEnumerate(file.absoluteFilePath()); else if (!Core::EditorManager::isAutoSaveFile(file.fileName())) - result += FileName::fromFileInfo(file); + result += FilePath::fromFileInfo(file); } return result; } @@ -315,7 +315,7 @@ void QmakePriFile::extractSources( auto *result = proToResult.value(source.proFileId); if (!result) result = fallback; - result->foundFiles[type].insert(FileName::fromString(source.fileName)); + result->foundFiles[type].insert(FilePath::fromString(source.fileName)); } } @@ -328,7 +328,7 @@ void QmakePriFile::extractInstalls( auto *result = proToResult.value(source.proFileId); if (!result) result = fallback; - result->folders.insert(FileName::fromString(source.fileName)); + result->folders.insert(FilePath::fromString(source.fileName)); } } } @@ -357,9 +357,9 @@ void QmakePriFile::processValues(QmakePriFileEvalResult &result) for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) { auto type = static_cast<FileType>(i); - QSet<FileName> &foundFiles = result.foundFiles[type]; + QSet<FilePath> &foundFiles = result.foundFiles[type]; result.recursiveEnumerateFiles.subtract(foundFiles); - QSet<FileName> newFilePaths = filterFilesProVariables(type, foundFiles); + QSet<FilePath> newFilePaths = filterFilesProVariables(type, foundFiles); newFilePaths += filterFilesRecursiveEnumerata(type, result.recursiveEnumerateFiles); foundFiles = newFilePaths; } @@ -376,10 +376,10 @@ void QmakePriFile::update(const Internal::QmakePriFileEvalResult &result) } } -void QmakePriFile::watchFolders(const QSet<FileName> &folders) +void QmakePriFile::watchFolders(const QSet<FilePath> &folders) { const QSet<QString> folderStrings = - Utils::transform(folders, &FileName::toString); + Utils::transform(folders, &FilePath::toString); QSet<QString> toUnwatch = m_watchedFolders; toUnwatch.subtract(folderStrings); @@ -405,23 +405,23 @@ QString QmakePriFile::continuationIndent() const return QString(tabSettings.m_indentSize, ' '); } -bool QmakePriFile::knowsFile(const FileName &filePath) const +bool QmakePriFile::knowsFile(const FilePath &filePath) const { return m_recursiveEnumerateFiles.contains(filePath); } -bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FileName> &newFiles) +bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FilePath> &newFiles) { qCDebug(qmakeParse()) << "QmakePriFile::folderChanged"; - QSet<FileName> addedFiles = newFiles; + QSet<FilePath> addedFiles = newFiles; addedFiles.subtract(m_recursiveEnumerateFiles); - QSet<FileName> removedFiles = m_recursiveEnumerateFiles; + QSet<FilePath> removedFiles = m_recursiveEnumerateFiles; removedFiles.subtract(newFiles); - foreach (const FileName &file, removedFiles) { - if (!file.isChildOf(FileName::fromString(changedFolder))) + foreach (const FilePath &file, removedFiles) { + if (!file.isChildOf(FilePath::fromString(changedFolder))) removedFiles.remove(file); } @@ -433,8 +433,8 @@ bool QmakePriFile::folderChanged(const QString &changedFolder, const QSet<FileNa // Apply the differences per file type for (int i = 0; i < static_cast<int>(FileType::FileTypeSize); ++i) { auto type = static_cast<FileType>(i); - QSet<FileName> add = filterFilesRecursiveEnumerata(type, addedFiles); - QSet<FileName> remove = filterFilesRecursiveEnumerata(type, removedFiles); + QSet<FilePath> add = filterFilesRecursiveEnumerata(type, addedFiles); + QSet<FilePath> remove = filterFilesRecursiveEnumerata(type, removedFiles); if (!add.isEmpty() || !remove.isEmpty()) { qCDebug(qmakeParse()) << "For type" << static_cast<int>(type) <<"\n" @@ -508,7 +508,7 @@ static QString simplifyProFilePath(const QString &proFilePath) bool QmakePriFile::addSubProject(const QString &proFile) { QStringList uniqueProFilePaths; - if (!m_recursiveEnumerateFiles.contains(FileName::fromString(proFile))) + if (!m_recursiveEnumerateFiles.contains(FilePath::fromString(proFile))) uniqueProFilePaths.append(simplifyProFilePath(proFile)); QStringList failedFiles; @@ -560,13 +560,13 @@ bool QmakePriFile::addFiles(const QStringList &filePaths, QStringList *notAdded) QStringList uniqueQrcFiles; foreach (const QString &file, qrcFiles) { - if (!m_recursiveEnumerateFiles.contains(FileName::fromString(file))) + if (!m_recursiveEnumerateFiles.contains(FilePath::fromString(file))) uniqueQrcFiles.append(file); } QStringList uniqueFilePaths; foreach (const QString &file, typeFiles) { - if (!m_recursiveEnumerateFiles.contains(FileName::fromString(file))) + if (!m_recursiveEnumerateFiles.contains(FilePath::fromString(file))) uniqueFilePaths.append(file); } uniqueFilePaths.sort(); @@ -994,34 +994,34 @@ QStringList QmakePriFile::varNamesForRemoving() return vars; } -QSet<FileName> QmakePriFile::filterFilesProVariables(FileType fileType, const QSet<FileName> &files) +QSet<FilePath> QmakePriFile::filterFilesProVariables(FileType fileType, const QSet<FilePath> &files) { if (fileType != FileType::QML && fileType != FileType::Unknown) return files; - QSet<FileName> result; + QSet<FilePath> result; if (fileType == FileType::QML) { - foreach (const FileName &file, files) + foreach (const FilePath &file, files) if (file.toString().endsWith(QLatin1String(".qml"))) result << file; } else { - foreach (const FileName &file, files) + foreach (const FilePath &file, files) if (!file.toString().endsWith(QLatin1String(".qml"))) result << file; } return result; } -QSet<FileName> QmakePriFile::filterFilesRecursiveEnumerata(FileType fileType, const QSet<FileName> &files) +QSet<FilePath> QmakePriFile::filterFilesRecursiveEnumerata(FileType fileType, const QSet<FilePath> &files) { - QSet<FileName> result; + QSet<FilePath> result; if (fileType != FileType::QML && fileType != FileType::Unknown) return result; if (fileType == FileType::QML) { - foreach (const FileName &file, files) + foreach (const FilePath &file, files) if (file.toString().endsWith(QLatin1String(".qml"))) result << file; } else { - foreach (const FileName &file, files) + foreach (const FilePath &file, files) if (!file.toString().endsWith(QLatin1String(".qml"))) result << file; } @@ -1051,12 +1051,12 @@ static ProjectType proFileTemplateTypeToProjectType(ProFileEvaluator::TemplateTy } } -QmakeProFile *QmakeProFile::findProFile(const FileName &fileName) +QmakeProFile *QmakeProFile::findProFile(const FilePath &fileName) { return static_cast<QmakeProFile *>(findPriFile(fileName)); } -const QmakeProFile *QmakeProFile::findProFile(const FileName &fileName) const +const QmakeProFile *QmakeProFile::findProFile(const FilePath &fileName) const { return static_cast<const QmakeProFile *>(findPriFile(fileName)); } @@ -1093,7 +1093,7 @@ QByteArray QmakeProFile::cxxDefines() const \class QmakeProFile Implements abstract ProjectNode class */ -QmakeProFile::QmakeProFile(QmakeProject *project, const FileName &filePath) : +QmakeProFile::QmakeProFile(QmakeProject *project, const FilePath &filePath) : QmakePriFile(project, this, filePath) { // The lifetime of the m_parserFutureWatcher is shorter @@ -1221,7 +1221,7 @@ QmakeEvalInput QmakeProFile::evalInput() const input.projectDir = directoryPath().toString(); input.projectFilePath = filePath(); input.buildDirectory = buildDir(); - input.sysroot = FileName::fromString(m_project->qmakeSysroot()); + input.sysroot = FilePath::fromString(m_project->qmakeSysroot()); input.readerExact = m_readerExact; input.readerCumulative = m_readerCumulative; input.qmakeGlobals = m_project->qmakeGlobals(); @@ -1308,10 +1308,10 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input) if (result->state == QmakeEvalResult::EvalOk) { if (result->projectType == ProjectType::SubDirsTemplate) { QStringList errors; - FileNameList subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors); + FilePathList subDirs = subDirsPaths(input.readerExact, input.projectDir, &result->subProjectsNotToDeploy, &errors); result->errors.append(errors); - foreach (const Utils::FileName &subDirName, subDirs) { + foreach (const Utils::FilePath &subDirName, subDirs) { auto subDir = new QmakeIncludedPriFile; subDir->proFile = nullptr; subDir->name = subDirName; @@ -1330,7 +1330,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input) continue; // Don't attempt to map subdirs here QVector<ProFile *> children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { - const Utils::FileName childName = Utils::FileName::fromString(child->fileName()); + const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName()); auto it = current->children.find(childName); if (it == current->children.end()) { auto childTree = new QmakeIncludedPriFile; @@ -1345,8 +1345,8 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input) } if (result->projectType == ProjectType::SubDirsTemplate) { - FileNameList subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr); - foreach (const Utils::FileName &subDirName, subDirs) { + FilePathList subDirs = subDirsPaths(input.readerCumulative, input.projectDir, nullptr, nullptr); + foreach (const Utils::FilePath &subDirName, subDirs) { auto it = result->includedFiles.children.find(subDirName); if (it == result->includedFiles.children.end()) { auto subDir = new QmakeIncludedPriFile; @@ -1366,7 +1366,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input) continue; // Don't attempt to map subdirs here QVector<ProFile *> children = includeFiles.value(current->proFile); foreach (ProFile *child, children) { - const Utils::FileName childName = Utils::FileName::fromString(child->fileName()); + const Utils::FilePath childName = Utils::FilePath::fromString(child->fileName()); auto it = current->children.find(childName); if (it == current->children.end()) { auto childTree = new QmakeIncludedPriFile; @@ -1564,7 +1564,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult) // Add/Remove pri files, sub projects // - FileName buildDirectory = buildDir(); + FilePath buildDirectory = buildDir(); QList<QPair<QmakePriFile *, QmakeIncludedPriFile *>> toCompare; @@ -1619,7 +1619,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult) m_subProjectsNotToDeploy = Utils::transform(result->subProjectsNotToDeploy, - [](const QString &s) { return FileName::fromString(s); }); + [](const QString &s) { return FilePath::fromString(s); }); m_installsList = result->installsList; if (m_varValues != result->newVarValues) @@ -1687,7 +1687,7 @@ void QmakeProFile::cleanupProFileReaders() m_readerCumulative = nullptr; } -QString QmakeProFile::uiDirPath(QtSupport::ProFileReader *reader, const FileName &buildDir) +QString QmakeProFile::uiDirPath(QtSupport::ProFileReader *reader, const FilePath &buildDir) { QString path = reader->value(QLatin1String("UI_DIR")); if (QFileInfo(path).isRelative()) @@ -1695,7 +1695,7 @@ QString QmakeProFile::uiDirPath(QtSupport::ProFileReader *reader, const FileName return path; } -QString QmakeProFile::mocDirPath(QtSupport::ProFileReader *reader, const FileName &buildDir) +QString QmakeProFile::mocDirPath(QtSupport::ProFileReader *reader, const FilePath &buildDir) { QString path = reader->value(QLatin1String("MOC_DIR")); if (QFileInfo(path).isRelative()) @@ -1719,8 +1719,8 @@ QString QmakeProFile::sysrootify(const QString &path, const QString &sysroot, return !IoUtils::exists(sysrooted) ? path : sysrooted; } -QStringList QmakeProFile::includePaths(QtSupport::ProFileReader *reader, const FileName &sysroot, - const FileName &buildDir, const QString &projectDir) +QStringList QmakeProFile::includePaths(QtSupport::ProFileReader *reader, const FilePath &sysroot, + const FilePath &buildDir, const QString &projectDir) { QStringList paths; bool nextIsAnIncludePath = false; @@ -1758,12 +1758,12 @@ QStringList QmakeProFile::libDirectories(QtSupport::ProFileReader *reader) return result; } -FileNameList QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, +FilePathList QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors) { - FileNameList subProjectPaths; + FilePathList subProjectPaths; const QStringList subDirVars = reader->values(QLatin1String("SUBDIRS")); @@ -1797,7 +1797,7 @@ FileNameList QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, if (QFile::exists(realFile)) { realFile = QDir::cleanPath(realFile); - subProjectPaths << FileName::fromString(realFile); + subProjectPaths << FilePath::fromString(realFile); if (subProjectsNotToDeploy && !subProjectsNotToDeploy->contains(realFile) && reader->values(subDirVar + QLatin1String(".CONFIG")) .contains(QLatin1String("no_default_target"))) { @@ -1815,8 +1815,8 @@ FileNameList QmakeProFile::subDirsPaths(QtSupport::ProFileReader *reader, TargetInformation QmakeProFile::targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, - const FileName &buildDir, - const FileName &projectFilePath) + const FilePath &buildDir, + const FilePath &projectFilePath) { TargetInformation result; if (!reader || !readerBuildPass) @@ -1832,7 +1832,7 @@ TargetInformation QmakeProFile::targetInformation(QtSupport::ProFileReader *read result.buildDir = buildDir; if (readerBuildPass->contains(QLatin1String("DESTDIR"))) - result.destDir = FileName::fromString(readerBuildPass->value(QLatin1String("DESTDIR"))); + result.destDir = FilePath::fromString(readerBuildPass->value(QLatin1String("DESTDIR"))); // Target result.target = readerBuildPass->value(QLatin1String("TARGET")); @@ -1906,12 +1906,12 @@ InstallsList QmakeProFile::installsList() const return m_installsList; } -FileName QmakeProFile::sourceDir() const +FilePath QmakeProFile::sourceDir() const { return directoryPath(); } -FileName QmakeProFile::buildDir(QmakeBuildConfiguration *bc) const +FilePath QmakeProFile::buildDir(QmakeBuildConfiguration *bc) const { const QDir srcDirRoot = QDir(m_project->projectDirectory().toString()); const QString relativeDir = srcDirRoot.relativeFilePath(directoryPath().toString()); @@ -1921,11 +1921,11 @@ FileName QmakeProFile::buildDir(QmakeBuildConfiguration *bc) const const QString buildDir = buildConfigBuildDir.isEmpty() ? m_project->projectDirectory().toString() : buildConfigBuildDir; - return FileName::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir))); + return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir))); } -FileNameList QmakeProFile::generatedFiles(const FileName &buildDir, - const FileName &sourceFile, +FilePathList QmakeProFile::generatedFiles(const FilePath &buildDir, + const FilePath &sourceFile, const FileType &sourceFileType) const { // The mechanism for finding the file names is rather crude, but as we @@ -1934,10 +1934,10 @@ FileNameList QmakeProFile::generatedFiles(const FileName &buildDir, // cannot help doing this here. if (sourceFileType == FileType::Form) { - FileName location; + FilePath location; auto it = m_varValues.constFind(Variable::UiDir); if (it != m_varValues.constEnd() && !it.value().isEmpty()) - location = FileName::fromString(it.value().front()); + location = FilePath::fromString(it.value().front()); else location = buildDir; if (location.isEmpty()) @@ -1945,11 +1945,11 @@ FileNameList QmakeProFile::generatedFiles(const FileName &buildDir, location = location.pathAppended("ui_" + sourceFile.toFileInfo().completeBaseName() + singleVariableValue(Variable::HeaderExtension)); - return { Utils::FileName::fromString(QDir::cleanPath(location.toString())) }; + return { Utils::FilePath::fromString(QDir::cleanPath(location.toString())) }; } else if (sourceFileType == FileType::StateChart) { if (buildDir.isEmpty()) return { }; - const FileName location = buildDir.pathAppended(sourceFile.toFileInfo().completeBaseName()); + const FilePath location = buildDir.pathAppended(sourceFile.toFileInfo().completeBaseName()); return { location.stringAppended(singleVariableValue(Variable::HeaderExtension)), location.stringAppended(singleVariableValue(Variable::CppExtension)) @@ -1963,17 +1963,17 @@ QList<ExtraCompiler *> QmakeProFile::extraCompilers() const return m_extraCompilers; } -void QmakeProFile::setupExtraCompiler(const FileName &buildDir, +void QmakeProFile::setupExtraCompiler(const FilePath &buildDir, const FileType &fileType, ExtraCompilerFactory *factory) { - for (const FileName &fn : collectFiles(fileType)) { - const FileNameList generated = generatedFiles(buildDir, fn, fileType); + for (const FilePath &fn : collectFiles(fileType)) { + const FilePathList generated = generatedFiles(buildDir, fn, fileType); if (!generated.isEmpty()) m_extraCompilers.append(factory->create(m_project, fn, generated)); } } -void QmakeProFile::updateGeneratedFiles(const FileName &buildDir) +void QmakeProFile::updateGeneratedFiles(const FilePath &buildDir) { // We can do this because other plugins are not supposed to keep the compilers around. qDeleteAll(m_extraCompilers); diff --git a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h index 8147b19d5f..857d59734a 100644 --- a/src/plugins/qmakeprojectmanager/qmakeparsernodes.h +++ b/src/plugins/qmakeprojectmanager/qmakeparsernodes.h @@ -40,7 +40,7 @@ #include <memory> namespace Utils { -class FileName; +class FilePath; class FileSystemWatcher; } // namespace Utils; @@ -115,29 +115,29 @@ class InstallsList; class QMAKEPROJECTMANAGER_EXPORT QmakePriFile { public: - QmakePriFile(QmakeProject *project, QmakeProFile *qmakeProFile, const Utils::FileName &filePath); + QmakePriFile(QmakeProject *project, QmakeProFile *qmakeProFile, const Utils::FilePath &filePath); virtual ~QmakePriFile(); - Utils::FileName filePath() const; - Utils::FileName directoryPath() const; + Utils::FilePath filePath() const; + Utils::FilePath directoryPath() const; virtual QString displayName() const; QmakePriFile *parent() const; QmakeProject *project() const; QVector<QmakePriFile *> children() const; - QmakePriFile *findPriFile(const Utils::FileName &fileName); - const QmakePriFile *findPriFile(const Utils::FileName &fileName) const; + QmakePriFile *findPriFile(const Utils::FilePath &fileName); + const QmakePriFile *findPriFile(const Utils::FilePath &fileName) const; - bool knowsFile(const Utils::FileName &filePath) const; + bool knowsFile(const Utils::FilePath &filePath) const; void makeEmpty(); // Files of the specified type declared in this file. - QSet<Utils::FileName> files(const ProjectExplorer::FileType &type) const; + QSet<Utils::FilePath> files(const ProjectExplorer::FileType &type) const; // Files of the specified type declared in this file and in included .pri files. - const QSet<Utils::FileName> collectFiles(const ProjectExplorer::FileType &type) const; + const QSet<Utils::FilePath> collectFiles(const ProjectExplorer::FileType &type) const; void update(const Internal::QmakePriFileEvalResult &result); @@ -156,7 +156,7 @@ public: const QString &scope = QString(), int flags = QmakeProjectManager::Internal::ProWriter::ReplaceValues); - bool folderChanged(const QString &changedFolder, const QSet<Utils::FileName> &newFiles); + bool folderChanged(const QString &changedFolder, const QSet<Utils::FilePath> &newFiles); bool deploysFolder(const QString &folder) const; @@ -166,7 +166,7 @@ public: // Set by parent bool includedInExactParse() const; - static QSet<Utils::FileName> recursiveEnumerate(const QString &folder); + static QSet<Utils::FilePath> recursiveEnumerate(const QString &folder); void scheduleUpdate(); @@ -175,8 +175,8 @@ protected: static QStringList varNames(ProjectExplorer::FileType type, QtSupport::ProFileReader *readerExact); static QStringList varNamesForRemoving(); static QString varNameForAdding(const QString &mimeType); - static QSet<Utils::FileName> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files); - static QSet<Utils::FileName> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FileName> &files); + static QSet<Utils::FilePath> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<Utils::FilePath> &files); + static QSet<Utils::FilePath> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<Utils::FilePath> &files); enum ChangeType { AddToProFile, @@ -218,7 +218,7 @@ private: Internal::QmakePriFileEvalResult *fallback, const InstallsList &installList); static void processValues(Internal::QmakePriFileEvalResult &result); - void watchFolders(const QSet<Utils::FileName> &folders); + void watchFolders(const QSet<Utils::FilePath> &folders); QString continuationIndent() const; @@ -230,8 +230,8 @@ private: std::unique_ptr<Core::IDocument> m_priFileDocument; // Memory is cheap... - QMap<ProjectExplorer::FileType, QSet<Utils::FileName>> m_files; - QSet<Utils::FileName> m_recursiveEnumerateFiles; // FIXME: Remove this?! + QMap<ProjectExplorer::FileType, QSet<Utils::FilePath>> m_files; + QSet<Utils::FilePath> m_recursiveEnumerateFiles; // FIXME: Remove this?! QSet<QString> m_watchedFolders; bool m_includedInExactParse = true; @@ -243,8 +243,8 @@ class QMAKEPROJECTMANAGER_EXPORT TargetInformation public: bool valid = false; QString target; - Utils::FileName destDir; - Utils::FileName buildDir; + Utils::FilePath destDir; + Utils::FilePath buildDir; QString buildTarget; bool operator==(const TargetInformation &other) const { @@ -284,30 +284,30 @@ public: class QMAKEPROJECTMANAGER_EXPORT QmakeProFile : public QmakePriFile { public: - QmakeProFile(QmakeProject *project, const Utils::FileName &filePath); + QmakeProFile(QmakeProject *project, const Utils::FilePath &filePath); ~QmakeProFile() override; bool isParent(QmakeProFile *node); QString displayName() const final; QList<QmakeProFile *> allProFiles(); - QmakeProFile *findProFile(const Utils::FileName &fileName); - const QmakeProFile *findProFile(const Utils::FileName &fileName) const; + QmakeProFile *findProFile(const Utils::FilePath &fileName); + const QmakeProFile *findProFile(const Utils::FilePath &fileName) const; ProjectType projectType() const; QStringList variableValue(const Variable var) const; QString singleVariableValue(const Variable var) const; - bool isSubProjectDeployable(const Utils::FileName &filePath) const { + bool isSubProjectDeployable(const Utils::FilePath &filePath) const { return !m_subProjectsNotToDeploy.contains(filePath); } - Utils::FileName sourceDir() const; - Utils::FileName buildDir(QmakeBuildConfiguration *bc = nullptr) const; + Utils::FilePath sourceDir() const; + Utils::FilePath buildDir(QmakeBuildConfiguration *bc = nullptr) const; - Utils::FileNameList generatedFiles(const Utils::FileName &buildDirectory, - const Utils::FileName &sourceFile, + Utils::FilePathList generatedFiles(const Utils::FilePath &buildDirectory, + const Utils::FilePath &sourceFile, const ProjectExplorer::FileType &sourceFileType) const; QList<ProjectExplorer::ExtraCompiler *> extraCompilers() const; @@ -343,19 +343,19 @@ private: void asyncEvaluate(QFutureInterface<Internal::QmakeEvalResult *> &fi, Internal::QmakeEvalInput input); void cleanupProFileReaders(); - void updateGeneratedFiles(const Utils::FileName &buildDir); + void updateGeneratedFiles(const Utils::FilePath &buildDir); - static QString uiDirPath(QtSupport::ProFileReader *reader, const Utils::FileName &buildDir); - static QString mocDirPath(QtSupport::ProFileReader *reader, const Utils::FileName &buildDir); + static QString uiDirPath(QtSupport::ProFileReader *reader, const Utils::FilePath &buildDir); + static QString mocDirPath(QtSupport::ProFileReader *reader, const Utils::FilePath &buildDir); static QString sysrootify(const QString &path, const QString &sysroot, const QString &baseDir, const QString &outputDir); - static QStringList includePaths(QtSupport::ProFileReader *reader, const Utils::FileName &sysroot, const Utils::FileName &buildDir, const QString &projectDir); + static QStringList includePaths(QtSupport::ProFileReader *reader, const Utils::FilePath &sysroot, const Utils::FilePath &buildDir, const QString &projectDir); static QStringList libDirectories(QtSupport::ProFileReader *reader); - static Utils::FileNameList subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors); + static Utils::FilePathList subDirsPaths(QtSupport::ProFileReader *reader, const QString &projectDir, QStringList *subProjectsNotToDeploy, QStringList *errors); - static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const Utils::FileName &buildDir, const Utils::FileName &projectFilePath); + static TargetInformation targetInformation(QtSupport::ProFileReader *reader, QtSupport::ProFileReader *readerBuildPass, const Utils::FilePath &buildDir, const Utils::FilePath &projectFilePath); static InstallsList installsList(const QtSupport::ProFileReader *reader, const QString &projectFilePath, const QString &projectDir, const QString &buildDir); - void setupExtraCompiler(const Utils::FileName &buildDir, + void setupExtraCompiler(const Utils::FilePath &buildDir, const ProjectExplorer::FileType &fileType, ProjectExplorer::ExtraCompilerFactory *factory); @@ -371,7 +371,7 @@ private: QList<ProjectExplorer::ExtraCompiler *> m_extraCompilers; TargetInformation m_qmakeTargetInformation; - Utils::FileNameList m_subProjectsNotToDeploy; + Utils::FilePathList m_subProjectsNotToDeploy; InstallsList m_installsList; QStringList m_featureRoots; diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index 97fcaf6dad..3b5e4531b6 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -120,7 +120,7 @@ static QList<QmakeProject *> s_projects; QmakeProject manages information about an individual Qt 4 (.pro) project file. */ -QmakeProject::QmakeProject(const FileName &fileName) : +QmakeProject::QmakeProject(const FilePath &fileName) : Project(QmakeProjectManager::Constants::PROFILE_MIMETYPE, fileName), m_qmakeVfs(new QMakeVfs), m_cppCodeModelUpdater(new CppTools::CppProjectUpdater) @@ -269,7 +269,7 @@ void QmakeProject::updateCppCodeModel() QStringList fileList = pro->variableValue(Variable::ExactSource) + cumulativeSourceFiles; QList<ProjectExplorer::ExtraCompiler *> proGenerators = pro->extraCompilers(); foreach (ProjectExplorer::ExtraCompiler *ec, proGenerators) { - ec->forEachTarget([&](const Utils::FileName &generatedFile) { + ec->forEachTarget([&](const Utils::FilePath &generatedFile) { fileList += generatedFile.toString(); }); } @@ -305,7 +305,7 @@ void QmakeProject::updateQmlJSCodeModel() bool hasQmlLib = false; for (QmakeProFile *file : proFiles) { for (const QString &path : file->variableValue(Variable::QmlImportPath)) { - projectInfo.importPaths.maybeInsert(FileName::fromString(path), + projectInfo.importPaths.maybeInsert(FilePath::fromString(path), QmlJS::Dialect::Qml); } const QStringList &exactResources = file->variableValue(Variable::ExactResource); @@ -553,7 +553,7 @@ Tasks QmakeProject::projectIssues(const Kit *k) const } // Find the folder that contains a file with a certain name (recurse down) -static FolderNode *folderOf(FolderNode *in, const FileName &fileName) +static FolderNode *folderOf(FolderNode *in, const FilePath &fileName) { foreach (FileNode *fn, in->fileNodes()) if (fn->filePath() == fileName) @@ -566,7 +566,7 @@ static FolderNode *folderOf(FolderNode *in, const FileName &fileName) // Find the QmakeProFileNode that contains a certain file. // First recurse down to folder, then find the pro-file. -static FileNode *fileNodeOf(FolderNode *in, const FileName &fileName) +static FileNode *fileNodeOf(FolderNode *in, const FilePath &fileName) { for (FolderNode *folder = folderOf(in, fileName); folder; folder = folder->parentFolderNode()) { if (auto *proFile = dynamic_cast<QmakeProFileNode *>(folder)) { @@ -584,13 +584,13 @@ QStringList QmakeProject::filesGeneratedFrom(const QString &input) const if (!rootProjectNode()) return { }; - if (const FileNode *file = fileNodeOf(rootProjectNode(), FileName::fromString(input))) { + if (const FileNode *file = fileNodeOf(rootProjectNode(), FilePath::fromString(input))) { const QmakeProFileNode *pro = static_cast<QmakeProFileNode *>(file->parentFolderNode()); QTC_ASSERT(pro, return {}); if (const QmakeProFile *proFile = pro->proFile()) - return Utils::transform(proFile->generatedFiles(FileName::fromString(pro->buildDir()), + return Utils::transform(proFile->generatedFiles(FilePath::fromString(pro->buildDir()), file->filePath(), file->fileType()), - &FileName::toString); + &FilePath::toString); } return { }; } @@ -731,7 +731,7 @@ void QmakeProject::setAllBuildConfigurationsEnabled(bool enabled) } } -static void notifyChangedHelper(const FileName &fileName, QmakeProFile *file) +static void notifyChangedHelper(const FilePath &fileName, QmakeProFile *file) { if (file->filePath() == fileName) { QtSupport::ProFileCacheManager::instance()->discardFile( @@ -745,7 +745,7 @@ static void notifyChangedHelper(const FileName &fileName, QmakeProFile *file) } } -void QmakeProject::notifyChanged(const FileName &name) +void QmakeProject::notifyChanged(const FilePath &name) { for (QmakeProject *project : s_projects) { if (project->files(QmakeProject::SourceFiles).contains(name)) @@ -882,7 +882,7 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder) QList<QmakePriFile *> files = m_map.values(dir); if (!files.isEmpty()) { // Collect all the files - QSet<FileName> newFiles; + QSet<FilePath> newFiles; newFiles += QmakePriFile::recursiveEnumerate(folder); foreach (QmakePriFile *file, files) newOrRemovedFiles = newOrRemovedFiles || file->folderChanged(folder, newFiles); @@ -986,11 +986,11 @@ void QmakeProject::updateBuildSystemData() workingDir += '/' + ti.target + ".app/Contents/MacOS"; BuildTargetInfo bti; - bti.targetFilePath = FileName::fromString(executableFor(node->proFile())); + bti.targetFilePath = FilePath::fromString(executableFor(node->proFile())); bti.projectFilePath = node->filePath(); - bti.workingDirectory = FileName::fromString(workingDir); + bti.workingDirectory = FilePath::fromString(workingDir); bti.displayName = bti.projectFilePath.toFileInfo().completeBaseName(); - const FileName relativePathInProject + const FilePath relativePathInProject = bti.projectFilePath.relativeChildPath(projectDirectory()); if (!relativePathInProject.isEmpty()) { bti.displayNameUniquifier = QString::fromLatin1(" (%1)") @@ -1080,12 +1080,12 @@ void QmakeProject::collectApplicationData(const QmakeProFile *file, DeploymentDa DeployableFile::TypeExecutable); } -static FileName destDirFor(const TargetInformation &ti) +static FilePath destDirFor(const TargetInformation &ti) { if (ti.destDir.isEmpty()) return ti.buildDir; if (QDir::isRelativePath(ti.destDir.toString())) - return FileName::fromString(QDir::cleanPath(ti.buildDir.toString() + '/' + ti.destDir.toString())); + return FilePath::fromString(QDir::cleanPath(ti.buildDir.toString() + '/' + ti.destDir.toString())); return ti.destDir; } @@ -1122,7 +1122,7 @@ void QmakeProject::collectLibraryData(const QmakeProFile *file, DeploymentData & break; } case Abi::DarwinOS: { - FileName destDir = destDirFor(ti); + FilePath destDir = destDirFor(ti); if (config.contains(QLatin1String("lib_bundle"))) { destDir = destDir.pathAppended(ti.target + ".framework"); } else { @@ -1181,7 +1181,7 @@ void QmakeProject::collectLibraryData(const QmakeProFile *file, DeploymentData & bool QmakeProject::matchesKit(const Kit *kit) { - FileName filePath = projectFilePath(); + FilePath filePath = projectFilePath(); QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(kit); return QtSupport::QtVersionManager::version([&filePath, version](const QtSupport::BaseQtVersion *v) { @@ -1189,7 +1189,7 @@ bool QmakeProject::matchesKit(const Kit *kit) }); } -static Utils::FileName getFullPathOf(const QmakeProFile *pro, Variable variable, +static Utils::FilePath getFullPathOf(const QmakeProFile *pro, Variable variable, const BuildConfiguration *bc) { // Take last non-flag value, to cover e.g. '@echo $< && $$QMAKE_CC' or 'ccache gcc' @@ -1198,22 +1198,22 @@ static Utils::FileName getFullPathOf(const QmakeProFile *pro, Variable variable, return !value.startsWith('-'); }); if (values.isEmpty()) - return Utils::FileName(); + return Utils::FilePath(); const QString exe = values.last(); - QTC_ASSERT(bc, return Utils::FileName::fromString(exe)); + QTC_ASSERT(bc, return Utils::FilePath::fromString(exe)); QFileInfo fi(exe); if (fi.isAbsolute()) - return Utils::FileName::fromString(exe); + return Utils::FilePath::fromString(exe); return bc->environment().searchInPath(exe); } -void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) const +void QmakeProject::testToolChain(ToolChain *tc, const Utils::FilePath &path) const { if (!tc || path.isEmpty()) return; - const Utils::FileName expected = tc->compilerCommand(); + const Utils::FilePath expected = tc->compilerCommand(); Environment env = Environment::systemEnvironment(); Kit *k = nullptr; @@ -1228,7 +1228,7 @@ void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) con if (env.isSameExecutable(path.toString(), expected.toString())) return; - const QPair<Utils::FileName, Utils::FileName> pair = qMakePair(expected, path); + const QPair<Utils::FilePath, Utils::FilePath> pair = qMakePair(expected, path); if (m_toolChainWarnings.contains(pair)) return; // Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode. @@ -1246,7 +1246,7 @@ void QmakeProject::testToolChain(ToolChain *tc, const Utils::FileName &path) con "Please update your kit (%3) or choose a mkspec for qmake that matches " "your target environment better.") .arg(path.toUserOutput()).arg(expected.toUserOutput()).arg(k->displayName()), - Utils::FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); + Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); m_toolChainWarnings.insert(pair); } @@ -1305,7 +1305,7 @@ QmakeProject::AsyncUpdateState QmakeProject::asyncUpdateState() const return m_asyncUpdateState; } -QString QmakeProject::mapProFilePathToTarget(const FileName &proFilePath) +QString QmakeProject::mapProFilePathToTarget(const FilePath &proFilePath) { const QmakeProFile *pro = rootProFile()->findProFile(proFilePath); return pro ? pro->targetInformation().target : QString(); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.h b/src/plugins/qmakeprojectmanager/qmakeproject.h index b079ecbe11..42e8e57ec0 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.h +++ b/src/plugins/qmakeprojectmanager/qmakeproject.h @@ -56,7 +56,7 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeProject : public ProjectExplorer::Project Q_OBJECT public: - explicit QmakeProject(const Utils::FileName &proFile); + explicit QmakeProject(const Utils::FilePath &proFile); ~QmakeProject() final; QmakeProFile *rootProFile() const; @@ -67,7 +67,7 @@ public: QStringList filesGeneratedFrom(const QString &file) const final; - static void notifyChanged(const Utils::FileName &name); + static void notifyChanged(const Utils::FilePath &name); /// \internal QtSupport::ProFileReader *createProFileReader(const QmakeProFile *qmakeProFile); @@ -105,7 +105,7 @@ public: enum AsyncUpdateState { Base, AsyncFullUpdatePending, AsyncPartialUpdatePending, AsyncUpdateInProgress, ShuttingDown }; AsyncUpdateState asyncUpdateState() const; - QString mapProFilePathToTarget(const Utils::FileName &proFilePath); + QString mapProFilePathToTarget(const Utils::FilePath &proFilePath); QVariant additionalData(Core::Id id, const ProjectExplorer::Target *target) const final; @@ -148,9 +148,9 @@ private: bool matchesKit(const ProjectExplorer::Kit *kit); void warnOnToolChainMismatch(const QmakeProFile *pro) const; - void testToolChain(ProjectExplorer::ToolChain *tc, const Utils::FileName &path) const; + void testToolChain(ProjectExplorer::ToolChain *tc, const Utils::FilePath &path) const; - mutable QSet<const QPair<Utils::FileName, Utils::FileName>> m_toolChainWarnings; + mutable QSet<const QPair<Utils::FilePath, Utils::FilePath>> m_toolChainWarnings; // Current configuration QString m_oldQtIncludePath; diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp index e96fc9d240..a5a2d673a1 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectconfigwidget.cpp @@ -208,7 +208,7 @@ void QmakeProjectConfigWidget::buildDirectoryChanged() void QmakeProjectConfigWidget::onBeforeBeforeShadowBuildDirBrowsed() { - Utils::FileName initialDirectory = m_buildConfiguration->target()->project()->projectDirectory(); + Utils::FilePath initialDirectory = m_buildConfiguration->target()->project()->projectDirectory(); if (!initialDirectory.isEmpty()) shadowBuildDirEdit->setInitialBrowsePathBackup(initialDirectory.toString()); } @@ -223,9 +223,9 @@ void QmakeProjectConfigWidget::shadowBuildClicked(bool checked) m_ignoreChange = true; if (checked) - m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(shadowBuildDirEdit->rawPath())); + m_buildConfiguration->setBuildDirectory(Utils::FilePath::fromString(shadowBuildDirEdit->rawPath())); else - m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(inSourceBuildDirEdit->rawPath())); + m_buildConfiguration->setBuildDirectory(Utils::FilePath::fromString(inSourceBuildDirEdit->rawPath())); m_ignoreChange = false; updateDetails(); @@ -238,7 +238,7 @@ void QmakeProjectConfigWidget::shadowBuildEdited() return; m_ignoreChange = true; - m_buildConfiguration->setBuildDirectory(Utils::FileName::fromString(shadowBuildDirEdit->rawPath())); + m_buildConfiguration->setBuildDirectory(Utils::FilePath::fromString(shadowBuildDirEdit->rawPath())); m_ignoreChange = false; } diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp index 1ba254348f..fe3d1bf67d 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.cpp @@ -64,8 +64,8 @@ namespace { struct DirectoryData { QString makefile; - Utils::FileName buildDirectory; - Utils::FileName canonicalQmakeBinary; + Utils::FilePath buildDirectory; + Utils::FilePath canonicalQmakeBinary; QtProjectImporter::QtVersionData qtVersionData; QString parsedSpec; BaseQtVersion::QmakeBuildConfigs buildConfig; @@ -83,7 +83,7 @@ namespace Internal { const Core::Id QT_IS_TEMPORARY("Qmake.TempQt"); const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios"; // ugly -QmakeProjectImporter::QmakeProjectImporter(const FileName &path) : +QmakeProjectImporter::QmakeProjectImporter(const FilePath &path) : QtProjectImporter(path) { } @@ -109,7 +109,7 @@ QStringList QmakeProjectImporter::importCandidates() return candidates; } -QList<void *> QmakeProjectImporter::examineDirectory(const FileName &importPath) const +QList<void *> QmakeProjectImporter::examineDirectory(const FilePath &importPath) const { QList<void *> result; const QLoggingCategory &logs = MakeFileParse::logging(); @@ -136,7 +136,7 @@ QList<void *> QmakeProjectImporter::examineDirectory(const FileName &importPath) } QFileInfo qmakeFi = parse.qmakePath().toFileInfo(); - data->canonicalQmakeBinary = FileName::fromString(qmakeFi.canonicalFilePath()); + data->canonicalQmakeBinary = FilePath::fromString(qmakeFi.canonicalFilePath()); if (data->canonicalQmakeBinary.isEmpty()) { qCDebug(logs) << " " << parse.qmakePath() << "doesn't exist anymore"; continue; diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h index 0dd3cf59a3..c6f364210a 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectimporter.h @@ -36,12 +36,12 @@ namespace Internal { class QmakeProjectImporter : public QtSupport::QtProjectImporter { public: - QmakeProjectImporter(const Utils::FileName &path); + QmakeProjectImporter(const Utils::FilePath &path); QStringList importCandidates() final; private: - QList<void *> examineDirectory(const Utils::FileName &importPath) const final; + QList<void *> examineDirectory(const Utils::FilePath &importPath) const final; bool matchKit(void *directoryData, const ProjectExplorer::Kit *k) const final; ProjectExplorer::Kit *createKit(void *directoryData) const final; const QList<ProjectExplorer::BuildInfo> buildInfoListForKit(const ProjectExplorer::Kit *k, diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp index a8f8c7648f..adbc1709fb 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.cpp @@ -184,7 +184,7 @@ void QmakeManager::buildFileContextMenu() void QmakeManager::buildFile() { if (Core::IDocument *currentDocument= Core::EditorManager::currentDocument()) { - const Utils::FileName file = currentDocument->filePath(); + const Utils::FilePath file = currentDocument->filePath(); Node *n = ProjectTree::nodeForFile(file); FileNode *node = n ? n->asFileNode() : nullptr; Project *project = SessionManager::projectForFile(file); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h index f137f98289..ab163f1a76 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanager.h @@ -45,7 +45,7 @@ class QMAKEPROJECTMANAGER_EXPORT QmakeManager : public QObject Q_OBJECT public: - void notifyChanged(const Utils::FileName &name); + void notifyChanged(const Utils::FilePath &name); // Context information used in the slot implementations static ProjectExplorer::FileNode *contextBuildableFileNode(); diff --git a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp index f914fa4f8d..bf21949215 100644 --- a/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeprojectmanagerplugin.cpp @@ -86,7 +86,7 @@ public: void buildStateChanged(Project *pro); void updateBuildFileAction(); void disableBuildFileMenus(); - void enableBuildFileMenus(const Utils::FileName &file); + void enableBuildFileMenus(const Utils::FilePath &file); QmakeManager qmakeProjectManager; Core::Context projectContext; @@ -452,7 +452,7 @@ void QmakeProjectManagerPluginPrivate::disableBuildFileMenus() m_buildFileContextMenu->setEnabled(false); } -void QmakeProjectManagerPluginPrivate::enableBuildFileMenus(const Utils::FileName &file) +void QmakeProjectManagerPluginPrivate::enableBuildFileMenus(const Utils::FilePath &file) { bool visible = false; bool enabled = false; diff --git a/src/plugins/qmakeprojectmanager/qmakestep.cpp b/src/plugins/qmakeprojectmanager/qmakestep.cpp index 2245588f74..104a093e4d 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.cpp +++ b/src/plugins/qmakeprojectmanager/qmakestep.cpp @@ -223,7 +223,7 @@ bool QMakeStep::init() ProcessParameters *pp = processParameters(); pp->setMacroExpander(qmakeBc->macroExpander()); - pp->setWorkingDirectory(Utils::FileName::fromString(workingDirectory)); + pp->setWorkingDirectory(Utils::FilePath::fromString(workingDirectory)); pp->setEnvironment(qmakeBc->environment()); setOutputParser(new QMakeParser); @@ -311,7 +311,7 @@ void QMakeStep::finish(bool success) runNextCommand(); } -void QMakeStep::startOneCommand(const FileName &command, const QString &args) +void QMakeStep::startOneCommand(const FilePath &command, const QString &args) { ProcessParameters *pp = processParameters(); pp->setCommand(command); @@ -436,10 +436,10 @@ void QMakeStep::setSeparateDebugInfo(bool enable) qmakeBuildConfiguration()->emitProFileEvaluateNeeded(); } -FileName QMakeStep::makeCommand() const +FilePath QMakeStep::makeCommand() const { auto ms = qobject_cast<BuildStepList *>(parent())->firstOfType<MakeStep>(); - return ms ? ms->effectiveMakeCommand() : FileName(); + return ms ? ms->effectiveMakeCommand() : FilePath(); } QString QMakeStep::makeArguments(const QString &makefile) const @@ -498,7 +498,7 @@ QString QMakeStep::mkspec() const for (QtcProcess::ArgIterator ait(&additionalArguments); ait.next(); ) { if (ait.value() == "-spec") { if (ait.next()) - return FileName::fromUserInput(ait.value()).toString(); + return FilePath::fromUserInput(ait.value()).toString(); } } diff --git a/src/plugins/qmakeprojectmanager/qmakestep.h b/src/plugins/qmakeprojectmanager/qmakestep.h index ac19720478..90fef01d35 100644 --- a/src/plugins/qmakeprojectmanager/qmakestep.h +++ b/src/plugins/qmakeprojectmanager/qmakestep.h @@ -144,7 +144,7 @@ public: bool separateDebugInfo() const; void setSeparateDebugInfo(bool enable); - Utils::FileName makeCommand() const; + Utils::FilePath makeCommand() const; QString makeArguments(const QString &makefile) const; QString effectiveQMakeCall() const; @@ -166,12 +166,12 @@ private: void doCancel() override; void finish(bool success) override; - void startOneCommand(const Utils::FileName &command, const QString &args); + void startOneCommand(const Utils::FilePath &command, const QString &args); void runNextCommand(); - Utils::FileName m_qmakeExecutable; + Utils::FilePath m_qmakeExecutable; QString m_qmakeArguments; - Utils::FileName m_makeExecutable; + Utils::FilePath m_makeExecutable; QString m_makeArguments; QString m_userArgs; // Extra arguments for qmake. diff --git a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp index d223b16bf3..0e9cd877a5 100644 --- a/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/qtwizard.cpp @@ -259,7 +259,7 @@ bool BaseQmakeProjectWizardDialog::writeUserFile(const QString &proFileName) con if (!m_targetSetupPage) return false; - QmakeProject *pro = new QmakeProject(Utils::FileName::fromString(proFileName)); + QmakeProject *pro = new QmakeProject(Utils::FilePath::fromString(proFileName)); bool success = m_targetSetupPage->setupProject(pro); if (success) pro->saveSettings(); diff --git a/src/plugins/qmakeprojectmanager/wizards/simpleprojectwizard.cpp b/src/plugins/qmakeprojectmanager/wizards/simpleprojectwizard.cpp index 2c1621fcb0..77c6fdd10f 100644 --- a/src/plugins/qmakeprojectmanager/wizards/simpleprojectwizard.cpp +++ b/src/plugins/qmakeprojectmanager/wizards/simpleprojectwizard.cpp @@ -70,8 +70,8 @@ public: bool isComplete() const override { return m_filesWidget->hasFilesSelected(); } void initializePage() override; void cleanupPage() override { m_filesWidget->cancelParsing(); } - FileNameList selectedFiles() const { return m_filesWidget->selectedFiles(); } - FileNameList selectedPaths() const { return m_filesWidget->selectedPaths(); } + FilePathList selectedFiles() const { return m_filesWidget->selectedFiles(); } + FilePathList selectedPaths() const { return m_filesWidget->selectedPaths(); } private: SimpleProjectWizardDialog *m_simpleProjectWizardDialog; @@ -117,8 +117,8 @@ public: QString path() const { return m_firstPage->path(); } void setPath(const QString &path) { m_firstPage->setPath(path); } - FileNameList selectedFiles() const { return m_secondPage->selectedFiles(); } - FileNameList selectedPaths() const { return m_secondPage->selectedPaths(); } + FilePathList selectedFiles() const { return m_secondPage->selectedFiles(); } + FilePathList selectedPaths() const { return m_secondPage->selectedPaths(); } QString projectName() const { return m_firstPage->fileName(); } FileWizardPage *m_firstPage; @@ -127,8 +127,8 @@ public: void FilesSelectionWizardPage::initializePage() { - m_filesWidget->resetModel(FileName::fromString(m_simpleProjectWizardDialog->path()), - FileNameList()); + m_filesWidget->resetModel(FilePath::fromString(m_simpleProjectWizardDialog->path()), + FilePathList()); } SimpleProjectWizard::SimpleProjectWizard() @@ -169,7 +169,7 @@ GeneratedFiles SimpleProjectWizard::generateFiles(const QWizard *w, const QDir dir(projectPath); const QString projectName = wizard->projectName(); const QString proFileName = QFileInfo(dir, projectName + ".pro").absoluteFilePath(); - const QStringList paths = Utils::transform(wizard->selectedPaths(), &FileName::toString); + const QStringList paths = Utils::transform(wizard->selectedPaths(), &FilePath::toString); MimeType headerType = Utils::mimeTypeForName("text/x-chdr"); @@ -189,7 +189,7 @@ GeneratedFiles SimpleProjectWizard::generateFiles(const QWizard *w, QString proSources = "SOURCES = \\\n"; QString proHeaders = "HEADERS = \\\n"; - for (const FileName &fileName : wizard->selectedFiles()) { + for (const FilePath &fileName : wizard->selectedFiles()) { QString source = dir.relativeFilePath(fileName.toString()); MimeType mimeType = Utils::mimeTypeForFile(fileName.toFileInfo()); if (mimeType.matchesName("text/x-chdr") || mimeType.matchesName("text/x-c++hdr")) diff --git a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp index c607499b66..c2a17cd7b1 100644 --- a/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp +++ b/src/plugins/qmldesigner/components/componentcore/changestyleaction.cpp @@ -35,10 +35,10 @@ namespace QmlDesigner { static QString styleConfigFileName(const QString &qmlFileName) { - ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(qmlFileName)); + ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FilePath::fromString(qmlFileName)); if (currentProject) - foreach (const Utils::FileName &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) + foreach (const Utils::FilePath &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) if (fileName.endsWith("qtquickcontrols2.conf")) return fileName.toString(); @@ -97,7 +97,7 @@ QWidget *ChangeStyleWidgetAction::createWidget(QWidget *parent) if (style.isEmpty()) return; - const Utils::FileName configFileName = Utils::FileName::fromString(styleConfigFileName(qmlFileName)); + const Utils::FilePath configFileName = Utils::FilePath::fromString(styleConfigFileName(qmlFileName)); if (configFileName.exists()) { QSettings infiFile(configFileName.toString(), QSettings::IniFormat); @@ -125,7 +125,7 @@ void ChangeStyleAction::currentContextChanged(const SelectionContext &selectionC const QString confFileName = styleConfigFileName(fileName); - if (Utils::FileName::fromString(confFileName).exists()) { + if (Utils::FilePath::fromString(confFileName).exists()) { QSettings infiFile(confFileName, QSettings::IniFormat); m_action->handleModelUpdate(infiFile.value("Controls/Style", "Default").toString()); } else { diff --git a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp index 112923c5f7..733b29ef5a 100644 --- a/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp +++ b/src/plugins/qmldesigner/components/componentcore/crumblebar.cpp @@ -78,7 +78,7 @@ CrumbleBar::~CrumbleBar() delete m_crumblePath; } -void CrumbleBar::pushFile(const Utils::FileName &fileName) +void CrumbleBar::pushFile(const Utils::FilePath &fileName) { if (!m_isInternalCalled) { crumblePath()->clear(); diff --git a/src/plugins/qmldesigner/components/componentcore/crumblebar.h b/src/plugins/qmldesigner/components/componentcore/crumblebar.h index d29d8f594e..cd19e1faa2 100644 --- a/src/plugins/qmldesigner/components/componentcore/crumblebar.h +++ b/src/plugins/qmldesigner/components/componentcore/crumblebar.h @@ -39,7 +39,7 @@ public: explicit CrumbleBar(QObject *parent = nullptr); ~CrumbleBar() override; - void pushFile(const Utils::FileName &fileName); + void pushFile(const Utils::FilePath &fileName); void pushInFileComponent(const ModelNode &modelNode); void nextFileIsCalledInternally(); @@ -58,7 +58,7 @@ private: class CrumbleBarInfo { public: - Utils::FileName fileName; + Utils::FilePath fileName; QString displayName; ModelNode modelNode; }; diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index f5b701e44d..691c1b6ca5 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -676,7 +676,7 @@ void addSignalHandlerOrGotoImplementation(const SelectionContext &selectionState QString itemId = modelNode.id(); - const Utils::FileName currentDesignDocument = QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName(); + const Utils::FilePath currentDesignDocument = QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName(); const QString fileName = currentDesignDocument.toString(); const QString typeName = currentDesignDocument.toFileInfo().baseName(); diff --git a/src/plugins/qmldesigner/components/integration/designdocument.cpp b/src/plugins/qmldesigner/components/integration/designdocument.cpp index d1b8586b5a..a10225cc06 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.cpp +++ b/src/plugins/qmldesigner/components/integration/designdocument.cpp @@ -196,7 +196,7 @@ QString DesignDocument::simplfiedDisplayName() const return rootModelNode().simplifiedTypeName(); } -void DesignDocument::updateFileName(const Utils::FileName & /*oldFileName*/, const Utils::FileName &newFileName) +void DesignDocument::updateFileName(const Utils::FilePath & /*oldFileName*/, const Utils::FilePath &newFileName) { if (m_documentModel) m_documentModel->setFileUrl(QUrl::fromLocalFile(newFileName.toString())); @@ -209,11 +209,11 @@ void DesignDocument::updateFileName(const Utils::FileName & /*oldFileName*/, con emit displayNameChanged(displayName()); } -Utils::FileName DesignDocument::fileName() const +Utils::FilePath DesignDocument::fileName() const { if (editor()) return editor()->document()->filePath(); - return Utils::FileName(); + return Utils::FilePath(); } Kit *DesignDocument::currentKit() const @@ -250,7 +250,7 @@ void DesignDocument::loadDocument(QPlainTextEdit *edit) m_inFileComponentTextModifier.reset(); - updateFileName(Utils::FileName(), fileName()); + updateFileName(Utils::FilePath(), fileName()); updateQrcFiles(); @@ -287,7 +287,7 @@ void DesignDocument::updateQrcFiles() ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName()); if (currentProject) { - for (const Utils::FileName &fileName : currentProject->files(ProjectExplorer::Project::SourceFiles)) { + for (const Utils::FilePath &fileName : currentProject->files(ProjectExplorer::Project::SourceFiles)) { if (fileName.endsWith(".qrc")) QmlJS::ModelManagerInterface::instance()->updateQrcFile(fileName.toString()); } diff --git a/src/plugins/qmldesigner/components/integration/designdocument.h b/src/plugins/qmldesigner/components/integration/designdocument.h index 0bb5377c6d..eba0cf4060 100644 --- a/src/plugins/qmldesigner/components/integration/designdocument.h +++ b/src/plugins/qmldesigner/components/integration/designdocument.h @@ -90,7 +90,7 @@ public: TextEditor::BaseTextEditor *textEditor() const; QPlainTextEdit *plainTextEdit() const; - Utils::FileName fileName() const; + Utils::FilePath fileName() const; ProjectExplorer::Kit *currentKit() const; bool isDocumentLoaded() const; @@ -121,7 +121,7 @@ public: void changeToMaster(); private: // functions - void updateFileName(const Utils::FileName &oldFileName, const Utils::FileName &newFileName); + void updateFileName(const Utils::FilePath &oldFileName, const Utils::FilePath &newFileName); void changeToInFileComponentModel(ComponentTextModifier *textModifer); diff --git a/src/plugins/qmldesigner/designercore/include/viewmanager.h b/src/plugins/qmldesigner/designercore/include/viewmanager.h index 4673e341cc..71c869916e 100644 --- a/src/plugins/qmldesigner/designercore/include/viewmanager.h +++ b/src/plugins/qmldesigner/designercore/include/viewmanager.h @@ -80,7 +80,7 @@ public: void disableWidgets(); void enableWidgets(); - void pushFileOnCrumbleBar(const Utils::FileName &fileName); + void pushFileOnCrumbleBar(const Utils::FilePath &fileName); void pushInFileComponentOnCrumbleBar(const ModelNode &modelNode); void nextFileIsCalledInternally(); diff --git a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp index e53d461436..0959dd4a9e 100644 --- a/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp +++ b/src/plugins/qmldesigner/designercore/instances/puppetcreator.cpp @@ -153,7 +153,7 @@ QString PuppetCreator::getStyleConfigFileName() const { #ifndef QMLDESIGNER_TEST if (m_currentProject) { - for (const Utils::FileName &fileName : m_currentProject->files(ProjectExplorer::Project::SourceFiles)) { + for (const Utils::FilePath &fileName : m_currentProject->files(ProjectExplorer::Project::SourceFiles)) { if (fileName.fileName() == "qtquickcontrols2.conf") return fileName.toString(); } @@ -422,7 +422,7 @@ QProcessEnvironment PuppetCreator::processEnvironment() const const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(m_kit); if (QTC_GUARD(qt)) { // Kits without a Qt version should not have a puppet! // Update PATH to include QT_HOST_BINS - const Utils::FileName qtBinPath = qt->binPath(); + const Utils::FilePath qtBinPath = qt->binPath(); environment.prependOrSetPath(qtBinPath.toString()); } environment.set("QML_BAD_GUI_RENDER_LOOP", "true"); diff --git a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp index c22ce39ad1..c2f36fad90 100644 --- a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp +++ b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp @@ -384,7 +384,7 @@ void ViewManager::enableWidgets() view->enableWidget(); } -void ViewManager::pushFileOnCrumbleBar(const Utils::FileName &fileName) +void ViewManager::pushFileOnCrumbleBar(const Utils::FilePath &fileName) { crumbleBar()->pushFile(fileName); } diff --git a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp index 149a76ef51..9b319a814d 100644 --- a/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp +++ b/src/plugins/qmldesigner/designercore/pluginmanager/widgetpluginpath.cpp @@ -190,7 +190,7 @@ QStandardItem *WidgetPluginPath::createModelItem() QStandardItem *failedCategory = nullptr; const auto end = m_plugins.end(); for (auto it = m_plugins.begin(); it != end; ++it) { - QStandardItem *pluginItem = new QStandardItem(Utils::FileName::fromString(it->path).fileName()); + QStandardItem *pluginItem = new QStandardItem(Utils::FilePath::fromString(it->path).fileName()); if (instance(*it)) { pluginItem->appendRow(new QStandardItem(QString::fromUtf8(it->instanceGuard->metaObject()->className()))); pathItem->appendRow(pluginItem); diff --git a/src/plugins/qmldesigner/designmodewidget.cpp b/src/plugins/qmldesigner/designmodewidget.cpp index 8bce47b012..f171c89c0f 100644 --- a/src/plugins/qmldesigner/designmodewidget.cpp +++ b/src/plugins/qmldesigner/designmodewidget.cpp @@ -435,7 +435,7 @@ void DesignModeWidget::setupNavigatorHistory(Core::IEditor *editor) m_toolBar->setCurrentEditor(editor); } -void DesignModeWidget::addNavigatorHistoryEntry(const Utils::FileName &fileName) +void DesignModeWidget::addNavigatorHistoryEntry(const Utils::FilePath &fileName) { if (m_navigatorHistoryCounter > 0) m_navigatorHistory.insert(m_navigatorHistoryCounter + 1, fileName.toString()); diff --git a/src/plugins/qmldesigner/designmodewidget.h b/src/plugins/qmldesigner/designmodewidget.h index 0642727cbe..b446cdf2e1 100644 --- a/src/plugins/qmldesigner/designmodewidget.h +++ b/src/plugins/qmldesigner/designmodewidget.h @@ -95,7 +95,7 @@ private: // functions void setup(); bool isInNodeDefinition(int nodeOffset, int nodeLength, int cursorPos) const; QmlDesigner::ModelNode nodeForPosition(int cursorPos) const; - void addNavigatorHistoryEntry(const Utils::FileName &fileName); + void addNavigatorHistoryEntry(const Utils::FilePath &fileName); QWidget *createCenterWidget(); QWidget *createCrumbleBarFrame(); diff --git a/src/plugins/qmldesigner/documentmanager.cpp b/src/plugins/qmldesigner/documentmanager.cpp index b87f1cbff4..d264f286cc 100644 --- a/src/plugins/qmldesigner/documentmanager.cpp +++ b/src/plugins/qmldesigner/documentmanager.cpp @@ -316,19 +316,19 @@ void DocumentManager::addFileToVersionControl(const QString &directoryPath, cons } } -Utils::FileName DocumentManager::currentFilePath() +Utils::FilePath DocumentManager::currentFilePath() { return QmlDesignerPlugin::instance()->documentManager().currentDesignDocument()->fileName(); } -Utils::FileName DocumentManager::currentProjectDirPath() +Utils::FilePath DocumentManager::currentProjectDirPath() { QTC_ASSERT(QmlDesignerPlugin::instance(), return {}); if (!QmlDesignerPlugin::instance()->currentDesignDocument()) return {}; - Utils::FileName qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); + Utils::FilePath qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(qmlFileName); if (!project) return {}; @@ -338,7 +338,7 @@ Utils::FileName DocumentManager::currentProjectDirPath() QStringList DocumentManager::isoIconsQmakeVariableValue(const QString &proPath) { - ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FileName::fromString(proPath)); + ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(proPath)); if (!node) { qCWarning(documentManagerLog) << "No node for .pro:" << proPath; return QStringList(); @@ -361,7 +361,7 @@ QStringList DocumentManager::isoIconsQmakeVariableValue(const QString &proPath) bool DocumentManager::setIsoIconsQmakeVariableValue(const QString &proPath, const QStringList &value) { - ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FileName::fromString(proPath)); + ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(proPath)); if (!node) { qCWarning(documentManagerLog) << "No node for .pro:" << proPath; return false; @@ -389,7 +389,7 @@ bool DocumentManager::setIsoIconsQmakeVariableValue(const QString &proPath, cons void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists, QString *resourceFilePath, QString *resourceFileProPath, const QString &isoIconsQrcFile) { - Utils::FileName qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); + Utils::FilePath qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(qmlFileName); ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(qmlFileName)->parentFolderNode(); ProjectExplorer::Node *iconQrcFileNode = nullptr; @@ -440,7 +440,7 @@ void DocumentManager::findPathToIsoProFile(bool *iconResourceFileAlreadyExists, bool DocumentManager::isoProFileSupportsAddingExistingFiles(const QString &resourceFileProPath) { - ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FileName::fromString(resourceFileProPath)); + ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(resourceFileProPath)); if (!node || !node->parentFolderNode()) return false; ProjectExplorer::ProjectNode *projectNode = node->parentFolderNode()->asProjectNode(); @@ -456,7 +456,7 @@ bool DocumentManager::isoProFileSupportsAddingExistingFiles(const QString &resou bool DocumentManager::addResourceFileToIsoProject(const QString &resourceFileProPath, const QString &resourceFilePath) { - ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FileName::fromString(resourceFileProPath)); + ProjectExplorer::Node *node = ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(resourceFileProPath)); if (!node || !node->parentFolderNode()) return false; ProjectExplorer::ProjectNode *projectNode = node->parentFolderNode()->asProjectNode(); @@ -477,7 +477,7 @@ bool DocumentManager::belongsToQmakeProject() if (!QmlDesignerPlugin::instance()->currentDesignDocument()) return false; - Utils::FileName qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); + Utils::FilePath qmlFileName = QmlDesignerPlugin::instance()->currentDesignDocument()->fileName(); ProjectExplorer::Project *project = ProjectExplorer::SessionManager::projectForFile(qmlFileName); if (!project) return false; diff --git a/src/plugins/qmldesigner/documentmanager.h b/src/plugins/qmldesigner/documentmanager.h index 0c5bd20043..bb3b13c9ac 100644 --- a/src/plugins/qmldesigner/documentmanager.h +++ b/src/plugins/qmldesigner/documentmanager.h @@ -55,8 +55,8 @@ public: static bool createFile(const QString &filePath, const QString &contents); static void addFileToVersionControl(const QString &directoryPath, const QString &newFilePath); - static Utils::FileName currentFilePath(); - static Utils::FileName currentProjectDirPath(); + static Utils::FilePath currentFilePath(); + static Utils::FilePath currentProjectDirPath(); static QStringList isoIconsQmakeVariableValue(const QString &proPath); static bool setIsoIconsQmakeVariableValue(const QString &proPath, const QStringList &value); diff --git a/src/plugins/qmldesigner/qmldesignerplugin.cpp b/src/plugins/qmldesigner/qmldesignerplugin.cpp index 42fd9fbefa..eb16cbedd1 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.cpp +++ b/src/plugins/qmldesigner/qmldesignerplugin.cpp @@ -217,13 +217,13 @@ void QmlDesignerPlugin::extensionsInitialized() }); } -static QStringList allUiQmlFilesforCurrentProject(const Utils::FileName &fileName) +static QStringList allUiQmlFilesforCurrentProject(const Utils::FilePath &fileName) { QStringList list; ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName); if (currentProject) { - foreach (const Utils::FileName &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) { + foreach (const Utils::FilePath &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) { if (fileName.endsWith(".ui.qml")) list.append(fileName.toString()); } @@ -232,7 +232,7 @@ static QStringList allUiQmlFilesforCurrentProject(const Utils::FileName &fileNam return list; } -static QString projectPath(const Utils::FileName &fileName) +static QString projectPath(const Utils::FilePath &fileName) { QString path; ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName); @@ -304,7 +304,7 @@ void QmlDesignerPlugin::showDesigner() d->mainWidget.initialize(); - const Utils::FileName fileName = Core::EditorManager::currentEditor()->document()->filePath(); + const Utils::FilePath fileName = Core::EditorManager::currentEditor()->document()->filePath(); const QStringList allUiQmlFiles = allUiQmlFilesforCurrentProject(fileName); if (warningsForQmlFilesInsteadOfUiQmlEnabled() && !fileName.endsWith(".ui.qml") && !allUiQmlFiles.isEmpty()) { OpenUiQmlFileDialog dialog(&d->mainWidget); diff --git a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp index a88d615082..3afca0b036 100644 --- a/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp +++ b/src/plugins/qmljseditor/qmljscomponentfromobjectdef.cpp @@ -192,7 +192,7 @@ public: if (path == QFileInfo(currentFileName).path()) { // hack for the common case, next version should use the wizard ProjectExplorer::Node * oldFileNode = - ProjectExplorer::ProjectTree::nodeForFile(Utils::FileName::fromString(currentFileName)); + ProjectExplorer::ProjectTree::nodeForFile(Utils::FilePath::fromString(currentFileName)); if (oldFileNode) { ProjectExplorer::FolderNode *containingFolder = oldFileNode->parentFolderNode(); if (containingFolder) diff --git a/src/plugins/qmljseditor/qmljstextmark.cpp b/src/plugins/qmljseditor/qmljstextmark.cpp index 7c427a4d00..4ef80eb7a2 100644 --- a/src/plugins/qmljseditor/qmljstextmark.cpp +++ b/src/plugins/qmljseditor/qmljstextmark.cpp @@ -59,7 +59,7 @@ static Core::Id cartegoryForSeverity(QmlJS::Severity::Enum kind) return isWarning(kind) ? QMLJS_WARNING : QMLJS_ERROR; } -QmlJSTextMark::QmlJSTextMark(const FileName &fileName, +QmlJSTextMark::QmlJSTextMark(const FilePath &fileName, const QmlJS::DiagnosticMessage &diagnostic, const QmlJSTextMark::RemovedFromEditorHandler &removedHandler) : TextEditor::TextMark(fileName, int(diagnostic.loc.startLine), @@ -70,7 +70,7 @@ QmlJSTextMark::QmlJSTextMark(const FileName &fileName, init(isWarning(diagnostic.kind), diagnostic.message); } -QmlJSTextMark::QmlJSTextMark(const FileName &fileName, +QmlJSTextMark::QmlJSTextMark(const FilePath &fileName, const QmlJS::StaticAnalysis::Message &message, const QmlJSTextMark::RemovedFromEditorHandler &removedHandler) : TextEditor::TextMark(fileName, int(message.location.startLine), diff --git a/src/plugins/qmljseditor/qmljstextmark.h b/src/plugins/qmljseditor/qmljstextmark.h index e9bc567451..7034838e66 100644 --- a/src/plugins/qmljseditor/qmljstextmark.h +++ b/src/plugins/qmljseditor/qmljstextmark.h @@ -38,10 +38,10 @@ class QmlJSTextMark : public TextEditor::TextMark public: using RemovedFromEditorHandler = std::function<void(QmlJSTextMark *)>; - QmlJSTextMark(const Utils::FileName &fileName, + QmlJSTextMark(const Utils::FilePath &fileName, const QmlJS::DiagnosticMessage &diagnostic, const RemovedFromEditorHandler &removedHandler); - QmlJSTextMark(const Utils::FileName &fileName, + QmlJSTextMark(const Utils::FilePath &fileName, const QmlJS::StaticAnalysis::Message &message, const RemovedFromEditorHandler &removedHandler); diff --git a/src/plugins/qmljseditor/qmltaskmanager.cpp b/src/plugins/qmljseditor/qmltaskmanager.cpp index 0110478020..c9b5b83b24 100644 --- a/src/plugins/qmljseditor/qmltaskmanager.cpp +++ b/src/plugins/qmljseditor/qmltaskmanager.cpp @@ -60,7 +60,7 @@ QmlTaskManager::QmlTaskManager() connect(&m_updateDelay, &QTimer::timeout, this, [this] { updateMessagesNow(); }); } -static Tasks convertToTasks(const QList<DiagnosticMessage> &messages, const FileName &fileName, Core::Id category) +static Tasks convertToTasks(const QList<DiagnosticMessage> &messages, const FilePath &fileName, Core::Id category) { Tasks result; foreach (const DiagnosticMessage &msg, messages) { @@ -71,7 +71,7 @@ static Tasks convertToTasks(const QList<DiagnosticMessage> &messages, const File return result; } -static Tasks convertToTasks(const QList<StaticAnalysis::Message> &messages, const FileName &fileName, Core::Id category) +static Tasks convertToTasks(const QList<StaticAnalysis::Message> &messages, const FilePath &fileName, Core::Id category) { QList<DiagnosticMessage> diagnostics; foreach (const StaticAnalysis::Message &msg, messages) @@ -101,17 +101,17 @@ void QmlTaskManager::collectMessages( result.fileName = fileName; if (document->language().isFullySupportedLanguage()) { result.tasks = convertToTasks(document->diagnosticMessages(), - FileName::fromString(fileName), + FilePath::fromString(fileName), Constants::TASK_CATEGORY_QML); if (updateSemantic) { result.tasks += convertToTasks(linkMessages.value(fileName), - FileName::fromString(fileName), + FilePath::fromString(fileName), Constants::TASK_CATEGORY_QML_ANALYSIS); Check checker(document, context); result.tasks += convertToTasks(checker(), - FileName::fromString(fileName), + FilePath::fromString(fileName), Constants::TASK_CATEGORY_QML_ANALYSIS); } } diff --git a/src/plugins/qmljstools/qmljslocatordata.cpp b/src/plugins/qmljstools/qmljslocatordata.cpp index 01725f1d9f..3b68bf6521 100644 --- a/src/plugins/qmljstools/qmljslocatordata.cpp +++ b/src/plugins/qmljstools/qmljslocatordata.cpp @@ -48,7 +48,7 @@ LocatorData::LocatorData() connect(manager, &ModelManagerInterface::projectInfoUpdated, [manager](const ModelManagerInterface::ProjectInfo &info) { QStringList files; - for (const Utils::FileName &f: info.project->files(ProjectExplorer::Project::SourceFiles)) + for (const Utils::FilePath &f: info.project->files(ProjectExplorer::Project::SourceFiles)) files << f.toString(); manager->updateSourceFiles(files, true); }); @@ -82,7 +82,7 @@ public: if (!doc->componentName().isEmpty()) m_documentContext = doc->componentName(); else - m_documentContext = Utils::FileName::fromString(doc->fileName()).fileName(); + m_documentContext = Utils::FilePath::fromString(doc->fileName()).fileName(); accept(doc->ast(), m_documentContext); return m_entries; } diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp index c06487cb67..2d996f4985 100644 --- a/src/plugins/qmljstools/qmljsmodelmanager.cpp +++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp @@ -94,7 +94,7 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject( return fn && fn->fileType() == FileType::QML && qmlTypeNames.contains(Utils::mimeTypeForFile(fn->filePath().toString(), MimeMatchMode::MatchExtension).name()); - }), &FileName::toString); + }), &FilePath::toString); activeTarget = project->activeTarget(); } Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit(); diff --git a/src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp b/src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp index ad9c6467b6..af67b55f1c 100644 --- a/src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp +++ b/src/plugins/qmlpreview/qmlpreviewconnectionmanager.cpp @@ -49,7 +49,7 @@ QmlPreviewConnectionManager::QmlPreviewConnectionManager(QObject *parent) : void QmlPreviewConnectionManager::setTarget(ProjectExplorer::Target *target) { QtSupport::BaseQtVersion::populateQmlFileFinder(&m_projectFileFinder, target); - m_projectFileFinder.setAdditionalSearchDirectories(Utils::FileNameList()); + m_projectFileFinder.setAdditionalSearchDirectories(Utils::FilePathList()); m_targetFileFinder.setTarget(target); } diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp index 42e56851ee..630bd06fa1 100644 --- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp +++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp @@ -76,7 +76,7 @@ signals: static QByteArray defaultFileLoader(const QString &filename, bool *success) { if (Core::DocumentModel::Entry *entry - = Core::DocumentModel::entryForFilePath(Utils::FileName::fromString(filename))) { + = Core::DocumentModel::entryForFilePath(Utils::FilePath::fromString(filename))) { if (!entry->isSuspended) { *success = true; return entry->document->contents(); diff --git a/src/plugins/qmlprofiler/qmlprofilertextmark.cpp b/src/plugins/qmlprofiler/qmlprofilertextmark.cpp index 6d7b69eb45..3630d6a2d2 100644 --- a/src/plugins/qmlprofiler/qmlprofilertextmark.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertextmark.cpp @@ -39,7 +39,7 @@ namespace QmlProfiler { namespace Internal { QmlProfilerTextMark::QmlProfilerTextMark(QmlProfilerViewManager *viewManager, int typeId, - const FileName &fileName, int lineNumber) : + const FilePath &fileName, int lineNumber) : TextMark(fileName, lineNumber, Constants::TEXT_MARK_CATEGORY, 3.5), m_viewManager(viewManager), m_typeIds(1, typeId) { @@ -116,7 +116,7 @@ void QmlProfilerTextMarkModel::createMarks(QmlProfilerViewManager *viewManager, lineNumber = id.lineNumber; m_marks << new QmlProfilerTextMark(viewManager, id.typeId, - FileName::fromString(fileName), + FilePath::fromString(fileName), id.lineNumber); } } diff --git a/src/plugins/qmlprofiler/qmlprofilertextmark.h b/src/plugins/qmlprofiler/qmlprofilertextmark.h index 8ed4576ea1..5b529cd3c1 100644 --- a/src/plugins/qmlprofiler/qmlprofilertextmark.h +++ b/src/plugins/qmlprofiler/qmlprofilertextmark.h @@ -36,7 +36,7 @@ class QmlProfilerTextMark : public TextEditor::TextMark { public: QmlProfilerTextMark(QmlProfilerViewManager *viewManager, int typeId, - const Utils::FileName &fileName, int lineNumber); + const Utils::FilePath &fileName, int lineNumber); void addTypeId(int typeId); void paintIcon(QPainter *painter, const QRect &rect) const override; diff --git a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp index 0f07737f5c..baef1083e8 100644 --- a/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp +++ b/src/plugins/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp @@ -45,7 +45,7 @@ class DummyProject : public ProjectExplorer::Project { Q_OBJECT public: - DummyProject(const Utils::FileName &file) : + DummyProject(const Utils::FilePath &file) : ProjectExplorer::Project(QString(), file, {}) { auto fileNode @@ -53,7 +53,7 @@ public: auto root = std::make_unique<ProjectExplorer::ProjectNode>(file); root->addNode(std::move(fileNode)); fileNode = std::make_unique<ProjectExplorer::FileNode>( - Utils::FileName::fromLatin1( + Utils::FilePath::fromLatin1( ":/qmlprofiler/tests/qmlprofilerdetailsrewriter_test.cpp"), ProjectExplorer::FileType::Source); root->addNode(std::move(fileNode)); @@ -181,10 +181,10 @@ void QmlProfilerDetailsRewriterTest::testPopulateFileFinder() QCOMPARE(m_rewriter.getLocalFile("Test.qml"), QString()); // Test that the rewriter will populate from available projects if given nullptr as parameter. - DummyProject *project1 = new DummyProject(Utils::FileName::fromString(":/nix.nix")); + DummyProject *project1 = new DummyProject(Utils::FilePath::fromString(":/nix.nix")); ProjectExplorer::SessionManager::addProject(project1); DummyProject *project2 = new DummyProject( - Utils::FileName::fromString(":/qmlprofiler/tests/Test.qml")); + Utils::FilePath::fromString(":/qmlprofiler/tests/Test.qml")); ProjectExplorer::SessionManager::addProject(project2); m_rewriter.populateFileFinder(nullptr); QCOMPARE(m_rewriter.getLocalFile("Test.qml"), @@ -203,7 +203,7 @@ void QmlProfilerDetailsRewriterTest::seedRewriter() QFutureInterface<void> result; QmlJS::PathsAndLanguages lPaths; lPaths.maybeInsert( - Utils::FileName::fromString(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)), + Utils::FilePath::fromString(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)), QmlJS::Dialect::Qml); QmlJS::ModelManagerInterface::importScan(result, QmlJS::ModelManagerInterface::workingCopy(), lPaths, m_modelManager, false); @@ -220,9 +220,9 @@ void QmlProfilerDetailsRewriterTest::seedRewriter() auto kit = std::make_unique<ProjectExplorer::Kit>(); ProjectExplorer::SysRootKitAspect::setSysRoot( - kit.get(), Utils::FileName::fromLatin1("/nowhere")); + kit.get(), Utils::FilePath::fromLatin1("/nowhere")); - DummyProject *project = new DummyProject(Utils::FileName::fromString(filename)); + DummyProject *project = new DummyProject(Utils::FilePath::fromString(filename)); ProjectExplorer::SessionManager::addProject(project); { diff --git a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp index 233712dc06..9f0a16a921 100644 --- a/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/filefilteritems.cpp @@ -175,7 +175,7 @@ bool FileFilterBaseItem::matchesFile(const QString &filePath) const return true; } - const QString &fileName = Utils::FileName::fromString(filePath).fileName(); + const QString &fileName = Utils::FilePath::fromString(filePath).fileName(); if (!fileMatches(fileName)) return false; diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp index 198aa05da7..2102147c29 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.cpp @@ -63,7 +63,7 @@ void setupFileFilterItem(QmlProjectManager::FileFilterBaseItem *fileFilterItem, namespace QmlProjectManager { -QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FileName &fileName, QString *errorMessage) +QmlProjectItem *QmlProjectFileFormat::parseProjectFile(const Utils::FilePath &fileName, QString *errorMessage) { QmlJS::SimpleReader simpleQmlJSReader; diff --git a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h index 70c5870347..9453ac8d71 100644 --- a/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h +++ b/src/plugins/qmlprojectmanager/fileformat/qmlprojectfileformat.h @@ -39,7 +39,7 @@ class QmlProjectFileFormat Q_DECLARE_TR_FUNCTIONS(QmlProjectManager::QmlProjectFileFormat) public: - static QmlProjectItem *parseProjectFile(const Utils::FileName &fileName, + static QmlProjectItem *parseProjectFile(const Utils::FilePath &fileName, QString *errorMessage = nullptr); }; diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index 7d07bc1bde..5b518ccc87 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -56,13 +56,13 @@ using namespace ProjectExplorer; namespace QmlProjectManager { -QmlProject::QmlProject(const Utils::FileName &fileName) : +QmlProject::QmlProject(const Utils::FilePath &fileName) : Project(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName, [this]() { refreshProjectFile(); }) { const QString normalized = Utils::FileUtils::normalizePathName(fileName.toFileInfo().canonicalFilePath()); - m_canonicalProjectDir = Utils::FileName::fromString(normalized).parentDir(); + m_canonicalProjectDir = Utils::FilePath::fromString(normalized).parentDir(); setId(QmlProjectManager::Constants::QML_PROJECT_ID); setProjectLanguages(Context(ProjectExplorer::Constants::QMLJS_LANGUAGE_ID)); @@ -97,7 +97,7 @@ void QmlProject::onKitChanged() refresh(Configuration); } -Utils::FileName QmlProject::canonicalProjectDir() const +Utils::FilePath QmlProject::canonicalProjectDir() const { return m_canonicalProjectDir; } @@ -165,7 +165,7 @@ void QmlProject::refresh(RefreshOptions options) QmlJS::ModelManagerInterface::ProjectInfo projectInfo = modelManager->defaultProjectInfoForProject(this); foreach (const QString &searchPath, makeAbsolute(canonicalProjectDir(), customImportPaths())) - projectInfo.importPaths.maybeInsert(Utils::FileName::fromString(searchPath), + projectInfo.importPaths.maybeInsert(Utils::FilePath::fromString(searchPath), QmlJS::Dialect::Qml); modelManager->updateProjectInfo(projectInfo, this); @@ -186,24 +186,24 @@ void QmlProject::setMainFile(const QString &mainFilePath) m_projectItem.data()->setMainFile(mainFilePath); } -Utils::FileName QmlProject::targetDirectory(const Target *target) const +Utils::FilePath QmlProject::targetDirectory(const Target *target) const { if (DeviceTypeKitAspect::deviceTypeId(target->kit()) == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE) return canonicalProjectDir(); - return m_projectItem ? Utils::FileName::fromString(m_projectItem->targetDirectory()) - : Utils::FileName(); + return m_projectItem ? Utils::FilePath::fromString(m_projectItem->targetDirectory()) + : Utils::FilePath(); } -Utils::FileName QmlProject::targetFile(const Utils::FileName &sourceFile, +Utils::FilePath QmlProject::targetFile(const Utils::FilePath &sourceFile, const Target *target) const { const QDir sourceDir(m_projectItem ? m_projectItem->sourceDirectory() : canonicalProjectDir().toString()); const QDir targetDir(targetDirectory(target).toString()); const QString relative = sourceDir.relativeFilePath(sourceFile.toString()); - return Utils::FileName::fromString(QDir::cleanPath(targetDir.absoluteFilePath(relative))); + return Utils::FilePath::fromString(QDir::cleanPath(targetDir.absoluteFilePath(relative))); } QList<Utils::EnvironmentItem> QmlProject::environment() const @@ -252,7 +252,7 @@ bool QmlProject::needsBuildConfigurations() const return false; } -QStringList QmlProject::makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths) +QStringList QmlProject::makeAbsolute(const Utils::FilePath &path, const QStringList &relativePaths) { if (path.isEmpty()) return relativePaths; @@ -374,7 +374,7 @@ void QmlProject::generateProjectTree() auto newRoot = std::make_unique<Internal::QmlProjectNode>(this); for (const QString &f : m_projectItem.data()->files()) { - const Utils::FileName fileName = Utils::FileName::fromString(f); + const Utils::FilePath fileName = Utils::FilePath::fromString(f); const FileType fileType = (fileName == projectFilePath()) ? FileType::Project : FileNode::fileTypeForFileName(fileName); newRoot->addNestedNode(std::make_unique<FileNode>(fileName, fileType)); @@ -399,7 +399,7 @@ void QmlProject::updateDeploymentData(ProjectExplorer::Target *target) for (const QString &file : m_projectItem->files()) { deploymentData.addFile( file, - targetFile(Utils::FileName::fromString(file), target).parentDir().toString()); + targetFile(Utils::FilePath::fromString(file), target).parentDir().toString()); } target->setDeploymentData(deploymentData); diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h index c04e83d63b..b3ce817f19 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.h +++ b/src/plugins/qmlprojectmanager/qmlproject.h @@ -45,7 +45,7 @@ class QMLPROJECTMANAGER_EXPORT QmlProject : public ProjectExplorer::Project Q_OBJECT public: - explicit QmlProject(const Utils::FileName &filename); + explicit QmlProject(const Utils::FilePath &filename); ~QmlProject() override; ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const final; @@ -62,11 +62,11 @@ public: void refresh(RefreshOptions options); - Utils::FileName canonicalProjectDir() const; + Utils::FilePath canonicalProjectDir() const; QString mainFile() const; void setMainFile(const QString &mainFilePath); - Utils::FileName targetDirectory(const ProjectExplorer::Target *target) const; - Utils::FileName targetFile(const Utils::FileName &sourceFile, + Utils::FilePath targetDirectory(const ProjectExplorer::Target *target) const; + Utils::FilePath targetFile(const Utils::FilePath &sourceFile, const ProjectExplorer::Target *target) const; QList<Utils::EnvironmentItem> environment() const; @@ -79,7 +79,7 @@ public: bool needsBuildConfigurations() const final; - static QStringList makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths); + static QStringList makeAbsolute(const Utils::FilePath &path, const QStringList &relativePaths); QVariant additionalData(Core::Id id, const ProjectExplorer::Target *target) const override; @@ -103,7 +103,7 @@ private: ProjectExplorer::Target *m_activeTarget = nullptr; QPointer<QmlProjectItem> m_projectItem; - Utils::FileName m_canonicalProjectDir; + Utils::FilePath m_canonicalProjectDir; }; } // namespace QmlProjectManager diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index fa4625c535..f2e54f6444 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -173,7 +173,7 @@ void MainQmlFileAspect::updateFileComboBox() QModelIndex currentIndex; QStringList sortedFiles = Utils::transform(m_project->files(Project::AllFiles), - &Utils::FileName::toString); + &Utils::FilePath::toString); // make paths relative to project directory QStringList relativeFiles; @@ -298,7 +298,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id) return envModifier(Environment()); }); - setExecutableGetter([this] { return FileName::fromString(theExecutable()); }); + setExecutableGetter([this] { return FilePath::fromString(theExecutable()); }); m_qmlViewerAspect = addAspect<BaseStringAspect>(); m_qmlViewerAspect->setLabelText(tr("QML Viewer:")); @@ -395,7 +395,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const Utils::QtcProcess::addArg(&args, fileSelector, osType); } - const QString main = project->targetFile(Utils::FileName::fromString(mainScript()), + const QString main = project->targetFile(Utils::FilePath::fromString(mainScript()), currentTarget).toString(); if (!main.isEmpty()) Utils::QtcProcess::addArg(&args, main, osType); @@ -432,7 +432,7 @@ bool MainQmlFileAspect::isQmlFilePresent() // find a qml file with lowercase filename. This is slow, but only done // in initialization/other border cases. const auto files = m_project->files(Project::AllFiles); - for (const Utils::FileName &filename : files) { + for (const Utils::FilePath &filename : files) { const QFileInfo fi = filename.toFileInfo(); if (!filename.isEmpty() && fi.baseName().at(0).isLower()) { diff --git a/src/plugins/qnx/qnxconfiguration.cpp b/src/plugins/qnx/qnxconfiguration.cpp index 3d3a09df7b..d05ae172ff 100644 --- a/src/plugins/qnx/qnxconfiguration.cpp +++ b/src/plugins/qnx/qnxconfiguration.cpp @@ -69,7 +69,7 @@ const QLatin1String SdpEnvFileKey("NDKEnvFile"); QnxConfiguration::QnxConfiguration() = default; -QnxConfiguration::QnxConfiguration(const FileName &sdpEnvFile) +QnxConfiguration::QnxConfiguration(const FilePath &sdpEnvFile) { setDefaultConfiguration(sdpEnvFile); readInformation(); @@ -83,26 +83,26 @@ QnxConfiguration::QnxConfiguration(const QVariantMap &data) m_version = QnxVersionNumber(data.value(QNXVersionKey).toString()); - setDefaultConfiguration(FileName::fromString(envFilePath)); + setDefaultConfiguration(FilePath::fromString(envFilePath)); readInformation(); } -FileName QnxConfiguration::envFile() const +FilePath QnxConfiguration::envFile() const { return m_envFile; } -FileName QnxConfiguration::qnxTarget() const +FilePath QnxConfiguration::qnxTarget() const { return m_qnxTarget; } -FileName QnxConfiguration::qnxHost() const +FilePath QnxConfiguration::qnxHost() const { return m_qnxHost; } -FileName QnxConfiguration::qccCompilerPath() const +FilePath QnxConfiguration::qccCompilerPath() const { return m_qccCompiler; } @@ -209,7 +209,7 @@ bool QnxConfiguration::canCreateKits() const [this](const Target &target) -> bool { return qnxQtVersion(target); }); } -FileName QnxConfiguration::sdpPath() const +FilePath QnxConfiguration::sdpPath() const { return envFile().parentDir(); } @@ -220,7 +220,7 @@ QnxQtVersion *QnxConfiguration::qnxQtVersion(const Target &target) const QtVersionManager::instance()->versions(Utils::equal(&BaseQtVersion::type, QString::fromLatin1(Constants::QNX_QNX_QT)))) { auto qnxQt = dynamic_cast<QnxQtVersion *>(version); - if (qnxQt && FileName::fromString(qnxQt->sdpPath()) == sdpPath()) { + if (qnxQt && FilePath::fromString(qnxQt->sdpPath()) == sdpPath()) { foreach (const Abi &qtAbi, version->qtAbis()) { if ((qtAbi == target.m_abi) && (qnxQt->cpuDir() == target.cpuDir())) return qnxQt; @@ -360,8 +360,8 @@ void QnxConfiguration::readInformation() return; foreach (const ConfigInstallInformation &info, installInfoList) { - if (m_qnxHost == FileName::fromString(info.host) - && m_qnxTarget == FileName::fromString(info.target)) { + if (m_qnxHost == FilePath::fromString(info.host) + && m_qnxTarget == FilePath::fromString(info.target)) { m_configName = info.name; setVersion(QnxVersionNumber(info.version)); break; @@ -369,21 +369,21 @@ void QnxConfiguration::readInformation() } } -void QnxConfiguration::setDefaultConfiguration(const Utils::FileName &envScript) +void QnxConfiguration::setDefaultConfiguration(const Utils::FilePath &envScript) { QTC_ASSERT(!envScript.isEmpty(), return); m_envFile = envScript; m_qnxEnv = QnxUtils::qnxEnvironmentFromEnvFile(m_envFile.toString()); foreach (const EnvironmentItem &item, m_qnxEnv) { if (item.name == QLatin1String("QNX_CONFIGURATION")) - m_qnxConfiguration = FileName::fromString(item.value); + m_qnxConfiguration = FilePath::fromString(item.value); else if (item.name == QLatin1String("QNX_TARGET")) - m_qnxTarget = FileName::fromString(item.value); + m_qnxTarget = FilePath::fromString(item.value); else if (item.name == QLatin1String("QNX_HOST")) - m_qnxHost = FileName::fromString(item.value); + m_qnxHost = FilePath::fromString(item.value); } - FileName qccPath = FileName::fromString(HostOsInfo::withExecutableSuffix( + FilePath qccPath = FilePath::fromString(HostOsInfo::withExecutableSuffix( m_qnxHost.toString() + QLatin1String("/usr/bin/qcc"))); if (qccPath.exists()) @@ -401,7 +401,7 @@ void QnxConfiguration::setDefaultConfiguration(const Utils::FileName &envScript) } const QnxConfiguration::Target *QnxConfiguration::findTargetByDebuggerPath( - const FileName &path) const + const FilePath &path) const { auto it = std::find_if(m_targets.begin(), m_targets.end(), [path](const Target &target) { return target.m_debuggerPath == path; }); @@ -423,7 +423,7 @@ void QnxConfiguration::assignDebuggersToTargets() QStringList(HostOsInfo::withExecutableSuffix(QLatin1String("nto*-gdb"))), QDir::Files); foreach (const QString &debuggerName, debuggerNames) { - const FileName debuggerPath = FileName::fromString(hostUsrBinDir.path()) + const FilePath debuggerPath = FilePath::fromString(hostUsrBinDir.path()) .pathAppended(debuggerName); DebuggerItem item; item.setCommand(debuggerPath); diff --git a/src/plugins/qnx/qnxconfiguration.h b/src/plugins/qnx/qnxconfiguration.h index 61bee235d5..ebb77c825f 100644 --- a/src/plugins/qnx/qnxconfiguration.h +++ b/src/plugins/qnx/qnxconfiguration.h @@ -54,13 +54,13 @@ class QnxConfiguration { public: QnxConfiguration(); - QnxConfiguration(const Utils::FileName &sdpEnvFile); + QnxConfiguration(const Utils::FilePath &sdpEnvFile); QnxConfiguration(const QVariantMap &data); - Utils::FileName envFile() const; - Utils::FileName qnxTarget() const; - Utils::FileName qnxHost() const; - Utils::FileName qccCompilerPath() const; + Utils::FilePath envFile() const; + Utils::FilePath qnxTarget() const; + Utils::FilePath qnxHost() const; + Utils::FilePath qccCompilerPath() const; QList<Utils::EnvironmentItem> qnxEnv() const; QnxVersionNumber version() const; QVariantMap toMap() const; @@ -72,7 +72,7 @@ public: void deactivate(); bool isActive() const; bool canCreateKits() const; - Utils::FileName sdpPath() const; + Utils::FilePath sdpPath() const; QList<ProjectExplorer::ToolChain *> autoDetect( const QList<ProjectExplorer::ToolChain *> &alreadyKnown); @@ -88,22 +88,22 @@ private: void readInformation(); - void setDefaultConfiguration(const Utils::FileName &envScript); + void setDefaultConfiguration(const Utils::FilePath &envScript); QString m_configName; - Utils::FileName m_envFile; - Utils::FileName m_qnxConfiguration; - Utils::FileName m_qnxTarget; - Utils::FileName m_qnxHost; - Utils::FileName m_qccCompiler; + Utils::FilePath m_envFile; + Utils::FilePath m_qnxConfiguration; + Utils::FilePath m_qnxTarget; + Utils::FilePath m_qnxHost; + Utils::FilePath m_qccCompiler; QList<Utils::EnvironmentItem> m_qnxEnv; QnxVersionNumber m_version; class Target { public: - Target(const ProjectExplorer::Abi &abi, const Utils::FileName &path) + Target(const ProjectExplorer::Abi &abi, const Utils::FilePath &path) : m_abi(abi), m_path(path) { } @@ -112,8 +112,8 @@ private: QString cpuDir() const; ProjectExplorer::Abi m_abi; - Utils::FileName m_path; - Utils::FileName m_debuggerPath; + Utils::FilePath m_path; + Utils::FilePath m_debuggerPath; }; QList<Target> m_targets; @@ -125,7 +125,7 @@ private: QnxToolChain *createToolChain(const Target &target); void createKit(const Target &target, QnxToolChain *toolChain, const QVariant &debugger); - const Target *findTargetByDebuggerPath(const Utils::FileName &path) const; + const Target *findTargetByDebuggerPath(const Utils::FilePath &path) const; void updateTargets(); void assignDebuggersToTargets(); diff --git a/src/plugins/qnx/qnxconfigurationmanager.cpp b/src/plugins/qnx/qnxconfigurationmanager.cpp index 2f026bbcb5..f44313d233 100644 --- a/src/plugins/qnx/qnxconfigurationmanager.cpp +++ b/src/plugins/qnx/qnxconfigurationmanager.cpp @@ -36,9 +36,9 @@ const QLatin1String QNXConfigDataKey("QNXConfiguration."); const QLatin1String QNXConfigCountKey("QNXConfiguration.Count"); const QLatin1String QNXConfigsFileVersionKey("Version"); -static Utils::FileName qnxConfigSettingsFileName() +static Utils::FilePath qnxConfigSettingsFileName() { - return Utils::FileName::fromString(Core::ICore::userResourcePath() + QLatin1String("/qnx/") + return Utils::FilePath::fromString(Core::ICore::userResourcePath() + QLatin1String("/qnx/") + QLatin1String(Constants::QNX_CONFIGS_FILENAME)); } @@ -94,7 +94,7 @@ bool QnxConfigurationManager::addConfiguration(QnxConfiguration *config) return true; } -QnxConfiguration *QnxConfigurationManager::configurationFromEnvFile(const Utils::FileName &envFile) const +QnxConfiguration *QnxConfigurationManager::configurationFromEnvFile(const Utils::FilePath &envFile) const { foreach (QnxConfiguration *c, m_configurations) { if (c->envFile() == envFile) diff --git a/src/plugins/qnx/qnxconfigurationmanager.h b/src/plugins/qnx/qnxconfigurationmanager.h index 938a098250..83e148afa9 100644 --- a/src/plugins/qnx/qnxconfigurationmanager.h +++ b/src/plugins/qnx/qnxconfigurationmanager.h @@ -45,7 +45,7 @@ public: QList<QnxConfiguration*> configurations() const; void removeConfiguration(QnxConfiguration *config); bool addConfiguration(QnxConfiguration *config); - QnxConfiguration* configurationFromEnvFile(const Utils::FileName &envFile) const; + QnxConfiguration* configurationFromEnvFile(const Utils::FilePath &envFile) const; protected slots: void saveConfigs(); diff --git a/src/plugins/qnx/qnxqtversion.cpp b/src/plugins/qnx/qnxqtversion.cpp index 354c8f0b38..ffddcf7811 100644 --- a/src/plugins/qnx/qnxqtversion.cpp +++ b/src/plugins/qnx/qnxqtversion.cpp @@ -80,17 +80,17 @@ QString QnxQtVersion::qnxHost() const return QString(); } -Utils::FileName QnxQtVersion::qnxTarget() const +Utils::FilePath QnxQtVersion::qnxTarget() const { if (!m_environmentUpToDate) updateEnvironment(); foreach (const Utils::EnvironmentItem &item, m_qnxEnv) { if (item.name == QLatin1String(Constants::QNX_TARGET_KEY)) - return Utils::FileName::fromUserInput(item.value); + return Utils::FilePath::fromUserInput(item.value); } - return Utils::FileName(); + return Utils::FilePath(); } QString QnxQtVersion::cpuDir() const diff --git a/src/plugins/qnx/qnxqtversion.h b/src/plugins/qnx/qnxqtversion.h index 87ca17d9e0..6479954bf8 100644 --- a/src/plugins/qnx/qnxqtversion.h +++ b/src/plugins/qnx/qnxqtversion.h @@ -47,7 +47,7 @@ public: QSet<Core::Id> targetDeviceTypes() const override; QString qnxHost() const; - Utils::FileName qnxTarget() const; + Utils::FilePath qnxTarget() const; QString cpuDir() const; diff --git a/src/plugins/qnx/qnxsettingswidget.cpp b/src/plugins/qnx/qnxsettingswidget.cpp index 6ca598db6a..ae2950b926 100644 --- a/src/plugins/qnx/qnxsettingswidget.cpp +++ b/src/plugins/qnx/qnxsettingswidget.cpp @@ -83,7 +83,7 @@ void QnxSettingsWidget::addConfiguration() if (envFile.isEmpty()) return; - QnxConfiguration *config = new QnxConfiguration(Utils::FileName::fromString(envFile)); + QnxConfiguration *config = new QnxConfiguration(Utils::FilePath::fromString(envFile)); if (m_qnxConfigManager->configurations().contains(config) || !config->isValid()) { QMessageBox::warning(Core::ICore::mainWindow(), tr("Warning"), diff --git a/src/plugins/qnx/qnxtoolchain.cpp b/src/plugins/qnx/qnxtoolchain.cpp index 1853af62ee..376ae63711 100644 --- a/src/plugins/qnx/qnxtoolchain.cpp +++ b/src/plugins/qnx/qnxtoolchain.cpp @@ -44,16 +44,16 @@ namespace Internal { static const char CompilerSdpPath[] = "Qnx.QnxToolChain.NDKPath"; static const char CpuDirKey[] = "Qnx.QnxToolChain.CpuDir"; -static Abis detectTargetAbis(const FileName &sdpPath) +static Abis detectTargetAbis(const FilePath &sdpPath) { Abis result; - FileName qnxTarget; + FilePath qnxTarget; if (!sdpPath.fileName().isEmpty()) { QList<Utils::EnvironmentItem> environment = QnxUtils::qnxEnvironment(sdpPath.toString()); foreach (const Utils::EnvironmentItem &item, environment) { if (item.name == QLatin1Literal("QNX_TARGET")) - qnxTarget = FileName::fromString(item.value); + qnxTarget = FilePath::fromString(item.value); } } @@ -185,7 +185,7 @@ void QnxToolChain::setCpuDir(const QString &cpuDir) GccToolChain::DetectedAbisResult QnxToolChain::detectSupportedAbis() const { - return detectTargetAbis(FileName::fromString(m_sdpPath)); + return detectTargetAbis(FilePath::fromString(m_sdpPath)); } bool QnxToolChain::operator ==(const ToolChain &other) const diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp index 3be4d4de4d..9d61864558 100644 --- a/src/plugins/qnx/qnxutils.cpp +++ b/src/plugins/qnx/qnxutils.cpp @@ -211,7 +211,7 @@ QList<Utils::EnvironmentItem> QnxUtils::qnxEnvironment(const QString &sdpPath) return qnxEnvironmentFromEnvFile(envFilePath(sdpPath)); } -QList<QnxTarget> QnxUtils::findTargets(const Utils::FileName &basePath) +QList<QnxTarget> QnxUtils::findTargets(const Utils::FilePath &basePath) { using namespace Utils; QList<QnxTarget> result; @@ -219,7 +219,7 @@ QList<QnxTarget> QnxUtils::findTargets(const Utils::FileName &basePath) QDirIterator iterator(basePath.toString()); while (iterator.hasNext()) { iterator.next(); - const FileName libc = FileName::fromString(iterator.filePath()).pathAppended("lib/libc.so"); + const FilePath libc = FilePath::fromString(iterator.filePath()).pathAppended("lib/libc.so"); if (libc.exists()) { auto abis = Abi::abisOfBinary(libc); if (abis.isEmpty()) { @@ -230,7 +230,7 @@ QList<QnxTarget> QnxUtils::findTargets(const Utils::FileName &basePath) if (abis.count() > 1) qWarning() << libc << "has more than one ABI ... processing all"; - FileName path = FileName::fromString(iterator.filePath()); + FilePath path = FilePath::fromString(iterator.filePath()); for (Abi abi : abis) result.append(QnxTarget(path, QnxUtils::convertAbi(abi))); } diff --git a/src/plugins/qnx/qnxutils.h b/src/plugins/qnx/qnxutils.h index cc3c5e0f90..ae8367e43b 100644 --- a/src/plugins/qnx/qnxutils.h +++ b/src/plugins/qnx/qnxutils.h @@ -57,11 +57,11 @@ public: class QnxTarget { public: - QnxTarget(const Utils::FileName &path, const ProjectExplorer::Abi &abi) : + QnxTarget(const Utils::FilePath &path, const ProjectExplorer::Abi &abi) : m_path(path), m_abi(abi) { } - Utils::FileName m_path; + Utils::FilePath m_path; ProjectExplorer::Abi m_abi; }; @@ -75,7 +75,7 @@ public: static QString defaultTargetVersion(const QString &sdpPath); static QList<ConfigInstallInformation> installedConfigs(const QString &configPath = QString()); static QList<Utils::EnvironmentItem> qnxEnvironment(const QString &sdpPath); - static QList<QnxTarget> findTargets(const Utils::FileName &basePath); + static QList<QnxTarget> findTargets(const Utils::FilePath &basePath); static ProjectExplorer::Abi convertAbi(const ProjectExplorer::Abi &abi); static ProjectExplorer::Abis convertAbis(const ProjectExplorer::Abis &abis); }; diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 440d042bc0..2dd4160a3b 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -199,7 +199,7 @@ BaseQtVersion::BaseQtVersion() = default; BaseQtVersion::~BaseQtVersion() = default; -void BaseQtVersion::setupQmakePathAndId(const FileName &qmakeCommand) +void BaseQtVersion::setupQmakePathAndId(const FilePath &qmakeCommand) { m_id = QtVersionManager::getUniqueId(); QTC_CHECK(m_qmakeCommand.isEmpty()); // Should only be used once. @@ -207,7 +207,7 @@ void BaseQtVersion::setupQmakePathAndId(const FileName &qmakeCommand) setUnexpandedDisplayName(defaultUnexpandedDisplayName(m_qmakeCommand, false)); } -QString BaseQtVersion::defaultUnexpandedDisplayName(const FileName &qmakePath, bool fromPath) +QString BaseQtVersion::defaultUnexpandedDisplayName(const FilePath &qmakePath, bool fromPath) { QString location; if (qmakePath.isEmpty()) { @@ -369,7 +369,7 @@ Tasks BaseQtVersion::validateKit(const Kit *k) result << Task(Task::Warning, QCoreApplication::translate("BaseQtVersion", "Device type is not supported by Qt version."), - FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); + FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); } ToolChain *tc = ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::CXX_LANGUAGE_ID); @@ -400,74 +400,74 @@ Tasks BaseQtVersion::validateKit(const Kit *k) "The compiler \"%1\" (%2) may not produce code compatible with the Qt version \"%3\" (%4)."); message = message.arg(tc->displayName(), targetAbi.toString(), version->displayName(), qtAbiString); - result << Task(fuzzyMatch ? Task::Warning : Task::Error, message, FileName(), -1, + result << Task(fuzzyMatch ? Task::Warning : Task::Error, message, FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); } } else if (ToolChainKitAspect::toolChain(k, ProjectExplorer::Constants::C_LANGUAGE_ID)) { const QString message = QCoreApplication::translate("BaseQtVersion", "The kit has a Qt version, but no C++ compiler."); - result << Task(Task::Warning, message, FileName(), -1, + result << Task(Task::Warning, message, FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); } return result; } -FileName BaseQtVersion::headerPath() const +FilePath BaseQtVersion::headerPath() const { - return FileName::fromUserInput(qmakeProperty("QT_INSTALL_HEADERS")); + return FilePath::fromUserInput(qmakeProperty("QT_INSTALL_HEADERS")); } -FileName BaseQtVersion::docsPath() const +FilePath BaseQtVersion::docsPath() const { - return FileName::fromUserInput(qmakeProperty("QT_INSTALL_DOCS")); + return FilePath::fromUserInput(qmakeProperty("QT_INSTALL_DOCS")); } -FileName BaseQtVersion::libraryPath() const +FilePath BaseQtVersion::libraryPath() const { - return FileName::fromUserInput(qmakeProperty("QT_INSTALL_LIBS")); + return FilePath::fromUserInput(qmakeProperty("QT_INSTALL_LIBS")); } -FileName BaseQtVersion::pluginPath() const +FilePath BaseQtVersion::pluginPath() const { - return FileName::fromUserInput(qmakeProperty("QT_INSTALL_PLUGINS")); + return FilePath::fromUserInput(qmakeProperty("QT_INSTALL_PLUGINS")); } -FileName BaseQtVersion::qmlPath() const +FilePath BaseQtVersion::qmlPath() const { - return FileName::fromUserInput(qmakeProperty("QT_INSTALL_QML")); + return FilePath::fromUserInput(qmakeProperty("QT_INSTALL_QML")); } -FileName BaseQtVersion::binPath() const +FilePath BaseQtVersion::binPath() const { - return FileName::fromUserInput(qmakeProperty("QT_HOST_BINS")); + return FilePath::fromUserInput(qmakeProperty("QT_HOST_BINS")); } -FileName BaseQtVersion::mkspecsPath() const +FilePath BaseQtVersion::mkspecsPath() const { - const FileName result = FileName::fromUserInput(qmakeProperty("QT_HOST_DATA")); + const FilePath result = FilePath::fromUserInput(qmakeProperty("QT_HOST_DATA")); if (result.isEmpty()) - return FileName::fromUserInput(qmakeProperty("QMAKE_MKSPECS")); + return FilePath::fromUserInput(qmakeProperty("QMAKE_MKSPECS")); return result.pathAppended("mkspecs"); } -FileName BaseQtVersion::qmlBinPath() const +FilePath BaseQtVersion::qmlBinPath() const { - return FileName::fromUserInput(m_mkspecValues.value("QT.qml.bins")); + return FilePath::fromUserInput(m_mkspecValues.value("QT.qml.bins")); } -FileName BaseQtVersion::librarySearchPath() const +FilePath BaseQtVersion::librarySearchPath() const { return HostOsInfo::isWindowsHost() - ? FileName::fromUserInput(qmakeProperty("QT_INSTALL_BINS")) : libraryPath(); + ? FilePath::fromUserInput(qmakeProperty("QT_INSTALL_BINS")) : libraryPath(); } -FileNameList BaseQtVersion::directoriesToIgnoreInProjectTree() const +FilePathList BaseQtVersion::directoriesToIgnoreInProjectTree() const { - FileNameList result; - const FileName mkspecPathGet = mkspecsPath(); + FilePathList result; + const FilePath mkspecPathGet = mkspecsPath(); result.append(mkspecPathGet); - FileName mkspecPathSrc = FileName::fromUserInput(qmakeProperty("QT_HOST_DATA", PropertyVariantSrc)); + FilePath mkspecPathSrc = FilePath::fromUserInput(qmakeProperty("QT_HOST_DATA", PropertyVariantSrc)); if (!mkspecPathSrc.isEmpty()) { mkspecPathSrc = mkspecPathSrc.pathAppended("mkspecs"); if (mkspecPathSrc != mkspecPathGet) @@ -529,7 +529,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map) if (string.startsWith('~')) string.remove(0, 1).prepend(QDir::homePath()); - m_qtSources = Utils::FileName::fromUserInput( + m_qtSources = Utils::FilePath::fromUserInput( map.value(QTVERSIONSOURCEPATH).toString()); // Handle ABIs provided by the SDKTool: @@ -546,7 +546,7 @@ void BaseQtVersion::fromMap(const QVariantMap &map) string = BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget()); } - m_qmakeCommand = Utils::FileName::fromString(string); + m_qmakeCommand = Utils::FilePath::fromString(string); } QVariantMap BaseQtVersion::toMap() const @@ -615,7 +615,7 @@ QStringList BaseQtVersion::warningReason() const return ret; } -FileName BaseQtVersion::qmakeCommand() const +FilePath BaseQtVersion::qmakeCommand() const { return m_qmakeCommand; } @@ -772,7 +772,7 @@ QString BaseQtVersion::toHtml(bool verbose) const return rc; } -FileName BaseQtVersion::sourcePath() const +FilePath BaseQtVersion::sourcePath() const { if (m_sourcePath.isEmpty()) { updateVersionInfo(); @@ -781,7 +781,7 @@ FileName BaseQtVersion::sourcePath() const return m_sourcePath; } -FileName BaseQtVersion::qtPackageSourcePath() const +FilePath BaseQtVersion::qtPackageSourcePath() const { return m_qtSources; } @@ -898,13 +898,13 @@ void BaseQtVersion::updateMkspec() const if (m_mkspecFullPath.isEmpty()) return; - FileName baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo()); + FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo()); if (m_mkspec.isChildOf(baseMkspecDir)) { m_mkspec = m_mkspec.relativeChildPath(baseMkspecDir); // qDebug() << "Setting mkspec to"<<mkspec; } else { - const FileName sourceMkSpecPath = sourcePath().pathAppended("mkspecs"); + const FilePath sourceMkSpecPath = sourcePath().pathAppended("mkspecs"); if (m_mkspec.isChildOf(sourceMkSpecPath)) { m_mkspec = m_mkspec.relativeChildPath(sourceMkSpecPath); } else { @@ -989,7 +989,7 @@ QString BaseQtVersion::mkspecFor(ToolChain *tc) const return versionSpec; } -FileName BaseQtVersion::mkspecPath() const +FilePath BaseQtVersion::mkspecPath() const { updateMkspec(); return m_mkspecFullPath; @@ -1364,8 +1364,8 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar const QList<ProjectExplorer::Project *> projects = ProjectExplorer::SessionManager::projects(); QTC_CHECK(projects.isEmpty() || startupProject); - Utils::FileName projectDirectory; - Utils::FileNameList sourceFiles; + Utils::FilePath projectDirectory; + Utils::FilePathList sourceFiles; // Sort files from startupProject to the front of the list ... if (startupProject) { @@ -1386,11 +1386,11 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar // ... and find the sysroot and qml directory if we have any target at all. const ProjectExplorer::Kit *kit = target ? target->kit() : nullptr; - const Utils::FileName activeSysroot = ProjectExplorer::SysRootKitAspect::sysRoot(kit); + const Utils::FilePath activeSysroot = ProjectExplorer::SysRootKitAspect::sysRoot(kit); const QtSupport::BaseQtVersion *qtVersion = QtVersionManager::isLoaded() ? QtSupport::QtKitAspect::qtVersion(kit) : nullptr; - Utils::FileNameList additionalSearchDirectories = qtVersion - ? Utils::FileNameList({qtVersion->qmlPath()}) : Utils::FileNameList(); + Utils::FilePathList additionalSearchDirectories = qtVersion + ? Utils::FilePathList({qtVersion->qmlPath()}) : Utils::FilePathList(); if (target) { for (const ProjectExplorer::DeployableFile &file : target->deploymentData().allFiles()) @@ -1476,7 +1476,7 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui if (!isValid()) { //: %1: Reason for being invalid const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", "The Qt version is invalid: %1").arg(invalidReason()); - results.append(Task(Task::Error, msg, FileName(), -1, + results.append(Task(Task::Error, msg, FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } @@ -1486,7 +1486,7 @@ Tasks BaseQtVersion::reportIssuesImpl(const QString &proFile, const QString &bui //: %1: Path to qmake executable const QString msg = QCoreApplication::translate("QmakeProjectManager::QtVersion", "The qmake command \"%1\" was not found or is not executable.").arg(qmakeCommand().toUserOutput()); - results.append(Task(Task::Error, msg, FileName(), -1, + results.append(Task(Task::Error, msg, FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM)); } @@ -1505,7 +1505,7 @@ QtConfigWidget *BaseQtVersion::createConfigurationWidget() const return nullptr; } -static QByteArray runQmakeQuery(const FileName &binary, const Environment &env, +static QByteArray runQmakeQuery(const FilePath &binary, const Environment &env, QString *error) { QTC_ASSERT(error, return QByteArray()); @@ -1537,7 +1537,7 @@ static QByteArray runQmakeQuery(const FileName &binary, const Environment &env, return process.readAllStandardOutput(); } -bool BaseQtVersion::queryQMakeVariables(const FileName &binary, const Environment &env, +bool BaseQtVersion::queryQMakeVariables(const FilePath &binary, const Environment &env, QHash<ProKey, ProString> *versionInfo, QString *error) { QString tmp; @@ -1579,19 +1579,19 @@ bool BaseQtVersion::queryQMakeVariables(const FileName &binary, const Environmen return true; } -FileName BaseQtVersion::mkspecDirectoryFromVersionInfo(const QHash<ProKey, ProString> &versionInfo) +FilePath BaseQtVersion::mkspecDirectoryFromVersionInfo(const QHash<ProKey, ProString> &versionInfo) { QString dataDir = qmakeProperty(versionInfo, "QT_HOST_DATA", PropertyVariantSrc); if (dataDir.isEmpty()) - return FileName(); - return FileName::fromUserInput(dataDir + "/mkspecs"); + return FilePath(); + return FilePath::fromUserInput(dataDir + "/mkspecs"); } -FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<ProKey, ProString> &versionInfo) +FilePath BaseQtVersion::mkspecFromVersionInfo(const QHash<ProKey, ProString> &versionInfo) { - FileName baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo); + FilePath baseMkspecDir = mkspecDirectoryFromVersionInfo(versionInfo); if (baseMkspecDir.isEmpty()) - return FileName(); + return FilePath(); bool qt5 = false; QString theSpec = qmakeProperty(versionInfo, "QMAKE_XSPEC"); @@ -1600,7 +1600,7 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<ProKey, ProString> &ve else qt5 = true; - FileName mkspecFullPath = baseMkspecDir.pathAppended(theSpec); + FilePath mkspecFullPath = baseMkspecDir.pathAppended(theSpec); // qDebug() << "default mkspec is located at" << mkspecFullPath; @@ -1625,7 +1625,7 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<ProKey, ProString> &ve // We sometimes get a mix of different slash styles here... possibleFullPath = possibleFullPath.replace('\\', '/'); if (QFileInfo::exists(possibleFullPath)) // Only if the path exists - mkspecFullPath = FileName::fromUserInput(possibleFullPath); + mkspecFullPath = FilePath::fromUserInput(possibleFullPath); } break; } @@ -1659,18 +1659,18 @@ FileName BaseQtVersion::mkspecFromVersionInfo(const QHash<ProKey, ProString> &ve //resolve mkspec link QString rspec = mkspecFullPath.toFileInfo().symLinkTarget(); if (!rspec.isEmpty()) - mkspecFullPath = FileName::fromUserInput( + mkspecFullPath = FilePath::fromUserInput( QDir(baseMkspecDir.toString()).absoluteFilePath(rspec)); } } return mkspecFullPath; } -FileName BaseQtVersion::sourcePath(const QHash<ProKey, ProString> &versionInfo) +FilePath BaseQtVersion::sourcePath(const QHash<ProKey, ProString> &versionInfo) { const QString qt5Source = qmakeProperty(versionInfo, "QT_INSTALL_PREFIX/src"); if (!qt5Source.isEmpty()) - return Utils::FileName::fromString(QFileInfo(qt5Source).canonicalFilePath()); + return Utils::FilePath::fromString(QFileInfo(qt5Source).canonicalFilePath()); const QString installData = qmakeProperty(versionInfo, "QT_INSTALL_PREFIX"); QString sourcePath = installData; @@ -1689,12 +1689,12 @@ FileName BaseQtVersion::sourcePath(const QHash<ProKey, ProString> &versionInfo) } } } - return FileName::fromUserInput(QFileInfo(sourcePath).canonicalFilePath()); + return FilePath::fromUserInput(QFileInfo(sourcePath).canonicalFilePath()); } -bool BaseQtVersion::isInSourceDirectory(const Utils::FileName &filePath) +bool BaseQtVersion::isInSourceDirectory(const Utils::FilePath &filePath) { - const Utils::FileName &source = sourcePath(); + const Utils::FilePath &source = sourcePath(); if (source.isEmpty()) return false; QDir dir = QDir(source.toString()); @@ -1703,9 +1703,9 @@ bool BaseQtVersion::isInSourceDirectory(const Utils::FileName &filePath) return filePath.isChildOf(dir); } -bool BaseQtVersion::isSubProject(const Utils::FileName &filePath) const +bool BaseQtVersion::isSubProject(const Utils::FilePath &filePath) const { - const Utils::FileName &source = sourcePath(); + const Utils::FilePath &source = sourcePath(); if (!source.isEmpty()) { QDir dir = QDir(source.toString()); if (dir.dirName() == "qtbase") @@ -1791,7 +1791,7 @@ bool BaseQtVersion::isQtQuickCompilerSupported(QString *reason) const return true; } -FileNameList BaseQtVersion::qtCorePaths() const +FilePathList BaseQtVersion::qtCorePaths() const { updateVersionInfo(); const QString &versionString = m_qtVersionString; @@ -1809,15 +1809,15 @@ FileNameList BaseQtVersion::qtCorePaths() const result += QDir(installBinDir).entryInfoList(filters); return result; }(); - FileNameList staticLibs; - FileNameList dynamicLibs; + FilePathList staticLibs; + FilePathList dynamicLibs; for (const QFileInfo &info : entryInfoList) { const QString file = info.fileName(); if (info.isDir() && file.startsWith("QtCore") && file.endsWith(".framework")) { // handle Framework - const FileName lib = FileName::fromFileInfo(info); + const FilePath lib = FilePath::fromFileInfo(info); dynamicLibs.append(lib.pathAppended(file.left(file.lastIndexOf('.')))); } else if (info.isReadable()) { if (file.startsWith("libQtCore") @@ -1825,12 +1825,12 @@ FileNameList BaseQtVersion::qtCorePaths() const || file.startsWith("QtCore") || file.startsWith("Qt5Core")) { if (file.endsWith(".a") || file.endsWith(".lib")) - staticLibs.append(FileName::fromFileInfo(info)); + staticLibs.append(FilePath::fromFileInfo(info)); else if (file.endsWith(".dll") || file.endsWith(QString::fromLatin1(".so.") + versionString) || file.endsWith(".so") || file.endsWith(QLatin1Char('.') + versionString + ".dylib")) - dynamicLibs.append(FileName::fromFileInfo(info)); + dynamicLibs.append(FilePath::fromFileInfo(info)); } } } @@ -1840,7 +1840,7 @@ FileNameList BaseQtVersion::qtCorePaths() const return dynamicLibs; } -static QByteArray scanQtBinaryForBuildString(const FileName &library) +static QByteArray scanQtBinaryForBuildString(const FilePath &library) { QFile lib(library.toString()); QByteArray buildString; @@ -1993,10 +1993,10 @@ static Abi refineAbiFromBuildString(const QByteArray &buildString, const Abi &pr return Abi(arch, os, flavor, format, wordWidth); } -static Abi scanQtBinaryForBuildStringAndRefineAbi(const FileName &library, +static Abi scanQtBinaryForBuildStringAndRefineAbi(const FilePath &library, const Abi &probableAbi) { - static QHash<Utils::FileName, Abi> results; + static QHash<Utils::FilePath, Abi> results; if (!results.contains(library)) { const QByteArray buildString = scanQtBinaryForBuildString(library); @@ -2005,10 +2005,10 @@ static Abi scanQtBinaryForBuildStringAndRefineAbi(const FileName &library, return results.value(library); } -Abis BaseQtVersion::qtAbisFromLibrary(const FileNameList &coreLibraries) +Abis BaseQtVersion::qtAbisFromLibrary(const FilePathList &coreLibraries) { Abis res; - for (const FileName &library : coreLibraries) { + for (const FilePath &library : coreLibraries) { for (Abi abi : Abi::abisOfBinary(library)) { Abi tmp = abi; if (abi.osFlavor() == Abi::UnknownFlavor) diff --git a/src/plugins/qtsupport/baseqtversion.h b/src/plugins/qtsupport/baseqtversion.h index e088b3953a..34e33b1c20 100644 --- a/src/plugins/qtsupport/baseqtversion.h +++ b/src/plugins/qtsupport/baseqtversion.h @@ -148,11 +148,11 @@ public: virtual Utils::Environment qmakeRunEnvironment() const; // source path defined by qmake property QT_INSTALL_PREFIX/src or by qmake.stash QT_SOURCE_TREE - Utils::FileName sourcePath() const; + Utils::FilePath sourcePath() const; // returns source path for installed qt packages and empty string for self build qt - Utils::FileName qtPackageSourcePath() const; - bool isInSourceDirectory(const Utils::FileName &filePath); - bool isSubProject(const Utils::FileName &filePath) const; + Utils::FilePath qtPackageSourcePath() const; + bool isInSourceDirectory(const Utils::FilePath &filePath); + bool isSubProject(const Utils::FilePath &filePath) const; // used by UiCodeModelSupport QString uicCommand() const; @@ -175,14 +175,14 @@ public: QString frameworkInstallPath() const; // former local functions - Utils::FileName qmakeCommand() const; + Utils::FilePath qmakeCommand() const; /// @returns the name of the mkspec QString mkspec() const; QString mkspecFor(ProjectExplorer::ToolChain *tc) const; /// @returns the full path to the default directory /// specifally not the directory the symlink/ORIGINAL_QMAKESPEC points to - Utils::FileName mkspecPath() const; + Utils::FilePath mkspecPath() const; bool hasMkspec(const QString &spec) const; @@ -216,24 +216,24 @@ public: virtual QtConfigWidget *createConfigurationWidget() const; - static QString defaultUnexpandedDisplayName(const Utils::FileName &qmakePath, + static QString defaultUnexpandedDisplayName(const Utils::FilePath &qmakePath, bool fromPath = false); virtual QSet<Core::Id> targetDeviceTypes() const = 0; virtual ProjectExplorer::Tasks validateKit(const ProjectExplorer::Kit *k); - Utils::FileName headerPath() const; - Utils::FileName docsPath() const; - Utils::FileName libraryPath() const; - Utils::FileName pluginPath() const; - Utils::FileName qmlPath() const; - Utils::FileName binPath() const; - Utils::FileName mkspecsPath() const; - Utils::FileName qmlBinPath() const; - Utils::FileName librarySearchPath() const; + Utils::FilePath headerPath() const; + Utils::FilePath docsPath() const; + Utils::FilePath libraryPath() const; + Utils::FilePath pluginPath() const; + Utils::FilePath qmlPath() const; + Utils::FilePath binPath() const; + Utils::FilePath mkspecsPath() const; + Utils::FilePath qmlBinPath() const; + Utils::FilePath librarySearchPath() const; - Utils::FileNameList directoriesToIgnoreInProjectTree() const; + Utils::FilePathList directoriesToIgnoreInProjectTree() const; QString qtNamespace() const; QString qtLibInfix() const; @@ -264,30 +264,30 @@ protected: virtual ProjectExplorer::Tasks reportIssuesImpl(const QString &proFile, const QString &buildDir) const; // helper function for desktop and simulator to figure out the supported abis based on the libraries - Utils::FileNameList qtCorePaths() const; - static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FileNameList &coreLibraries); + Utils::FilePathList qtCorePaths() const; + static ProjectExplorer::Abis qtAbisFromLibrary(const Utils::FilePathList &coreLibraries); void ensureMkSpecParsed() const; virtual void parseMkSpec(ProFileEvaluator *) const; private: - void setupQmakePathAndId(const Utils::FileName &path); + void setupQmakePathAndId(const Utils::FilePath &path); void setAutoDetectionSource(const QString &autodetectionSource); void updateVersionInfo() const; enum HostBinaries { Designer, Linguist, Uic, QScxmlc }; QString findHostBinary(HostBinaries binary) const; void updateMkspec() const; QHash<ProKey, ProString> versionInfo() const; - static bool queryQMakeVariables(const Utils::FileName &binary, + static bool queryQMakeVariables(const Utils::FilePath &binary, const Utils::Environment &env, QHash<ProKey, ProString> *versionInfo, QString *error = nullptr); static QString qmakeProperty(const QHash<ProKey, ProString> &versionInfo, const QByteArray &name, PropertyVariant variant = PropertyVariantGet); - static Utils::FileName mkspecDirectoryFromVersionInfo(const QHash<ProKey,ProString> &versionInfo); - static Utils::FileName mkspecFromVersionInfo(const QHash<ProKey,ProString> &versionInfo); - static Utils::FileName sourcePath(const QHash<ProKey,ProString> &versionInfo); + static Utils::FilePath mkspecDirectoryFromVersionInfo(const QHash<ProKey,ProString> &versionInfo); + static Utils::FilePath mkspecFromVersionInfo(const QHash<ProKey,ProString> &versionInfo); + static Utils::FilePath sourcePath(const QHash<ProKey,ProString> &versionInfo); void setId(int id); // used by the qtversionmanager for legacy restore // and by the qtoptionspage to replace Qt versions @@ -315,17 +315,17 @@ private: QString m_unexpandedDisplayName; QString m_autodetectionSource; QSet<Core::Id> m_overrideFeatures; - mutable Utils::FileName m_sourcePath; - mutable Utils::FileName m_qtSources; + mutable Utils::FilePath m_sourcePath; + mutable Utils::FilePath m_qtSources; - mutable Utils::FileName m_mkspec; - mutable Utils::FileName m_mkspecFullPath; + mutable Utils::FilePath m_mkspec; + mutable Utils::FilePath m_mkspecFullPath; mutable QHash<QString, QString> m_mkspecValues; mutable QHash<ProKey, ProString> m_versionInfo; - Utils::FileName m_qmakeCommand; + Utils::FilePath m_qmakeCommand; mutable QString m_qtVersionString; mutable QString m_uicCommand; mutable QString m_designerCommand; diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 63b9175c09..c80cbf44c6 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -151,17 +151,17 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI } else { QString error; QString targetDir = destBaseDir + QLatin1Char('/') + exampleDirName; - if (FileUtils::copyRecursively(FileName::fromString(projectDir), - FileName::fromString(targetDir), &error)) { + if (FileUtils::copyRecursively(FilePath::fromString(projectDir), + FilePath::fromString(targetDir), &error)) { // set vars to new location const QStringList::Iterator end = filesToOpen.end(); for (QStringList::Iterator it = filesToOpen.begin(); it != end; ++it) it->replace(projectDir, targetDir); foreach (const QString &dependency, dependencies) { - const FileName targetFile = FileName::fromString(targetDir) + const FilePath targetFile = FilePath::fromString(targetDir) .pathAppended(QDir(dependency).dirName()); - if (!FileUtils::copyRecursively(FileName::fromString(dependency), targetFile, + if (!FileUtils::copyRecursively(FilePath::fromString(dependency), targetFile, &error)) { QMessageBox::warning(ICore::mainWindow(), tr("Cannot Copy Project"), error); // do not fail, just warn; diff --git a/src/plugins/qtsupport/qscxmlcgenerator.cpp b/src/plugins/qtsupport/qscxmlcgenerator.cpp index 567f25cd24..415a6ea701 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.cpp +++ b/src/plugins/qtsupport/qscxmlcgenerator.cpp @@ -42,8 +42,8 @@ static QLoggingCategory log("qtc.qscxmlcgenerator", QtWarningMsg); static const char TaskCategory[] = "Task.Category.ExtraCompiler.QScxmlc"; QScxmlcGenerator::QScxmlcGenerator(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent) : + const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent) : ProcessExtraCompiler(project, source, targets, parent), m_tmpdir("qscxmlgenerator") { @@ -59,7 +59,7 @@ Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr) QByteArrayList tokens = line.split(':'); if (tokens.length() > 4) { - Utils::FileName file = Utils::FileName::fromUtf8(tokens[0]); + Utils::FilePath file = Utils::FilePath::fromUtf8(tokens[0]); int line = tokens[1].toInt(); // int column = tokens[2].toInt(); <- nice, but not needed for now. Task::TaskType type = tokens[3].trimmed() == "error" ? @@ -72,7 +72,7 @@ Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr) } -Utils::FileName QScxmlcGenerator::command() const +Utils::FilePath QScxmlcGenerator::command() const { QtSupport::BaseQtVersion *version = nullptr; Target *target; @@ -82,9 +82,9 @@ Utils::FileName QScxmlcGenerator::command() const version = QtSupport::QtKitAspect::qtVersion(KitManager::defaultKit()); if (!version) - return Utils::FileName(); + return Utils::FilePath(); - return Utils::FileName::fromString(version->qscxmlcCommand()); + return Utils::FilePath::fromString(version->qscxmlcCommand()); } QStringList QScxmlcGenerator::arguments() const @@ -95,14 +95,14 @@ QStringList QScxmlcGenerator::arguments() const tmpFile().fileName()}); } -Utils::FileName QScxmlcGenerator::workingDirectory() const +Utils::FilePath QScxmlcGenerator::workingDirectory() const { - return Utils::FileName::fromString(m_tmpdir.path()); + return Utils::FilePath::fromString(m_tmpdir.path()); } bool QScxmlcGenerator::prepareToRun(const QByteArray &sourceContents) { - const Utils::FileName fn = tmpFile(); + const Utils::FilePath fn = tmpFile(); QFile input(fn.toString()); if (!input.open(QIODevice::WriteOnly)) return false; @@ -115,10 +115,10 @@ bool QScxmlcGenerator::prepareToRun(const QByteArray &sourceContents) FileNameToContentsHash QScxmlcGenerator::handleProcessFinished(QProcess *process) { Q_UNUSED(process); - const Utils::FileName wd = workingDirectory(); + const Utils::FilePath wd = workingDirectory(); FileNameToContentsHash result; - forEachTarget([&](const Utils::FileName &target) { - const Utils::FileName file = wd.pathAppended(target.fileName()); + forEachTarget([&](const Utils::FilePath &target) { + const Utils::FilePath file = wd.pathAppended(target.fileName()); QFile generated(file.toString()); if (!generated.open(QIODevice::ReadOnly)) return; @@ -127,7 +127,7 @@ FileNameToContentsHash QScxmlcGenerator::handleProcessFinished(QProcess *process return result; } -Utils::FileName QScxmlcGenerator::tmpFile() const +Utils::FilePath QScxmlcGenerator::tmpFile() const { return workingDirectory().pathAppended(source().fileName()); } @@ -143,8 +143,8 @@ QString QScxmlcGeneratorFactory::sourceTag() const } ExtraCompiler *QScxmlcGeneratorFactory::create( - const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets) + const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets) { annouceCreation(project, source, targets); diff --git a/src/plugins/qtsupport/qscxmlcgenerator.h b/src/plugins/qtsupport/qscxmlcgenerator.h index 49cd1dd2cb..37c7617ed6 100644 --- a/src/plugins/qtsupport/qscxmlcgenerator.h +++ b/src/plugins/qtsupport/qscxmlcgenerator.h @@ -37,16 +37,16 @@ class QScxmlcGenerator : public ProjectExplorer::ProcessExtraCompiler { Q_OBJECT public: - QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent = 0); + QScxmlcGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent = 0); protected: - Utils::FileName command() const override; + Utils::FilePath command() const override; QStringList arguments() const override; - Utils::FileName workingDirectory() const override; + Utils::FilePath workingDirectory() const override; private: - Utils::FileName tmpFile() const; + Utils::FilePath tmpFile() const; ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override; bool prepareToRun(const QByteArray &sourceContents) override; ProjectExplorer::Tasks parseIssues(const QByteArray &processStderr) override; @@ -67,8 +67,8 @@ public: QString sourceTag() const override; ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) override; + const Utils::FilePath &source, + const Utils::FilePathList &targets) override; }; } // QtSupport diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index 94ab9cc123..c2269ebe07 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -542,7 +542,7 @@ QtOptionsPageWidget::~QtOptionsPageWidget() void QtOptionsPageWidget::addQtDir() { - FileName qtVersion = FileName::fromString( + FilePath qtVersion = FilePath::fromString( QFileDialog::getOpenFileName(this, tr("Select a qmake Executable"), QString(), @@ -555,7 +555,7 @@ void QtOptionsPageWidget::addQtDir() QFileInfo fi = qtVersion.toFileInfo(); // should add all qt versions here ? if (BuildableHelperLibrary::isQtChooser(fi)) - qtVersion = FileName::fromString(BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget())); + qtVersion = FilePath::fromString(BuildableHelperLibrary::qtChooserToQmakePath(fi.symLinkTarget())); auto checkAlreadyExists = [qtVersion](Utils::TreeItem *parent) { for (int i = 0; i < parent->childCount(); ++i) { @@ -614,7 +614,7 @@ void QtOptionsPageWidget::editPath() { BaseQtVersion *current = currentVersion(); QString dir = currentVersion()->qmakeCommand().toFileInfo().absolutePath(); - FileName qtVersion = FileName::fromString( + FilePath qtVersion = FilePath::fromString( QFileDialog::getOpenFileName(this, tr("Select a qmake Executable"), dir, diff --git a/src/plugins/qtsupport/qtparser.cpp b/src/plugins/qtsupport/qtparser.cpp index 08be37d5ab..6176e281c4 100644 --- a/src/plugins/qtsupport/qtparser.cpp +++ b/src/plugins/qtsupport/qtparser.cpp @@ -58,7 +58,7 @@ void QtParser::stdError(const QString &line) if (level.compare(QLatin1String("Note"), Qt::CaseInsensitive) == 0) type = Task::Unknown; Task task(type, m_mocRegExp.cap(5).trimmed() /* description */, - Utils::FileName::fromUserInput(m_mocRegExp.cap(1)) /* filename */, + Utils::FilePath::fromUserInput(m_mocRegExp.cap(1)) /* filename */, lineno, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); @@ -69,7 +69,7 @@ void QtParser::stdError(const QString &line) if (m_translationRegExp.cap(1) == QLatin1String("Error")) type = Task::Error; Task task(type, m_translationRegExp.cap(2), - Utils::FileName::fromUserInput(m_translationRegExp.cap(3)) /* filename */, + Utils::FilePath::fromUserInput(m_translationRegExp.cap(3)) /* filename */, -1, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE); emit addTask(task, 1); @@ -131,7 +131,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("Can't create link to 'Object Trees & Ownership'"), - Utils::FileName::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295, + Utils::FilePath::fromUserInput(QLatin1String("/home/user/dev/qt5/qtscript/src/script/api/qscriptengine.cpp")), 295, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc warning") @@ -140,7 +140,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("..\\untitled\\errorfile.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("..\\untitled\\errorfile.h")), 0, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc warning 2") @@ -149,7 +149,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("Property declaration ) has no READ accessor function. The property will be invalid."), - Utils::FileName::fromUserInput(QLatin1String("c:\\code\\test.h")), 96, + Utils::FilePath::fromUserInput(QLatin1String("c:\\code\\test.h")), 96, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("moc note") @@ -158,7 +158,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Unknown, QLatin1String("No relevant classes found. No output generated."), - Utils::FileName::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, + Utils::FilePath::fromUserInput(QLatin1String("/home/qtwebkithelpviewer.h")), 0, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("ninja with moc") @@ -167,7 +167,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Error, QLatin1String("Undefined interface"), - Utils::FileName::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54, + Utils::FilePath::fromUserInput(QLatin1String("E:/sandbox/creator/loaden/src/libs/utils/iwelcomepage.h")), 54, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); QTest::newRow("translation") @@ -176,7 +176,7 @@ void QtSupportPlugin::testQtOutputParser_data() << QString() << QString() << (Tasks() << Task(Task::Warning, QLatin1String("dropping duplicate messages"), - Utils::FileName::fromUserInput(QLatin1String("/some/place/qtcreator_fr.qm")), -1, + Utils::FilePath::fromUserInput(QLatin1String("/some/place/qtcreator_fr.qm")), -1, ProjectExplorer::Constants::TASK_CATEGORY_COMPILE)) << QString(); } diff --git a/src/plugins/qtsupport/qtprojectimporter.cpp b/src/plugins/qtsupport/qtprojectimporter.cpp index 0350995736..0e4124f7d9 100644 --- a/src/plugins/qtsupport/qtprojectimporter.cpp +++ b/src/plugins/qtsupport/qtprojectimporter.cpp @@ -45,7 +45,7 @@ using namespace ProjectExplorer; namespace QtSupport { -QtProjectImporter::QtProjectImporter(const Utils::FileName &path) : ProjectImporter(path) +QtProjectImporter::QtProjectImporter(const Utils::FilePath &path) : ProjectImporter(path) { useTemporaryKitAspect(QtKitAspect::id(), [this](Kit *k, const QVariantList &vl) {cleanupTemporaryQt(k, vl);}, @@ -53,7 +53,7 @@ QtProjectImporter::QtProjectImporter(const Utils::FileName &path) : ProjectImpor } QtProjectImporter::QtVersionData -QtProjectImporter::findOrCreateQtVersion(const Utils::FileName &qmakePath) const +QtProjectImporter::findOrCreateQtVersion(const Utils::FilePath &qmakePath) const { QtVersionData result; result.qt = QtVersionManager::version(Utils::equal(&BaseQtVersion::qmakeCommand, qmakePath)); @@ -144,9 +144,9 @@ namespace Internal { struct DirectoryData { DirectoryData(const QString &ip, Kit *k = nullptr, bool ink = false, - const Utils::FileName &qp = Utils::FileName(), bool inq = false) : + const Utils::FilePath &qp = Utils::FilePath(), bool inq = false) : isNewKit(ink), isNewQt(inq), - importPath(Utils::FileName::fromString(ip)), + importPath(Utils::FilePath::fromString(ip)), kit(k), qmakePath(qp) { } @@ -160,15 +160,15 @@ struct DirectoryData { const bool isNewKit = false; const bool isNewQt = false; - const Utils::FileName importPath; + const Utils::FilePath importPath; Kit *const kit = nullptr; - const Utils::FileName qmakePath; + const Utils::FilePath qmakePath; }; class TestQtProjectImporter : public QtProjectImporter { public: - TestQtProjectImporter(const Utils::FileName &pp, const QList<void *> &testData) : + TestQtProjectImporter(const Utils::FilePath &pp, const QList<void *> &testData) : QtProjectImporter(pp), m_testData(testData) { } @@ -178,7 +178,7 @@ public: bool allDeleted() const { return m_deletedTestData.count() == m_testData.count();} protected: - QList<void *> examineDirectory(const Utils::FileName &importPath) const override; + QList<void *> examineDirectory(const Utils::FilePath &importPath) const override; bool matchKit(void *directoryData, const Kit *k) const override; Kit *createKit(void *directoryData) const override; const QList<BuildInfo> buildInfoListForKit(const Kit *k, void *directoryData) const override; @@ -186,7 +186,7 @@ protected: private: const QList<void *> m_testData; - mutable Utils::FileName m_path; + mutable Utils::FilePath m_path; mutable QVector<void*> m_deletedTestData; QList<Kit *> m_deletedKits; @@ -197,7 +197,7 @@ QStringList TestQtProjectImporter::importCandidates() return QStringList(); } -QList<void *> TestQtProjectImporter::examineDirectory(const Utils::FileName &importPath) const +QList<void *> TestQtProjectImporter::examineDirectory(const Utils::FilePath &importPath) const { m_path = importPath; @@ -268,14 +268,14 @@ void TestQtProjectImporter::deleteDirectoryData(void *directoryData) const delete static_cast<DirectoryData *>(directoryData); } -static Utils::FileName setupQmake(const BaseQtVersion *qt, const QString &path) +static Utils::FilePath setupQmake(const BaseQtVersion *qt, const QString &path) { const QFileInfo fi = QFileInfo(qt->qmakeCommand().toFileInfo().canonicalFilePath()); const QString qmakeFile = path + "/" + fi.fileName(); if (!QFile::copy(fi.absoluteFilePath(), qmakeFile)) - return Utils::FileName(); + return Utils::FilePath(); - return Utils::FileName::fromString(qmakeFile); + return Utils::FilePath::fromString(qmakeFile); } void QtSupportPlugin::testQtProjectImporter_oneProject_data() @@ -375,10 +375,10 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() // Customize kit numbers 1 and 2: QtKitAspect::setQtVersion(kitTemplates[1], nullptr); QtKitAspect::setQtVersion(kitTemplates[2], nullptr); - SysRootKitAspect::setSysRoot(kitTemplates[1], Utils::FileName::fromString("/some/path")); - SysRootKitAspect::setSysRoot(kitTemplates[2], Utils::FileName::fromString("/some/other/path")); + SysRootKitAspect::setSysRoot(kitTemplates[1], Utils::FilePath::fromString("/some/path")); + SysRootKitAspect::setSysRoot(kitTemplates[2], Utils::FilePath::fromString("/some/other/path")); - QVector<Utils::FileName> qmakePaths = {defaultQt->qmakeCommand(), + QVector<Utils::FilePath> qmakePaths = {defaultQt->qmakeCommand(), setupQmake(defaultQt, tempDir1.path()), setupQmake(defaultQt, tempDir2.path())}; @@ -405,13 +405,13 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() testData.append(new DirectoryData(appDir, (kitIndex < 0) ? nullptr : kitTemplates.at(kitIndex), (kitIndex > 0), /* new Kit */ - (qtIndex < 0) ? Utils::FileName() : qmakePaths.at(qtIndex), + (qtIndex < 0) ? Utils::FilePath() : qmakePaths.at(qtIndex), (qtIndex > 0) /* new Qt */)); } // Finally set up importer: // Copy the directoryData so that importer is free to delete it later. - TestQtProjectImporter importer(Utils::FileName::fromString(tempDir1.path()), + TestQtProjectImporter importer(Utils::FilePath::fromString(tempDir1.path()), Utils::transform(testData, [](DirectoryData *i) { return static_cast<void *>(new DirectoryData(*i)); })); @@ -421,7 +421,7 @@ void QtSupportPlugin::testQtProjectImporter_oneProject() // -------------------------------------------------------------------- // choose an existing directory to "import" - const QList<BuildInfo> buildInfo = importer.import(Utils::FileName::fromString(appDir), true); + const QList<BuildInfo> buildInfo = importer.import(Utils::FilePath::fromString(appDir), true); // VALIDATE: Basic TestImporter state: QCOMPARE(importer.projectFilePath().toString(), tempDir1.path()); diff --git a/src/plugins/qtsupport/qtprojectimporter.h b/src/plugins/qtsupport/qtprojectimporter.h index 082a689bb8..2736787f32 100644 --- a/src/plugins/qtsupport/qtprojectimporter.h +++ b/src/plugins/qtsupport/qtprojectimporter.h @@ -37,7 +37,7 @@ class BaseQtVersion; class QTSUPPORT_EXPORT QtProjectImporter : public ProjectExplorer::ProjectImporter { public: - QtProjectImporter(const Utils::FileName &path); + QtProjectImporter(const Utils::FilePath &path); class QtVersionData { @@ -47,7 +47,7 @@ public: }; protected: - QtVersionData findOrCreateQtVersion(const Utils::FileName &qmakePath) const; + QtVersionData findOrCreateQtVersion(const Utils::FilePath &qmakePath) const; ProjectExplorer::Kit *createTemporaryKit(const QtVersionData &versionData, const KitSetupFunction &setup) const; diff --git a/src/plugins/qtsupport/qttestparser.cpp b/src/plugins/qtsupport/qttestparser.cpp index 0492f0631b..901613437e 100644 --- a/src/plugins/qtsupport/qttestparser.cpp +++ b/src/plugins/qtsupport/qttestparser.cpp @@ -54,7 +54,7 @@ void QtTestParser::stdOutput(const QString &line) QTC_CHECK(triggerPattern.isValid()); if (triggerPattern.match(theLine).hasMatch()) { emitCurrentTask(); - m_currentTask = Task(Task::Error, theLine, FileName(), -1, + m_currentTask = Task(Task::Error, theLine, FilePath(), -1, Constants::TASK_CATEGORY_AUTOTEST); return; } @@ -68,7 +68,7 @@ void QtTestParser::stdOutput(const QString &line) QTC_CHECK(locationPattern.isValid()); const QRegularExpressionMatch match = locationPattern.match(theLine); if (match.hasMatch()) { - m_currentTask.file = FileName::fromString( + m_currentTask.file = FilePath::fromString( QDir::fromNativeSeparators(match.captured("file"))); m_currentTask.line = match.captured("line").toInt(); emitCurrentTask(); @@ -113,7 +113,7 @@ void QtSupportPlugin::testQtTestOutputParser() "PASS : MyTest::someTest()\n" "XPASS: irrelevant\n" "PASS : MyTest::anotherTest()\n"; - const FileName theFile = FileName::fromString(HostOsInfo::isWindowsHost() + const FilePath theFile = FilePath::fromString(HostOsInfo::isWindowsHost() ? QString("C:/dev/tests/tst_mytest.cpp") : QString("/home/me/tests/tst_mytest.cpp")); const Tasks expectedTasks{ Task(Task::Error, "XPASS : MyTest::someTest()", theFile, 154, diff --git a/src/plugins/qtsupport/qtversionfactory.cpp b/src/plugins/qtsupport/qtversionfactory.cpp index 2ae9c2030c..4560667d8f 100644 --- a/src/plugins/qtsupport/qtversionfactory.cpp +++ b/src/plugins/qtsupport/qtversionfactory.cpp @@ -71,13 +71,13 @@ BaseQtVersion *QtVersionFactory::restore(const QString &type, const QVariantMap return version; } -BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FileName &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error) +BaseQtVersion *QtVersionFactory::createQtVersionFromQMakePath(const Utils::FilePath &qmakePath, bool isAutoDetected, const QString &autoDetectionSource, QString *error) { QHash<ProKey, ProString> versionInfo; if (!BaseQtVersion::queryQMakeVariables(qmakePath, Utils::Environment::systemEnvironment(), &versionInfo, error)) return 0; - Utils::FileName mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo); + Utils::FilePath mkspec = BaseQtVersion::mkspecFromVersionInfo(versionInfo); QMakeVfs vfs; QMakeGlobals globals; diff --git a/src/plugins/qtsupport/qtversionfactory.h b/src/plugins/qtsupport/qtversionfactory.h index 9753fccfba..4bafe40c14 100644 --- a/src/plugins/qtsupport/qtversionfactory.h +++ b/src/plugins/qtsupport/qtversionfactory.h @@ -29,7 +29,7 @@ #include <QVariantMap> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace QtSupport { @@ -54,7 +54,7 @@ public: QString supportedType() const; static BaseQtVersion *createQtVersionFromQMakePath( - const Utils::FileName &qmakePath, bool isAutoDetected = false, + const Utils::FilePath &qmakePath, bool isAutoDetected = false, const QString &autoDetectionSource = QString(), QString *error = nullptr); static BaseQtVersion *cloneQtVersion(const BaseQtVersion *source); diff --git a/src/plugins/qtsupport/qtversionmanager.cpp b/src/plugins/qtsupport/qtversionmanager.cpp index 734363d2e6..36e720a8f0 100644 --- a/src/plugins/qtsupport/qtversionmanager.cpp +++ b/src/plugins/qtsupport/qtversionmanager.cpp @@ -75,14 +75,14 @@ static PersistentSettingsWriter *m_writer = nullptr; enum { debug = 0 }; -static FileName globalSettingsFileName() +static FilePath globalSettingsFileName() { - return FileName::fromString(Core::ICore::installerResourcePath() + QTVERSION_FILENAME); + return FilePath::fromString(Core::ICore::installerResourcePath() + QTVERSION_FILENAME); } -static FileName settingsFileName(const QString &path) +static FilePath settingsFileName(const QString &path) { - return FileName::fromString(Core::ICore::userResourcePath() + path); + return FilePath::fromString(Core::ICore::userResourcePath() + path); } @@ -109,7 +109,7 @@ QtVersionManager::QtVersionManager() m_writer = nullptr; m_idcount = 1; - qRegisterMetaType<FileName>(); + qRegisterMetaType<FilePath>(); // Give the file a bit of time to settle before reading it... m_fileWatcherTimer->setInterval(2000); @@ -134,7 +134,7 @@ void QtVersionManager::triggerQtVersionRestore() emit m_instance->qtVersionsChanged(m_versions.keys(), QList<int>(), QList<int>()); saveQtVersions(); - const FileName configFileName = globalSettingsFileName(); + const FilePath configFileName = globalSettingsFileName(); if (configFileName.exists()) { m_configFileWatcher = new FileSystemWatcher(m_instance); connect(m_configFileWatcher, &FileSystemWatcher::fileChanged, @@ -178,7 +178,7 @@ static bool restoreQtVersions() const QList<QtVersionFactory *> factories = QtVersionFactory::allQtVersionFactories(); PersistentSettingsReader reader; - FileName filename = settingsFileName(QLatin1String(QTVERSION_FILENAME)); + FilePath filename = settingsFileName(QLatin1String(QTVERSION_FILENAME)); if (!reader.load(filename)) return false; @@ -234,7 +234,7 @@ void QtVersionManager::updateFromInstaller(bool emitSignal) { m_fileWatcherTimer->stop(); - const FileName path = globalSettingsFileName(); + const FilePath path = globalSettingsFileName(); // Handle overwritting of data: if (m_configFileWatcher) { m_configFileWatcher->removeFile(path.toString()); @@ -408,16 +408,16 @@ static QString qmakePath(const QString &qtchooser, const QString &version) return QString(); } -static FileNameList gatherQmakePathsFromQtChooser() +static FilePathList gatherQmakePathsFromQtChooser() { const QString qtchooser = QStandardPaths::findExecutable(QStringLiteral("qtchooser")); if (qtchooser.isEmpty()) - return FileNameList(); + return FilePathList(); QList<QByteArray> versions = runQtChooser(qtchooser, QStringList("-l")); - QSet<FileName> foundQMakes; + QSet<FilePath> foundQMakes; foreach (const QByteArray &version, versions) { - FileName possibleQMake = FileName::fromString( + FilePath possibleQMake = FilePath::fromString( qmakePath(qtchooser, QString::fromLocal8Bit(version))); if (!possibleQMake.isEmpty()) foundQMakes << possibleQMake; @@ -427,12 +427,12 @@ static FileNameList gatherQmakePathsFromQtChooser() static void findSystemQt() { - FileNameList systemQMakes + FilePathList systemQMakes = BuildableHelperLibrary::findQtsInEnvironment(Environment::systemEnvironment()); systemQMakes.append(gatherQmakePathsFromQtChooser()); - foreach (const FileName &qmakePath, Utils::filteredUnique(systemQMakes)) { + foreach (const FilePath &qmakePath, Utils::filteredUnique(systemQMakes)) { BaseQtVersion *version = QtVersionFactory::createQtVersionFromQMakePath(qmakePath, false, QLatin1String("PATH")); if (version) { @@ -591,7 +591,7 @@ void QtVersionManager::setNewQtVersions(QList<BaseQtVersion *> newVersions) emit m_instance->qtVersionsChanged(addedVersions, removedVersions, changedVersions); } -BaseQtVersion *QtVersionManager::qtVersionForQMakeBinary(const FileName &qmakePath) +BaseQtVersion *QtVersionManager::qtVersionForQMakeBinary(const FilePath &qmakePath) { return version(Utils::equal(&BaseQtVersion::qmakeCommand, qmakePath)); } diff --git a/src/plugins/qtsupport/qtversionmanager.h b/src/plugins/qtsupport/qtversionmanager.h index 76969b478e..4a9d077752 100644 --- a/src/plugins/qtsupport/qtversionmanager.h +++ b/src/plugins/qtsupport/qtversionmanager.h @@ -58,7 +58,7 @@ public: // Sorting is potentially expensive since it might require qmake --query to run for each version! static QList<BaseQtVersion *> sortVersions(const QList<BaseQtVersion *> &input); - static BaseQtVersion *qtVersionForQMakeBinary(const Utils::FileName &qmakePath); + static BaseQtVersion *qtVersionForQMakeBinary(const Utils::FilePath &qmakePath); static void addVersion(BaseQtVersion *version); static void removeVersion(BaseQtVersion *version); diff --git a/src/plugins/qtsupport/screenshotcropper.cpp b/src/plugins/qtsupport/screenshotcropper.cpp index 1865826ebf..79e10a8b84 100644 --- a/src/plugins/qtsupport/screenshotcropper.cpp +++ b/src/plugins/qtsupport/screenshotcropper.cpp @@ -52,7 +52,7 @@ Q_GLOBAL_STATIC(AreasOfInterest, welcomeScreenAreas) static inline QString fileNameForPath(const QString &path) { - return Utils::FileName::fromString(path).fileName(); + return Utils::FilePath::fromString(path).fileName(); } static QRect cropRectForAreaOfInterest(const QSize &imageSize, const QSize &cropSize, const QRect &areaOfInterest) diff --git a/src/plugins/qtsupport/uicgenerator.cpp b/src/plugins/qtsupport/uicgenerator.cpp index e0cddab37d..9d86893278 100644 --- a/src/plugins/qtsupport/uicgenerator.cpp +++ b/src/plugins/qtsupport/uicgenerator.cpp @@ -43,14 +43,14 @@ using namespace ProjectExplorer; namespace QtSupport { -UicGenerator::UicGenerator(const Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent) : +UicGenerator::UicGenerator(const Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent) : ProcessExtraCompiler(project, source, targets, parent) { QTC_ASSERT(targets.count() == 1, return); } -Utils::FileName UicGenerator::command() const +Utils::FilePath UicGenerator::command() const { QtSupport::BaseQtVersion *version = nullptr; Target *target; @@ -60,9 +60,9 @@ Utils::FileName UicGenerator::command() const version = QtSupport::QtKitAspect::qtVersion(KitManager::defaultKit()); if (!version) - return Utils::FileName(); + return Utils::FilePath(); - return Utils::FileName::fromString(version->uicCommand()); + return Utils::FilePath::fromString(version->uicCommand()); } QStringList UicGenerator::arguments() const @@ -76,7 +76,7 @@ FileNameToContentsHash UicGenerator::handleProcessFinished(QProcess *process) if (process->exitStatus() != QProcess::NormalExit && process->exitCode() != 0) return result; - const Utils::FileNameList targetList = targets(); + const Utils::FilePathList targetList = targets(); if (targetList.size() != 1) return result; // As far as I can discover in the UIC sources, it writes out local 8-bit encoding. The @@ -96,8 +96,8 @@ QString UicGeneratorFactory::sourceTag() const } ExtraCompiler *UicGeneratorFactory::create(const Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) + const Utils::FilePath &source, + const Utils::FilePathList &targets) { annouceCreation(project, source, targets); diff --git a/src/plugins/qtsupport/uicgenerator.h b/src/plugins/qtsupport/uicgenerator.h index 115343ae95..1253e8f1ab 100644 --- a/src/plugins/qtsupport/uicgenerator.h +++ b/src/plugins/qtsupport/uicgenerator.h @@ -36,11 +36,11 @@ class UicGenerator : public ProjectExplorer::ProcessExtraCompiler { Q_OBJECT public: - UicGenerator(const ProjectExplorer::Project *project, const Utils::FileName &source, - const Utils::FileNameList &targets, QObject *parent = 0); + UicGenerator(const ProjectExplorer::Project *project, const Utils::FilePath &source, + const Utils::FilePathList &targets, QObject *parent = 0); protected: - Utils::FileName command() const override; + Utils::FilePath command() const override; QStringList arguments() const override; ProjectExplorer::FileNameToContentsHash handleProcessFinished(QProcess *process) override; }; @@ -56,8 +56,8 @@ public: QString sourceTag() const override; ProjectExplorer::ExtraCompiler *create(const ProjectExplorer::Project *project, - const Utils::FileName &source, - const Utils::FileNameList &targets) override; + const Utils::FilePath &source, + const Utils::FilePathList &targets) override; }; } // QtSupport diff --git a/src/plugins/remotelinux/abstractpackagingstep.cpp b/src/plugins/remotelinux/abstractpackagingstep.cpp index 81f692a87f..c328837628 100644 --- a/src/plugins/remotelinux/abstractpackagingstep.cpp +++ b/src/plugins/remotelinux/abstractpackagingstep.cpp @@ -152,7 +152,7 @@ void AbstractPackagingStep::setDeploymentDataModified() void AbstractPackagingStep::raiseError(const QString &errorMessage) { - Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1, + Task task = Task(Task::Error, errorMessage, Utils::FilePath(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task); emit addOutput(errorMessage, BuildStep::OutputFormat::Stderr); @@ -160,7 +160,7 @@ void AbstractPackagingStep::raiseError(const QString &errorMessage) void AbstractPackagingStep::raiseWarning(const QString &warningMessage) { - Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1, + Task task = Task(Task::Warning, warningMessage, Utils::FilePath(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task); emit addOutput(warningMessage, OutputFormat::ErrorMessage); diff --git a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp index c6baf0d3dd..45e34bda29 100644 --- a/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp +++ b/src/plugins/remotelinux/abstractremotelinuxdeploystep.cpp @@ -115,7 +115,7 @@ void AbstractRemoteLinuxDeployStep::handleProgressMessage(const QString &message void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) { - ProjectExplorer::Task task = Task(Task::Error, message, Utils::FileName(), -1, + ProjectExplorer::Task task = Task(Task::Error, message, Utils::FilePath(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); // TODO correct? emit addOutput(message, OutputFormat::ErrorMessage); @@ -124,7 +124,7 @@ void AbstractRemoteLinuxDeployStep::handleErrorMessage(const QString &message) void AbstractRemoteLinuxDeployStep::handleWarningMessage(const QString &message) { - ProjectExplorer::Task task = Task(Task::Warning, message, Utils::FileName(), -1, + ProjectExplorer::Task task = Task(Task::Warning, message, Utils::FilePath(), -1, Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); // TODO correct? emit addOutput(message, OutputFormat::ErrorMessage); diff --git a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp index ee79ba4ec8..18ac23f496 100644 --- a/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp +++ b/src/plugins/remotelinux/abstractuploadandinstallpackageservice.cpp @@ -110,7 +110,7 @@ void AbstractUploadAndInstallPackageService::doDeploy() QTC_ASSERT(d->state == Inactive, return); d->state = Uploading; - const QString fileName = Utils::FileName::fromString(packageFilePath()).fileName(); + const QString fileName = Utils::FilePath::fromString(packageFilePath()).fileName(); const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName; connect(d->uploader, &PackageUploader::progress, this, &AbstractUploadAndInstallPackageService::progressMessage); @@ -148,7 +148,7 @@ void AbstractUploadAndInstallPackageService::handleUploadFinished(const QString emit progressMessage(tr("Successfully uploaded package file.")); const QString remoteFilePath = uploadDir() + QLatin1Char('/') - + Utils::FileName::fromString(packageFilePath()).fileName(); + + Utils::FilePath::fromString(packageFilePath()).fileName(); d->state = Installing; emit progressMessage(tr("Installing package to device...")); connect(packageInstaller(), &AbstractRemoteLinuxPackageInstaller::stdoutData, diff --git a/src/plugins/remotelinux/makeinstallstep.cpp b/src/plugins/remotelinux/makeinstallstep.cpp index 25d4128941..0b1fa704ad 100644 --- a/src/plugins/remotelinux/makeinstallstep.cpp +++ b/src/plugins/remotelinux/makeinstallstep.cpp @@ -85,7 +85,7 @@ MakeInstallStep::MakeInstallStep(BuildStepList *parent) : MakeStep(parent, stepI commandLineAspect->setLabelText(tr("Full command line:")); QTemporaryDir tmpDir; - installRootAspect->setFileName(FileName::fromString(tmpDir.path())); + installRootAspect->setFileName(FilePath::fromString(tmpDir.path())); const MakeInstallCommand cmd = target()->makeInstallCommand(tmpDir.path()); QTC_ASSERT(!cmd.command.isEmpty(), return); makeAspect->setExecutable(cmd.command); @@ -112,7 +112,7 @@ bool MakeInstallStep::init() return false; const QString rootDirPath = installRoot().toString(); if (rootDirPath.isEmpty()) { - emit addTask(Task(Task::Error, tr("You must provide an install root."), FileName(), -1, + emit addTask(Task(Task::Error, tr("You must provide an install root."), FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); return false; } @@ -120,19 +120,19 @@ bool MakeInstallStep::init() if (cleanInstallRoot() && !rootDir.removeRecursively()) { emit addTask(Task(Task::Error, tr("The install root '%1' could not be cleaned.") .arg(installRoot().toUserOutput()), - FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); + FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); return false; } if (!rootDir.exists() && !QDir::root().mkpath(rootDirPath)) { emit addTask(Task(Task::Error, tr("The install root '%1' could not be created.") .arg(installRoot().toUserOutput()), - FileName(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); + FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); return false; } if (this == deployConfiguration()->stepList()->steps().last()) { emit addTask(Task(Task::Warning, tr("The \"make install\" step should probably not be " "last in the list of deploy steps. " - "Consider moving it up."), FileName(), -1, + "Consider moving it up."), FilePath(), -1, Constants::TASK_CATEGORY_BUILDSYSTEM)); } const MakeInstallCommand cmd = target()->makeInstallCommand(installRoot().toString()); @@ -167,7 +167,7 @@ void MakeInstallStep::finish(bool success) } else if (m_noInstallTarget && m_isCmakeProject) { emit addTask(Task(Task::Warning, tr("You need to add an install statement to your " "CMakeLists.txt file for deployment to work."), - FileName(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT)); + FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT)); } MakeStep::finish(success); } @@ -181,7 +181,7 @@ void MakeInstallStep::stdError(const QString &line) MakeStep::stdError(line); } -FileName MakeInstallStep::installRoot() const +FilePath MakeInstallStep::installRoot() const { return static_cast<BaseStringAspect *>(aspect(InstallRootAspectId))->fileName(); } diff --git a/src/plugins/remotelinux/makeinstallstep.h b/src/plugins/remotelinux/makeinstallstep.h index c6a0fd5fff..5620c966b4 100644 --- a/src/plugins/remotelinux/makeinstallstep.h +++ b/src/plugins/remotelinux/makeinstallstep.h @@ -28,7 +28,7 @@ #include <projectexplorer/deploymentdata.h> #include <projectexplorer/makestep.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace RemoteLinux { namespace Internal { @@ -49,7 +49,7 @@ private: void finish(bool success) override; void stdError(const QString &line) override; - Utils::FileName installRoot() const; + Utils::FilePath installRoot() const; bool cleanInstallRoot() const; void updateCommandFromAspect(); diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 1c7c07be2d..f636799af8 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -96,7 +96,7 @@ void RemoteLinuxRunConfiguration::updateTargetInformation() QString localExecutable = bti.targetFilePath.toString(); DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable); - aspect<ExecutableAspect>()->setExecutable(FileName::fromString(depFile.remoteFilePath())); + aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(depFile.remoteFilePath())); aspect<SymbolFileAspect>()->setValue(localExecutable); emit enabledChanged(); diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index 4f2032d28b..b4172173fa 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -813,7 +813,7 @@ bool ResourceModel::setData(const QModelIndex &index, const QVariant &value, int return false; const QDir baseDir = QFileInfo(fileName()).absoluteDir(); - Utils::FileName newFileName = Utils::FileName::fromUserInput( + Utils::FilePath newFileName = Utils::FilePath::fromUserInput( baseDir.absoluteFilePath(value.toString())); if (newFileName.isEmpty()) diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 6b7e7c471f..7a5aedc434 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -216,7 +216,7 @@ void ResourceEditorPlugin::extensionsInitialized() for (FileNode *file : toReplace) { FolderNode *const pn = file->parentFolderNode(); QTC_ASSERT(pn, continue); - const Utils::FileName path = file->filePath(); + const Utils::FilePath path = file->filePath(); auto topLevel = std::make_unique<ResourceTopLevelNode>(path, pn->filePath()); topLevel->setIsGenerated(file->isGenerated()); pn->replaceSubtree(file, std::move(topLevel)); diff --git a/src/plugins/resourceeditor/resourceeditorw.cpp b/src/plugins/resourceeditor/resourceeditorw.cpp index 09a4001ff6..1dff313993 100644 --- a/src/plugins/resourceeditor/resourceeditorw.cpp +++ b/src/plugins/resourceeditor/resourceeditorw.cpp @@ -137,7 +137,7 @@ Core::IDocument::OpenResult ResourceEditorDocument::open(QString *errorString, return openResult; } - setFilePath(FileName::fromString(fileName)); + setFilePath(FilePath::fromString(fileName)); setBlockDirtyChanged(false); m_model->setDirty(fileName != realFileName); m_shouldAutoSave = false; @@ -151,8 +151,8 @@ bool ResourceEditorDocument::save(QString *errorString, const QString &name, boo if (debugResourceEditorW) qDebug(">ResourceEditorW::save: %s", qPrintable(name)); - const FileName oldFileName = filePath(); - const FileName actualName = name.isEmpty() ? oldFileName : FileName::fromString(name); + const FilePath oldFileName = filePath(); + const FilePath actualName = name.isEmpty() ? oldFileName : FilePath::fromString(name); if (actualName.isEmpty()) return false; @@ -208,7 +208,7 @@ bool ResourceEditorDocument::setContents(const QByteArray &contents) return success; } -void ResourceEditorDocument::setFilePath(const FileName &newName) +void ResourceEditorDocument::setFilePath(const FilePath &newName) { m_model->setFileName(newName.toString()); IDocument::setFilePath(newName); diff --git a/src/plugins/resourceeditor/resourceeditorw.h b/src/plugins/resourceeditor/resourceeditorw.h index 25bca62908..14c9c12394 100644 --- a/src/plugins/resourceeditor/resourceeditorw.h +++ b/src/plugins/resourceeditor/resourceeditorw.h @@ -61,7 +61,7 @@ public: bool isModified() const override; bool isSaveAsAllowed() const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - void setFilePath(const Utils::FileName &newName) override; + void setFilePath(const Utils::FilePath &newName) override; void setBlockDirtyChanged(bool value); RelativeResourceModel *model() const; diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index 6a8a33783d..baf214a2be 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -119,7 +119,7 @@ static bool hasPriority(const QStringList &files) return false; } -static bool addFilesToResource(const FileName &resourceFile, +static bool addFilesToResource(const FilePath &resourceFile, const QStringList &filePaths, QStringList *notAdded, const QString &prefix, @@ -157,7 +157,7 @@ class SimpleResourceFolderNode : public FolderNode friend class ResourceEditor::ResourceTopLevelNode; public: SimpleResourceFolderNode(const QString &afolderName, const QString &displayName, - const QString &prefix, const QString &lang, FileName absolutePath, + const QString &prefix, const QString &lang, FilePath absolutePath, ResourceTopLevelNode *topLevel, ResourceFolderNode *prefixNode); bool supportsAction(ProjectAction, const Node *node) const final; @@ -180,7 +180,7 @@ private: SimpleResourceFolderNode::SimpleResourceFolderNode(const QString &afolderName, const QString &displayName, const QString &prefix, const QString &lang, - FileName absolutePath, ResourceTopLevelNode *topLevel, ResourceFolderNode *prefixNode) + FilePath absolutePath, ResourceTopLevelNode *topLevel, ResourceFolderNode *prefixNode) : FolderNode(absolutePath) , m_folderName(afolderName) , m_prefix(prefix) @@ -224,8 +224,8 @@ bool SimpleResourceFolderNode::renameFile(const QString &filePath, const QString } // Internal -ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, - const FileName &base, +ResourceTopLevelNode::ResourceTopLevelNode(const FilePath &filePath, + const FilePath &base, const QString &contents) : FolderNode(filePath) { @@ -328,7 +328,7 @@ void ResourceTopLevelNode::addInternalNodes() const QString absoluteFolderName = filePath().toFileInfo().absoluteDir().absoluteFilePath( currentPathList.join(QLatin1Char('/'))); - const FileName folderPath = FileName::fromString(absoluteFolderName); + const FilePath folderPath = FilePath::fromString(absoluteFolderName); std::unique_ptr<FolderNode> newNode = std::make_unique<SimpleResourceFolderNode>(folderName, pathElement, prefix, lang, folderPath, @@ -351,7 +351,7 @@ void ResourceTopLevelNode::addInternalNodes() FolderNode *fn = folderNodes[folderId]; QTC_CHECK(fn); if (fn) - fn->addNode(std::make_unique<ResourceFileNode>(FileName::fromString(fileName), + fn->addNode(std::make_unique<ResourceFileNode>(FilePath::fromString(fileName), qrcPath, displayName)); } } @@ -623,7 +623,7 @@ ResourceTopLevelNode *ResourceFolderNode::resourceNode() const return m_topLevelNode; } -ResourceFileNode::ResourceFileNode(const FileName &filePath, const QString &qrcPath, const QString &displayName) +ResourceFileNode::ResourceFileNode(const FilePath &filePath, const QString &qrcPath, const QString &displayName) : FileNode(filePath, FileNode::fileTypeForFileName(filePath)) , m_qrcPath(qrcPath) , m_displayName(displayName) diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index 089f9170f7..181172a7fe 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -34,8 +34,8 @@ namespace Internal { class ResourceFileWatcher; } class RESOURCE_EXPORT ResourceTopLevelNode : public ProjectExplorer::FolderNode { public: - ResourceTopLevelNode(const Utils::FileName &filePath, - const Utils::FileName &basePath, + ResourceTopLevelNode(const Utils::FilePath &filePath, + const Utils::FilePath &basePath, const QString &contents = {}); ~ResourceTopLevelNode() override; @@ -91,7 +91,7 @@ private: class RESOURCE_EXPORT ResourceFileNode : public ProjectExplorer::FileNode { public: - ResourceFileNode(const Utils::FileName &filePath, const QString &qrcPath, const QString &displayName); + ResourceFileNode(const Utils::FilePath &filePath, const QString &qrcPath, const QString &displayName); QString displayName() const override; QString qrcPath() const; diff --git a/src/plugins/scxmleditor/scxmleditordocument.cpp b/src/plugins/scxmleditor/scxmleditordocument.cpp index d7c09b9e88..3f74d97a0c 100644 --- a/src/plugins/scxmleditor/scxmleditordocument.cpp +++ b/src/plugins/scxmleditor/scxmleditordocument.cpp @@ -74,15 +74,15 @@ Core::IDocument::OpenResult ScxmlEditorDocument::open(QString *errorString, cons return OpenResult::ReadError; } - setFilePath(Utils::FileName::fromString(absfileName)); + setFilePath(Utils::FilePath::fromString(absfileName)); return OpenResult::Success; } bool ScxmlEditorDocument::save(QString *errorString, const QString &name, bool autoSave) { - const FileName oldFileName = filePath(); - const FileName actualName = name.isEmpty() ? oldFileName : FileName::fromString(name); + const FilePath oldFileName = filePath(); + const FilePath actualName = name.isEmpty() ? oldFileName : FilePath::fromString(name); if (actualName.isEmpty()) return false; bool dirty = m_designWidget->isDirty(); @@ -108,7 +108,7 @@ bool ScxmlEditorDocument::save(QString *errorString, const QString &name, bool a return true; } -void ScxmlEditorDocument::setFilePath(const FileName &newName) +void ScxmlEditorDocument::setFilePath(const FilePath &newName) { m_designWidget->setFileName(newName.toString()); IDocument::setFilePath(newName); diff --git a/src/plugins/scxmleditor/scxmleditordocument.h b/src/plugins/scxmleditor/scxmleditordocument.h index 2ccb98213d..537c7eb027 100644 --- a/src/plugins/scxmleditor/scxmleditordocument.h +++ b/src/plugins/scxmleditor/scxmleditordocument.h @@ -60,7 +60,7 @@ public: Common::MainWidget *designWidget() const; void syncXmlFromDesignWidget(); QString designWidgetContents() const; - void setFilePath(const Utils::FileName&) override; + void setFilePath(const Utils::FilePath&) override; signals: void reloadRequested(QString *errorString, const QString &); diff --git a/src/plugins/scxmleditor/scxmltexteditor.cpp b/src/plugins/scxmleditor/scxmltexteditor.cpp index 0c86cad919..f6f3f08954 100644 --- a/src/plugins/scxmleditor/scxmltexteditor.cpp +++ b/src/plugins/scxmleditor/scxmltexteditor.cpp @@ -74,7 +74,7 @@ bool ScxmlTextEditor::open(QString *errorString, const QString &fileName, const } document->syncXmlFromDesignWidget(); - document->setFilePath(Utils::FileName::fromString(absfileName)); + document->setFilePath(Utils::FilePath::fromString(absfileName)); return true; } diff --git a/src/plugins/silversearcher/findinfilessilversearcher.cpp b/src/plugins/silversearcher/findinfilessilversearcher.cpp index 4fe0ed97c4..f0d6fa7eae 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.cpp +++ b/src/plugins/silversearcher/findinfilessilversearcher.cpp @@ -127,7 +127,7 @@ void runSilverSeacher(FutureInterfaceType &fi, FileFindParameters parameters) if (!params.searchOptions.isEmpty()) arguments << params.searchOptions.split(' '); - const FileName path = FileName::fromUserInput(FileUtils::normalizePathName(directory)); + const FilePath path = FilePath::fromUserInput(FileUtils::normalizePathName(directory)); arguments << "--" << parameters.text << path.toString(); QProcess process; diff --git a/src/plugins/silversearcher/findinfilessilversearcher.h b/src/plugins/silversearcher/findinfilessilversearcher.h index 8d0ebdd2c4..798b7f9fd9 100644 --- a/src/plugins/silversearcher/findinfilessilversearcher.h +++ b/src/plugins/silversearcher/findinfilessilversearcher.h @@ -61,7 +61,7 @@ public: private: QPointer<Core::IFindSupport> m_currentFindSupport; - Utils::FileName m_directorySetting; + Utils::FilePath m_directorySetting; QPointer<QWidget> m_widget; QPointer<QLineEdit> m_searchOptionsLineEdit; QString m_path; diff --git a/src/plugins/subversion/subversionclient.cpp b/src/plugins/subversion/subversionclient.cpp index ef65246fc3..6982bb854b 100644 --- a/src/plugins/subversion/subversionclient.cpp +++ b/src/plugins/subversion/subversionclient.cpp @@ -150,7 +150,7 @@ QString SubversionClient::synchronousTopic(const QString &repository) svnVersionBinary = svnVersionBinary.left(pos + 1); svnVersionBinary.append(HostOsInfo::withExecutableSuffix("svnversion")); const SynchronousProcessResponse result - = vcsFullySynchronousExec(repository, FileName::fromString(svnVersionBinary), args); + = vcsFullySynchronousExec(repository, FilePath::fromString(svnVersionBinary), args); if (result.result != SynchronousProcessResponse::Finished) return QString(); diff --git a/src/plugins/subversion/subversionclient.h b/src/plugins/subversion/subversionclient.h index 00ab1639ee..aa11695e9b 100644 --- a/src/plugins/subversion/subversionclient.h +++ b/src/plugins/subversion/subversionclient.h @@ -80,7 +80,7 @@ private: SubversionDiffEditorController *findOrCreateDiffEditor(const QString &documentId, const QString &source, const QString &title, const QString &workingDirectory) const; - mutable Utils::FileName m_svnVersionBinary; + mutable Utils::FilePath m_svnVersionBinary; mutable QString m_svnVersion; }; diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index 461bac97fd..0d4a024271 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -78,14 +78,14 @@ Core::Id SubversionControl::id() const return Core::Id(VcsBase::Constants::VCS_ID_SUBVERSION); } -bool SubversionControl::isVcsFileOrDirectory(const Utils::FileName &fileName) const +bool SubversionControl::isVcsFileOrDirectory(const Utils::FilePath &fileName) const { return m_plugin->isVcsDirectory(fileName); } bool SubversionControl::isConfigured() const { - const Utils::FileName binary = m_plugin->client()->vcsBinary(); + const Utils::FilePath binary = m_plugin->client()->vcsBinary(); if (binary.isEmpty()) return false; QFileInfo fi = binary.toFileInfo(); @@ -158,7 +158,7 @@ bool SubversionControl::vcsAnnotate(const QString &file, int line) } Core::ShellCommand *SubversionControl::createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) { diff --git a/src/plugins/subversion/subversioncontrol.h b/src/plugins/subversion/subversioncontrol.h index 9a8f9ff0e6..561decc2e9 100644 --- a/src/plugins/subversion/subversioncontrol.h +++ b/src/plugins/subversion/subversioncontrol.h @@ -40,7 +40,7 @@ public: explicit SubversionControl(SubversionPlugin *plugin); QString displayName() const final; Core::Id id() const final; - bool isVcsFileOrDirectory(const Utils::FileName &fileName) const final; + bool isVcsFileOrDirectory(const Utils::FilePath &fileName) const final; bool managesDirectory(const QString &directory, QString *topLevel = nullptr) const final; bool managesFile(const QString &workingDirectory, const QString &fileName) const final; @@ -56,7 +56,7 @@ public: bool vcsAnnotate(const QString &file, int line) final; Core::ShellCommand *createInitialCheckoutCommand(const QString &url, - const Utils::FileName &baseDirectory, + const Utils::FilePath &baseDirectory, const QString &localName, const QStringList &extraArgs) final; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index e9a70d2f9a..21b30d878d 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -390,7 +390,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e return true; } -bool SubversionPlugin::isVcsDirectory(const FileName &fileName) +bool SubversionPlugin::isVcsDirectory(const FilePath &fileName) { const QString baseName = fileName.fileName(); return fileName.toFileInfo().isDir() diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 67575fdb2d..a5b2dbd253 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -73,7 +73,7 @@ public: bool initialize(const QStringList &arguments, QString *errorMessage) override; - bool isVcsDirectory(const Utils::FileName &fileName); + bool isVcsDirectory(const Utils::FilePath &fileName); SubversionClient *client() const; diff --git a/src/plugins/tasklist/taskfile.cpp b/src/plugins/tasklist/taskfile.cpp index 3620616438..871cefe1ab 100644 --- a/src/plugins/tasklist/taskfile.cpp +++ b/src/plugins/tasklist/taskfile.cpp @@ -61,7 +61,7 @@ bool TaskFile::reload(QString *errorString, ReloadFlag flag, ChangeType type) return load(errorString, filePath()); } -bool TaskFile::load(QString *errorString, const Utils::FileName &fileName) +bool TaskFile::load(QString *errorString, const Utils::FilePath &fileName) { setFilePath(fileName); return TaskListPlugin::loadFile(errorString, fileName); diff --git a/src/plugins/tasklist/taskfile.h b/src/plugins/tasklist/taskfile.h index eaaf638829..22331f788e 100644 --- a/src/plugins/tasklist/taskfile.h +++ b/src/plugins/tasklist/taskfile.h @@ -40,7 +40,7 @@ public: ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - bool load(QString *errorString, const Utils::FileName &fileName); + bool load(QString *errorString, const Utils::FilePath &fileName); }; } // namespace Internal diff --git a/src/plugins/tasklist/tasklistplugin.cpp b/src/plugins/tasklist/tasklistplugin.cpp index 95b6fa9e86..b1d843355a 100644 --- a/src/plugins/tasklist/tasklistplugin.cpp +++ b/src/plugins/tasklist/tasklistplugin.cpp @@ -107,7 +107,7 @@ static QString unescape(const QString &input) return result; } -static bool parseTaskFile(QString *errorString, const FileName &name) +static bool parseTaskFile(QString *errorString, const FilePath &name) { QFile tf(name.toString()); if (!tf.open(QIODevice::ReadOnly)) { @@ -116,7 +116,7 @@ static bool parseTaskFile(QString *errorString, const FileName &name) return false; } - const FileName parentDir = name.parentDir(); + const FilePath parentDir = name.parentDir(); while (!tf.atEnd()) { QStringList chunks = parseRawLine(tf.readLine()); if (chunks.isEmpty()) @@ -154,7 +154,7 @@ static bool parseTaskFile(QString *errorString, const FileName &name) description = unescape(description); TaskHub::addTask(type, description, Constants::TASKLISTTASK_ID, - FileName::fromUserInput(file), line); + FilePath::fromUserInput(file), line); } return true; } @@ -163,7 +163,7 @@ static bool parseTaskFile(QString *errorString, const FileName &name) // TaskListPlugin // -------------------------------------------------------------------------- -IDocument *TaskListPlugin::openTasks(const FileName &fileName) +IDocument *TaskListPlugin::openTasks(const FilePath &fileName) { foreach (TaskFile *doc, d->m_openFiles) { if (doc->filePath() == fileName) @@ -210,7 +210,7 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess d->m_fileFactory.addMimeType(QLatin1String("text/x-tasklist")); d->m_fileFactory.setOpener([this](const QString &fileName) { - return openTasks(FileName::fromString(fileName)); + return openTasks(FilePath::fromString(fileName)); }); connect(SessionManager::instance(), &SessionManager::sessionLoaded, @@ -219,7 +219,7 @@ bool TaskListPlugin::initialize(const QStringList &arguments, QString *errorMess return true; } -bool TaskListPlugin::loadFile(QString *errorString, const FileName &fileName) +bool TaskListPlugin::loadFile(QString *errorString, const FilePath &fileName) { clearTasks(); @@ -248,7 +248,7 @@ void TaskListPlugin::clearTasks() void TaskListPlugin::loadDataFromSession() { - const FileName fileName = FileName::fromString( + const FilePath fileName = FilePath::fromString( SessionManager::value(QLatin1String(SESSION_FILE_KEY)).toString()); if (!fileName.isEmpty()) openTasks(fileName); diff --git a/src/plugins/tasklist/tasklistplugin.h b/src/plugins/tasklist/tasklistplugin.h index 4c78fcbfd0..6fcd6f3d7f 100644 --- a/src/plugins/tasklist/tasklistplugin.h +++ b/src/plugins/tasklist/tasklistplugin.h @@ -28,7 +28,7 @@ #include <coreplugin/idocumentfactory.h> #include <extensionsystem/iplugin.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace TaskList { namespace Internal { @@ -45,12 +45,12 @@ public: bool initialize(const QStringList &arguments, QString *errorMessage) override; void extensionsInitialized() override {} - static bool loadFile(QString *errorString, const Utils::FileName &fileName); + static bool loadFile(QString *errorString, const Utils::FilePath &fileName); static void stopMonitoring(); static void clearTasks(); - Core::IDocument *openTasks(const Utils::FileName &fileName); + Core::IDocument *openTasks(const Utils::FilePath &fileName); void loadDataFromSession(); diff --git a/src/plugins/texteditor/codestylepool.cpp b/src/plugins/texteditor/codestylepool.cpp index 348b810070..7696fe0623 100644 --- a/src/plugins/texteditor/codestylepool.cpp +++ b/src/plugins/texteditor/codestylepool.cpp @@ -117,9 +117,9 @@ QString CodeStylePool::settingsDir() const return customCodeStylesPath().append(suffix); } -Utils::FileName CodeStylePool::settingsPath(const QByteArray &id) const +Utils::FilePath CodeStylePool::settingsPath(const QByteArray &id) const { - return Utils::FileName::fromString(settingsDir()).pathAppended(QString::fromUtf8(id + ".xml")); + return Utils::FilePath::fromString(settingsDir()).pathAppended(QString::fromUtf8(id + ".xml")); } QList<ICodeStylePreferences *> CodeStylePool::codeStyles() const @@ -218,11 +218,11 @@ void CodeStylePool::loadCustomCodeStyles() const QString codeStyleFile = codeStyleFiles.at(i); // filter out styles which id is the same as one of built-in styles if (!d->m_idToCodeStyle.contains(QFileInfo(codeStyleFile).completeBaseName().toUtf8())) - loadCodeStyle(Utils::FileName::fromString(dir.absoluteFilePath(codeStyleFile))); + loadCodeStyle(Utils::FilePath::fromString(dir.absoluteFilePath(codeStyleFile))); } } -ICodeStylePreferences *CodeStylePool::importCodeStyle(const Utils::FileName &fileName) +ICodeStylePreferences *CodeStylePool::importCodeStyle(const Utils::FilePath &fileName) { ICodeStylePreferences *codeStyle = loadCodeStyle(fileName); if (codeStyle) @@ -230,7 +230,7 @@ ICodeStylePreferences *CodeStylePool::importCodeStyle(const Utils::FileName &fil return codeStyle; } -ICodeStylePreferences *CodeStylePool::loadCodeStyle(const Utils::FileName &fileName) +ICodeStylePreferences *CodeStylePool::loadCodeStyle(const Utils::FilePath &fileName) { ICodeStylePreferences *codeStyle = nullptr; Utils::PersistentSettingsReader reader; @@ -280,7 +280,7 @@ void CodeStylePool::saveCodeStyle(ICodeStylePreferences *codeStyle) const exportCodeStyle(settingsPath(codeStyle->id()), codeStyle); } -void CodeStylePool::exportCodeStyle(const Utils::FileName &fileName, ICodeStylePreferences *codeStyle) const +void CodeStylePool::exportCodeStyle(const Utils::FilePath &fileName, ICodeStylePreferences *codeStyle) const { QVariantMap map; codeStyle->toMap(QString(), &map); diff --git a/src/plugins/texteditor/codestylepool.h b/src/plugins/texteditor/codestylepool.h index 81c60a657c..150e57013a 100644 --- a/src/plugins/texteditor/codestylepool.h +++ b/src/plugins/texteditor/codestylepool.h @@ -29,7 +29,7 @@ #include <QObject> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace TextEditor { class ICodeStylePreferences; @@ -61,8 +61,8 @@ public: void loadCustomCodeStyles(); - ICodeStylePreferences *importCodeStyle(const Utils::FileName &fileName); - void exportCodeStyle(const Utils::FileName &fileName, ICodeStylePreferences *codeStyle) const; + ICodeStylePreferences *importCodeStyle(const Utils::FilePath &fileName); + void exportCodeStyle(const Utils::FilePath &fileName, ICodeStylePreferences *codeStyle) const; signals: void codeStyleAdded(ICodeStylePreferences *); @@ -72,8 +72,8 @@ private: void slotSaveCodeStyle(); QString settingsDir() const; - Utils::FileName settingsPath(const QByteArray &id) const; - ICodeStylePreferences *loadCodeStyle(const Utils::FileName &fileName); + Utils::FilePath settingsPath(const QByteArray &id) const; + ICodeStylePreferences *loadCodeStyle(const Utils::FilePath &fileName); void saveCodeStyle(ICodeStylePreferences *codeStyle) const; Internal::CodeStylePoolPrivate *d; diff --git a/src/plugins/texteditor/codestyleselectorwidget.cpp b/src/plugins/texteditor/codestyleselectorwidget.cpp index 1e76b1fc2c..2d6f9dd2e0 100644 --- a/src/plugins/texteditor/codestyleselectorwidget.cpp +++ b/src/plugins/texteditor/codestyleselectorwidget.cpp @@ -326,8 +326,8 @@ void CodeStyleSelectorWidget::slotRemoveClicked() void CodeStyleSelectorWidget::slotImportClicked() { - const Utils::FileName fileName = - Utils::FileName::fromString(QFileDialog::getOpenFileName(this, tr("Import Code Style"), QString(), + const Utils::FilePath fileName = + Utils::FilePath::fromString(QFileDialog::getOpenFileName(this, tr("Import Code Style"), QString(), tr("Code styles (*.xml);;All files (*)"))); if (!fileName.isEmpty()) { CodeStylePool *codeStylePool = m_codeStyle->delegatingPool(); @@ -348,7 +348,7 @@ void CodeStyleSelectorWidget::slotExportClicked() tr("Code styles (*.xml);;All files (*)")); if (!fileName.isEmpty()) { CodeStylePool *codeStylePool = m_codeStyle->delegatingPool(); - codeStylePool->exportCodeStyle(Utils::FileName::fromString(fileName), currentPreferences); + codeStylePool->exportCodeStyle(Utils::FilePath::fromString(fileName), currentPreferences); } } diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 080a1ec830..4372dd0394 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -203,7 +203,7 @@ QWidget *FindInFiles::createConfigWidget() return m_configWidget; } -FileName FindInFiles::path() const +FilePath FindInFiles::path() const { return m_directory->fileName(); } @@ -222,17 +222,17 @@ void FindInFiles::readSettings(QSettings *settings) settings->endGroup(); } -void FindInFiles::setDirectory(const FileName &directory) +void FindInFiles::setDirectory(const FilePath &directory) { m_directory->setFileName(directory); } -void FindInFiles::setBaseDirectory(const FileName &directory) +void FindInFiles::setBaseDirectory(const FilePath &directory) { m_directory->setBaseFileName(directory); } -FileName FindInFiles::directory() const +FilePath FindInFiles::directory() const { return m_directory->fileName(); } @@ -242,7 +242,7 @@ void FindInFiles::findOnFileSystem(const QString &path) QTC_ASSERT(m_instance, return); const QFileInfo fi(path); const QString folder = fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath(); - m_instance->setDirectory(FileName::fromString(folder)); + m_instance->setDirectory(FilePath::fromString(folder)); Find::openFindDialog(m_instance); } diff --git a/src/plugins/texteditor/findinfiles.h b/src/plugins/texteditor/findinfiles.h index f5df340ebd..54b1315096 100644 --- a/src/plugins/texteditor/findinfiles.h +++ b/src/plugins/texteditor/findinfiles.h @@ -56,9 +56,9 @@ public: void readSettings(QSettings *settings) override; bool isValid() const override; - void setDirectory(const Utils::FileName &directory); - void setBaseDirectory(const Utils::FileName &directory); - Utils::FileName directory() const; + void setDirectory(const Utils::FilePath &directory); + void setBaseDirectory(const Utils::FilePath &directory); + Utils::FilePath directory() const; static void findOnFileSystem(const QString &path); static FindInFiles *instance(); @@ -77,7 +77,7 @@ protected: private: void setValid(bool valid); void searchEnginesSelectionChanged(int index); - Utils::FileName path() const; + Utils::FilePath path() const; QPointer<QWidget> m_configWidget; QPointer<Utils::PathChooser> m_directory; diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp index cb783fa7bb..6911c844a8 100644 --- a/src/plugins/texteditor/fontsettingspage.cpp +++ b/src/plugins/texteditor/fontsettingspage.cpp @@ -586,7 +586,7 @@ void FontSettingsPage::refreshColorSchemeList() int selected = 0; QStringList schemeList = styleDir.entryList(); - QString defaultScheme = Utils::FileName::fromString(FontSettings::defaultSchemeFileName()).fileName(); + QString defaultScheme = Utils::FilePath::fromString(FontSettings::defaultSchemeFileName()).fileName(); if (schemeList.removeAll(defaultScheme)) schemeList.prepend(defaultScheme); foreach (const QString &file, schemeList) { diff --git a/src/plugins/texteditor/highlighter.cpp b/src/plugins/texteditor/highlighter.cpp index 07ec2fcf96..7fc085bb3d 100644 --- a/src/plugins/texteditor/highlighter.cpp +++ b/src/plugins/texteditor/highlighter.cpp @@ -125,7 +125,7 @@ Highlighter::Definition Highlighter::definitionForMimeType(const QString &mimeTy return highlightRepository()->definitionForMimeType(mimeType); } -Highlighter::Definition Highlighter::definitionForFilePath(const Utils::FileName &fileName) +Highlighter::Definition Highlighter::definitionForFilePath(const Utils::FilePath &fileName) { const Definitions definitions = definitionsForFileName(fileName); if (definitions.size() == 1) @@ -171,7 +171,7 @@ Highlighter::Definitions Highlighter::definitionsForMimeType(const QString &mime return definitions; } -Highlighter::Definitions Highlighter::definitionsForFileName(const Utils::FileName &fileName) +Highlighter::Definitions Highlighter::definitionsForFileName(const Utils::FilePath &fileName) { Definitions definitions = highlightRepository()->definitionsForFileName(fileName.fileName()).toList(); @@ -229,7 +229,7 @@ void Highlighter::clearDefintionForDocumentCache() settings->endGroup(); } -void Highlighter::addCustomHighlighterPath(const Utils::FileName &path) +void Highlighter::addCustomHighlighterPath(const Utils::FilePath &path) { highlightRepository()->addCustomSearchPath(path.toString()); } diff --git a/src/plugins/texteditor/highlighter.h b/src/plugins/texteditor/highlighter.h index 8777bf006f..33637070af 100644 --- a/src/plugins/texteditor/highlighter.h +++ b/src/plugins/texteditor/highlighter.h @@ -47,18 +47,18 @@ public: static Definition definitionForDocument(const TextDocument *document); static Definition definitionForMimeType(const QString &mimeType); - static Definition definitionForFilePath(const Utils::FileName &fileName); + static Definition definitionForFilePath(const Utils::FilePath &fileName); static Definition definitionForName(const QString &name); static Definitions definitionsForDocument(const TextDocument *document); static Definitions definitionsForMimeType(const QString &mimeType); - static Definitions definitionsForFileName(const Utils::FileName &fileName); + static Definitions definitionsForFileName(const Utils::FilePath &fileName); static void rememberDefintionForDocument(const Definition &definition, const TextDocument *document); static void clearDefintionForDocumentCache(); - static void addCustomHighlighterPath(const Utils::FileName &path); + static void addCustomHighlighterPath(const Utils::FilePath &path); static void updateDefinitions(std::function<void()> callback = nullptr); static void handleShutdown(); diff --git a/src/plugins/texteditor/indenter.h b/src/plugins/texteditor/indenter.h index 31dda46800..c377085d9a 100644 --- a/src/plugins/texteditor/indenter.h +++ b/src/plugins/texteditor/indenter.h @@ -33,7 +33,7 @@ #include <vector> namespace Utils { -class FileName; +class FilePath; } namespace TextEditor { @@ -74,7 +74,7 @@ public: : m_doc(doc) {} - void setFileName(const Utils::FileName &fileName) { m_fileName = fileName; } + void setFileName(const Utils::FilePath &fileName) { m_fileName = fileName; } virtual ~Indenter() = default; @@ -137,7 +137,7 @@ public: protected: QTextDocument *m_doc; - Utils::FileName m_fileName; + Utils::FilePath m_fileName; }; } // namespace TextEditor diff --git a/src/plugins/texteditor/textdocument.cpp b/src/plugins/texteditor/textdocument.cpp index d619213923..7bf7a2c371 100644 --- a/src/plugins/texteditor/textdocument.cpp +++ b/src/plugins/texteditor/textdocument.cpp @@ -300,7 +300,7 @@ TextDocument *TextDocument::currentTextDocument() return qobject_cast<TextDocument *>(EditorManager::currentDocument()); } -TextDocument *TextDocument::textDocumentForFileName(const Utils::FileName &fileName) +TextDocument *TextDocument::textDocumentForFileName(const Utils::FilePath &fileName) { return qobject_cast<TextDocument *>(DocumentModel::documentForFilePath(fileName.toString())); } @@ -364,7 +364,7 @@ void TextDocument::setFontSettings(const FontSettings &fontSettings) } QAction *TextDocument::createDiffAgainstCurrentFileAction( - QObject *parent, const std::function<Utils::FileName()> &filePath) + QObject *parent, const std::function<Utils::FilePath()> &filePath) { const auto diffAgainstCurrentFile = [filePath]() { auto diffService = DiffService::instance(); @@ -604,7 +604,7 @@ bool TextDocument::save(QString *errorString, const QString &saveFileName, bool // inform about the new filename const QFileInfo fi(fName); d->m_document.setModified(false); // also triggers update of the block revisions - setFilePath(Utils::FileName::fromUserInput(fi.absoluteFilePath())); + setFilePath(Utils::FilePath::fromUserInput(fi.absoluteFilePath())); emit changed(); return true; } @@ -624,11 +624,11 @@ bool TextDocument::shouldAutoSave() const return d->m_autoSaveRevision != d->m_document.revision(); } -void TextDocument::setFilePath(const Utils::FileName &newName) +void TextDocument::setFilePath(const Utils::FilePath &newName) { if (newName == filePath()) return; - IDocument::setFilePath(Utils::FileName::fromUserInput(newName.toFileInfo().absoluteFilePath())); + IDocument::setFilePath(Utils::FilePath::fromUserInput(newName.toFileInfo().absoluteFilePath())); } bool TextDocument::isFileReadOnly() const @@ -725,7 +725,7 @@ Core::IDocument::OpenResult TextDocument::openImpl(QString *errorString, const Q documentLayout->lastSaveRevision = d->m_autoSaveRevision = d->m_document.revision(); d->updateRevisions(); d->m_document.setModified(fileName != realFileName); - setFilePath(Utils::FileName::fromUserInput(fi.absoluteFilePath())); + setFilePath(Utils::FilePath::fromUserInput(fi.absoluteFilePath())); } if (readResult == Utils::TextFileFormat::ReadIOError) return OpenResult::ReadError; diff --git a/src/plugins/texteditor/textdocument.h b/src/plugins/texteditor/textdocument.h index d09d606c4b..a3b8678851 100644 --- a/src/plugins/texteditor/textdocument.h +++ b/src/plugins/texteditor/textdocument.h @@ -70,7 +70,7 @@ public: static QMap<QString, QString> openedTextDocumentContents(); static QMap<QString, QTextCodec *> openedTextDocumentEncodings(); static TextDocument *currentTextDocument(); - static TextDocument *textDocumentForFileName(const Utils::FileName &fileName); + static TextDocument *textDocumentForFileName(const Utils::FilePath &fileName); virtual QString plainText() const; virtual QString textAt(int pos, int length) const; @@ -116,7 +116,7 @@ public: bool isSaveAsAllowed() const override; void checkPermissions() override; bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override; - void setFilePath(const Utils::FileName &newName) override; + void setFilePath(const Utils::FilePath &newName) override; QString fallbackSaveAsPath() const override; QString fallbackSaveAsFileName() const override; @@ -150,7 +150,7 @@ public: void setFontSettings(const TextEditor::FontSettings &fontSettings); static QAction *createDiffAgainstCurrentFileAction(QObject *parent, - const std::function<Utils::FileName()> &filePath); + const std::function<Utils::FilePath()> &filePath); signals: void aboutToOpen(const QString &fileName, const QString &realFileName); diff --git a/src/plugins/texteditor/textmark.cpp b/src/plugins/texteditor/textmark.cpp index a881480d95..3493570487 100644 --- a/src/plugins/texteditor/textmark.cpp +++ b/src/plugins/texteditor/textmark.cpp @@ -58,7 +58,7 @@ private: void documentRenamed(Core::IDocument *document, const QString &oldName, const QString &newName); void allDocumentsRenamed(const QString &oldName, const QString &newName); - QHash<Utils::FileName, QSet<TextMark *> > m_marks; + QHash<Utils::FilePath, QSet<TextMark *> > m_marks; }; class AnnotationColors @@ -78,7 +78,7 @@ private: TextMarkRegistry *m_instance = nullptr; -TextMark::TextMark(const FileName &fileName, int lineNumber, Id category, double widthFactor) +TextMark::TextMark(const FilePath &fileName, int lineNumber, Id category, double widthFactor) : m_fileName(fileName) , m_lineNumber(lineNumber) , m_visible(true) @@ -100,12 +100,12 @@ TextMark::~TextMark() m_baseTextDocument = nullptr; } -FileName TextMark::fileName() const +FilePath TextMark::fileName() const { return m_fileName; } -void TextMark::updateFileName(const FileName &fileName) +void TextMark::updateFileName(const FilePath &fileName) { if (fileName == m_fileName) return; @@ -398,8 +398,8 @@ void TextMarkRegistry::documentRenamed(IDocument *document, const auto baseTextDocument = qobject_cast<TextDocument *>(document); if (!baseTextDocument) return; - FileName oldFileName = FileName::fromString(oldName); - FileName newFileName = FileName::fromString(newName); + FilePath oldFileName = FilePath::fromString(oldName); + FilePath newFileName = FilePath::fromString(newName); if (!m_marks.contains(oldFileName)) return; @@ -416,8 +416,8 @@ void TextMarkRegistry::documentRenamed(IDocument *document, const void TextMarkRegistry::allDocumentsRenamed(const QString &oldName, const QString &newName) { - FileName oldFileName = FileName::fromString(oldName); - FileName newFileName = FileName::fromString(newName); + FilePath oldFileName = FilePath::fromString(oldName); + FilePath newFileName = FilePath::fromString(newName); if (!m_marks.contains(oldFileName)) return; diff --git a/src/plugins/texteditor/textmark.h b/src/plugins/texteditor/textmark.h index eeeb761eaf..2d049cbacc 100644 --- a/src/plugins/texteditor/textmark.h +++ b/src/plugins/texteditor/textmark.h @@ -50,7 +50,7 @@ class TextDocument; class TEXTEDITOR_EXPORT TextMark { public: - TextMark(const Utils::FileName &fileName, + TextMark(const Utils::FilePath &fileName, int lineNumber, Core::Id category, double widthFactor = 1.0); @@ -65,7 +65,7 @@ public: HighPriority // shown on top. }; - Utils::FileName fileName() const; + Utils::FilePath fileName() const; int lineNumber() const; virtual void paintIcon(QPainter *painter, const QRect &rect) const; @@ -84,7 +84,7 @@ public: AnnotationRects annotationRects(const QRectF &boundingRect, const QFontMetrics &fm, const qreal fadeInOffset, const qreal fadeOutOffset) const; /// called if the filename of the document changed - virtual void updateFileName(const Utils::FileName &fileName); + virtual void updateFileName(const Utils::FilePath &fileName); virtual void updateLineNumber(int lineNumber); virtual void updateBlock(const QTextBlock &block); virtual void move(int line); @@ -131,7 +131,7 @@ private: Q_DISABLE_COPY(TextMark) TextDocument *m_baseTextDocument = nullptr; - Utils::FileName m_fileName; + Utils::FilePath m_fileName; int m_lineNumber = 0; Priority m_priority = LowPriority; QIcon m_icon; diff --git a/src/plugins/todo/cpptodoitemsscanner.cpp b/src/plugins/todo/cpptodoitemsscanner.cpp index 46b6f3d9a7..938f7922fc 100644 --- a/src/plugins/todo/cpptodoitemsscanner.cpp +++ b/src/plugins/todo/cpptodoitemsscanner.cpp @@ -60,7 +60,7 @@ void CppTodoItemsScanner::scannerParamsChanged() QSet<QString> filesToBeUpdated; foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos()) filesToBeUpdated.unite(Utils::transform(info.project().data()->files(ProjectExplorer::Project::SourceFiles), - &Utils::FileName::toString).toSet()); + &Utils::FilePath::toString).toSet()); modelManager->updateSourceFiles(filesToBeUpdated); } diff --git a/src/plugins/todo/todoitem.h b/src/plugins/todo/todoitem.h index be38f85ae7..f44cf0b42c 100644 --- a/src/plugins/todo/todoitem.h +++ b/src/plugins/todo/todoitem.h @@ -42,7 +42,7 @@ class TodoItem { public: QString text; - Utils::FileName file; + Utils::FilePath file; int line = -1; IconType iconType = IconType::Todo; QColor color; diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp index 56de5e6bd5..ef2523c346 100644 --- a/src/plugins/todo/todoitemsprovider.cpp +++ b/src/plugins/todo/todoitemsprovider.cpp @@ -124,7 +124,7 @@ void TodoItemsProvider::setItemsListWithinStartupProject() QHashIterator<QString, QList<TodoItem> > it(m_itemsHash); const QSet<QString> fileNames = QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles), - &Utils::FileName::toString)); + &Utils::FilePath::toString)); QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap(); @@ -154,7 +154,7 @@ void TodoItemsProvider::setItemsListWithinSubproject() ProjectNode *projectNode = node->parentProjectNode(); if (projectNode) { // FIXME: The name doesn't match the implementation that lists all files. - QSet<Utils::FileName> subprojectFileNames; + QSet<Utils::FilePath> subprojectFileNames; projectNode->forEachGenericNode([&](Node *node) { subprojectFileNames.insert(node->filePath()); }); @@ -162,11 +162,11 @@ void TodoItemsProvider::setItemsListWithinSubproject() // files must be both in the current subproject and the startup-project. const QSet<QString> fileNames = QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles), - &Utils::FileName::toString)); + &Utils::FilePath::toString)); QHashIterator<QString, QList<TodoItem> > it(m_itemsHash); while (it.hasNext()) { it.next(); - if (subprojectFileNames.contains(Utils::FileName::fromString(it.key())) + if (subprojectFileNames.contains(Utils::FilePath::fromString(it.key())) && fileNames.contains(it.key())) { m_itemsList << it.value(); } diff --git a/src/plugins/todo/todoitemsscanner.cpp b/src/plugins/todo/todoitemsscanner.cpp index 9b3a25dbfa..f9c57cccb7 100644 --- a/src/plugins/todo/todoitemsscanner.cpp +++ b/src/plugins/todo/todoitemsscanner.cpp @@ -54,7 +54,7 @@ void TodoItemsScanner::processCommentLine(const QString &fileName, const QString for (int i = 0; i < newItemList.count(); ++i) { newItemList[i].line = lineNumber; - newItemList[i].file = Utils::FileName::fromString(fileName); + newItemList[i].file = Utils::FilePath::fromString(fileName); } outItemList << newItemList; diff --git a/src/plugins/todo/todooutputpane.cpp b/src/plugins/todo/todooutputpane.cpp index 13eccae4b9..8abab12696 100644 --- a/src/plugins/todo/todooutputpane.cpp +++ b/src/plugins/todo/todooutputpane.cpp @@ -176,7 +176,7 @@ void TodoOutputPane::todoTreeViewClicked(const QModelIndex &index) TodoItem item; item.text = index.sibling(row, Constants::OUTPUT_COLUMN_TEXT).data().toString(); - item.file = Utils::FileName::fromUserInput(index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString()); + item.file = Utils::FilePath::fromUserInput(index.sibling(row, Constants::OUTPUT_COLUMN_FILE).data().toString()); item.line = index.sibling(row, Constants::OUTPUT_COLUMN_LINE).data().toInt(); item.color = index.data(Qt::TextColorRole).value<QColor>(); item.iconType = static_cast<IconType>(index.sibling(row, Constants::OUTPUT_COLUMN_TEXT) diff --git a/src/plugins/updateinfo/updateinfoplugin.cpp b/src/plugins/updateinfo/updateinfoplugin.cpp index 8d9d0813da..08e644bc5e 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::fromFileInfo(d->m_maintenanceTool), {"--checkupdates"}, + d->m_checkUpdatesCommand->addJob(Utils::FilePath::fromFileInfo(d->m_maintenanceTool), {"--checkupdates"}, 60 * 3, // 3 minutes timeout /*workingDirectory=*/QString(), [](int /*exitCode*/) { return Utils::SynchronousProcessResponse::Finished; }); diff --git a/src/plugins/valgrind/callgrindtextmark.cpp b/src/plugins/valgrind/callgrindtextmark.cpp index ab21688013..3ba65a3e00 100644 --- a/src/plugins/valgrind/callgrindtextmark.cpp +++ b/src/plugins/valgrind/callgrindtextmark.cpp @@ -42,7 +42,7 @@ using namespace Valgrind::Callgrind; namespace Constants { const char CALLGRIND_TEXT_MARK_CATEGORY[] = "Callgrind.Textmark"; } CallgrindTextMark::CallgrindTextMark(const QPersistentModelIndex &index, - const FileName &fileName, int lineNumber) + const FilePath &fileName, int lineNumber) : TextEditor::TextMark(fileName, lineNumber, Constants::CALLGRIND_TEXT_MARK_CATEGORY, 4.0) , m_modelIndex(index) { diff --git a/src/plugins/valgrind/callgrindtextmark.h b/src/plugins/valgrind/callgrindtextmark.h index abc710e993..e92f16ce23 100644 --- a/src/plugins/valgrind/callgrindtextmark.h +++ b/src/plugins/valgrind/callgrindtextmark.h @@ -45,7 +45,7 @@ public: * \note The index parameter must refer to one of the DataModel cost columns */ explicit CallgrindTextMark(const QPersistentModelIndex &index, - const Utils::FileName &fileName, int lineNumber); + const Utils::FilePath &fileName, int lineNumber); const Valgrind::Callgrind::Function *function() const; diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 4f14ed86c0..355d755521 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -982,7 +982,7 @@ void CallgrindToolPrivate::createTextMarks() continue; locations << location; - m_textMarks.append(new CallgrindTextMark(index, FileName::fromString(fileName), lineNumber)); + m_textMarks.append(new CallgrindTextMark(index, FilePath::fromString(fileName), lineNumber)); } } diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp index 4ccbcd973f..fee5c9a8d4 100644 --- a/src/plugins/valgrind/memchecktool.cpp +++ b/src/plugins/valgrind/memchecktool.cpp @@ -946,7 +946,7 @@ void MemcheckToolPrivate::setupRunner(MemcheckToolRunner *runTool) { RunControl *runControl = runTool->runControl(); m_errorModel.setRelevantFrameFinder(makeFrameFinder(transform(runControl->project()->files(Project::AllFiles), - &FileName::toString))); + &FilePath::toString))); connect(runTool, &MemcheckToolRunner::parserError, this, &MemcheckToolPrivate::parserError); @@ -966,12 +966,12 @@ void MemcheckToolPrivate::setupRunner(MemcheckToolRunner *runTool) m_loadExternalLogFile->setDisabled(true); QString dir = runControl->project()->projectDirectory().toString() + '/'; - const QString name = FileName::fromString(runTool->executable()).fileName(); + const QString name = FilePath::fromString(runTool->executable()).fileName(); m_errorView->setDefaultSuppressionFile(dir + name + ".supp"); foreach (const QString &file, runTool->suppressionFiles()) { - QAction *action = m_filterMenu->addAction(FileName::fromString(file).fileName()); + QAction *action = m_filterMenu->addAction(FilePath::fromString(file).fileName()); action->setToolTip(file); connect(action, &QAction::triggered, this, [file] { EditorManager::openEditorAt(file, 0); diff --git a/src/plugins/valgrind/suppressiondialog.cpp b/src/plugins/valgrind/suppressiondialog.cpp index 67b5612b3e..fbd2b21726 100644 --- a/src/plugins/valgrind/suppressiondialog.cpp +++ b/src/plugins/valgrind/suppressiondialog.cpp @@ -208,7 +208,7 @@ void SuppressionDialog::accept() return; // Add file to project if there is a project containing this file on the file system. - if (!ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(path))) { + if (!ProjectExplorer::SessionManager::projectForFile(Utils::FilePath::fromString(path))) { for (ProjectExplorer::Project *p : ProjectExplorer::SessionManager::projects()) { if (path.startsWith(p->projectDirectory().toString())) { p->rootProjectNode()->addFiles(QStringList() << path); diff --git a/src/plugins/valgrind/valgrindrunner.cpp b/src/plugins/valgrind/valgrindrunner.cpp index c5fdc115c6..587c2cb7d8 100644 --- a/src/plugins/valgrind/valgrindrunner.cpp +++ b/src/plugins/valgrind/valgrindrunner.cpp @@ -164,7 +164,7 @@ void ValgrindRunner::Private::remoteProcessStarted() // we pick the last one, first would be "bash -c ..." " | awk '{print $1;}'" // get pid "\"" - ).arg(proc, Utils::FileName::fromString(m_debuggee.executable).fileName()); + ).arg(proc, Utils::FilePath::fromString(m_debuggee.executable).fileName()); // m_remote.m_findPID = m_remote.m_connection->createRemoteProcess(cmd.toUtf8()); connect(&m_findPID, &ApplicationLauncher::remoteStderr, diff --git a/src/plugins/vcsbase/submiteditorfile.cpp b/src/plugins/vcsbase/submiteditorfile.cpp index 9136118bf7..e7e5d01e15 100644 --- a/src/plugins/vcsbase/submiteditorfile.cpp +++ b/src/plugins/vcsbase/submiteditorfile.cpp @@ -68,7 +68,7 @@ Core::IDocument::OpenResult SubmitEditorFile::open(QString *errorString, const Q if (!m_editor->setFileContents(text.toUtf8())) return OpenResult::CannotHandle; - setFilePath(FileName::fromString(fileName)); + setFilePath(FilePath::fromString(fileName)); setModified(fileName != realFileName); return OpenResult::Success; } @@ -93,7 +93,7 @@ void SubmitEditorFile::setModified(bool modified) bool SubmitEditorFile::save(QString *errorString, const QString &fileName, bool autoSave) { - const FileName fName = fileName.isEmpty() ? filePath() : FileName::fromString(fileName); + const FilePath fName = fileName.isEmpty() ? filePath() : FilePath::fromString(fileName); FileSaver saver(fName.toString(), QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); saver.write(m_editor->fileContents()); @@ -101,7 +101,7 @@ bool SubmitEditorFile::save(QString *errorString, const QString &fileName, bool return false; if (autoSave) return true; - setFilePath(FileName::fromUserInput(fName.toFileInfo().absoluteFilePath())); + setFilePath(FilePath::fromUserInput(fName.toFileInfo().absoluteFilePath())); setModified(false); if (!errorString->isEmpty()) return false; diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index bda0b6379b..4e772f3b2c 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -110,7 +110,7 @@ VcsBaseClientSettings &VcsBaseClientImpl::settings() const return *d->m_clientSettings; } -FileName VcsBaseClientImpl::vcsBinary() const +FilePath VcsBaseClientImpl::vcsBinary() const { return settings().binaryPath(); } @@ -178,7 +178,7 @@ QString VcsBaseClientImpl::stripLastNewline(const QString &in) } SynchronousProcessResponse -VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const FileName &binary, +VcsBaseClientImpl::vcsFullySynchronousExec(const QString &workingDir, const FilePath &binary, const QStringList &args, unsigned flags, int timeoutS, QTextCodec *codec) const { @@ -643,7 +643,7 @@ QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sour { return vcsBinary().toFileInfo().baseName() + QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') + - FileName::fromString(sourceId).fileName(); + FilePath::fromString(sourceId).fileName(); } void VcsBaseClient::statusParser(const QString &text) diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 9f365af6df..0706d53861 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -64,7 +64,7 @@ public: VcsBaseClientSettings &settings() const; - virtual Utils::FileName vcsBinary() const; + virtual Utils::FilePath vcsBinary() const; int vcsTimeoutS() const; enum JobOutputBindMode { @@ -105,7 +105,7 @@ public: vcsFullySynchronousExec(const QString &workingDir, const QStringList &args, unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const; Utils::SynchronousProcessResponse - vcsFullySynchronousExec(const QString &workingDir, const Utils::FileName &binary, const QStringList &args, + vcsFullySynchronousExec(const QString &workingDir, const Utils::FilePath &binary, const QStringList &args, unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const; diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 7d30181959..96571e5782 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -175,7 +175,7 @@ public: QHash<QString, SettingValue> m_valueHash; QVariantHash m_defaultValueHash; QString m_settingsGroup; - mutable FileName m_binaryFullPath; + mutable FilePath m_binaryFullPath; }; } // namespace Internal @@ -351,11 +351,11 @@ QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const return QVariant::Invalid; } -FileName VcsBaseClientSettings::binaryPath() const +FilePath VcsBaseClientSettings::binaryPath() const { if (d->m_binaryFullPath.isEmpty()) { - const FileNameList searchPaths - = Utils::transform(searchPathList(), [](const QString &s) { return FileName::fromString(s); }); + const FilePathList searchPaths + = Utils::transform(searchPathList(), [](const QString &s) { return FilePath::fromString(s); }); d->m_binaryFullPath = Environment::systemEnvironment().searchInPath( stringValue(binaryPathKey), searchPaths); } diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index 137d4391d8..e722a56564 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -35,7 +35,7 @@ QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace VcsBase { namespace Internal { class VcsBaseClientSettingsPrivate; } @@ -77,7 +77,7 @@ public: void setValue(const QString &key, const QVariant &v); QVariant::Type valueType(const QString &key) const; - Utils::FileName binaryPath() const; + Utils::FilePath binaryPath() const; QStringList searchPathList() const; diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 2a0a0e35e6..c6b5ed8fbe 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -868,7 +868,7 @@ void VcsBaseEditorWidget::slotPopulateDiffBrowser() lastFileName = file; // ignore any headers d->m_entrySections.push_back(d->m_entrySections.empty() ? 0 : lineNumber); - entriesComboBox->addItem(FileName::fromString(file).fileName()); + entriesComboBox->addItem(FilePath::fromString(file).fileName()); } } } diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index 2d70846c34..298fdf61b3 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -791,7 +791,7 @@ void VcsBasePlugin::setProcessEnvironment(QProcessEnvironment *e, // Run a process synchronously, returning Utils::SynchronousProcessResponse // response struct and using the VcsBasePlugin flags as applicable SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir, - const FileName &binary, + const FilePath &binary, const QStringList &arguments, int timeOutS, unsigned flags, diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h index 1bbe0c29b4..e1bfa15ded 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.h +++ b/src/plugins/vcsbase/vcsbaseplugin.h @@ -41,7 +41,7 @@ class QTextCodec; QT_END_NAMESPACE namespace Utils { -class FileName; +class FilePath; class SynchronousProcessResponse; } // namespace Utils @@ -170,7 +170,7 @@ public: static QString source(Core::IDocument *document); static Utils::SynchronousProcessResponse runVcs(const QString &workingDir, - const Utils::FileName &binary, + const Utils::FilePath &binary, const QStringList &arguments, int timeOutS, unsigned flags = 0, diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 0066047526..3017ae03b9 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -741,7 +741,7 @@ void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositor const QDir repoDir(repositoryDirectory); for (QStringList::iterator it = untrackedFiles->begin(); it != untrackedFiles->end(); ) { const QString path = repoDir.absoluteFilePath(*it); - if (ProjectExplorer::SessionManager::projectForFile(FileName::fromString(path))) + if (ProjectExplorer::SessionManager::projectForFile(FilePath::fromString(path))) ++it; else it = untrackedFiles->erase(it); diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index 6422eb2997..a659b13fec 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -77,7 +77,7 @@ const QProcessEnvironment VcsCommand::processEnvironment() const return env; } -SynchronousProcessResponse VcsCommand::runCommand(const FileName &binary, +SynchronousProcessResponse VcsCommand::runCommand(const FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workingDirectory, const ExitCodeInterpreter &interpreter) diff --git a/src/plugins/vcsbase/vcscommand.h b/src/plugins/vcsbase/vcscommand.h index bc7ad022e4..191b72b980 100644 --- a/src/plugins/vcsbase/vcscommand.h +++ b/src/plugins/vcsbase/vcscommand.h @@ -45,7 +45,7 @@ public: const QProcessEnvironment processEnvironment() const override; - Utils::SynchronousProcessResponse runCommand(const Utils::FileName &binary, + Utils::SynchronousProcessResponse runCommand(const Utils::FilePath &binary, const QStringList &arguments, int timeoutS, const QString &workDirectory = QString(), const Utils::ExitCodeInterpreter &interpreter = Utils::defaultExitCodeInterpreter) override; diff --git a/src/plugins/vcsbase/vcsoutputwindow.cpp b/src/plugins/vcsbase/vcsoutputwindow.cpp index 69746094ae..4c559a9c74 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsoutputwindow.cpp @@ -457,7 +457,7 @@ static inline QString formatArguments(const QStringList &args) } QString VcsOutputWindow::msgExecutionLogEntry(const QString &workingDir, - const FileName &executable, + const FilePath &executable, const QStringList &arguments) { const QString args = formatArguments(arguments); @@ -474,7 +474,7 @@ void VcsOutputWindow::appendShellCommandLine(const QString &text) } void VcsOutputWindow::appendCommand(const QString &workingDirectory, - const FileName &binary, + const FilePath &binary, const QStringList &args) { appendShellCommandLine(msgExecutionLogEntry(workingDirectory, binary, args)); diff --git a/src/plugins/vcsbase/vcsoutputwindow.h b/src/plugins/vcsbase/vcsoutputwindow.h index 9de4e41576..d54b4e6306 100644 --- a/src/plugins/vcsbase/vcsoutputwindow.h +++ b/src/plugins/vcsbase/vcsoutputwindow.h @@ -29,7 +29,7 @@ #include <coreplugin/ioutputpane.h> -namespace Utils { class FileName; } +namespace Utils { class FilePath; } namespace VcsBase { namespace Internal { class VcsPlugin; } @@ -66,7 +66,7 @@ public: // 'Executing <dir>: <cmd> <args>'. Hides well-known password option // arguments. static QString msgExecutionLogEntry(const QString &workingDir, - const Utils::FileName &executable, + const Utils::FilePath &executable, const QStringList &arguments); enum MessageStyle { @@ -107,7 +107,7 @@ public slots: // Append a standard-formatted entry for command execution // (see msgExecutionLogEntry). static void appendCommand(const QString &workingDirectory, - const Utils::FileName &binary, + const Utils::FilePath &binary, const QStringList &args); // Append a blue message text and pop up. diff --git a/src/plugins/vcsbase/wizard/vcscommandpage.cpp b/src/plugins/vcsbase/wizard/vcscommandpage.cpp index 6ad605f586..f40138c1a3 100644 --- a/src/plugins/vcsbase/wizard/vcscommandpage.cpp +++ b/src/plugins/vcsbase/wizard/vcscommandpage.cpp @@ -287,7 +287,7 @@ void VcsCommandPage::delayedInitialize() } Core::ShellCommand *command - = vc->createInitialCheckoutCommand(repo, FileName::fromString(base), + = vc->createInitialCheckoutCommand(repo, FilePath::fromString(base), name, extraArgs); foreach (const JobData &job, m_additionalJobs) { @@ -310,7 +310,7 @@ void VcsCommandPage::delayedInitialize() const QString dir = wiz->expander()->expand(job.workDirectory); const int timeoutS = command->defaultTimeoutS() * job.timeOutFactor; - command->addJob(FileName::fromUserInput(commandString), args, timeoutS, dir); + command->addJob(FilePath::fromUserInput(commandString), args, timeoutS, dir); } start(command); diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp index d9c6c260e4..357a306177 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp +++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp @@ -70,7 +70,7 @@ bool WinRtPackageDeploymentStep::init() QTC_ASSERT(rc, return false); const BuildTargetInfo bti = rc->buildTargetInfo(); - Utils::FileName appTargetFilePath = bti.targetFilePath; + Utils::FilePath appTargetFilePath = bti.targetFilePath; m_targetFilePath = appTargetFilePath.toString(); if (m_targetFilePath.isEmpty()) { @@ -107,7 +107,7 @@ bool WinRtPackageDeploymentStep::init() QDir::toNativeSeparators(qt->binPath().toString()))); return false; } - params->setCommand(Utils::FileName::fromString(windeployqtPath)); + params->setCommand(Utils::FilePath::fromString(windeployqtPath)); params->setArguments(args); params->setEnvironment(buildConfiguration()->environment()); @@ -248,7 +248,7 @@ QString WinRtPackageDeploymentStep::defaultWinDeployQtArguments() const void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage) { - ProjectExplorer::Task task = Task(Task::Error, errorMessage, Utils::FileName(), -1, + ProjectExplorer::Task task = Task(Task::Error, errorMessage, Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); emit addOutput(errorMessage, BuildStep::OutputFormat::ErrorMessage); @@ -256,7 +256,7 @@ void WinRtPackageDeploymentStep::raiseError(const QString &errorMessage) void WinRtPackageDeploymentStep::raiseWarning(const QString &warningMessage) { - ProjectExplorer::Task task = Task(Task::Warning, warningMessage, Utils::FileName(), -1, + ProjectExplorer::Task task = Task(Task::Warning, warningMessage, Utils::FilePath(), -1, ProjectExplorer::Constants::TASK_CATEGORY_DEPLOYMENT); emit addTask(task, 1); emit addOutput(warningMessage, BuildStep::OutputFormat::NormalMessage); diff --git a/src/tools/cplusplus-shared/utils.cpp b/src/tools/cplusplus-shared/utils.cpp index 48178d7cf9..1373d5f6f9 100644 --- a/src/tools/cplusplus-shared/utils.cpp +++ b/src/tools/cplusplus-shared/utils.cpp @@ -94,7 +94,7 @@ SystemPreprocessor::SystemPreprocessor(bool verbose) QMapIterator<QString, QString> i(m_knownCompilers); while (i.hasNext()) { i.next(); - const Utils::FileName executablePath + const Utils::FilePath executablePath = Utils::Environment::systemEnvironment().searchInPath(i.key()); if (!executablePath.isEmpty()) { m_compiler = i.key(); diff --git a/src/tools/qtcreatorcrashhandler/crashhandler.cpp b/src/tools/qtcreatorcrashhandler/crashhandler.cpp index c6df3c9ad9..89ff098420 100644 --- a/src/tools/qtcreatorcrashhandler/crashhandler.cpp +++ b/src/tools/qtcreatorcrashhandler/crashhandler.cpp @@ -94,7 +94,7 @@ public: dialog(crashHandler, signalName, appName) {} const pid_t pid; - const Utils::FileName creatorInPath; // Backup debugger. + const Utils::FilePath creatorInPath; // Backup debugger. BacktraceCollector backtraceCollector; CrashHandlerDialog dialog; diff --git a/src/tools/sdktool/main.cpp b/src/tools/sdktool/main.cpp index 444752a5a4..808a2652fa 100644 --- a/src/tools/sdktool/main.cpp +++ b/src/tools/sdktool/main.cpp @@ -116,7 +116,7 @@ int parseArguments(const QStringList &args, Settings *s, // sdkpath if (current.startsWith(QLatin1String("--sdkpath="))) { - s->sdkPath = Utils::FileName::fromString(current.mid(10)); + s->sdkPath = Utils::FilePath::fromString(current.mid(10)); continue; } if (current == QLatin1String("-s")) { @@ -125,7 +125,7 @@ int parseArguments(const QStringList &args, Settings *s, printHelp(operations); return 1; } - s->sdkPath = Utils::FileName::fromString(next); + s->sdkPath = Utils::FilePath::fromString(next); ++i; // skip next; continue; } diff --git a/src/tools/sdktool/operation.cpp b/src/tools/sdktool/operation.cpp index 68bad3272d..a31e6ce271 100644 --- a/src/tools/sdktool/operation.cpp +++ b/src/tools/sdktool/operation.cpp @@ -87,7 +87,7 @@ QVariantMap Operation::load(const QString &file) QVariantMap map; // Read values from original file: - Utils::FileName path = Settings::instance()->getPath(file); + Utils::FilePath path = Settings::instance()->getPath(file); if (path.exists()) { Utils::PersistentSettingsReader reader; if (!reader.load(path)) @@ -100,14 +100,14 @@ QVariantMap Operation::load(const QString &file) bool Operation::save(const QVariantMap &map, const QString &file) const { - Utils::FileName path = Settings::instance()->getPath(file); + Utils::FilePath path = Settings::instance()->getPath(file); if (path.isEmpty()) { std::cerr << "Error: No path found for " << qPrintable(file) << "." << std::endl; return false; } - Utils::FileName dirName = path.parentDir(); + Utils::FilePath dirName = path.parentDir(); QDir dir(dirName.toString()); if (!dir.exists() && !dir.mkpath(QLatin1String("."))) { std::cerr << "Error: Could not create directory " << qPrintable(dirName.toString()) diff --git a/src/tools/sdktool/settings.cpp b/src/tools/sdktool/settings.cpp index 632173dc13..01f5120e16 100644 --- a/src/tools/sdktool/settings.cpp +++ b/src/tools/sdktool/settings.cpp @@ -47,15 +47,15 @@ Settings::Settings() : m_instance = this; // autodetect sdk dir: - sdkPath = Utils::FileName::fromString(QCoreApplication::applicationDirPath()) + sdkPath = Utils::FilePath::fromString(QCoreApplication::applicationDirPath()) .pathAppended(DATA_PATH); - sdkPath = Utils::FileName::fromString(QDir::cleanPath(sdkPath.toString())) + sdkPath = Utils::FilePath::fromString(QDir::cleanPath(sdkPath.toString())) .pathAppended(QLatin1String(Core::Constants::IDE_SETTINGSVARIANT_STR) + '/' + Core::Constants::IDE_ID); } -Utils::FileName Settings::getPath(const QString &file) +Utils::FilePath Settings::getPath(const QString &file) { - Utils::FileName result = sdkPath; + Utils::FilePath result = sdkPath; const QString lowerFile = file.toLower(); const QStringList identical = QStringList({ "android", "cmaketools", "debuggers", "devices", diff --git a/src/tools/sdktool/settings.h b/src/tools/sdktool/settings.h index dbf3481c26..b2804e9907 100644 --- a/src/tools/sdktool/settings.h +++ b/src/tools/sdktool/settings.h @@ -37,11 +37,11 @@ public: Settings(); static Settings *instance(); - Utils::FileName sdkPath; + Utils::FilePath sdkPath; Operation *operation; - Utils::FileName getPath(const QString &file); + Utils::FilePath getPath(const QString &file); private: static Settings *m_instance; |