[Qgis-developer] finding custom svg from project file assumes only on level of directories under SvgPath

Gabriele Monfardini gabrimonfa at gmail.com
Thu Mar 22 13:04:13 EDT 2012


Hi all,

I've probably found a bug in using a custom svg for symbology.
I've tested it in 1.7.4 and master.

In order to use a custom svg file I've dropped it into
~homedir/.qgis/svg/<custom_directory>/<custom_subdirectory>

I'm able to use the svg both with 1.7.4 and with master.
I see it in the list of svgs, I can select it and it is drawn
correctly, its path is correctly saved in project file (1.7.4
version).

However reopening the project qgis 1.7.4 is not able to find the file,
resulting in

"Warning: QFSFileEngine::open: No file name specified
Warning: Cannot open file '', because: No file name specified"


<custom_directory> = custom
<custom_subdirectory> = ctr

Also master code is not able to find svg, and Debug version log the
following lines

Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 798:
(symbolNameToPath) SvgPath: /usr/local/share/qgis/svg/
Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 804:
(symbolNameToPath) Alternative svg path:
/usr/local/share/qgis/svg//ctr/0706.svg
Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 827:
(symbolNameToPath) Computed alternate path but no svg there either
Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 798:
(symbolNameToPath) SvgPath: /home/monfardini/.qgis//svg/
Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 804:
(symbolNameToPath) Alternative svg path:
/home/monfardini/.qgis//svg//ctr/0706.svg <--
Debug: src/core/symbology-ng/qgsmarkersymbollayerv2.cpp: 827:
(symbolNameToPath) Computed alternate path but no svg there either

The directory "custom" has been wiped from the path (it should be
/home/monfardini/.qgis//svg/custom/ctr/0706.svg instead of
/home/monfardini/.qgis//svg//ctr/0706.svg)

so it appears that code assumes only one level of directories under SvgPath

I've opened the following bug: http://hub.qgis.org/issues/5222

Regards,

Gabriele


More information about the Qgis-developer mailing list