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

Lubomir I. Ivanov neolit123 at gmail.com
Mon Apr 17 14:02:09 PDT 2017


On 17 April 2017 at 23:46, Thiago Macieira <thiago at macieira.org> wrote:
> This disables the debug output for the default category, that is, every user
> of qDebug().
>

yep, i later figured that might happen.

> I was suggesting turning mDebug() into qCDebug(...).
>
> // in a header
> namespace Marble {
>     Q_DECLARE_LOGGING_CATEGORY(loggingCategory)
> }
> #define mDebug          qCDebug(Marble::loggingCategory)
>
> // in one source file
> namespace Marble {
>     Q_LOGGING_CATEGORY(loggingCategory, "marble", QtWarningMsg)
> }
>

i've tried returning a qCDebug() from mDebug, but it cannot be done.
so how can the flag MarbleDebug::isEnabled() be used then to
conditionally show debug output in Marble?

lubomir
--


More information about the subsurface mailing list