Bug 450832 - Can't save anything with Flatpak packaging
Summary: Can't save anything with Flatpak packaging
Status: RESOLVED UPSTREAM
Alias: None
Product: Skanpage
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Stippich
URL: https://bugreports.qt.io/browse/QTBUG...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-25 16:55 UTC by Nate Graham
Modified: 2022-03-03 19:05 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2022-02-25 16:55:38 UTC
I am working on packaging Skanlite for Flathub, and I'm running into the following issue with both 1.0 version and current git master:

STEPS TO REPRODUCE
1. Scan one or more documents
2. Click "Save"
3. In the file dialog, navigate to some location, type a filename, and click on the "Save" button

OBSERVED RESULT
The file dialogs closes, and main window shows a small message saying, "Nothing to save."

EXPECTED RESULT
The file is saved.

ADDITIONAL INFORMATION
Does not affect non-Flatpak version of the 1.0 release or current git master.

You can see my draft Flatpak manifest here: https://github.com/Pointedstick/flathub/blob/skanpage/org.kde.skanpage.json
Comment 1 Nate Graham 2022-02-25 17:13:37 UTC
I mean Skanpage, of course. The names are so similar that I always mix them up!
Comment 2 Alexander Stippich 2022-02-26 10:28:16 UTC
Well, I have zero experience with flatpaks, so I don't know what's going on.
The message is displayed in https://invent.kde.org/utilities/skanpage/-/blob/master/src/DocumentSaver.cpp at line 29.
Means that either the specified fileUrl for saveing is empty or the document contains no actual pages.
Since the scanning seems to be working, I guess it's the first.
Comment 3 Nate Graham 2022-02-28 22:11:12 UTC
OK, I will dig into it a bit soon. Probably a weird interaction with the XDG save portal that provides the file URL.
Comment 4 Nate Graham 2022-03-03 16:20:09 UTC
After some qWarning()/console.log() debugging, I've discovered that FileDialog in MainWindow.qml fails to set `fileUrl` after it's been accepted. This workes outside of a Flatpak, but fails within it, and I am starting to fear that this is a Qt bug.
Comment 5 Nate Graham 2022-03-03 19:05:11 UTC
Filed https://bugreports.qt.io/browse/QTBUG-101437 to track this.

There's a chance it's an issue in our KDE desktop portal implementation rather than in Qt, but I don't understand enough about how these pieces interact to figure that out. CCing Jan Grulich who is more familiar.