Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Allow saving relative paths to settings #922

Merged
merged 1 commit into from
Jul 9, 2020

Conversation

lassoan
Copy link
Member

@lassoan lassoan commented Jul 8, 2020

ctkCoreSettings allows storing paths relative to an "application home" folder. This makes it easy to create fully portable applications (that do not have absolute paths in application settings).

It will be used with this development in 3D Slicer: Slicer/Slicer#5029

@lassoan lassoan force-pushed the settings-relative-path branch 2 times, most recently from 8625ac2 to eb99c3a Compare July 9, 2020 02:04
ctkCoreSettings allows storing paths relative to an "application home" folder. This makes it easy to create fully portable applications (that do not have absolute paths in application settings).
@lassoan
Copy link
Member Author

lassoan commented Jul 9, 2020

@jcfr This is ready, please have a look. We can set ApplicationHomePlaceholder to use <APPLAUNCHER_DIR> as a basis of relative paths.

@lassoan
Copy link
Member Author

lassoan commented Jul 9, 2020

@jcfr if you don't have any further comments then I would merge this so that we can proceed with the Slicer pull request.

@jcfr
Copy link
Member

jcfr commented Jul 9, 2020

It looks good to me, thanks for address the comment.

Then, within Slicer, I suggest to update these lines by changing occurrences of:

QSettings settings(q->extensionsSettingsFilePath(), QSettings::IniFormat);

into

ctkCoreSettings settings(q->extensionsSettingsFilePath(), QSettings::IniFormat);
settings.setApplicationHomeDirectory(qSlicerCoreApplication::application()->slicerHome());
settings.setApplicationHomePlaceholder("<APPLAUNCHER_SETTINGS_DIR>");

And it look like you did so already 👍

@jcfr jcfr merged commit f0bb5d7 into commontk:master Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants