Commit graph

31 commits

Author SHA1 Message Date
gfgtdf
f8bd32eb15 Deploy and refactor config::optional_child
Previously the config class had an operator bool and
it was a common pattern to use if(const config& = cfg.child(..)).
While this pattern was nice to use. It has severe drawbacks, in
particular it was unclear whether a function that took a config&
parameter allowed "invalid" configs, while most functions
did not, there were some that did. Furtheremore it lead to a few
buggy codes that were unconvered by this change (Not fixed though!),
in particular codes that tested local config objects that were
not references to being invalid, which could never be the case.
This commits replaces those with just `true` in order to not
change behaviour.

Some obvious cases were also removed including for example
things like `assert(config());` There is ony case in the ai code
that i'm not 100% sure of where one implementation of a virtual
function checked for an invalid config and another one that didn't.

With this, all code that check for a config child to be
present now uses config::optional_child which returns an object
that behaves similar to optional<(const) config&>, so it throws
on invalid dereferencing. But it also has operator[string] for
convinience, in particular to make is similary
easy to use the the previous `if (config& = .. child())`.
Also it has a tool DEBUG_CONFIG which tests whether all
optional_config values are checked before they are derefereneced.

Another method manditory_child was
added that throws when the key is not found, which replaces all
occurances of child() that did not check whether the result was
valid. This was neccecary (this= adding a new method instead of
renaming .child) to keep track of converted changes, and be sure
no occurances of child() were accidentally changed to the
throwing version.

We might want to rename one of mandatory_child or optional_child
to just child later. Not sure which one yet. I think it's better
to keep it in the current state (no config::child() ) for a while
though, so that people that currently used child() in their open
prs or other work get an error and not wrongly rely on the previous
behviour of config::child.

The interface of vconfig was not changed in this commit.
2023-04-03 00:39:12 +02:00
Martin Hrubý (hrubymar10)
6f468a3757
Migrate links to https if available
Closes #3343
2019-09-08 07:53:28 +02:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0
(cherry-picked from commit bc4d22dc72)
2018-10-07 03:23:36 +00:00
Charles Dang
3a90f86674 Addressed more whitespace issues from #2613
[ci skip]
2018-03-12 03:48:59 +11:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
Matthias Krüger
1a09ba1c75 doc: fix some typos 2018-02-06 23:03:06 +11:00
aquileia
c19e729c6b gitignore: Merge rules from doc/ and data/tools 2014-06-09 01:00:50 +02:00
Mark de Wever
5da495122a Add a new GUI2 tooltip.
The placement of tooltip is controlled by the WML of the GUI engine. The
code is not used yet, only available with a proof-of-concept define named
DEBUG_TOOLTIP.
2014-02-08 21:13:08 +01:00
Mark de Wever
b2832d94be Add the initial draft of the new addon server.
The draft is still preliminary and needs polishing and extending.
2012-03-10 10:19:48 +00:00
Steven Panek
2e3a99ec86 Set svn:ignore. 2011-04-09 20:50:03 +00:00
Mark de Wever
7fbfe57b36 Fix documentation errors/typos and grammar.
Errors found by zaroth while reading the document. (patch #2613).
2011-04-09 16:00:26 +00:00
Mark de Wever
634051f7e2 Clarify the documentation a bit.
Issue spotted by zaroth.
2011-04-09 16:00:23 +00:00
Mark de Wever
54ceda8497 Improve linking to references.
Use cleveref and add some helper macros for references it can't handle
(yet). Support for listings is in a newer version, so look at that in
the future.
2011-02-26 08:54:02 +00:00
Mark de Wever
65dca6e323 Fix some references for the gui2 design document. 2011-02-26 08:53:59 +00:00
Mark de Wever
f469451755 Improve the looks of the listing a bit.
Fixing some reference styles and shrink the size of the text.
2011-02-26 08:53:56 +00:00
Mark de Wever
f4cc4ed993 Improve the used packages for gui2.tex. 2011-02-26 08:53:53 +00:00
Mark de Wever
6da140a22a Seperate gui2 design document in several files. 2011-02-09 19:15:22 +00:00
Mark de Wever
ea9ff40e58 Add a cmake target to build the design document. 2011-02-08 19:37:36 +00:00
Ignacio R. Morelle
d6a3de1938 Apply patch #2213 by stikonas, using file #11274 2010-11-21 01:56:29 +00:00
Gabriel Morin
d5e99256b6 Whiteboard: erase docs since they're rather outdated 2010-08-18 01:41:09 +00:00
Steven Panek
a5d40fe960 Ran space2underscore.py. 2010-06-18 07:00:16 +00:00
Gabriel Morin
5a22743874 Class and Sequence diagrams for the whiteboard framework 2010-06-04 20:05:15 +00:00
Mark de Wever
e2b886dfa6 Add the window part to the design document. 2010-04-30 14:21:02 +00:00
Mark de Wever
92b1c831e5 Fix some formatting in the design documentation. 2010-04-30 13:59:39 +00:00
Mark de Wever
3aa3f9d914 Fix some references in the design document. 2010-04-30 13:52:45 +00:00
Mark de Wever
961dbec1d4 Make the designdoc 'compile' again. 2010-04-24 13:58:08 +00:00
Mark de Wever
8607604a71 Update design documentation. 2010-04-12 19:26:09 +00:00
Mark de Wever
dcfd8bea24 Update design document. 2010-04-05 09:51:00 +00:00
Mark de Wever
5c6ef7e88e Add bootstrap info to the design documentation. 2010-03-30 21:56:20 +00:00
Mark de Wever
49b298b8a5 Add helper classes to improve callback handling. 2010-03-30 09:12:17 +00:00
Mark de Wever
76a2517739 Adds the draft gui2 design documentation.
This document describes parts of the design of gui2 and the ideas
behind the gui in general. It's composed of several notes I've written
during the development. More parts will be added later.
2010-03-20 16:52:57 +00:00