Commit c76519a7 authored by Agata Cacko's avatar Agata Cacko
Browse files

Don't leave incorrect resource files after loading

Before this commit, KisFolderStorage wouldn't check if the
resource can be loaded after importing, so it didn't even know
that maybe it imported an incorrect file which is later
staying in the resource folder unnecessarily.
This commit adds checking for whether the resource can be loaded
immediately after copying it to the folder, and then removes it
if the resource file is incorrect.

BUG:446279
parent c5b89e89
Pipeline #120844 skipped with stage
......@@ -200,6 +200,13 @@ bool KisFolderStorage::importResource(const QString &url, QIODevice *device)
qWarning() << "Cannot open" << resourcesLocation << "for writing";
}
KoResourceSP resourceAfterLoading = resource(url);
if (resourceAfterLoading.isNull()) {
f.remove();
return false;
}
return result;
}
......
Supports Markdown
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