Commit ea2bb656 authored by Tobias Hunger's avatar Tobias Hunger

ResourceNode: Update to new ResourceFile::load return value

Change-Id: I8900225ecf4c69be7f9b6983edeb4cfdfebc0b77
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent fef9d7ff
......@@ -71,7 +71,7 @@ static bool addFilesToResource(const Utils::FileName &resourceFile,
*notAdded = filePaths;
ResourceFile file(resourceFile.toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
int index = file.indexOfPrefix(prefix, lang);
......@@ -226,7 +226,7 @@ bool ResourceTopLevelNode::removeFiles(const QStringList &filePaths, QStringList
bool ResourceTopLevelNode::addPrefix(const QString &prefix, const QString &lang)
{
ResourceFile file(path().toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
int index = file.addPrefix(prefix, lang);
if (index == -1)
......@@ -241,7 +241,7 @@ bool ResourceTopLevelNode::addPrefix(const QString &prefix, const QString &lang)
bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &lang)
{
ResourceFile file(path().toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
for (int i = 0; i < file.prefixCount(); ++i) {
if (file.prefix(i) == prefix
......@@ -259,7 +259,7 @@ bool ResourceTopLevelNode::removePrefix(const QString &prefix, const QString &la
bool ResourceTopLevelNode::removeNonExistingFiles()
{
ResourceFile file(path().toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
QFileInfo fi;
......@@ -352,7 +352,7 @@ bool ResourceFolderNode::removeFiles(const QStringList &filePaths, QStringList *
if (notRemoved)
*notRemoved = filePaths;
ResourceFile file(m_topLevelNode->path().toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
int index = file.indexOfPrefix(m_prefix, m_lang);
if (index == -1)
......@@ -376,7 +376,7 @@ bool ResourceFolderNode::removeFiles(const QStringList &filePaths, QStringList *
bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newFilePath)
{
ResourceFile file(m_topLevelNode->path().toString());
if (!file.load())
if (file.load() != Core::IDocument::OpenResult::Success)
return false;
int index = file.indexOfPrefix(m_prefix, m_lang);
if (index == -1)
......@@ -398,7 +398,7 @@ bool ResourceFolderNode::renameFile(const QString &filePath, const QString &newF
bool ResourceFolderNode::renamePrefix(const QString &prefix, const QString &lang)
{
ResourceFile file(m_topLevelNode->path().toString());
if (!file.load())
if (file.load() == Core::IDocument::OpenResult::Success)
return false;
int index = file.indexOfPrefix(m_prefix, m_lang);
if (index == -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment