[kmymoney] [Bug 436647] Overwriting a gpg-encrypted file results in a zero byte file

Ralf Habacker bugzilla_noreply at kde.org
Sun May 9 15:41:25 BST 2021


https://bugs.kde.org/show_bug.cgi?id=436647

--- Comment #1 from Ralf Habacker <ralf.habacker at freenet.de> ---
An investigation shows that there is a problem when QTemporaryFile and
QSaveFile are used together on Windows.

For the case of creating a local gpg-encrypted file, only one KSaveFile
instance inside KMyMoneyView::saveToLocalFile()
https://github.com/KDE/kmymoney/blob/07d368edf5098cb06774a1cecc41551ce3ad43c5/kmymoney/views/kmymoneyview.cpp#L1151
was used in the 4.8 branch, which also works as expected for the case that the
file to be created already existed before.

In the 5.1 branch the procedure was changed so that in the mentioned function
first a QTemporaryFile instance is created and if the resulting file already
exists, the file name created in this way is passed to the KGPGFile instance,
which internally uses a QSaveFile instance, which in turn creates a temporary
file.

Something goes wrong with this multiple renaming or copying. If you omit the
superfluous use of the QTemporaryFile instance in the case mentioned, it works
as expected.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list