aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/desktops/plasma-5/patches/0001-Add-a-logging-category-config-file.patch
blob: d8d54a117eb2513691947c9905a69779b594586d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
From e63a0dc2a7b185906a93d60e9d5d6deee4950efc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?M=C3=A9ven=20Car?= <meven.car@enioka.com>
Date: Wed, 20 May 2020 14:02:07 +0200
Subject: [PATCH] Add a logging category config file

Makes powerdevil default logging level Warning
---
 CMakeLists.txt                     |  2 ++
 daemon/CMakeLists.txt              |  6 ++++++
 daemon/actions/dpms/CMakeLists.txt |  2 +-
 daemon/backends/CMakeLists.txt     |  6 +++---
 daemon/powerdevil_debug.cpp        | 21 ---------------------
 daemon/powerdevil_debug.h          | 26 --------------------------
 kcmodule/activities/CMakeLists.txt |  2 +-
 kcmodule/common/CMakeLists.txt     |  2 +-
 kcmodule/profiles/CMakeLists.txt   |  2 +-
 powerdevil.categories              |  1 +
 10 files changed, 16 insertions(+), 54 deletions(-)
 delete mode 100644 daemon/powerdevil_debug.cpp
 delete mode 100644 daemon/powerdevil_debug.h
 create mode 100644 powerdevil.categories

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ded8f5a..52a7318c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
 
 include(ECMSetupVersion)
+include(ECMQtDeclareLoggingCategory)
 include(FeatureSummary)
 include(KDEInstallDirs)
 include(KDECMakeSettings)
@@ -76,6 +77,7 @@ add_subdirectory(daemon)
 add_subdirectory(kcmodule)
 add_subdirectory(doc)
 
+install( FILES powerdevil.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
 install( FILES powerdevil.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
 
 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt
index 33ca655b..96cc9b7b 100644
--- a/daemon/CMakeLists.txt
+++ b/daemon/CMakeLists.txt
@@ -48,6 +48,12 @@ set(powerdevilcore_SRCS
     kwinkscreenhelpereffect.cpp
 )
 
+ecm_qt_declare_logging_category(powerdevilcore_SRCS
+   HEADER powerdevil_debug.h
+   IDENTIFIER POWERDEVIL
+   CATEGORY_NAME org.kde.powerdevil
+   DEFAULT_SEVERITY Warning)
+
 kconfig_add_kcfg_files(powerdevilcore_SRCS ../PowerDevilSettings.kcfgc)
 
 # Action DBus Adaptors
diff --git a/daemon/actions/dpms/CMakeLists.txt b/daemon/actions/dpms/CMakeLists.txt
index f8ca4e20..3b8bd95b 100644
--- a/daemon/actions/dpms/CMakeLists.txt
+++ b/daemon/actions/dpms/CMakeLists.txt
@@ -3,7 +3,7 @@ include_directories(${PowerDevil_SOURCE_DIR}/daemon
                     ${CMAKE_CURRENT_BINARY_DIR})
 
 set(powerdevildpmsaction_SRCS
-    ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
+    ${CMAKE_CURRENT_BINARY_DIR}/../../powerdevil_debug.cpp
     powerdevildpmsaction.cpp
     abstractdpmshelper.cpp
     xcbdpmshelper.cpp
diff --git a/daemon/backends/CMakeLists.txt b/daemon/backends/CMakeLists.txt
index 89400446..05c4263e 100644
--- a/daemon/backends/CMakeLists.txt
+++ b/daemon/backends/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/upower
                     ${X11_Xrandr_INCLUDE_PATH})
 
 set(powerdevilupowerbackend_SRCS
-    ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
+    ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp
     upower/upowersuspendjob.cpp
     upower/login1suspendjob.cpp
     upower/powerdevilupowerbackend.cpp
@@ -33,14 +33,14 @@ ${CMAKE_CURRENT_SOURCE_DIR}/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml
 upower_kbdbacklight_interface)
 
 ## backlight helper executable
-add_executable(backlighthelper upower/backlighthelper.cpp ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp ${backlighthelper_mocs})
+add_executable(backlighthelper upower/backlighthelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${backlighthelper_mocs})
 target_link_libraries(backlighthelper Qt5::Core KF5::AuthCore KF5::I18n)
 install(TARGETS backlighthelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
 kauth_install_helper_files(backlighthelper org.kde.powerdevil.backlighthelper root)
 kauth_install_actions(org.kde.powerdevil.backlighthelper ${CMAKE_CURRENT_SOURCE_DIR}/upower/backlight_helper_actions.actions)
 
 ## discrete gpu helper executable
-add_executable(discretegpuhelper upower/discretegpuhelper.cpp ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp ${discretegpuhelper_mocs})
+add_executable(discretegpuhelper upower/discretegpuhelper.cpp ${CMAKE_CURRENT_BINARY_DIR}/../powerdevil_debug.cpp ${discretegpuhelper_mocs})
 target_link_libraries(discretegpuhelper Qt5::Core KF5::AuthCore)
 install(TARGETS discretegpuhelper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
 kauth_install_helper_files(discretegpuhelper org.kde.powerdevil.discretegpuhelper root)
diff --git a/daemon/powerdevil_debug.cpp b/daemon/powerdevil_debug.cpp
deleted file mode 100644
index 86172c1b..00000000
--- a/daemon/powerdevil_debug.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2014 Hrvoje Senjan <hrvoje.senjan@gmail.com>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library 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
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#include "powerdevil_debug.h"
-Q_LOGGING_CATEGORY(POWERDEVIL, "powerdevil")
diff --git a/daemon/powerdevil_debug.h b/daemon/powerdevil_debug.h
deleted file mode 100644
index fcd9c10f..00000000
--- a/daemon/powerdevil_debug.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*  This file is part of the KDE project
-    Copyright (C) 2014 Hrvoje Senjan <hrvoje.senjan@gmail.com>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Library General Public
-    License as published by the Free Software Foundation; either
-    version 2 of the License, or (at your option) any later version.
-
-    This library 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
-    Library General Public License for more details.
-
-    You should have received a copy of the GNU Library General Public License
-    along with this library; see the file COPYING.LIB.  If not, write to
-    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-    Boston, MA 02110-1301, USA.
-*/
-
-#ifndef PROCESSCORE_DEBUG_H
-#define PROCESSCORE_DEBUG_H
-
-#include <QLoggingCategory>
-Q_DECLARE_LOGGING_CATEGORY(POWERDEVIL)
-
-#endif
diff --git a/kcmodule/activities/CMakeLists.txt b/kcmodule/activities/CMakeLists.txt
index 41a6da48..6e248e91 100644
--- a/kcmodule/activities/CMakeLists.txt
+++ b/kcmodule/activities/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_definitions(-DTRANSLATION_DOMAIN=\"powerdevilactivitiesconfig\")
 
 set( kcm_powerdevil_activities_SRCS
-     ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
+     ${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
      activitypage.cpp
      activitywidget.cpp
      ../common/ErrorOverlay.cpp
diff --git a/kcmodule/common/CMakeLists.txt b/kcmodule/common/CMakeLists.txt
index ca483fa7..400b7746 100644
--- a/kcmodule/common/CMakeLists.txt
+++ b/kcmodule/common/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_definitions(-DTRANSLATION_DOMAIN=\"libpowerdevilcommonconfig\")
 
 set( powerdevil_config_common_private_SRCS
-    ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
+    ${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
     actionconfigwidget.cpp
     actioneditwidget.cpp
     ErrorOverlay.cpp
diff --git a/kcmodule/profiles/CMakeLists.txt b/kcmodule/profiles/CMakeLists.txt
index ac5c96e0..32279089 100644
--- a/kcmodule/profiles/CMakeLists.txt
+++ b/kcmodule/profiles/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_definitions(-DTRANSLATION_DOMAIN=\"powerdevilprofilesconfig\")
 
 set( kcm_powerdevil_profiles_SRCS
-     ${PowerDevil_SOURCE_DIR}/daemon/powerdevil_debug.cpp
+     ${CMAKE_CURRENT_BINARY_DIR}/../../daemon/powerdevil_debug.cpp
      EditPage.cpp
      ${PowerDevil_SOURCE_DIR}/daemon/powerdevilprofilegenerator.cpp
 )
diff --git a/powerdevil.categories b/powerdevil.categories
new file mode 100644
index 00000000..3147de54
--- /dev/null
+++ b/powerdevil.categories
@@ -0,0 +1 @@
+org.kde.powerdevil Powerdevil DEFAULT_SEVERITY [WARNING] IDENTIFIER [POWERDEVIL]
-- 
2.25.4