toga icon indicating copy to clipboard operation
toga copied to clipboard

Local app config for Linux

Open cyphase opened this issue 7 months ago • 6 comments

Refactored tests to respect XDG app path customization, and added the functionality for the GTK backend while marking it as not implemented on the other backends.

This fixes the problem of Linux users not having their app files stored in the place they've configured.

Fixes (partially) #2867 (since that mentions Windows as well).

PR Checklist:

  • [x] All new features have been tested
  • [x] All new features have been documented
  • [x] I have read the CONTRIBUTING.md file
  • [x] I will abide by the code of conduct

cyphase avatar May 21 '25 21:05 cyphase

Does this need any documentation beyond the changenote?

cyphase avatar May 22 '25 21:05 cyphase

I'm sure this is on Russell's radar...but as a doublecheck: while I agree this is a bugfix, I would also consider it a candidate for the Backward Incompatible Changes changelog section.

rmartin16 avatar May 22 '25 21:05 rmartin16

Does this need any documentation beyond the changenote?

I'd say it's worth adding a platform note to the app paths docs. That page doesn't have a notes section at present, but a lot of other widgets have a Notes section to capture "platform quirks" and things like that (see MapView for one example).

As @rmartin16 notes - it's probably worth a removal note as well, as it could potentially break existing apps where users have saved data in a non-XDG location.

freakboy3742 avatar May 22 '25 21:05 freakboy3742

I've been thinking for the past week that today might be the day I could get back to this and finish it up, but some work things intervened. It's still very much my intention to finish this ASAP.

I haven't taken the coin out of the sleeve, or looked at it since I got back. Not until I properly earn it. :laughing:

cyphase avatar Jun 03 '25 04:06 cyphase

I've updated this and it's almost ready to merge. One of the failing checks is a spelling issue I've already fixed locally (I added "config" to the word list).

The other three failing checks are because the GTK tests are testing different app paths, which is conflicting with the caching of app paths introduced in #3544 / #3669 (cc: @HalfWhitt ).

It seems that we can either remove the caching, which is a pretty minor optimization, or add some ability to clear the cache. Thoughts?

cyphase avatar Sep 12 '25 22:09 cyphase

It seems that we can either remove the caching, which is a pretty minor optimization, or add some ability to clear the cache. Thoughts?

The @cache decorator should provide that, i.e. Paths.config_path.clear_cache(). (Note that this is accessing via the class Paths, not the instance app.paths.)

I'm not currently at a computer to verify that works; it's possible I'm overlooking some detail of how exactly to properly access the function that's wrapped by the property...

HalfWhitt avatar Sep 13 '25 05:09 HalfWhitt