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

Stefan Fuchs sfuchs at gmx.de
Mon Apr 17 12:20:07 PDT 2017


Hello Lubomir,

Am 17.04.2017 um 21:01 schrieb Lubomir I. Ivanov:
> your best bet is to change the function to this:
>
> QDebug mDebug()
>  {
>     return QDebug( QtDebugMsg ); // or "return qDebug();"
> }
>
> which will essentially enable debug output for everything in Marble,
> until we write a dummy Class with an overloaded << operator to void
> all the incoming debug calls.
Yes, agreed. I did this already once before following your suggestion
and I now did it again in a little different way by enabling a line Dirk
recently added in MarbleDebug.cpp:

namespace Marble
{
bool MarbleDebug::m_enabled = true;
// bool MarbleDebug::m_enabled = false;

Even with my limited skills I can guess that will give the same result.
And yes: In both cases no more crashes.
And yes: I see lot's of marble debug output now if I start under windows
from the PowerShell.


But still two questions, one maybe stupid:
- Why could it be that eventually in Marble FileLoader::run every ~10th
startup the "different" branch including line 138 is executed? Does this
happen unintentionally? This is executed for d->m_contents.isEmpty()==true.
- Can this change also go into Dirks Subsurface-marble branch? Maybe
also other users are affected?

Best regards
Stefan

-- 

Stefan Fuchs
E-Mail: sfuchs at gmx.de <mailto:sfuchs at gmx.de>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20170417/85730579/attachment.html>


More information about the subsurface mailing list