gcompris / GCompris-qt

GCompris in Qt Quick - Mirror of https://invent.kde.org/education/gcompris
218 stars 167 forks source link

Sync configuration #257

Closed qoheniac closed 4 years ago

qoheniac commented 4 years ago

I would like to sync the configuration across devices, but it seems like cachePath and userDataPath only work with absolute paths, or am I missing something?

petitlapin commented 4 years ago

Hi,

thank you for the report. I'm not sure to understand the question.

1) Which kind of synchronisation? Do they share a shared folder or "cloud" synchronisation?

For now, the configuration file is stored under QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation) + "/gcompris/" + GCOMPRIS_APPLICATION_NAME + ".conf"

The data are stored under: QCoreApplication::applicationDirPath() + '/' + QString(GCOMPRIS_DATA_FOLDER) + "/rcc/", "value stored in [Admin]/cachePath of the gcompris.conf file", QStandardPaths::writableLocation(QStandardPaths::CacheLocation), "assets:", QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + '/' + GCOMPRIS_APPLICATION_NAME

For the configuration file itself, an idea could be to create a first config file that we always read in the cache file that would contain the path to the "shared" configuration file if needed (a redirection).

Or 2) are you talking about updating the configuration file [Admin]/cachePath and [Admin]/userDataPath with values that are on the network?

Johnny

qoheniac commented 4 years ago

Thank you for your reply! I only tried to move the configuration file to a location that is synced with a cloud storage (in my case Nextcloud) and leave a symbolic link at the original location. The problem with this is that cachePath and userDataPath contain absolute paths, so something like /home/user1/... while I would need /home/user2/... on the other device. So I tried values like ~/... or $HOME/... which did not work.

For the configuration file itself, an idea could be to create a first config file that we always read in the cache file that would contain the path to the "shared" configuration file if needed (a redirection).

So you mean a second optional configuration file that would overwrite values from the first one, so I could put all the options I like to sync in there? That would be nice as I actually do not even want to sync those path settings causing the problems, but they just happen to also be in that one configuration file and thus get synced too.

EDIT: I decided to use chezmoi and it works so well that I think there is no reason to do this in any other way. I think this issue can be closed.

petitlapin commented 4 years ago

Great, thanks for the discovery :)