[Marble-devel] Review Request 123866: Add KmlLabelTagWriter
Dennis Nienhüser
earthwings at gentoo.org
Sat May 23 17:00:02 UTC 2015
> On May 22, 2015, 7:17 p.m., Constantin Mihalache wrote:
> > src/lib/marble/geodata/writers/kml/KmlLabelStyleTagWriter.cpp, line 39
> > <https://git.reviewboard.kde.org/r/123866/diff/2/?file=370442#file370442line39>
> >
> > Handling color defaults in KmlColorStyleTagWriter may not be working right because each style tag can have a different default.
> >
> > Even if isEmpty() is never called for any LabelStyleTag, they are all written to .kml.
> >
> > As I see things, this can be solved, either by checking in KmlColorStyleTagWriter for each "nodeType" defaults, or by handling color in each StyleTagWriter.
> >
> > Could you please advise further implementation ?
> >
> > **Unit Test **
> > ListStyleTest1.kml (FAIL) <- the file doesn't have any <LabelStyle> tags, but <LabelStyle> tags are written to .kml after loading.
Indeed, good catch. I'd suggest to add another protected virtual method to KmlColorStyleTagWriter with a signature of
`virtual QColor defaultColor() const;`
It can have a default implementation in KmlColorStyleTagWriter.cpp where it returns QColor( Qt::white ), and KmlLabelStyleTagWriter can overwrite it and return QColor( Qt::black ). Then change KmlColorStyleTagWriter::write to use that method (together with formatColor()) instead of using the hardcoded "ffffffff".
- Dennis
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123866/#review80741
-----------------------------------------------------------
On May 22, 2015, 5:24 p.m., Constantin Mihalache wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123866/
> -----------------------------------------------------------
>
> (Updated May 22, 2015, 5:24 p.m.)
>
>
> Review request for Marble.
>
>
> Repository: marble
>
>
> Description
> -------
>
> Implemented the KmlLabelTagWriter which is useful for writing styles for TextAnnotations.
>
>
> Diffs
> -----
>
> src/lib/marble/geodata/CMakeLists.txt fe22e24
> src/lib/marble/geodata/writers/kml/KmlLabelStyleTagWriter.h PRE-CREATION
> src/lib/marble/geodata/writers/kml/KmlLabelStyleTagWriter.cpp PRE-CREATION
>
> Diff: https://git.reviewboard.kde.org/r/123866/diff/
>
>
> Testing
> -------
>
> It works as expected.
>
>
> Thanks,
>
> Constantin Mihalache
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20150523/d5aa1e4b/attachment-0001.html>
More information about the Marble-devel
mailing list