[PATCH] MarbleDebug: don't use a class extending QIODevice as a null device

Lubomir I. Ivanov neolit123 at gmail.com
Tue Apr 18 06:54:17 PDT 2017


On 18 April 2017 at 16:47, Stefan Fuchs <sfuchs at gmx.de> wrote:
> Hello Lubomir,
>
> Am 18.04.2017 um 13:22 schrieb Lubomir I. Ivanov:
>
> here are the updated Marble files and a patch diff for review.
> i can't build Marble to test these changes ATM though.
>
> Looks good, so long as "Marble::category" isn't too generic a name.
>
> ok, i've renamed it to Marable::loggingCategory.
>
> Stefan, could you please try building and running the attached patch?
> you can toggle the debugging with MarbleDebug::setEnabled(true/false)
> e.g. from the Subsurface source code.
>
> Sorry, I'm once again lost...
> I have multiple compile issues like this:
>
> /home/stefan/Entwicklung/Subsurface/marble-source/src/lib/marble/geodata/data/GeoDataPolygon.cpp:
> In member function 'virtual void Marble::GeoDataPolygon::pack(QDataStream&)
> const':
> /home/stefan/Entwicklung/Subsurface/marble-source/src/lib/marble/geodata/data/GeoDataPolygon.cpp:174:16:
> error: no match for call to '(QDebug) ()'
>          mDebug() << "innerRing: size" << p()->inner.size();
>
> Also for:
> https://github.com/Subsurface-divelog/marble/blob/Subsurface-branch/src/lib/marble/geodata/data/GeoDataVec2.cpp#L56
> https://github.com/Subsurface-divelog/marble/blob/Subsurface-branch/src/lib/marble/geodata/data/GeoDataMultiTrack.cpp#L115
> and many others.
>
> But all these files do
> #include "MarbleDebug.h"
>

i must admit i followed Thiago's suggestions blindly.
Thiago, do you have an idea why this happens?

the macro:
#define mDebug qCDebug(Marble::loggingCategory)

expands calls like this one:
mDebug() << "innerRing: size" << p()->inner.size();

to:
qCDebug(Marble::loggingCategory)() << "innerRing: size" << p()->inner.size();

is it complaining about the extra()?

lubomir
--


More information about the subsurface mailing list