RFC: Krita "Install Path" location on Android

Sharaf Zaman shzam at sdf.org
Mon Nov 14 09:58:04 GMT 2022


Hello everyone!

I recently learned that `cf3f1d162f8f2a53be7791906f435d8c0501247d' broke a
couple of things on Android (my fault to not be careful when an MR was created).
But fortunately, this doesn’t happen for most users (since bugs only surface
once you change the resource location).

There are a couple of bugs that I want to discuss, one during the meeting and
one over the mailing list to get a proper opinion about this.

*The Bug*:

One of the bug we have is, when the user changes resource location and restarts
Krita. The resource paths that use `KoResourcePaths::cleanup()' in its code
paths don’t get installed. Reason being cleanup is supposed to skip the resource
paths that start with default path (`QStandardPaths::AppDataLocation') but if
and only if the user resource path has been changed.

Now on Android, the default resource location points to something like this:

`/storage/self/primary/Android/data/org.krita/files' – which is good. But the
install location points to
`/storage/self/primary/Android/data/org.krita/files/share' which if we look at
the logic of cleanup gets skipped because of the `startsWith' clause.

┌────
│ static QStringList cleanup(const QStringList &pathList)
│ {
│     // [...]
│     const QString writableLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
│ 
│     // [...]
│     //                                   v HERE
│         if (getRidOfAppDataLocation && cleanPath.startsWith(writableLocation)) {
│             continue;
│         }
│         cleanedPathList << cleanPath;
│     }
│     return cleanedPathList;
│ }
└────

Resulting in resources not getting installed… *So my question is*, if we change
the “Install Location” to an inaccessible location [1] what would the
consequences be?

The other option is to create different directories in
`/storage/self/primary/Android/data/org.krita/files' for install and the user
config. But since the user-config gets installed in `files/' itself we may have
a problem where user would lose their configs (unless we also provide a way to
move the resources to the new location in this particular case).

Deciding which one would solely depend on if there is a use-case to having
Install Location be an accessible location? Is there any?

[1]: This path is something which user wouldn’t be able to view or copy or
access from external apps. This path can only be seen by Krita and will be setup
when the app is installed/updated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20221114/13c48dea/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot_20221114-153454_My Files.jpg
Type: image/jpeg
Size: 62901 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20221114/13c48dea/attachment-0001.jpg>


More information about the kimageshop mailing list