Bug 407875 - Save/load file in KXStitch is not working properly.
Summary: Save/load file in KXStitch is not working properly.
Status: RESOLVED FIXED
Alias: None
Product: KXStitch
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Mint (Debian based) Linux
: NOR normal
Target Milestone: ---
Assignee: Steve Allewell
URL:
Keywords: accessibility, usability
Depends on:
Blocks:
 
Reported: 2019-05-23 18:07 UTC by Milan Steklý
Modified: 2019-06-02 10:32 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In: 2.2.0
Sentry Crash Report:


Attachments
Screenshot of the window which appears when I try to load a saved file. The error message: The file does not appear to be a recognized cross stitch file. (11.92 KB, image/png)
2019-05-23 18:07 UTC, Milan Steklý
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Steklý 2019-05-23 18:07:30 UTC
Created attachment 120274 [details]
Screenshot of the window which appears when I try to load a saved file. The error message: The file does not appear to be a recognized cross stitch file.

SUMMARY
Save/load file in KXStitch is not working properly.

STEPS TO REPRODUCE
1. Save the file you are working on.
2. Try to load/open it.
3. The error window (see the attachment) appears.

OBSERVED RESULT
See the attachment.

EXPECTED RESULT
To be able to save and load files.

SOFTWARE/OS VERSIONS
KXStitch 2.1.1
Comment 1 Steve Allewell 2019-05-24 23:12:22 UTC
Thanks for reporting this, I can confirm that it is happening with me too.  Oddly, the code that is failing hasn't changed in a while so I'm not sure on the cause at the moment.  I am busy investigating, but can you confirm which KDE and Qt versions you are using.

Regards
Comment 2 Steve Allewell 2019-05-25 16:48:36 UTC
I have been doing some experimenting and tried the release-2.1.0 branch (v2.1.1) and the current master branch.

OpenSuSE Leap 15.1, KDE 5.55.0, Qt 5.9.7 which works fine.

OpenSuSE Leap 15.0, KDE 5.45.0, Qt 5.9.4 which works fine.

OpenSuSE Tumbleweed, KDE 5.58.0, Qt 5.12.3 which does not work.

It seems to be something got broken somewhere, although I haven't narrowed down what that is yet.

If you can confirm which versions of KDE and Qt you have, that might help narrow it down.  I will continue investigating.

Regards
Comment 3 Steve Allewell 2019-05-26 16:37:12 UTC
Git commit f9b52573043e91c69c377727fac6951e677a1e69 by Steve Allewell.
Committed on 26/05/2019 at 16:24.
Pushed by sallewell into branch 'release-2.2.0'.

Fix file opening bug

A change in KDE/Qt has resulted in a QTemporaryFile size() of 0 after
KIO::copy_file overwrites it, previous versions show the size of the
copied file.  As such garbage was read instead of the file content.

Fixed by closing the temporary file after opening it, reopening it using
a QFile which then has the correct size.
FIXED-IN: 2.2.0

M  +39   -23   src/MainWindow.cpp

https://commits.kde.org/kxstitch/f9b52573043e91c69c377727fac6951e677a1e69
Comment 4 Milan Steklý 2019-06-01 21:11:07 UTC
So how to solve the problem as a regular user:
Comment 5 Steve Allewell 2019-06-02 10:30:00 UTC
Your options are:
1. Downgrade KDE/QT to a version that worked.
2. Clone the release-2.2.0 branch and compile that yourself.
3. Wait for the release of the 2.2.0 version and propagation through whichever package manager you use.

How do you normally get updates?
Comment 6 Steve Allewell 2019-06-02 10:32:53 UTC
If you want to try compiling yourself.

git clone --single-branch --branch release-2.2.0 git://anongit.kde.org/kxstitch

run the build.sh script.