qgis/Quantum-GIS — pull request #644 by olivierdalang (2013-06-09 20:51:13+00:00)
Title: [SVG Library] retro compatibility for project files

Hi !

As posted on the dev mailing list ( http://osgeo-org.1560.x6.nabble.com/many-SVG-symbols-disappeared-tp5051296p5058817.html ), this pull requests tries to solve the problem for opening 1.8 projects under 2.0 in regards of the modified SVG library.

**Please don't merge it** without serious review (and answers to the following questions), since I'm not familiar at all with QgsProjectFileTransform, nor with how SVG search paths work, and am globally not sure that the strategy is OK.

**Here's what it does :**

1. Installation
It creates a new "svg_deprecated" folder containing all original 1.8's symbols (alongside the normal "svg" folder, right in the installation root)

2. Project file conversion
In the QgsProjectFileTransform::transform1800to1900() method, it updates the svg paths.
If the path starts with a "/" (which seems to correspond to the svg folder path), it prepends "QGIS_PREFIX_PATH/svg_deprecated"
If not, it does nothing (since it's an absolute path)

**Questions :**

1. Is it always right that a path starting with a "/" is a file inside the QGIS's svg folder ? (I never used SVGs search paths, if such a thing exists in 1.8)
2. Is it okay to refer to the deprecated folder using an absolute path ( starting with QGIS_PREFIX_PATH ) ? I tried to prepend "/../svg_deprecated" instead, but with no success... (using absolute path has the major disadvantage of making the project file unportable). Any idea ?
3. The file paths for SVGs in the print composer are absolute... So they still link to the 1.8 installation's svg folder. This works, but only until the user uninstalls 1.8... Is that OK ?
4. Are there other places where SVGs from the library can appear in QGIS 1.8's projects ? (I've thought of SvgMarker, SVGFill and as images in the print composer)
5. Is the transform1800to1900() method the right place to do this ? Or should it be in a transform1800to2000() or transform1900to2000() method ?