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/plugins/pythoneditor/pythoneditorplugin.cpp | |
| 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/plugins/pythoneditor/pythoneditorplugin.cpp')
| -rw-r--r-- | src/plugins/pythoneditor/pythoneditorplugin.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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()); |
