Open KusakabeShi opened 6 months ago
For the issue 3 Can't access boot/flash files at the app initialize. It turnd red if I close and restart the app.
, this only happens if I have multiple profiles/kits, like this:
Everytime I restart the whole app, the boot1 and flash becomes red and unavailable, I have to select it again.
It seems the file selector makes a copy of the selected to the tmp
folder, and both file are called boot1 and they overwrite it each other. That's why it behaves weird if I have multiple kits with flash/boot files with same filename.
And it explains why the "Save" function not works. It saved to the copy in the tmp
folder, but while I reselect the flash file, the changes got lost.
This is my assumption, all issues above are caused by one reason: tmp folder.
The file selector doesn't "select" a file, it copy the file to tmp folder instead. So any write operation are operates to the tmp file, the real file doesn't affected.
And the tmp file got removed somehow by some iOS cleanup mechanism, that causes boot/flash turns to red and asks users to select again. Meanwhile lost all change to the flash.
A potential fix may adding UIFileSharingEnabled
and LSSupportsOpeningDocumentsInPlace
to Info.plist
Once developer enable this, you can open Files app, navigate to the "On My iPhone" section and if you have any files inside Documents directory, you will se directory with your app name with these files inside.
Asks users to place image and flash and snapshot in it.
And then write a simple GUI allow users select the file in Document folder. Or put a textbox to ask users type the file path directly(relation path from Document folder) instead of using a file selector.
A potential fix may adding
UIFileSharingEnabled
andLSSupportsOpeningDocumentsInPlace
toInfo.plist
Well the first one is already there in https://github.com/nspire-emus/firebird/blob/master/Info.plist#L58-L59
I suppose we could try adding the other one...
According to this thread: https://stackoverflow.com/questions/66678061/why-does-uifilesharingenabled-lssupportsopeningdocumentsinplace-behave-like-ui
If you want to expose the Documents folder of an iOS app in iTunes/Music, you need to set
UIFileSharingEnabled
in yourInfo.plist
file.If you want to expose the Documents folder in the Files app in iOS, you need to set
UISupportsDocumentBrowser
in yourInfo.plist
file.If you set both, you expose it both ways.
Finally, if you set
UISupportsDocumentBrowser
in yourInfo.plist
file, you can also setLSSupportsOpeningDocumentsInPlace
in case you want to directly work with the original files, which means you have to explicitly coordinate file access. Without that flag you are working with copies.
It seems the UISupportsDocumentBrowser
+ LSSupportsOpeningDocumentsInPlace
is enough, a simple GUI to allow users to select files in Document folder is unnecessary.
By the way, the "Save file" GUI are basically unuseable. It would be better if we can rewrite a GUI for that. Even a textbox allows user to fill a file path(relative to Document folder) will better than current one I think.
Any progress on adding UISupportsDocumentBrowser
/ LSSupportsOpeningDocumentsInPlace
to the Info.plist
?
Not really, I haven't taken the time to do any firebird testing on iOS anymore, just macOS I guess. If you can test it and it works, feel free to make a PR and it can be merged.
(This won't solve the UI picker issues though, but that's more on the Qt side itself anyway)
Flash and snapshot saved
, but actually not. The md5sum of the flash files are not changed.