Commit 0ed13208 authored by Maximiliano Curia's avatar Maximiliano Curia
Browse files

Migrate to ecm_qt_declare_logging_category

Summary:
During D12656, it was suggested that it would be better to migrate to
ecm_qt_declare_logging_category.

Test Plan: It builds

Reviewers: #plasma, ivan, lbeltrame, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D12658
parent 25491ccb
......@@ -32,6 +32,7 @@ include (KDECMakeSettings)
include (KDECompilerSettings NO_POLICY_SCOPE)
include (GenerateExportHeader)
include (ECMGenerateHeaders)
include (ECMQtDeclareLoggingCategory)
# Qt
set (CMAKE_AUTOMOC ON)
......
......@@ -70,5 +70,21 @@ configure_file(org.kde.activitymanager.service.in
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.activitymanager.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
ecm_qt_declare_logging_category(debug_SRCS
HEADER DebugActivities.h
IDENTIFIER KAMD_LOG_ACTIVITIES
CATEGORY_NAME org.kde.kactivities.activities
DEFAULT_SEVERITY Warning)
ecm_qt_declare_logging_category(debug_SRCS
HEADER DebugResources.h
IDENTIFIER KAMD_LOG_RESOURCES
CATEGORY_NAME org.kde.kactivities.resources
DEFAULT_SEVERITY Warning)
ecm_qt_declare_logging_category(debug_SRCS
HEADER DebugApplication.h
IDENTIFIER KAMD_LOG_APPLICATION
CATEGORY_NAME org.kde.kactivities.application
DEFAULT_SEVERITY Warning)
add_subdirectory (service)
......@@ -35,7 +35,7 @@
#include <mutex>
#include <map>
#include "Debug.h"
#include "DebugResources.h"
namespace Common {
......
......@@ -43,7 +43,7 @@
#include <utils/range.h>
// Local
#include "Debug.h"
#include "DebugActivities.h"
#include "activitiesadaptor.h"
#include "ksmserver/KSMServer.h"
#include "common/dbus/common.h"
......
......@@ -57,7 +57,7 @@
#include "Features.h"
#include "Config.h"
#include "Plugin.h"
#include "Debug.h"
#include "DebugApplication.h"
#include "common/dbus/common.h"
......
......@@ -20,7 +20,7 @@ find_package (KF5KIO ${KF5_DEP_VERSION} CONFIG REQUIRED)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(kactivitymanagerd_plugin SHARED Plugin.cpp Module.cpp Event.cpp Debug.cpp)
add_library(kactivitymanagerd_plugin SHARED Plugin.cpp Module.cpp Event.cpp ${debug_SRCS})
generate_export_header(kactivitymanagerd_plugin)
target_link_libraries(kactivitymanagerd_plugin PUBLIC Qt5::Core Qt5::DBus KF5::CoreAddons KF5::ConfigCore)
......@@ -30,7 +30,7 @@ set (kactivitymanager_SRCS
Application.cpp
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/common/dbus/org.kde.ActivityManager.Activities.cpp
Debug.cpp
${debug_SRCS}
Activities.cpp
Resources.cpp
Features.cpp
......
/*
* Copyright (C) 2013 - 2016 by Ivan Cukic <ivan.cukic@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Debug.h"
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
// logging category for this framework, default: log stuff >= warning
Q_LOGGING_CATEGORY(KAMD_LOG_ACTIVITIES, "org.kde.kactivities.activities", QtWarningMsg)
Q_LOGGING_CATEGORY(KAMD_LOG_RESOURCES, "org.kde.kactivities.resources", QtWarningMsg)
Q_LOGGING_CATEGORY(KAMD_LOG_APPLICATION, "org.kde.kactivities.application", QtWarningMsg)
#else
Q_LOGGING_CATEGORY(KAMD_LOG_ACTIVITIES, "org.kde.kactivities.activities")
Q_LOGGING_CATEGORY(KAMD_LOG_RESOURCES, "org.kde.kactivities.resources")
Q_LOGGING_CATEGORY(KAMD_LOG_APPLICATION, "org.kde.kactivities.application")
#endif
/*
* Copyright (C) 2013 - 2016 by Ivan Cukic <ivan.cukic@kde.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License or (at your option) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ACTIVITIES_DEBUG_P_H
#define ACTIVITIES_DEBUG_P_H
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(KAMD_LOG_ACTIVITIES)
Q_DECLARE_LOGGING_CATEGORY(KAMD_LOG_RESOURCES)
Q_DECLARE_LOGGING_CATEGORY(KAMD_LOG_APPLICATION)
#endif /* ACTIVITIES_DEBUG_P_H */
......@@ -22,7 +22,7 @@
#include "Event.h"
// Local
#include "Debug.h"
#include <QDebug>
Event::Event()
......
......@@ -30,7 +30,7 @@
#include <utils/d_ptr_implementation.h>
// Local
#include "Debug.h"
#include "DebugApplication.h"
class Module::Private {
......
......@@ -28,7 +28,7 @@
#include <utils/d_ptr_implementation.h>
// Local
#include "Debug.h"
#include "DebugApplication.h"
class Plugin::Private {
......
......@@ -40,7 +40,6 @@
#include <time.h>
// Local
#include "Debug.h"
#include "Application.h"
#include "Activities.h"
#include "resourcesadaptor.h"
......
......@@ -37,7 +37,7 @@
#include <utils/d_ptr_implementation.h>
// Local
#include <Debug.h>
#include "DebugActivities.h"
#define KWIN_SERVICE QStringLiteral("org.kde.KWin")
......
......@@ -14,7 +14,7 @@ include_directories (
set (
runapplication_SRCS
RunApplicationPlugin.cpp
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/service/Debug.cpp
${debug_SRCS}
${plugin_implementation_SRCS}
)
......
......@@ -24,7 +24,7 @@
#include <QProcess>
#include <QDesktopServices>
#include <Debug.h>
#include "DebugApplication.h"
#include <KService>
......
......@@ -10,7 +10,7 @@ set (
ResourceScoreMaintainer.cpp
ResourceLinking.cpp
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/service/Debug.cpp
${debug_SRCS}
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/common/database/Database.cpp
${KACTIVITIES_CURRENT_ROOT_SOURCE_DIR}/src/common/database/schema/ResourcesDatabaseSchema.cpp
......
......@@ -41,7 +41,7 @@
#include <memory>
// Local
#include "Debug.h"
#include "DebugResources.h"
#include "Utils.h"
#include <common/database/Database.h>
......
......@@ -32,7 +32,6 @@
#include <utils/d_ptr.h>
// Local
#include <Debug.h>
#include <common/database/Database.h>
class QDateTime;
......
......@@ -35,7 +35,7 @@
#include <utils/range.h>
// Local
#include "Debug.h"
#include "DebugResources.h"
#include "Database.h"
#include "Utils.h"
#include "StatsPlugin.h"
......
......@@ -29,7 +29,7 @@
#include <utils/qsqlquery_iterator.h>
// Local
#include "Debug.h"
#include "DebugResources.h"
#include "StatsPlugin.h"
#include "Database.h"
#include "Utils.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment