config.h

changeset 78
c190fe218506
parent 69
6790dea720a8
child 104
6e29bb0e83c5
equal deleted inserted replaced
77:7c2f500405fe 78:c190fe218506
23 #include "str.h" 23 #include "str.h"
24 24
25 // ============================================================================= 25 // =============================================================================
26 #define CONFIGFILE APPNAME ".cfg" 26 #define CONFIGFILE APPNAME ".cfg"
27 #include <QString> 27 #include <QString>
28 #include <qkeysequence.h>
28 29
29 #define MAX_INI_LINE 512 30 #define MAX_INI_LINE 512
30 #define NUM_CONFIG (g_pConfigPointers.size ()) 31 #define NUM_CONFIG (g_pConfigPointers.size ())
31 32
32 #define cfg(T, NAME, DEFAULT) \ 33 #define cfg(T, NAME, DEFAULT) \
40 CONFIG_none, 41 CONFIG_none,
41 CONFIG_int, 42 CONFIG_int,
42 CONFIG_str, 43 CONFIG_str,
43 CONFIG_float, 44 CONFIG_float,
44 CONFIG_bool, 45 CONFIG_bool,
46 CONFIG_keyseq,
45 }; 47 };
46 48
47 // ========================================================= 49 // =========================================================
48 class config { 50 class config {
49 public: 51 public:
211 IMPLEMENT_CONFIG (bool) 213 IMPLEMENT_CONFIG (bool)
212 DEFINE_ALL_COMPARE_OPERATORS (bool) 214 DEFINE_ALL_COMPARE_OPERATORS (bool)
213 DEFINE_ASSIGN_OPERATOR (bool, =) 215 DEFINE_ASSIGN_OPERATOR (bool, =)
214 }; 216 };
215 217
218 // =============================================================================
219 typedef QKeySequence keyseq;
220
221 CONFIGTYPE (keyseq) {
222 public:
223 IMPLEMENT_CONFIG (keyseq)
224 DEFINE_ALL_COMPARE_OPERATORS (keyseq)
225 DEFINE_ASSIGN_OPERATOR (keyseq, =)
226 };
227
216 #endif // __OPTIONS_H__ 228 #endif // __OPTIONS_H__

mercurial