[Geany-devel] [PATCH 12/19] Use relative paths in the project files

Lex Trotman elextr at xxxxx
Thu Aug 5 02:48:03 UTC 2010


On 5 August 2010 09:59, Jiří Techet <techet at gmail.com> wrote:
>
> Right now projects cannot be moved to other directories without
> losing the base directory setting of the project and the list
> of open files. This makes the project totally unportable to different
> machines because even if the directory structure under your home is
> identical, the user name can be different so the path is different too.
>
> The paths should be relative to the project file, which is what
> every other IDE I know does. If you keep the project file in the
> same relative path to the project files, you can move it wherever you
> want.
>
> This patch does this in a backwards-compatible way - when the path
> in the project settings file is absolute, it uses the absoulte path.
> However, when the project is saved, all paths are converted to relative.
> This means that all new applications will be able to read the old
> project definition files but the old applications won't read
> the new files (or more precisely, the paths in them).
>
> For the global session file absolute paths are still used mainly because in
> Windows you cannot create a relative path to a different volume and the
> global settings file can be at a volume different from the project dir.
> (I don't expect anyone has the project definition file at different
> volume than the project files so this shouldn't be an issue for projects).
>
> As Dimitar suggested, absolute paths could be used for files outside
> the base directory which makes sense because the paths outside the project
> would be preserved even if the project moves somewhere else. This feature
> can be included depending on the further discussion.
>
> One more possibility is to add a settings option (either per project or
> global) that determines what kind of paths should be used.


Hi Jiri,

If I understand correctly this patch depends on the project file being
in the project tree, but that is not the Geany default.  Some people
don't like storing the project file in the project tree because it
contains an individual users session files and these shouldn't be in a
version controlled tree, imagine if you did a git commit -a.

I think this patch is a good idea, but only if the project file is in
the tree, so maybe it needs to be dependent on that preference
setting, or better still have its own preference setting so that the
user has to choose to not be backward compatible.

Cheers
Lex

>
> Signed-off-by: Jiří Techet <techet at gmail.com>
> ---
>  src/keyfile.c |   39 ++++++++++++++++++++++++++++++++++-----
>  src/keyfile.h |    2 +-
>  src/project.c |   26 +++++++++++++++++++++++---
>  3 files changed, 58 insertions(+), 9 deletions(-)
>
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>



More information about the Devel mailing list