No data is not an error
This commit is contained in:
parent
f5fa5b811a
commit
683fe9657d
3 changed files with 1 additions and 7 deletions
|
@ -86,7 +86,7 @@ void PaletteWorkspaceSetup::setup()
|
|||
auto loadData = [this]() {
|
||||
RetVal<QByteArray> data = workspacesDataProvider()->rawData(DataKey::Palettes);
|
||||
PaletteTreePtr tree;
|
||||
if (data.ret) {
|
||||
if (data.ret && !data.val.isEmpty()) {
|
||||
LOGD() << "there is palette data in the workspace, we will use it";
|
||||
ByteArray ba = ByteArray::fromQByteArrayNoCopy(data.val);
|
||||
tree = readPalette(ba);
|
||||
|
|
|
@ -71,11 +71,6 @@ RetVal<QByteArray> Workspace::rawData(const DataKey& key) const
|
|||
return RetVal<QByteArray>(make_ret(Err::NotLoaded));
|
||||
}
|
||||
|
||||
QByteArray data = m_file.data(key_to_string(key));
|
||||
if (data.isEmpty()) {
|
||||
return RetVal<QByteArray>(make_ret(Err::NoData));
|
||||
}
|
||||
|
||||
RetVal<QByteArray> rv;
|
||||
rv.ret = make_ret(Ret::Code::Ok);
|
||||
rv.val = m_file.data(key_to_string(key));
|
||||
|
|
|
@ -31,7 +31,6 @@ enum class Err {
|
|||
UnknownError = int(Ret::Code::WorkspaceFirst),
|
||||
|
||||
NotLoaded = 1502,
|
||||
NoData = 1503,
|
||||
|
||||
FailedPack = 1510,
|
||||
FailedUnPack = 1511,
|
||||
|
|
Loading…
Reference in a new issue