Remove normalization of "default" category

Commit d61e774307 got rid of the special handling of the 'default'
category in the qloggingregistry, so we don't need the private header
file anymore, nor does it gain us anything to 'normalize' all default
categories to one string.

Change-Id: I027b4b82ff915428287432f39f76b4e719cf7874
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
This commit is contained in:
Kai Koehne 2014-07-11 11:11:46 +02:00
parent e968793e81
commit b795e8d7c2
4 changed files with 3 additions and 77 deletions

View File

@ -51,7 +51,6 @@ HEADERS += \
io/qfileselector.h \ io/qfileselector.h \
io/qfileselector_p.h \ io/qfileselector_p.h \
io/qloggingcategory.h \ io/qloggingcategory.h \
io/qloggingcategory_p.h \
io/qloggingregistry_p.h io/qloggingregistry_p.h
SOURCES += \ SOURCES += \

View File

@ -40,7 +40,6 @@
****************************************************************************/ ****************************************************************************/
#include "qloggingcategory.h" #include "qloggingcategory.h"
#include "qloggingcategory_p.h"
#include "qloggingregistry_p.h" #include "qloggingregistry_p.h"
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
@ -221,15 +220,10 @@ void QLoggingCategory::init(const char *category, QtMsgType severityLevel)
{ {
enabled.store(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true; enabled.store(0x01010101); // enabledDebug = enabledWarning = enabledCritical = true;
const bool isDefaultCategory if (category)
= (category == 0) || (strcmp(category, qtDefaultCategoryName) == 0);
// normalize "default" category name, so that we can just do
// pointer comparison in QLoggingRegistry::updateCategory
if (isDefaultCategory)
name = qtDefaultCategoryName;
else
name = category; name = category;
else
name = qtDefaultCategoryName;
if (QLoggingRegistry *reg = QLoggingRegistry::instance()) if (QLoggingRegistry *reg = QLoggingRegistry::instance())
reg->registerCategory(this, severityLevel); reg->registerCategory(this, severityLevel);

View File

@ -1,66 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QLOGGINGCATEGORY_P_H
#define QLOGGINGCATEGORY_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of a number of Qt sources files. This header file may change from
// version to version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qglobal.h>
QT_BEGIN_NAMESPACE
// unique pointer to default category
// (allows to compare for pointers instead of strings)
extern const char qtDefaultCategoryName[];
QT_END_NAMESPACE
#endif // QLOGGINGCATEGORY_P_H

View File

@ -40,7 +40,6 @@
****************************************************************************/ ****************************************************************************/
#include "qloggingregistry_p.h" #include "qloggingregistry_p.h"
#include "qloggingcategory_p.h"
#include <QtCore/qfile.h> #include <QtCore/qfile.h>
#include <QtCore/qstandardpaths.h> #include <QtCore/qstandardpaths.h>