src/config.h

changeset 239
ea09eeba1c2b
parent 189
ac2d3e8dd110
child 286
7a562bf3d829
equal deleted inserted replaced
238:3b35f502a6c7 239:ea09eeba1c2b
24 // ============================================================================= 24 // =============================================================================
25 #include <QString> 25 #include <QString>
26 #include <qkeysequence.h> 26 #include <qkeysequence.h>
27 27
28 #define MAX_INI_LINE 512 28 #define MAX_INI_LINE 512
29 #define NUM_CONFIG (g_configPointers.size ()) 29 #define MAX_CONFIG 512
30 30
31 #define cfg(T, NAME, DEFAULT) \ 31 #define cfg(T, NAME, DEFAULT) \
32 T##config NAME (DEFAULT, #NAME, #T, #DEFAULT) 32 T##config NAME (DEFAULT, #NAME, #T, #DEFAULT)
33 33
34 #define extern_cfg(T, NAME) \ 34 #define extern_cfg(T, NAME) \
61 static void reset (); 61 static void reset ();
62 static str dirpath (); 62 static str dirpath ();
63 static str filepath (); 63 static str filepath ();
64 }; 64 };
65 65
66 extern std::vector<config*> g_configPointers; 66 void addConfig (config* ptr);
67 67
68 // ============================================================================= 68 // =============================================================================
69 #define DEFINE_UNARY_OPERATOR(T, OP) \ 69 #define DEFINE_UNARY_OPERATOR(T, OP) \
70 T operator OP () { \ 70 T operator OP () { \
71 return (OP value); \ 71 return (OP value); \
116 { \ 116 { \
117 value = defval = _defval; \ 117 value = defval = _defval; \
118 name = _name; \ 118 name = _name; \
119 typestring = _typestring; \ 119 typestring = _typestring; \
120 defaultstring = _defaultstring; \ 120 defaultstring = _defaultstring; \
121 g_configPointers.push_back (this); \ 121 addConfig (this); \
122 } \ 122 } \
123 operator T () { \ 123 operator T () { \
124 return value; \ 124 return value; \
125 } \ 125 } \
126 configtype_e getType () { \ 126 configtype_e getType () { \

mercurial