← Back to team overview

kicad-developers team mailing list archive

Re: PATCH: Compare project paths at load, not inodes

 

Good catch!  I committed your patch in product branch r6292.  Thanks.

On 10/31/2015 12:45 PM, Chris Pavlina wrote:
> Assuming: a project exists in /a/b/project.pro, and /a/b is symlinked to /a/c
> 
> 1. Load /a/b/project.pro
> 2. Load /a/c/project.pro
> 
> Expectation: filename switches to /a/c/project.pro (even though they are the same file, a user would expect the path to reflect the file selection he just made)
> 
> Reality: filename does not switch
> 
> This is because PROJECT::SetProjectFullName does not do anything if the path is not changed, and it uses wxFileName::SameAs to check this. For some bizarre reason, wxFileName::SameAs compares filesystem inodes rather than actual paths.
> 
> This patch instead creates a second wxFileName from the candidate name in order to normalize the path, and then compares paths directly. IMO this should be much more in line with what a user would expect.


References