spacr.qt.prefs

Per-user persistence of recent paths in spaCR’s canonical Qt store.

Recent paths used to live under two legacy Olafsson Lab namespaces. The first access copies their keys into QSettings("spacr", "qt") without deleting or overwriting either legacy store, so upgrades and downgrades both remain safe.

Functions

get_last_source(→ str)

Return the last folder used for a given app, or '' if unknown.

get_recent_sources(→ List[str])

Return the recent-source list (most-recent first).

push_recent_source(→ None)

Insert path at the head of the recent list and de-duplicate.

set_last_source(→ None)

Remember path as the most-recent source folder for app_key.

Module Contents

spacr.qt.prefs.get_last_source(app_key: str) → str[source]

Return the last folder used for a given app, or ‘’ if unknown.

Parameters:

app_key – the app key; the value is stored under recent/<app_key>/ in the Qt settings.

spacr.qt.prefs.get_recent_sources(app_key: str, limit: int = 8) → List[str][source]

Return the recent-source list (most-recent first).

Parameters:

app_key – the app key; the value is stored under recent/<app_key>/ in the Qt settings.

spacr.qt.prefs.push_recent_source(app_key: str, path: str, limit: int = 8) → None[source]

Insert path at the head of the recent list and de-duplicate.

Parameters:
  • app_key – the app key; the value is stored under recent/<app_key>/ in the Qt settings.

  • path – the folder to put first; an empty path is ignored. It also becomes the last source.

spacr.qt.prefs.set_last_source(app_key: str, path: str) → None[source]

Remember path as the most-recent source folder for app_key.

Parameters:
  • app_key – the app key; the value is stored under recent/<app_key>/ in the Qt settings.

  • path – the folder to remember; an empty path is ignored.