drop compile-time options to disable debug and warning output

such type of messages can still be filtered by installing message handler

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-12 03:11:56 +02:00
parent 523b62b6df
commit 3545b69f28
7 changed files with 56 additions and 108 deletions

View file

@ -633,7 +633,6 @@ katie_generate_obsolete(QMutableStringListIterator QtCore qstringlist.h)
katie_generate_obsolete(QMutableVectorIterator QtCore qvector.h)
katie_generate_obsolete(QMutexLocker QtCore qmutex.h)
katie_generate_obsolete(QNetworkAddressEntry QtNetwork qnetworkinterface.h)
katie_generate_obsolete(QNoDebug QtCore qdebug.h)
katie_generate_obsolete(QObjectData QtCore qobject.h)
katie_generate_obsolete(QObjectList QtCore qobject.h)
katie_generate_obsolete(QPaintEngineState QtGui qpaintengine.h)

View file

@ -91,7 +91,6 @@ include/katie/QtCore/QMutableStringListIterator
include/katie/QtCore/QMutableVectorIterator
include/katie/QtCore/QMutex
include/katie/QtCore/QMutexLocker
include/katie/QtCore/QNoDebug
include/katie/QtCore/QObject
include/katie/QtCore/QObjectCleanupHandler
include/katie/QtCore/QObjectData

View file

@ -54,7 +54,6 @@ incmap = {
'QMutableStringListIterator': 'qstringlist.h',
'QMutableVectorIterator': 'qvector.h',
'QMutexLocker': 'qmutex.h',
'QNoDebug': 'qdebug.h',
'QObjectData': 'qobject.h',
'QObjectList': 'qobject.h',
'QPersistentModelIndex': 'qabstractitemmodel.h',

View file

@ -391,7 +391,6 @@ classlist = [
"QNetworkInterface",
"QNetworkReply",
"QNetworkRequest",
"QNoDebug",
"QObject",
"QObjectCleanupHandler",
"QObjectData",

View file

@ -155,7 +155,6 @@
// #cmakedefine QT_NO_UNDOSTACK
// #cmakedefine QT_NO_VALIDATOR
// #cmakedefine QT_NO_VECTOR4D
// #cmakedefine QT_NO_WARNING_OUTPUT
// #cmakedefine QT_NO_WIZARD
// #cmakedefine QT_NO_XMLSTREAM
// #cmakedefine QT_NO_XMLSTREAMREADER

View file

@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE
\ingroup tools
The QFlags<Enum> class is a template class, where Enum is an enum
type. QFlags is used throughout Qt for storing combinations of
type. QFlags is used throughout Katie for storing combinations of
enum values.
The traditional C++ approach for storing OR-combinations of enum
@ -89,7 +89,7 @@ QT_BEGIN_NAMESPACE
enum value can be OR'd with any other enum value and passed on to
a function that takes an \c int or \c uint.
Qt uses QFlags to provide type safety. For example, the
Katie uses QFlags to provide type safety. For example, the
Qt::Alignment type is simply a typedef for
QFlags<Qt::AlignmentFlag>. QLabel::setAlignment() takes a
Qt::Alignment parameter, which means that any combination of
@ -115,7 +115,7 @@ QT_BEGIN_NAMESPACE
\section1 Flags and the Meta-Object System
The Q_DECLARE_FLAGS() macro does not expose the flags to the meta-object
system, so they cannot be used by Qt Script or edited in Katie Designer.
system, so they cannot be used by Katie Script or edited in Katie Designer.
To make the flags available for these purposes, the Q_FLAGS() macro must
be used:
@ -319,7 +319,7 @@ QT_BEGIN_NAMESPACE
to do), your compiler will thoughtfully create it for you. You must
do more.
The curious user will have seen that the Qt classes derived
The curious user will have seen that the Katie classes derived
from QObject typically include this macro in a private section:
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 43
@ -375,19 +375,19 @@ QT_BEGIN_NAMESPACE
/*!
\headerfile <QtGlobal>
\title Global Qt Declarations
\title Global Katie Declarations
\ingroup funclists
\brief The <QtGlobal> header file includes the fundamental global
declarations. It is included by most other Qt header files.
declarations. It is included by most other Katie header files.
The global declarations include \l{types}, \l{functions} and
\l{macros}.
The type definitions are partly convenience definitions for basic
types (some of which guarantee certain bit-sizes on all platforms
supported by Qt), partly types related to Qt message handling. The
functions are related to generating messages, Qt version handling
supported by Katie), partly types related to Katie message handling. The
functions are related to generating messages, Katie version handling
and comparing and adjusting object values. And finally, some of
the declared macros enable programmers to add compiler or platform
specific code to their applications, while others are convenience
@ -396,11 +396,11 @@ QT_BEGIN_NAMESPACE
\section1 Types
The header file declares several type definitions that guarantee a
specified bit-size on all platforms supported by Qt for various
specified bit-size on all platforms supported by Katie for various
basic types, for example \l qint8 which is a signed char
guaranteed to be 8-bit on all platforms supported by Qt. The
guaranteed to be 8-bit on all platforms supported by Katie. The
header file also declares the \l qlonglong type definition for \c
{long long int } (\c __int64 on Windows).
{long long int }.
Several convenience type definitions are declared: \l qreal for \c
double, \l uchar for \c unsigned char, \l uint for \c unsigned
@ -408,7 +408,7 @@ QT_BEGIN_NAMESPACE
short.
Finally, the QtMsgType definition identifies the various messages
that can be generated and sent to a Qt message handler;
that can be generated and sent to a Katie message handler;
QtMsgHandler is a type definition for a pointer to a function with
the signature \c {void myMsgHandler(QtMsgType, const char *)}.
@ -439,7 +439,7 @@ QT_BEGIN_NAMESPACE
qInstallMsgHandler() function which installs the given
QtMsgHandler, and the qVersion() function which returns the
version number of Qt at run-time as a string.
version number of Katie at run-time as a string.
\section1 Macros
@ -460,7 +460,7 @@ QT_BEGIN_NAMESPACE
i.e. translation without changing the stored source text. The
Q_ASSERT() and Q_ASSERT_X() enables warning messages of various
level of refinement. The Q_FOREACH() and foreach() macros
implement Qt's foreach loop.
implement Katie's foreach loop.
The Q_INT64_C() and Q_UINT64_C() macros wrap signed and unsigned
64-bit integer literals in a platform-independent way. The
@ -472,7 +472,7 @@ QT_BEGIN_NAMESPACE
Finally, the QT_POINTER_SIZE macro expands to the size of a
pointer in bytes, and the QT_VERSION and QT_VERSION_STR macros
expand to a numeric value or a string, respectively, specifying
Qt's version number, i.e the version the application is compiled
Katie's version number, i.e the version the application is compiled
against.
\sa <QtAlgorithms>
@ -516,7 +516,7 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Typedef for \c{signed char}. This type is guaranteed to be 8-bit
on all platforms supported by Qt.
on all platforms supported by Katie.
*/
/*!
@ -524,14 +524,14 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Typedef for \c{unsigned char}. This type is guaranteed to
be 8-bit on all platforms supported by Qt.
be 8-bit on all platforms supported by Katie.
*/
/*! \typedef qint16
\relates <QtGlobal>
Typedef for \c{signed short}. This type is guaranteed to be
16-bit on all platforms supported by Qt.
16-bit on all platforms supported by Katie.
*/
/*!
@ -539,14 +539,14 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Typedef for \c{unsigned short}. This type is guaranteed to
be 16-bit on all platforms supported by Qt.
be 16-bit on all platforms supported by Katie.
*/
/*! \typedef qint32
\relates <QtGlobal>
Typedef for \c{signed int}. This type is guaranteed to be 32-bit
on all platforms supported by Qt.
on all platforms supported by Katie.
*/
/*!
@ -554,14 +554,14 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
Typedef for \c{unsigned int}. This type is guaranteed to
be 32-bit on all platforms supported by Qt.
be 32-bit on all platforms supported by Katie.
*/
/*! \typedef qint64
\relates <QtGlobal>
Typedef for \c{long long int} (\c __int64 on Windows). This type
is guaranteed to be 64-bit on all platforms supported by Qt.
Typedef for \c{long long int}. This type is guaranteed to be
64-bit on all platforms supported by Katie.
Literals of this type can be created using the Q_INT64_C() macro:
@ -576,7 +576,7 @@ QT_BEGIN_NAMESPACE
Typedef for \c{unsigned long long int} (\c{unsigned __int64} on
Windows). This type is guaranteed to be 64-bit on all platforms
supported by Qt.
supported by Katie.
Literals of this type can be created using the Q_UINT64_C()
macro:
@ -594,8 +594,8 @@ QT_BEGIN_NAMESPACE
etc.).
Typedef for either quint32 or quint64. This type is guaranteed to
be the same size as a pointer on all platforms supported by Qt. On
a system with 32-bit pointers, quintptr is a typedef for quint32;
be the same size as a pointer on all platforms supported by Katie.
On a system with 32-bit pointers, quintptr is a typedef for quint32;
on a system with 64-bit pointers, quintptr is a typedef for
quint64.
@ -611,7 +611,7 @@ QT_BEGIN_NAMESPACE
Integral type for representing pointer differences.
Typedef for either qint32 or qint64. This type is guaranteed to be
the same size as a pointer on all platforms supported by Qt. On a
the same size as a pointer on all platforms supported by Katie. On a
system with 32-bit pointers, quintptr is a typedef for quint32; on
a system with 64-bit pointers, quintptr is a typedef for quint64.
@ -763,11 +763,11 @@ QT_BEGIN_NAMESPACE
\relates <QtGlobal>
This macro expands a numeric value of the form 0xMMNNPP (MM =
major, NN = minor, PP = patch) that specifies Qt's version
major, NN = minor, PP = patch) that specifies Katie's version
number. For example, if you compile your application against Qt
4.1.2, the QT_VERSION macro will expand to 0x040102.
You can use QT_VERSION to use the latest Qt features where
You can use QT_VERSION to use the latest Katie features where
available.
Example:
@ -781,7 +781,7 @@ QT_BEGIN_NAMESPACE
\macro QT_VERSION_STR
\relates <QtGlobal>
This macro expands to a string that specifies Qt's version number
This macro expands to a string that specifies Katie's version number
(for example, "4.1.2"). This is the version against which the
application is compiled.
@ -791,7 +791,7 @@ QT_BEGIN_NAMESPACE
/*!
\relates <QtGlobal>
Returns the version number of Qt at run-time as a string (for
Returns the version number of Katie at run-time as a string (for
example, "4.1.2"). This may be a different version than the
version the application was compiled against.
@ -1111,22 +1111,18 @@ static QtMsgHandler handler = 0; // pointer to debug handler
\fn QtMsgHandler qInstallMsgHandler(QtMsgHandler handler)
\relates <QtGlobal>
Installs a Qt message \a handler which has been defined
Installs a Katie message \a handler which has been defined
previously. Returns a pointer to the previous message handler
(which may be 0).
The message handler is a function that prints out debug messages,
warnings, critical and fatal error messages. The Qt library (debug
mode) contains hundreds of warning messages that are printed
when internal errors (usually invalid function arguments)
occur. Qt built in release mode also contains such warnings unless
QT_NO_WARNING_OUTPUT and/or QT_NO_DEBUG_OUTPUT have been set during
compilation. If you implement your own message handler, you get total
control of these messages.
warnings, critical and fatal error messages. The Katie library
contains hundreds of warning messages that are printed when internal
errors (usually invalid function arguments) occur. If you implement
your own message handler, you get total control of these messages.
The default message handler prints the message to the standard
output under X11 or to the debugger under Windows. If it is a
fatal message, the application aborts immediately.
output. If it is a fatal message, the application aborts immediately.
Only one message handler can be defined, since this is usually
done on an application-wide basis to control debug output.
@ -1180,16 +1176,12 @@ static void qt_message(QtMsgType msgType, const char *format, va_list ap)
}
}
#undef qDebug
/*!
\relates <QtGlobal>
Calls the message handler with the debug message \a msg. If no
message handler has been installed, the message is printed to
stderr. Under Windows, the message is sent to the console, if it is a
console application; otherwise, it is sent to the debugger. This
function does nothing if \c QT_NO_DEBUG_OUTPUT was defined
during compilation.
stderr.
If you pass the function a format string and a list of arguments,
it works in similar way to the C printf() function. The format
@ -1207,7 +1199,7 @@ static void qt_message(QtMsgType msgType, const char *format, va_list ap)
With this syntax, the function returns a QDebug object that is
configured to use the QtDebugMsg message type. It automatically
puts a single space between each item, and outputs a newline at
the end. It supports many C++ and Qt types.
the end. It supports many C++ and Katie types.
To suppress the output at run-time, install your own message handler
with qInstallMsgHandler().
@ -1223,16 +1215,13 @@ void qDebug(const char *msg, ...)
va_end(ap);
}
#undef qWarning
/*!
\relates <QtGlobal>
Calls the message handler with the warning message \a msg. If no
message handler has been installed, the message is printed to
stderr. Under Windows, the message is sent to the debugger. This
function does nothing if \c QT_NO_WARNING_OUTPUT was defined
during compilation; it exits if the environment variable \c
QT_FATAL_WARNINGS is defined.
stderr. It exits if the environment variable \c QT_FATAL_WARNINGS
is set.
This function takes a format string and a list of arguments,
similar to the C printf() function. The format should be a Latin-1
@ -1268,7 +1257,7 @@ void qWarning(const char *msg, ...)
Calls the message handler with the critical message \a msg. If no
message handler has been installed, the message is printed to
stderr. Under Windows, the message is sent to the debugger.
stderr.
This function takes a format string and a list of arguments,
similar to the C printf() function. The format should be a Latin-1
@ -1304,12 +1293,10 @@ void qCritical(const char *msg, ...)
Calls the message handler with the fatal message \a msg. If no
message handler has been installed, the message is printed to
stderr. Under Windows, the message is sent to the debugger.
stderr.
If you are using the \bold{default message handler} this function will
abort on Unix systems to create a core dump. On Windows, for debug builds,
this function will report a _CRT_ERROR enabling you to connect a debugger
to the application.
abort on Unix systems to create a core dump.
This function takes a format string and a list of arguments,
similar to the C printf() function.
@ -1464,9 +1451,9 @@ int qrand()
\macro foreach(variable, container)
\relates <QtGlobal>
This macro is used to implement Qt's \c foreach loop. The \a
This macro is used to implement Katie's \c foreach loop. The \a
variable parameter is a variable name or variable definition; the
\a container parameter is a Qt container whose value type
\a container parameter is a container whose value type
corresponds to the type of the variable. See \l{The foreach
Keyword} for details.
@ -1510,7 +1497,7 @@ int qrand()
using these macros is not required if UTF-8 codec is used for
translations.
\sa QT_TRANSLATE_NOOP(), {Internationalization with Qt}
\sa QT_TRANSLATE_NOOP(), {Internationalization with Katie}
*/
/*!
@ -1528,7 +1515,7 @@ int qrand()
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp 35
\sa QT_TR_NOOP(), {Internationalization with Qt}
\sa QT_TR_NOOP(), {Internationalization with Katie}
*/
/*!
@ -1598,7 +1585,7 @@ int qrand()
\relates <QtGlobal>
You can use this macro to specify information about a custom type
\a Type. With accurate type information, Qt's \l{Container Classes}
\a Type. With accurate type information, Katie's \l{Container Classes}
{generic containers} can choose appropriate storage methods and
algorithms.
@ -1662,7 +1649,7 @@ bool QInternal::activateCallbacks(void **parameters)
This macro can be used to determine the byte order your system
uses for storing data in memory. i.e., whether your system is
little-endian or big-endian. It is set by Qt to one of the macros
little-endian or big-endian. It is set by Katie to one of the macros
Q_LITTLE_ENDIAN or Q_BIG_ENDIAN. You normally won't need to worry
about endian-ness, but you might, for example if you need to know
which byte of an integer or UTF-16 character is stored in the
@ -1732,7 +1719,7 @@ bool QInternal::activateCallbacks(void **parameters)
\macro QT_NAMESPACE
\internal
If this macro is defined to \c ns all Qt classes are put in a namespace
If this macro is defined to \c ns all Katie classes are put in a namespace
called \c ns. Also, moc will output code putting metaobjects etc.
into namespace \c ns.
@ -1781,10 +1768,9 @@ bool QInternal::activateCallbacks(void **parameters)
declarations are wildly mixed, wrap the \c{#include} lines in
\c QT_END_NAMESPACE and \c QT_BEGIN_NAMESPACE.
When using the \c QT_NAMESPACE feature in user code
(e.g., when building plugins statically linked to Qt) where
When using the \c QT_NAMESPACE feature in user code where
the user code is not intended to go into the \c QT_NAMESPACE
namespace, all forward declarations of Qt classes need to
namespace, all forward declarations of Katie classes need to
be wrapped in \c QT_BEGIN_NAMESPACE and \c QT_END_NAMESPACE.
After that, a \c QT_USE_NAMESPACE should follow.
No further changes should be needed.
@ -1845,13 +1831,13 @@ bool QInternal::activateCallbacks(void **parameters)
\relates <QtGlobal>
This macro can be used to ensure that the application is run
against a recent enough version of Qt. This is especially useful
against a recent enough version of Katie. This is especially useful
if your application depends on a specific bug fix introduced in a
bug-fix release (e.g., 4.0.2).
The \a argc and \a argv parameters are the \c main() function's
\c argc and \c argv parameters. The \a version parameter is a
string literal that specifies which version of Qt the application
string literal that specifies which version of Katie the application
requires (e.g., "4.0.2").
Example:

View file

@ -90,26 +90,6 @@ public:
{ stream->ts << m; return *this; }
};
class QNoDebug
{
public:
inline QNoDebug(){}
inline QNoDebug(const QDebug &){}
inline ~QNoDebug(){}
#if !defined(QT_NO_TEXTSTREAM)
inline QNoDebug &operator<<(QTextStreamFunction) { return *this; }
inline QNoDebug &operator<<(QTextStreamManipulator) { return *this; }
#endif
inline QNoDebug &space() { return *this; }
inline QNoDebug &nospace() { return *this; }
inline QNoDebug &maybeSpace() { return *this; }
template<typename T>
inline QNoDebug &operator<<(const T &) { return *this; }
};
Q_CORE_EXPORT_INLINE QDebug qCritical() { return QDebug(QtCriticalMsg); }
inline QDebug &QDebug::operator=(const QDebug &other)
{
if (this != &other) {
@ -194,22 +174,9 @@ inline QDebug operator<<(QDebug debug, const QFlags<T> &flags)
return debug.space();
}
#if !defined(QT_NO_DEBUG_OUTPUT)
Q_CORE_EXPORT_INLINE QDebug qDebug() { return QDebug(QtDebugMsg); }
#else
#undef qDebug
inline QNoDebug qDebug() { return QNoDebug(); }
#define qDebug QNoDebug
#endif
#if !defined(QT_NO_WARNING_OUTPUT)
Q_CORE_EXPORT_INLINE QDebug qWarning() { return QDebug(QtWarningMsg); }
#else
#undef qWarning
inline QNoDebug qWarning() { return QNoDebug(); }
#define qWarning QNoDebug
#endif
Q_CORE_EXPORT_INLINE QDebug qCritical() { return QDebug(QtCriticalMsg); }
QT_END_NAMESPACE