From 493917aa8450760c9c6f88c75f289f92f3755b1d Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Tue, 22 Aug 2023 12:58:18 +0200 Subject: [PATCH] itemencrypt: Fix saving empty encrypted tab --- plugins/itemencrypted/itemencrypted.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/itemencrypted/itemencrypted.cpp b/plugins/itemencrypted/itemencrypted.cpp index d9c05ef58f..63a4ece6c3 100644 --- a/plugins/itemencrypted/itemencrypted.cpp +++ b/plugins/itemencrypted/itemencrypted.cpp @@ -296,9 +296,6 @@ ItemEncrypted::ItemEncrypted(QWidget *parent) bool ItemEncryptedSaver::saveItems(const QString &, const QAbstractItemModel &model, QIODevice *file) { const auto length = model.rowCount(); - if (length == 0) - return false; // No need to encode empty tab. - QByteArray bytes; { @@ -720,7 +717,7 @@ ItemSaverPtr ItemEncryptedLoader::loadItems(const QString &, QAbstractItemModel quint64 length; stream2 >> length; - if ( length <= 0 || stream2.status() != QDataStream::Ok ) { + if ( length < 0 || stream2.status() != QDataStream::Ok ) { emitDecryptFailed(); COPYQ_LOG("ItemEncrypt ERROR: Failed to parse item count!"); return nullptr;