Merge lp:~widelands-dev/widelands/compiler-warnings-201908-2 into lp:widelands
- compiler-warnings-201908-2
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 9199 |
Proposed branch: | lp:~widelands-dev/widelands/compiler-warnings-201908-2 |
Merge into: | lp:widelands |
Diff against target: |
519 lines (+79/-71) 24 files modified
src/CMakeLists.txt (+16/-3) src/ai/defaultai.cc (+0/-1) src/ai/test/test_ai.cc (+1/-0) src/economy/test/test_road.cc (+1/-0) src/economy/test/test_routing.cc (+1/-0) src/editor/CMakeLists.txt (+1/-1) src/graphic/styles/font_style.h (+0/-1) src/graphic/styles/text_panel_style.h (+0/-1) src/io/filesystem/test/test_filesystem.cc (+1/-0) src/logic/CMakeLists.txt (+2/-2) src/logic/map_objects/tribes/productionsite.cc (+1/-1) src/network/CMakeLists.txt (+1/-0) src/notifications/test/notifications_test.cc (+1/-0) src/scripting/CMakeLists.txt (+1/-1) src/scripting/test/test_luna.cc (+1/-0) src/sound/CMakeLists.txt (+1/-1) src/ui_basic/CMakeLists.txt (+1/-0) src/ui_fsmenu/CMakeLists.txt (+4/-3) src/ui_fsmenu/options.cc (+1/-1) src/wlapplication.cc (+12/-4) src/wlapplication.h (+0/-7) src/wlapplication_options.cc (+20/-21) src/wlapplication_options.h (+9/-21) src/wui/CMakeLists.txt (+3/-2) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/compiler-warnings-201908-2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Klaus Halfmann | Approve | ||
GunChleoc | Needs Resubmitting | ||
Review via email: mp+372111@code.launchpad.net |
Commit message
Fix compiler warnings and refactor config dir.
Description of the change
Do not send the merge command yet, I want to check the Travis/AppVeyor logs first.
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5378. State: failed. Details: https:/
Appveyor build 5148. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5378. State: passed. Details: https:/
Appveyor build 5148. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5399. State: failed. Details: https:/
Appveyor build 5169. State: success. Details: https:/
Klaus Halfmann (klaus-halfmann) wrote : | # |
* Replaced:
- widelands_
+ widelands_options
-> fine
* Codestyle: using this for a member function makes no sense.
* Smuggeled in some USE_XDG handling :-)
Will compile and start this, not doing much testing.
Please: review my refactor_gamehost before merging it becomes to much pain.
GunChleoc (gunchleoc) wrote : | # |
Thanks for the review!
I already did a code review on your branch, I guess you overlooked it.
@bunnybot merge
bunnybot (widelandsofficial) wrote : | # |
Refusing to merge, since Travis is not green. Use @bunnybot merge force for merging anyways.
Travis build 5399. State: failed. Details: https:/
Klaus Halfmann (klaus-halfmann) wrote : | # |
Locally commpiles without issues. Start upto Lobby was fine.
Klaus Halfmann (klaus-halfmann) wrote : | # |
Mhh,one test in travis fails
test/maps/
Running Widelands ... FAIL
But only for GCC_VERSION="4.9" BUILD_TYPE="Debug" ?
will run the test loocally, too
GunChleoc (gunchleoc) wrote : | # |
The UI test sometimes fails because it takes too long for the game to close. I have implemented a fix in one of my other branches. Will rerun the Travis job.
Klaus Halfmann (klaus-halfmann) wrote : | # |
local tests ok
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 5399. State: passed. Details: https:/
Appveyor build 5169. State: success. Details: https:/
GunChleoc (gunchleoc) wrote : | # |
Thanks again!
@bunnybot merge
Preview Diff
1 | === modified file 'src/CMakeLists.txt' |
2 | --- src/CMakeLists.txt 2019-07-20 14:32:57 +0000 |
3 | +++ src/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
4 | @@ -92,8 +92,6 @@ |
5 | wlapplication.h |
6 | wlapplication_messages.cc |
7 | wlapplication_messages.h |
8 | - wlapplication_options.cc |
9 | - wlapplication_options.h |
10 | USES_SDL2 |
11 | USES_SDL2_IMAGE |
12 | USES_SDL2_TTF |
13 | @@ -109,7 +107,6 @@ |
14 | graphic_fonthandler |
15 | graphic_text |
16 | io_filesystem |
17 | - io_profile |
18 | logic |
19 | logic_exceptions |
20 | logic_filesystem_constants |
21 | @@ -129,9 +126,25 @@ |
22 | ui_fsmenu_misc |
23 | ui_fsmenu_network |
24 | ui_fsmenu_options |
25 | + widelands_options |
26 | wui |
27 | ) |
28 | |
29 | +wl_library(widelands_options |
30 | + SRCS |
31 | + wlapplication_options.cc |
32 | + wlapplication_options.h |
33 | + USES_SDL2 |
34 | + USES_SDL2_IMAGE |
35 | + USES_SDL2_TTF |
36 | + DEPENDS |
37 | + base_log |
38 | + io_filesystem |
39 | + io_profile |
40 | + logic_filesystem_constants |
41 | +) |
42 | + |
43 | + |
44 | # TODO(sirver): Split into libs with useful names. |
45 | wl_library(helper |
46 | SRCS |
47 | |
48 | === modified file 'src/ai/defaultai.cc' |
49 | --- src/ai/defaultai.cc 2019-09-05 19:57:55 +0000 |
50 | +++ src/ai/defaultai.cc 2019-09-06 14:10:07 +0000 |
51 | @@ -5601,7 +5601,6 @@ |
52 | inputs[16] = 0; |
53 | inputs[17] = (inputs_on_stock) ? 0 : -2; |
54 | inputs[18] = (suppliers_exist) ? 0 : -3; |
55 | - ; |
56 | inputs[19] = (inputs_on_stock) ? 0 : -4; |
57 | inputs[20] = |
58 | (mines_per_type[bo.mines].in_construction + mines_per_type[bo.mines].finished == 1) ? |
59 | |
60 | === modified file 'src/ai/test/test_ai.cc' |
61 | --- src/ai/test/test_ai.cc 2019-08-31 20:12:56 +0000 |
62 | +++ src/ai/test/test_ai.cc 2019-09-06 14:10:07 +0000 |
63 | @@ -29,6 +29,7 @@ |
64 | |
65 | // Triggered by BOOST_AUTO_TEST_CASE |
66 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
67 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
68 | |
69 | using namespace Widelands; |
70 | |
71 | |
72 | === modified file 'src/economy/test/test_road.cc' |
73 | --- src/economy/test/test_road.cc 2019-02-23 11:00:49 +0000 |
74 | +++ src/economy/test/test_road.cc 2019-09-06 14:10:07 +0000 |
75 | @@ -33,6 +33,7 @@ |
76 | |
77 | // Triggered by BOOST_AUTO_TEST_CASE |
78 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
79 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
80 | |
81 | namespace Widelands { |
82 | class World; |
83 | |
84 | === modified file 'src/economy/test/test_routing.cc' |
85 | --- src/economy/test/test_routing.cc 2019-02-23 11:00:49 +0000 |
86 | +++ src/economy/test/test_routing.cc 2019-09-06 14:10:07 +0000 |
87 | @@ -33,6 +33,7 @@ |
88 | |
89 | // Triggered by BOOST_AUTO_TEST_CASE |
90 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
91 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
92 | |
93 | using namespace Widelands; |
94 | |
95 | |
96 | === modified file 'src/editor/CMakeLists.txt' |
97 | --- src/editor/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
98 | +++ src/editor/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
99 | @@ -115,7 +115,7 @@ |
100 | scripting_lua_interface |
101 | scripting_lua_table |
102 | ui_basic |
103 | - widelands_ball_of_mud |
104 | + widelands_options |
105 | wui |
106 | wui_common_mapdetails |
107 | wui_mapview_pixelfunctions |
108 | |
109 | === modified file 'src/graphic/styles/font_style.h' |
110 | --- src/graphic/styles/font_style.h 2019-06-01 14:16:25 +0000 |
111 | +++ src/graphic/styles/font_style.h 2019-09-06 14:10:07 +0000 |
112 | @@ -67,7 +67,6 @@ |
113 | bool init_underline, |
114 | bool init_shadow); |
115 | explicit FontStyleInfo(const FontStyleInfo& other); |
116 | - FontStyleInfo& operator=(const FontStyleInfo& other) = default; |
117 | |
118 | std::string as_font_tag(const std::string& text) const; |
119 | |
120 | |
121 | === modified file 'src/graphic/styles/text_panel_style.h' |
122 | --- src/graphic/styles/text_panel_style.h 2019-05-26 17:21:15 +0000 |
123 | +++ src/graphic/styles/text_panel_style.h 2019-09-06 14:10:07 +0000 |
124 | @@ -38,7 +38,6 @@ |
125 | : background_(new UI::PanelStyleInfo(other.background())), |
126 | font_(new UI::FontStyleInfo(other.font())) { |
127 | } |
128 | - TextPanelStyleInfo& operator=(const TextPanelStyleInfo& other) = default; |
129 | |
130 | const UI::FontStyleInfo& font() const { |
131 | return *font_.get(); |
132 | |
133 | === modified file 'src/io/filesystem/test/test_filesystem.cc' |
134 | --- src/io/filesystem/test/test_filesystem.cc 2019-04-09 16:43:49 +0000 |
135 | +++ src/io/filesystem/test/test_filesystem.cc 2019-09-06 14:10:07 +0000 |
136 | @@ -49,6 +49,7 @@ |
137 | |
138 | // Triggered by BOOST_AUTO_TEST_CASE |
139 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
140 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
141 | |
142 | BOOST_AUTO_TEST_SUITE(FileSystemTests) |
143 | #ifndef _WIN32 |
144 | |
145 | === modified file 'src/logic/CMakeLists.txt' |
146 | --- src/logic/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
147 | +++ src/logic/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
148 | @@ -63,7 +63,7 @@ |
149 | logic_commands |
150 | logic_game_settings |
151 | ui_basic |
152 | - widelands_ball_of_mud |
153 | + widelands_options |
154 | wui |
155 | ) |
156 | |
157 | @@ -258,7 +258,7 @@ |
158 | sound |
159 | sound_constants |
160 | ui_basic |
161 | - widelands_ball_of_mud |
162 | + widelands_options |
163 | wui # TODO(GunChleoc): Circular dependency |
164 | ) |
165 | |
166 | |
167 | === modified file 'src/logic/map_objects/tribes/productionsite.cc' |
168 | --- src/logic/map_objects/tribes/productionsite.cc 2019-08-20 17:35:33 +0000 |
169 | +++ src/logic/map_objects/tribes/productionsite.cc 2019-09-06 14:10:07 +0000 |
170 | @@ -1090,7 +1090,7 @@ |
171 | static const uint32_t entire_duration = 10 * 60 * 1000; |
172 | if (duration > duration_cap) { |
173 | duration = duration_cap; |
174 | - }; |
175 | + } |
176 | const uint32_t past_duration = entire_duration - duration; |
177 | crude_percent_ = |
178 | (crude_percent_ * past_duration + produced * duration * 10000) / entire_duration; |
179 | |
180 | === modified file 'src/network/CMakeLists.txt' |
181 | --- src/network/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
182 | +++ src/network/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
183 | @@ -61,5 +61,6 @@ |
184 | ui_basic |
185 | ui_fsmenu_gameloading |
186 | widelands_ball_of_mud |
187 | + widelands_options |
188 | wui |
189 | ) |
190 | |
191 | === modified file 'src/notifications/test/notifications_test.cc' |
192 | --- src/notifications/test/notifications_test.cc 2019-02-23 11:00:49 +0000 |
193 | +++ src/notifications/test/notifications_test.cc 2019-09-06 14:10:07 +0000 |
194 | @@ -29,6 +29,7 @@ |
195 | |
196 | // Triggered by BOOST_AUTO_TEST_CASE |
197 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
198 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
199 | |
200 | struct SimpleNote { |
201 | CAN_BE_SENT_AS_NOTE(100) |
202 | |
203 | === modified file 'src/scripting/CMakeLists.txt' |
204 | --- src/scripting/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
205 | +++ src/scripting/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
206 | @@ -129,7 +129,7 @@ |
207 | scripting_luna |
208 | third_party_eris |
209 | ui_basic |
210 | - widelands_ball_of_mud |
211 | + widelands_options |
212 | wui |
213 | wui_mapview_pixelfunctions |
214 | ) |
215 | |
216 | === modified file 'src/scripting/test/test_luna.cc' |
217 | --- src/scripting/test/test_luna.cc 2019-02-23 11:00:49 +0000 |
218 | +++ src/scripting/test/test_luna.cc 2019-09-06 14:10:07 +0000 |
219 | @@ -30,6 +30,7 @@ |
220 | |
221 | // Triggered by BOOST_AUTO_TEST_CASE |
222 | CLANG_DIAG_OFF("-Wdisabled-macro-expansion") |
223 | +CLANG_DIAG_OFF("-Wused-but-marked-unused") |
224 | |
225 | #ifndef BEGIN_LUNA_PROPERTIES |
226 | #define BEGIN_LUNA_PROPERTIES(klass) const PropertyType<klass> klass::Properties[] = { |
227 | |
228 | === modified file 'src/sound/CMakeLists.txt' |
229 | --- src/sound/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
230 | +++ src/sound/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
231 | @@ -34,5 +34,5 @@ |
232 | logic_exceptions |
233 | random |
234 | sound_constants |
235 | - widelands_ball_of_mud |
236 | + widelands_options |
237 | ) |
238 | |
239 | === modified file 'src/ui_basic/CMakeLists.txt' |
240 | --- src/ui_basic/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
241 | +++ src/ui_basic/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
242 | @@ -76,4 +76,5 @@ |
243 | sound |
244 | sound_constants |
245 | widelands_ball_of_mud |
246 | + widelands_options |
247 | ) |
248 | |
249 | === modified file 'src/ui_fsmenu/CMakeLists.txt' |
250 | --- src/ui_fsmenu/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
251 | +++ src/ui_fsmenu/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
252 | @@ -19,6 +19,7 @@ |
253 | ui_fsmenu_base |
254 | sound |
255 | widelands_ball_of_mud |
256 | + widelands_options |
257 | wui_sound_options |
258 | ) |
259 | |
260 | @@ -81,7 +82,7 @@ |
261 | ui_basic |
262 | ui_fsmenu_base |
263 | ui_fsmenu_main_menu |
264 | - widelands_ball_of_mud |
265 | + widelands_options |
266 | wui_common_mapdetails |
267 | wui |
268 | ) |
269 | @@ -118,7 +119,7 @@ |
270 | ui_fsmenu_helpwindow |
271 | ui_fsmenu_loading_common |
272 | ui_fsmenu_maploading |
273 | - widelands_ball_of_mud |
274 | + widelands_options |
275 | wui |
276 | wui_chat_ui |
277 | wui_common_gamedetails |
278 | @@ -177,7 +178,7 @@ |
279 | sound |
280 | ui_basic |
281 | ui_fsmenu_base |
282 | - widelands_ball_of_mud |
283 | + widelands_options |
284 | wui_chat_ui |
285 | ) |
286 | |
287 | |
288 | === modified file 'src/ui_fsmenu/options.cc' |
289 | --- src/ui_fsmenu/options.cc 2019-08-25 14:50:16 +0000 |
290 | +++ src/ui_fsmenu/options.cc 2019-09-06 14:10:07 +0000 |
291 | @@ -680,5 +680,5 @@ |
292 | g_sh->save_config(); |
293 | |
294 | // Now write to file |
295 | - write_config(WLApplication::get()); |
296 | + write_config(); |
297 | } |
298 | |
299 | === modified file 'src/wlapplication.cc' |
300 | --- src/wlapplication.cc 2019-09-05 20:04:47 +0000 |
301 | +++ src/wlapplication.cc 2019-09-06 14:10:07 +0000 |
302 | @@ -228,6 +228,9 @@ |
303 | |
304 | // Set up the homedir. Exit 1 if the homedir is illegal or the logger couldn't be initialized for |
305 | // Windows. |
306 | +// Also sets the config directory. This defaults to $XDG_CONFIG_HOME/widelands/config on Unix. |
307 | +// Defaults to homedir/config everywhere else, if homedir is set manually or if |
308 | +// built without XDG-support. |
309 | void WLApplication::setup_homedir() { |
310 | // Check if we have a command line override |
311 | if (commandline_.count("homedir")) { |
312 | @@ -274,6 +277,12 @@ |
313 | // Homedir is ready, so we can log normally from now on |
314 | log("Set home directory: %s\n", homedir_.c_str()); |
315 | } |
316 | + |
317 | +#ifdef USE_XDG |
318 | + set_config_directory(userconfigdir_); |
319 | +#else |
320 | + set_config_directory(homedir_); |
321 | +#endif |
322 | } |
323 | |
324 | WLApplication* WLApplication::the_singleton = nullptr; |
325 | @@ -766,7 +775,7 @@ |
326 | bool WLApplication::init_settings() { |
327 | |
328 | // Read in the configuration file |
329 | - read_config(this); |
330 | + read_config(); |
331 | |
332 | // Then parse the commandline - overwrites conffile settings |
333 | handle_commandline_parameters(); |
334 | @@ -846,7 +855,7 @@ |
335 | |
336 | // Save configuration now. Otherwise, the UUID is not saved |
337 | // when the game crashes, losing part of its advantage |
338 | - write_config(this); |
339 | + write_config(); |
340 | |
341 | return true; |
342 | } |
343 | @@ -872,8 +881,7 @@ |
344 | void WLApplication::shutdown_settings() { |
345 | // To be proper, release our textdomain |
346 | i18n::release_textdomain(); |
347 | - |
348 | - write_config(this); |
349 | + write_config(); |
350 | } |
351 | |
352 | void WLApplication::shutdown_hardware() { |
353 | |
354 | === modified file 'src/wlapplication.h' |
355 | --- src/wlapplication.h 2019-07-20 14:32:57 +0000 |
356 | +++ src/wlapplication.h 2019-09-06 14:10:07 +0000 |
357 | @@ -196,13 +196,6 @@ |
358 | void replay(); |
359 | static void emergency_save(Widelands::Game&); |
360 | |
361 | -#ifdef USE_XDG |
362 | - // this is only for src/wlapplication_options.cc |
363 | - std::string get_userconfigdir() { |
364 | - return userconfigdir_; |
365 | - } |
366 | -#endif |
367 | - |
368 | private: |
369 | WLApplication(int argc, char const* const* argv); |
370 | |
371 | |
372 | === modified file 'src/wlapplication_options.cc' |
373 | --- src/wlapplication_options.cc 2019-08-31 03:22:10 +0000 |
374 | +++ src/wlapplication_options.cc 2019-09-06 14:10:07 +0000 |
375 | @@ -19,14 +19,17 @@ |
376 | |
377 | #include "wlapplication_options.h" |
378 | |
379 | +#include <cassert> |
380 | +#include <memory> |
381 | + |
382 | #include "base/log.h" |
383 | #include "io/filesystem/disk_filesystem.h" |
384 | -#include "io/profile.h" |
385 | #include "logic/filesystem_constants.h" |
386 | -#include "wlapplication.h" |
387 | |
388 | static Profile g_options(Profile::err_log); |
389 | |
390 | +static std::unique_ptr<FileSystem> config_dir = nullptr; |
391 | + |
392 | void check_config_used() { |
393 | g_options.check_used(); |
394 | } |
395 | @@ -110,26 +113,22 @@ |
396 | g_options.pull_section(section.c_str()).set_string(name.c_str(), value.c_str()); |
397 | } |
398 | |
399 | -void read_config(WLApplication* wlapplication) { |
400 | -#ifdef USE_XDG |
401 | - RealFSImpl dir(wlapplication->get_userconfigdir()); |
402 | - dir.ensure_directory_exists("."); |
403 | - log("Set configuration file: %s/%s\n", wlapplication->get_userconfigdir().c_str(), |
404 | - kConfigFile.c_str()); |
405 | - g_options.read(kConfigFile.c_str(), "global", dir); |
406 | -#else |
407 | - g_options.read(kConfigFile.c_str(), "global"); |
408 | -#endif |
409 | -} |
410 | - |
411 | -void write_config(WLApplication* wlapplication) { |
412 | + |
413 | +void set_config_directory(const std::string& userconfigdir) { |
414 | + config_dir.reset(new RealFSImpl(userconfigdir)); |
415 | + config_dir->ensure_directory_exists("."); |
416 | + log("Set configuration file: %s/%s\n", userconfigdir.c_str(), kConfigFile.c_str()); |
417 | +} |
418 | + |
419 | +void read_config() { |
420 | + assert(config_dir != nullptr); |
421 | + g_options.read(kConfigFile.c_str(), "global", *config_dir); |
422 | +} |
423 | + |
424 | +void write_config() { |
425 | + assert(config_dir != nullptr); |
426 | try { // overwrite the old config file |
427 | -#ifdef USE_XDG |
428 | - RealFSImpl dir(wlapplication->get_userconfigdir()); |
429 | - g_options.write(kConfigFile.c_str(), true, dir); |
430 | -#else |
431 | - g_options.write(kConfigFile.c_str(), true); |
432 | -#endif |
433 | + g_options.write(kConfigFile.c_str(), true, *config_dir); |
434 | } catch (const std::exception& e) { |
435 | log("WARNING: could not save configuration: %s\n", e.what()); |
436 | } catch (...) { |
437 | |
438 | === modified file 'src/wlapplication_options.h' |
439 | --- src/wlapplication_options.h 2019-08-28 18:34:58 +0000 |
440 | +++ src/wlapplication_options.h 2019-09-06 14:10:07 +0000 |
441 | @@ -21,7 +21,6 @@ |
442 | #define WL_WLAPPLICATION_OPTIONS_H |
443 | |
444 | #include "io/profile.h" |
445 | -#include "wlapplication.h" |
446 | |
447 | /* |
448 | * Further explanations for all functions and its return values |
449 | @@ -77,31 +76,20 @@ |
450 | const std::string& value); |
451 | |
452 | /* |
453 | + * Sets the directory where to read/write kConfigFile. |
454 | + */ |
455 | +void set_config_directory(const std::string& userconfigdir); |
456 | + |
457 | +/* |
458 | * Reads the configuration from kConfigFile. |
459 | - * Defaults to $XDG_CONFIG_HOME/widelands/config on Unix. |
460 | - * Defaults to homedir/config everywhere else, if homedir is set manually or if |
461 | - * built without XDG-support. |
462 | - * |
463 | - * This function needs access to the WLApplication object to distinguish |
464 | - * between multiple possible states. |
465 | - * While we could use WLApplication::get() this would get us in an infinite loop |
466 | - * because this function will be called in the constructor of said object and |
467 | - * WLApplication::get() spawns another object if there isn't one yet. |
468 | + * Assumes that set_config_directory has been called. |
469 | */ |
470 | -void read_config(WLApplication*); |
471 | +void read_config(); |
472 | |
473 | /* |
474 | * Writes the configuration to kConfigFile. |
475 | - * Defaults to $XDG_CONFIG_HOME/widelands/config on Unix. |
476 | - * Defaults to homedir/config everywhere else, if homedir is set manually or if |
477 | - * built without XDG-support. |
478 | - * |
479 | - * This function needs access to the WLApplication object to distinguish |
480 | - * between multiple possible states. |
481 | - * While we could use WLApplication::get() this would get us in an infinite loop |
482 | - * because this function will be called in the constructor of said object and |
483 | - * WLApplication::get() spawns another object if there isn't one yet. |
484 | + * * Assumes that set_config_directory has been called. |
485 | */ |
486 | -void write_config(WLApplication*); |
487 | +void write_config(); |
488 | |
489 | #endif // end of include guard: WL_WLAPPLICATION_OPTIONS_H |
490 | |
491 | === modified file 'src/wui/CMakeLists.txt' |
492 | --- src/wui/CMakeLists.txt 2019-08-27 19:00:30 +0000 |
493 | +++ src/wui/CMakeLists.txt 2019-09-06 14:10:07 +0000 |
494 | @@ -33,7 +33,7 @@ |
495 | logic |
496 | sound |
497 | ui_basic |
498 | - widelands_ball_of_mud |
499 | + widelands_options |
500 | wui |
501 | ) |
502 | |
503 | @@ -154,6 +154,7 @@ |
504 | logic_widelands_geometry |
505 | ui_basic |
506 | widelands_ball_of_mud |
507 | + widelands_options |
508 | wui_mapview_pixelfunctions |
509 | ) |
510 | |
511 | @@ -314,7 +315,7 @@ |
512 | scripting_lua_table |
513 | sound |
514 | ui_basic |
515 | - widelands_ball_of_mud |
516 | + widelands_options |
517 | wui_chat_ui |
518 | wui_common_gamedetails |
519 | wui_economy_options |
I'm done checking the logs, so this is ready for review now.