Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Standard conforms config- and userdata-paths - Patch(es) to test
Jenna:
On linux we still use config and user-data paths, that are not standard-conform.
These patches move the C::B config-files from "~/.codeblocks" to "~/.config/codeblocks" and the user-data from "~/.codeblocks/share" to "~/.local/share/codeblocks".
The "UserTemplates"-folders is kept in the config-folder, not in the user-data-folder. It's easier to use cross-platform this way (less "#ifdef"'s) and I'm not absolutely sure where they really belong.
The patch is not tested on Mac, but seems to work on windows.
I attach a 7zipped-file that includes 6 patches:
patch_1.diff ... patch_5.diff and an all-in-one patch (patch.diff).
The description of the patches:
--- Quote ---patch_1.diff:
- Do not use data_path_global for user-data when C::B starts in portable mode.
It's not portable to have user-data in global-path and (what's more) the global-data-path is not user-writable on linux (and Mac?).
Instead keep the user-data in the exe-path (as the config-files.
patch_2.diff:
- BrowseTracker-plugin: use ConfigManager do determine the config-folder.
It's better maintainable and should work correct after last commit.
And it does not (try to) write the conf-file in the root-folder with new personalities.
patch_3.diff:
- CodeSnippets-plugin: use ConfigManager do determine the config-folder.
It's better maintainable and should work correct after last commit.
patch_4.diff:
- DoxyBlocks-plugin: use ConfigManager do determine the config-folder.
It's better maintainable and should work correct after last commit.
And it does not (try to) write the conf-file in the root-folder with new personalities.
patch_5.diff:
- Linux: Use standard-conform paths for config- and data-folders.
Use glib to determine the paths, as wxWidgets still can not do this.
All platforms: move UserTemplates into share/codeblocks to have the same layout on all platforms.
The old config and usewr-data folders are moved to the correct place (after a hint).
--- End quote ---
The patches have to be applied in the correct order.
Alternatively you can use the all-in-one-patch.
The single patches might be used to inspect the changes more easily.
Please test and give feedback, especially tests on Mac would be fine, because the the portable stuff has slightly changed: if the main config-file is found besides the executable, the user-data folder should always be there and not in the global-data-folder.
oBFusCATed:
Are there patches supposed to be applied with git am?
Jenna:
--- Quote from: oBFusCATed on January 31, 2015, 09:27:24 pm ---Are there patches supposed to be applied with git am?
--- End quote ---
I never used git am and the patches are normal git diffs, but they are overworked with a script to make them (tortoise-)svn compatible.
That's why the git-part is at the top of the files.
oBFusCATed:
OK... Is there any particular reason for using glib function instead of wxStandardPathsBase::GetDocumentsDir()?
Jenna:
--- Quote from: oBFusCATed on January 31, 2015, 09:33:17 pm ---OK... Is there any particular reason for using glib function instead of wxStandardPathsBase::GetDocumentsDir()?
--- End quote ---
GetDocumentsDir() just returns the users home-folder.
If we use this we have to construct the complete folder-names ourselves.
The glib-functions return the correct paths directly and what's more, they should be aware of env-vars that change the default foldernames.
See: https://developer.gnome.org/glib/stable/glib-Miscellaneous-Utility-Functions.html#g-get-user-config-dir and http://standards.freedesktop.org/basedir-spec/latest/ .
Navigation
[0] Message Index
[#] Next page
Go to full version