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
|
From bcd8015eaf3638fca0e369955aa1a4290d079ef8 Mon Sep 17 00:00:00 2001
From: David Faure <faure@kde.org>
Date: Sun, 31 Mar 2019 19:49:40 +0200
Subject: Harmonize use of HAVE_X11, using cmakedefine01.
Fixes: config-X11.h:44:18: warning: "TRUE" is not defined, evaluates to 0 [-Wundef]
It should *all* be ported to cmakedefine01...
---
CMakeLists.txt | 3 +++
config-X11.h.cmake | 2 +-
kcms/fonts/fonts.cpp | 4 ++--
kcms/fonts/fonts.h | 4 ++--
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 036d781..df43295 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -88,6 +88,9 @@ set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
TYPE REQUIRED
PURPOSE "Required for building the X11 based workspace"
)
+if(X11_FOUND)
+ set(HAVE_X11 1)
+endif()
find_package(UDev)
set_package_properties(UDev PROPERTIES DESCRIPTION "UDev library"
diff --git a/config-X11.h.cmake b/config-X11.h.cmake
index 60286dd..ae8978a 100644
--- a/config-X11.h.cmake
+++ b/config-X11.h.cmake
@@ -41,4 +41,4 @@
#cmakedefine HAS_RANDR_1_3 1
/* Define if you have X11 at all */
-#define HAVE_X11 ${X11_FOUND}
\ No newline at end of file
+#cmakedefine01 HAVE_X11
diff --git a/kcms/fonts/fonts.cpp b/kcms/fonts/fonts.cpp
index f336518..218c3eb 100644
--- a/kcms/fonts/fonts.cpp
+++ b/kcms/fonts/fonts.cpp
@@ -224,7 +224,7 @@
}
/**** FontAASettings ****/
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
FontAASettings::FontAASettings(QWidget *parent)
: QDialog(parent),
changesMade(false)
@@ -501,13 +501,13 @@
void FontAASettings::changed()
{
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
changesMade = true;
enableWidgets();
#endif
}
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
int FontAASettings::exec()
{
const int i = QDialog::exec();
@@ -643,7 +643,7 @@
QGridLayout *lay = new QGridLayout();
layout->addLayout(lay);
lay->setColumnStretch(3, 10);
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
QLabel *label = 0L;
label = new QLabel(i18n("Use a&nti-aliasing:"), this);
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
@@ -692,7 +692,7 @@
lay->addWidget(spinboxDpi, 1, 1);
layout->addStretch(1);
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
aaSettings = new FontAASettings(this);
#endif
@@ -720,7 +720,7 @@
fontUseList.at(i)->setDefault();
}
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
useAA = AASystem;
cbAA->setCurrentIndex(useAA);
aaSettings->defaults();
@@ -739,7 +739,7 @@
(*it)->readFont();
}
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
useAA_original = useAA = aaSettings->load() ? AAEnabled : AADisabled;
cbAA->setCurrentIndex(useAA);
#endif
@@ -762,7 +762,7 @@
spinboxDpi->setValue(dpicfg);
dpi_original = dpicfg;
};
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
if (cfgfonts.readEntry("dontChangeAASettings", true)) {
useAA_original = useAA = AASystem;
cbAA->setCurrentIndex(useAA);
@@ -791,7 +791,7 @@
} else {
cfgfonts.writeEntry("forceFontDPI", dpi);
}
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
cfgfonts.writeEntry("dontChangeAASettings", cbAA->currentIndex() == AASystem);
#endif
cfgfonts.sync();
@@ -817,7 +817,7 @@
// Don't overwrite global settings unless explicitly asked for - e.g. the system
// fontconfig setup may be much more complex than this module can provide.
// TODO: With AASystem the changes already made by this module should be reverted somehow.
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
bool aaSave = false;
if (cbAA->currentIndex() == AAEnabled ) {
aaSave = aaSettings->save(KXftConfig::AntiAliasing::Enabled);
@@ -870,7 +870,7 @@
void KFonts::slotUseAntiAliasing()
{
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
useAA = static_cast< AASetting >(cbAA->currentIndex());
aaSettingsButton->setEnabled(useAA == AAEnabled);
emit changed(true);
@@ -879,7 +879,7 @@
void KFonts::slotCfgAa()
{
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
if (aaSettings->exec()) {
emit changed(true);
}
diff --git a/kcms/fonts/fonts.h b/kcms/fonts/fonts.h
index f7ade6b..d760e52 100644
--- a/kcms/fonts/fonts.h
+++ b/kcms/fonts/fonts.h
@@ -80,7 +80,7 @@
public:
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
FontAASettings(QWidget *parent);
bool save(KXftConfig::AntiAliasing::State aaState);
@@ -135,7 +135,7 @@
void slotCfgAa();
private:
-#if defined(HAVE_FONTCONFIG) && defined (HAVE_X11)
+#if defined(HAVE_FONTCONFIG) && HAVE_X11
enum AASetting { AAEnabled, AASystem, AADisabled };
AASetting useAA, useAA_original;
QComboBox *cbAA;
--
cgit v1.1
|