[Panel-devel] Background painting bug

Aaron J. Seigo aseigo at kde.org
Mon Sep 17 22:58:01 CEST 2007


On Monday 17 September 2007, Petri Damsten wrote:
> On Friday 07 September 2007 08:44:43 Aaron J. Seigo wrote:
> > so if you have
> > some code you could share to demonstrate a different approach, that'd be
> > great =)
>
> This class could be used as temporary solution. It only reads svg tag from
> the start and parses it with simple QRegExp. e.g.:
>
>     SvgInfo svgInfo("/home/damu/kde4/src/testing/svginfo/clock.svg");
>
>     kDebug() << svgInfo["width"] << "x" << svgInfo["height"];
>     kDebug() << svgInfo["inkscape:version"];
>     kDebug() << svgInfo["plasma:stretch-borders"];
>
> Petri

a) i don't like the idea of processing the file twice. i suppose i should ask 
for processing times, but text processing is not exactly cheap and we use a 
lot of svg data ...

b) your regular expression will break if there is an escaped quote or '>' in 
the svg tag info. really, this should be using the new xml stream parsing 
stuff in Qt4 (i'm using it in the configxml class, iirc) since it's correct, 
memory friendly and rather fast.

best is for this to be added to QSvgDocument so it can grab these values in 
the process of parsing the XML the first time around ... i'm going to see if 
this can be done; in the meantime we have a workaround.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20070917/36f617fe/attachment.pgp 


More information about the Panel-devel mailing list