[QGIS-trac] Re: [Quantum GIS] #2433: Fix relative paths from absolute-with-symlinks

Quantum GIS qgis at qgis.org
Thu Feb 11 19:44:54 EST 2010


#2433: Fix relative paths from absolute-with-symlinks
---------------------------------------------+------------------------------
        Reporter:  strk                      |         Owner:  nobody       
            Type:  patch                     |        Status:  new          
        Priority:  minor: annoyance          |     Milestone:  Version 1.5.0
       Component:  Project Loading / Saving  |       Version:  HEAD         
      Resolution:                            |      Keywords:               
Platform_version:                            |      Platform:  Debian       
        Must_fix:  No                        |   Status_info:  1            
---------------------------------------------+------------------------------
Changes (by jef):

  * status_info:  0 => 1
  * component:  Build/Install => Project Loading / Saving

Comment:

 What's the point in using two different paths to the same directory in one
 project?

 If you use the same path for both the datasources and the project, you
 already get what you want - whether or not the path includes a symlink.

 If different paths are used, it might be even to get exactly this
 behavior.

 Moreover canonicalPath() only works on existing files and (some?) GRASS
 data sources have paths that only exist partly - and the patch would clear
 those.  This one wouldn't:

 {{{
 Index: src/core/qgsproject.cpp
 ===================================================================
 --- src/core/qgsproject.cpp     (revision 12928)
 +++ src/core/qgsproject.cpp     (working copy)
 @@ -1409,6 +1409,9 @@
    }

    QString srcPath = src;
 +  QFileInfo fi( srcPath );
 +  if ( fi.exists() )
 +    srcPath = fi.canonicalFilePath();
    QString projPath = fileName();

  #if defined( Q_OS_WIN )
 }}}

 Still IMHO that patch is unnecessary and might even be counter productive.

-- 
Ticket URL: <https://trac.osgeo.org/qgis/ticket/2433#comment:1>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list