Merge lp:~compiz-team/compiz/compiz.fix_1063617.1 into lp:compiz/0.9.9

Proposed by Sam Spilsbury
Status: Merged
Approved by: Daniel van Vugt
Approved revision: 3481
Merged at revision: 3484
Proposed branch: lp:~compiz-team/compiz/compiz.fix_1063617.1
Merge into: lp:compiz/0.9.9
Diff against target: 194 lines (+22/-22)
7 files modified
compizconfig/gconf/src/gconf.c (+2/-2)
compizconfig/gsettings/src/gsettings.c (+2/-2)
compizconfig/libcompizconfig/backend/src/ini.c (+3/-3)
compizconfig/libcompizconfig/include/ccs.h (+4/-4)
compizconfig/libcompizconfig/src/main.c (+4/-4)
compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp (+1/-1)
compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_mock.h (+6/-6)
To merge this branch: bzr merge lp:~compiz-team/compiz/compiz.fix_1063617.1
Reviewer Review Type Date Requested Status
Daniel van Vugt Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+136035@code.launchpad.net

Commit message

Make the output-parameters of ccsGetString and ccsGetMatch const char **
instead of char ** as the returned value is not transferred to the
caller.

Description of the change

This is about preparing a fix for (LP: #1063617).

(LP: #1063617) is really complicated. The problem is that there is a feedback loop between integrated keys and normal keys which can cause the integrated keys to read from normal keys which will be out of date or incorrect because they were never updated.

A part of that problem is that we need to have more information in the backends as to why setting a key to a particular value failed or succeeded.

Make the output-parameters of ccsGetString and ccsGetMatch const char **
instead of char ** as the returned value is not transferred to the
caller.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel van Vugt (vanvugt) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compizconfig/gconf/src/gconf.c'
2--- compizconfig/gconf/src/gconf.c 2012-08-16 17:00:25 +0000
3+++ compizconfig/gconf/src/gconf.c 2012-11-25 02:30:29 +0000
4@@ -822,14 +822,14 @@
5 {
6 case TypeString:
7 {
8- char *value;
9+ const char *value;
10 if (ccsGetString (setting, &value))
11 gconf_client_set_string (client, pathName, value, NULL);
12 }
13 break;
14 case TypeMatch:
15 {
16- char *value;
17+ const char *value;
18 if (ccsGetMatch (setting, &value))
19 gconf_client_set_string (client, pathName, value, NULL);
20 }
21
22=== modified file 'compizconfig/gsettings/src/gsettings.c'
23--- compizconfig/gsettings/src/gsettings.c 2012-11-16 17:01:25 +0000
24+++ compizconfig/gsettings/src/gsettings.c 2012-11-25 02:30:29 +0000
25@@ -239,7 +239,7 @@
26 {
27 case TypeString:
28 {
29- char *value;
30+ const char *value;
31 if (ccsGetString (setting, &value))
32 {
33 success = writeStringToVariant (value, &gsettingsValue);
34@@ -248,7 +248,7 @@
35 break;
36 case TypeMatch:
37 {
38- char *value;
39+ const char *value;
40 if (ccsGetMatch (setting, &value))
41 {
42
43
44=== modified file 'compizconfig/libcompizconfig/backend/src/ini.c'
45--- compizconfig/libcompizconfig/backend/src/ini.c 2012-08-01 10:25:15 +0000
46+++ compizconfig/libcompizconfig/backend/src/ini.c 2012-11-25 02:30:29 +0000
47@@ -451,15 +451,15 @@
48 case TypeString:
49 {
50 char *value;
51- if (ccsGetString (setting, &value))
52+ if (ccsGetString (setting, (const char **) &value))
53 ccsIniSetString (data->iniFile, ccsPluginGetName (ccsSettingGetParent (setting)),
54- keyName, value);
55+ keyName, value);
56 }
57 break;
58 case TypeMatch:
59 {
60 char *value;
61- if (ccsGetMatch (setting, &value))
62+ if (ccsGetMatch (setting, (const char **) &value))
63 ccsIniSetString (data->iniFile, ccsPluginGetName (ccsSettingGetParent (setting)),
64 keyName, value);
65 }
66
67=== modified file 'compizconfig/libcompizconfig/include/ccs.h'
68--- compizconfig/libcompizconfig/include/ccs.h 2012-10-03 10:50:07 +0000
69+++ compizconfig/libcompizconfig/include/ccs.h 2012-11-25 02:30:29 +0000
70@@ -482,11 +482,11 @@
71 Bool ccsGetBool (CCSSetting *setting,
72 Bool *data);
73 Bool ccsGetString (CCSSetting *setting,
74- char **data);
75+ const char **data);
76 Bool ccsGetColor (CCSSetting *setting,
77 CCSSettingColorValue *data);
78 Bool ccsGetMatch (CCSSetting *setting,
79- char **data);
80+ const char **data);
81 Bool ccsGetKey (CCSSetting *setting,
82 CCSSettingKeyValue *data);
83 Bool ccsGetButton (CCSSetting *setting,
84@@ -580,9 +580,9 @@
85 typedef Bool (*CCSSettingGetInt) (CCSSetting *setting, int *data);
86 typedef Bool (*CCSSettingGetFloat) (CCSSetting *setting, float *data);
87 typedef Bool (*CCSSettingGetBool) (CCSSetting *setting, Bool *data);
88-typedef Bool (*CCSSettingGetString) (CCSSetting *setting, char **data);
89+typedef Bool (*CCSSettingGetString) (CCSSetting *setting, const char **data);
90 typedef Bool (*CCSSettingGetColor) (CCSSetting *setting, CCSSettingColorValue *data);
91-typedef Bool (*CCSSettingGetMatch) (CCSSetting *setting, char **data);
92+typedef Bool (*CCSSettingGetMatch) (CCSSetting *setting, const char **data);
93 typedef Bool (*CCSSettingGetKey) (CCSSetting *setting, CCSSettingKeyValue *data);
94 typedef Bool (*CCSSettingGetButton) (CCSSetting *setting, CCSSettingButtonValue *data);
95 typedef Bool (*CCSSettingGetEdge) (CCSSetting *setting, unsigned int *data);
96
97=== modified file 'compizconfig/libcompizconfig/src/main.c'
98--- compizconfig/libcompizconfig/src/main.c 2012-11-19 06:07:45 +0000
99+++ compizconfig/libcompizconfig/src/main.c 2012-11-25 02:30:29 +0000
100@@ -2693,7 +2693,7 @@
101 }
102
103 Bool
104-ccsSettingGetStringDefault (CCSSetting * setting, char **data)
105+ccsSettingGetStringDefault (CCSSetting * setting, const char **data)
106 {
107 CCSSettingPrivate *sPrivate = GET_PRIVATE (CCSSettingPrivate, setting)
108
109@@ -2717,7 +2717,7 @@
110 }
111
112 Bool
113-ccsSettingGetMatchDefault (CCSSetting * setting, char **data)
114+ccsSettingGetMatchDefault (CCSSetting * setting, const char **data)
115 {
116 CCSSettingPrivate *sPrivate = GET_PRIVATE (CCSSettingPrivate, setting)
117
118@@ -2807,7 +2807,7 @@
119 }
120
121 Bool ccsGetString (CCSSetting *setting,
122- char **data)
123+ const char **data)
124 {
125 return (*(GET_INTERFACE (CCSSettingInterface, setting))->settingGetString) (setting, data);
126 }
127@@ -2819,7 +2819,7 @@
128 }
129
130 Bool ccsGetMatch (CCSSetting *setting,
131- char **data)
132+ const char **data)
133 {
134 return (*(GET_INTERFACE (CCSSettingInterface, setting))->settingGetMatch) (setting, data);
135 }
136
137=== modified file 'compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp'
138--- compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp 2012-10-03 10:50:07 +0000
139+++ compizconfig/libcompizconfig/tests/compizconfig_test_ccs_mock_backend_conformance.cpp 2012-11-25 02:30:29 +0000
140@@ -723,7 +723,7 @@
141 Bool vBool;
142 int vInt;
143 float vFloat;
144- char *vString;
145+ const char *vString;
146 CCSSettingColorValue vColor;
147 CCSSettingKeyValue vKey;
148 CCSSettingButtonValue vButton;
149
150=== modified file 'compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_mock.h'
151--- compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_mock.h 2012-09-10 01:06:55 +0000
152+++ compizconfig/mocks/libcompizconfig/compizconfig_ccs_setting_mock.h 2012-11-25 02:30:29 +0000
153@@ -48,9 +48,9 @@
154 virtual Bool getInt (int *) = 0;
155 virtual Bool getFloat (float *) = 0;
156 virtual Bool getBool (Bool *) = 0;
157- virtual Bool getString (char **) = 0;
158+ virtual Bool getString (const char **) = 0;
159 virtual Bool getColor (CCSSettingColorValue *) = 0;
160- virtual Bool getMatch (char **) = 0;
161+ virtual Bool getMatch (const char **) = 0;
162 virtual Bool getKey (CCSSettingKeyValue *) = 0;
163 virtual Bool getButton (CCSSettingButtonValue *) = 0;
164 virtual Bool getEdge (unsigned int *) = 0;
165@@ -107,9 +107,9 @@
166 MOCK_METHOD1 (getInt, Bool (int *));
167 MOCK_METHOD1 (getFloat, Bool (float *));
168 MOCK_METHOD1 (getBool, Bool (Bool *));
169- MOCK_METHOD1 (getString, Bool (char **));
170+ MOCK_METHOD1 (getString, Bool (const char **));
171 MOCK_METHOD1 (getColor, Bool (CCSSettingColorValue *));
172- MOCK_METHOD1 (getMatch, Bool (char **));
173+ MOCK_METHOD1 (getMatch, Bool (const char **));
174 MOCK_METHOD1 (getKey, Bool (CCSSettingKeyValue *));
175 MOCK_METHOD1 (getButton, Bool (CCSSettingButtonValue *));
176 MOCK_METHOD1 (getEdge, Bool (unsigned int *));
177@@ -145,7 +145,7 @@
178 }
179
180 static Bool ccsGetString (CCSSetting *setting,
181- char **data)
182+ const char **data)
183 {
184 return ((CCSSettingGMock *) ccsObjectGetPrivate (setting))->getString (data);
185 }
186@@ -157,7 +157,7 @@
187 }
188
189 static Bool ccsGetMatch (CCSSetting *setting,
190- char **data)
191+ const char **data)
192 {
193 return ((CCSSettingGMock *) ccsObjectGetPrivate (setting))->getMatch (data);
194 }

Subscribers

People subscribed via source and target branches