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/resourceeditor | |
parent | 4704f49fbb1201ebf10ab9dbaed0275ff25faba8 (diff) |
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/resourceeditor')
-rw-r--r-- | src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 2 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.cpp | 2 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorw.cpp | 8 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorw.h | 2 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.cpp | 16 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.h | 6 |
6 files changed, 18 insertions, 18 deletions
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; |