diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-09-24 17:26:25 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-09-24 18:13:04 +0200 |
commit | d236c7b4dd0ca4758b1a28d34e33d9143f08a6ec (patch) | |
tree | 9b59a51585922f4029bcada855c35a9af783f184 | |
parent | 4b3b07af9534bd8417801b08682339ddd6cea53c (diff) |
qdoc: Manage logging category in utilities.h/cpp
Change-Id: I39ec66fbe95edc42a3dac51e8bc718ee42cc4a2a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
-rw-r--r-- | src/qdoc/.prev_CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/qdoc/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/qdoc/clangcodeparser.cpp | 1 | ||||
-rw-r--r-- | src/qdoc/config.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 1 | ||||
-rw-r--r-- | src/qdoc/docprivate.h | 2 | ||||
-rw-r--r-- | src/qdoc/generator.cpp | 1 | ||||
-rw-r--r-- | src/qdoc/generator.h | 1 | ||||
-rw-r--r-- | src/qdoc/loggingcategory.h | 40 | ||||
-rw-r--r-- | src/qdoc/main.cpp | 3 | ||||
-rw-r--r-- | src/qdoc/qdoc.pro | 1 | ||||
-rw-r--r-- | src/qdoc/qdoccommandlineparser.cpp | 1 | ||||
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/sections.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/utilities.cpp | 7 | ||||
-rw-r--r-- | src/qdoc/utilities.h | 7 | ||||
-rw-r--r-- | tests/auto/qdoc/config/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tests/auto/qdoc/config/config.pro | 5 | ||||
-rw-r--r-- | tests/auto/qdoc/config/tst_config.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qdoc/utilities/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/auto/qdoc/utilities/tst_utilities.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qdoc/utilities/utilities.pro | 1 |
22 files changed, 23 insertions, 69 deletions
diff --git a/src/qdoc/.prev_CMakeLists.txt b/src/qdoc/.prev_CMakeLists.txt index 5baa6beb9..262ce6864 100644 --- a/src/qdoc/.prev_CMakeLists.txt +++ b/src/qdoc/.prev_CMakeLists.txt @@ -38,7 +38,6 @@ qt_add_tool(${target_name} importrec.h jscodemarker.cpp jscodemarker.h location.cpp location.h - loggingcategory.h macro.h main.cpp manifestwriter.cpp manifestwriter.h diff --git a/src/qdoc/CMakeLists.txt b/src/qdoc/CMakeLists.txt index ffd4e4eb1..cbc486d1a 100644 --- a/src/qdoc/CMakeLists.txt +++ b/src/qdoc/CMakeLists.txt @@ -46,7 +46,6 @@ qt_add_tool(${target_name} importrec.h jscodemarker.cpp jscodemarker.h location.cpp location.h - loggingcategory.h macro.h main.cpp manifestwriter.cpp manifestwriter.h diff --git a/src/qdoc/clangcodeparser.cpp b/src/qdoc/clangcodeparser.cpp index 36a65c1f1..ffae9205f 100644 --- a/src/qdoc/clangcodeparser.cpp +++ b/src/qdoc/clangcodeparser.cpp @@ -49,7 +49,6 @@ #include "config.h" #include "enumnode.h" #include "functionnode.h" -#include "loggingcategory.h" #include "namespacenode.h" #include "propertynode.h" #include "qdocdatabase.h" diff --git a/src/qdoc/config.cpp b/src/qdoc/config.cpp index 4f15e97da..250b9e53a 100644 --- a/src/qdoc/config.cpp +++ b/src/qdoc/config.cpp @@ -31,7 +31,7 @@ */ #include "config.h" -#include "loggingcategory.h" +#include "utilities.h" #include <QtCore/qdir.h> #include <QtCore/qfile.h> diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index eb6a86b80..bfc4b6e8d 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -36,7 +36,6 @@ #include "functionnode.h" #include "generator.h" #include "headernode.h" -#include "loggingcategory.h" #include "namespacenode.h" #include "qdocdatabase.h" #include "qmltypenode.h" diff --git a/src/qdoc/docprivate.h b/src/qdoc/docprivate.h index dab567f83..1c7969f1a 100644 --- a/src/qdoc/docprivate.h +++ b/src/qdoc/docprivate.h @@ -34,7 +34,7 @@ #include "doc.h" #include "editdistance.h" #include "generator.h" -#include "loggingcategory.h" +#include "utilities.h" #include "openedlist.h" #include "quoter.h" #include "text.h" diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 8e9a8698c..0baa05866 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -42,7 +42,6 @@ #include "enumnode.h" #include "examplenode.h" #include "functionnode.h" -#include "loggingcategory.h" #include "node.h" #include "openedlist.h" #include "propertynode.h" diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index 746ba424a..6a8e1fe98 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -30,6 +30,7 @@ #define GENERATOR_H #include "text.h" +#include "utilities.h" #include <QtCore/qlist.h> #include <QtCore/qmap.h> diff --git a/src/qdoc/loggingcategory.h b/src/qdoc/loggingcategory.h deleted file mode 100644 index 812ef7af8..000000000 --- a/src/qdoc/loggingcategory.h +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the tools applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LOGGINGCATEGORY_H -#define LOGGINGCATEGORY_H - -#include <QtCore/qloggingcategory.h> - -QT_BEGIN_NAMESPACE - -Q_DECLARE_LOGGING_CATEGORY(lcQdoc) - -QT_END_NAMESPACE - -#endif diff --git a/src/qdoc/main.cpp b/src/qdoc/main.cpp index a8196c4c6..4508039f4 100644 --- a/src/qdoc/main.cpp +++ b/src/qdoc/main.cpp @@ -36,7 +36,6 @@ #include "htmlgenerator.h" #include "jscodemarker.h" #include "location.h" -#include "loggingcategory.h" #include "puredocparser.h" #include "qdocdatabase.h" #include "qmlcodemarker.h" @@ -61,8 +60,6 @@ QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQdoc, "qt.qdoc") - bool creationTimeBefore(const QFileInfo &fi1, const QFileInfo &fi2) { return fi1.lastModified() < fi2.lastModified(); diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro index c71c6bbe1..784a29319 100644 --- a/src/qdoc/qdoc.pro +++ b/src/qdoc/qdoc.pro @@ -59,7 +59,6 @@ HEADERS += access.h \ htmlgenerator.h \ importrec.h \ location.h \ - loggingcategory.h \ macro.h \ manifestwriter.h \ namespacenode.h \ diff --git a/src/qdoc/qdoccommandlineparser.cpp b/src/qdoc/qdoccommandlineparser.cpp index 2076bb01c..ff9035ba0 100644 --- a/src/qdoc/qdoccommandlineparser.cpp +++ b/src/qdoc/qdoccommandlineparser.cpp @@ -28,7 +28,6 @@ #include "qdoccommandlineparser.h" -#include "loggingcategory.h" #include "utilities.h" #include <QtCore/qdebug.h> diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index 2b680b586..50003911d 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -40,7 +40,7 @@ #include "generator.h" #include "headernode.h" #include "location.h" -#include "loggingcategory.h" +#include "utilities.h" #include "propertynode.h" #include "qdocdatabase.h" #include "qmlpropertynode.h" diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp index c4029514d..dc3bacc6d 100644 --- a/src/qdoc/sections.cpp +++ b/src/qdoc/sections.cpp @@ -34,7 +34,7 @@ #include "enumnode.h" #include "functionnode.h" #include "generator.h" -#include "loggingcategory.h" +#include "utilities.h" #include "namespacenode.h" #include "qmlpropertynode.h" #include "qmltypenode.h" diff --git a/src/qdoc/utilities.cpp b/src/qdoc/utilities.cpp index 5bcafe0a7..fac225e27 100644 --- a/src/qdoc/utilities.cpp +++ b/src/qdoc/utilities.cpp @@ -27,7 +27,10 @@ ****************************************************************************/ #include "utilities.h" -#include "loggingcategory.h" + +QT_BEGIN_NAMESPACE + +Q_LOGGING_CATEGORY(lcQdoc, "qt.qdoc") /*! \namespace Utilities @@ -57,3 +60,5 @@ bool debugging() return lcQdoc().isEnabled(QtDebugMsg); } } + +QT_END_NAMESPACE diff --git a/src/qdoc/utilities.h b/src/qdoc/utilities.h index 841099aea..2ffdb8f42 100644 --- a/src/qdoc/utilities.h +++ b/src/qdoc/utilities.h @@ -30,6 +30,11 @@ #define UTILITIES_H #include <QtCore/qstring.h> +#include <QtCore/qloggingcategory.h> + +QT_BEGIN_NAMESPACE + +Q_DECLARE_LOGGING_CATEGORY(lcQdoc) namespace Utilities { void startDebugging(const QString &message); @@ -37,4 +42,6 @@ void stopDebugging(const QString &message); bool debugging(); }; +QT_END_NAMESPACE + #endif // UTILITIES_H diff --git a/tests/auto/qdoc/config/CMakeLists.txt b/tests/auto/qdoc/config/CMakeLists.txt index 2d54cc041..98eebb7d0 100644 --- a/tests/auto/qdoc/config/CMakeLists.txt +++ b/tests/auto/qdoc/config/CMakeLists.txt @@ -8,8 +8,8 @@ qt_add_test(tst_config SOURCES ../../../../src/qdoc/config.cpp ../../../../src/qdoc/config.h ../../../../src/qdoc/location.cpp ../../../../src/qdoc/location.h - ../../../../src/qdoc/loggingcategory.h ../../../../src/qdoc/qdoccommandlineparser.cpp ../../../../src/qdoc/qdoccommandlineparser.h + ../../../../src/qdoc/utilities.cpp ../../../../src/qdoc/utilities.h tst_config.cpp INCLUDE_DIRECTORIES ../../../../src/qdoc diff --git a/tests/auto/qdoc/config/config.pro b/tests/auto/qdoc/config/config.pro index b6cb9a32d..e72a99fa1 100644 --- a/tests/auto/qdoc/config/config.pro +++ b/tests/auto/qdoc/config/config.pro @@ -7,10 +7,11 @@ HEADERS += \ $$PWD/../../../../src/qdoc/config.h \ $$PWD/../../../../src/qdoc/location.h \ $$PWD/../../../../src/qdoc/qdoccommandlineparser.h \ - $$PWD/../../../../src/qdoc/loggingcategory.h + $$PWD/../../../../src/qdoc/utilities.h SOURCES += \ tst_config.cpp \ $$PWD/../../../../src/qdoc/config.cpp \ $$PWD/../../../../src/qdoc/location.cpp \ - $$PWD/../../../../src/qdoc/qdoccommandlineparser.cpp + $$PWD/../../../../src/qdoc/qdoccommandlineparser.cpp \ + $$PWD/../../../../src/qdoc/utilities.cpp diff --git a/tests/auto/qdoc/config/tst_config.cpp b/tests/auto/qdoc/config/tst_config.cpp index 816057512..15426f556 100644 --- a/tests/auto/qdoc/config/tst_config.cpp +++ b/tests/auto/qdoc/config/tst_config.cpp @@ -34,10 +34,6 @@ #include <QtCore/qstringlist.h> #include <QtTest/QtTest> -QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQdoc, "qt.test") -QT_END_NAMESPACE - class tst_Config : public QObject { Q_OBJECT diff --git a/tests/auto/qdoc/utilities/CMakeLists.txt b/tests/auto/qdoc/utilities/CMakeLists.txt index bd949b84d..d47700827 100644 --- a/tests/auto/qdoc/utilities/CMakeLists.txt +++ b/tests/auto/qdoc/utilities/CMakeLists.txt @@ -6,7 +6,6 @@ qt_add_test(tst_utilities SOURCES - ../../../../src/qdoc/loggingcategory.h ../../../../src/qdoc/utilities.cpp ../../../../src/qdoc/utilities.h tst_utilities.cpp INCLUDE_DIRECTORIES diff --git a/tests/auto/qdoc/utilities/tst_utilities.cpp b/tests/auto/qdoc/utilities/tst_utilities.cpp index 0f63b1daf..322c7197b 100644 --- a/tests/auto/qdoc/utilities/tst_utilities.cpp +++ b/tests/auto/qdoc/utilities/tst_utilities.cpp @@ -30,10 +30,6 @@ #include <QtTest/QtTest> -QT_BEGIN_NAMESPACE -Q_LOGGING_CATEGORY(lcQdoc, "qt.test") -QT_END_NAMESPACE - class tst_Utilities : public QObject { Q_OBJECT @@ -48,7 +44,7 @@ private slots: void tst_Utilities::loggingCategoryName() { - const QString expected = "qt.test"; + const QString expected = "qt.qdoc"; QCOMPARE(lcQdoc().categoryName(), expected); } diff --git a/tests/auto/qdoc/utilities/utilities.pro b/tests/auto/qdoc/utilities/utilities.pro index 57489f2b1..fb58b9211 100644 --- a/tests/auto/qdoc/utilities/utilities.pro +++ b/tests/auto/qdoc/utilities/utilities.pro @@ -4,7 +4,6 @@ TARGET = tst_utilities INCLUDEPATH += $$PWD/../../../../src/qdoc HEADERS += \ - $$PWD/../../../../src/qdoc/loggingcategory.h \ $$PWD/../../../../src/qdoc/utilities.h SOURCES += \ |