Wed, 17 Jul 2013 00:31:04 +0300
argh
1 | 1 | #include <QApplication> |
0 | 2 | #include "types.h" |
1 | 3 | #include "config.h" |
0 | 4 | |
1 | 5 | // ============================================================================= |
6 | // ----------------------------------------------------------------------------- | |
7 | int main( int argc, char* argv[] ) { | |
8 | QApplication app( argc, argv ); | |
9 | ||
10 | for( int i = 1; i < argc; ++i ) { | |
11 | str arg = argv[i]; | |
12 | ||
13 | if( arg == "--config" ) { | |
14 | ConfigBox* dlg = new ConfigBox; | |
15 | dlg->show(); | |
16 | } | |
17 | } | |
18 | ||
2 | 19 | print( "Hello world! This is " APPNAME " %1\n", versionString() ); |
1 | 20 | return app.exec(); |
0 | 21 | } |
22 | ||
1 | 23 | // ============================================================================= |
24 | // ----------------------------------------------------------------------------- | |
0 | 25 | QString versionString() { |
26 | str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR ); | |
27 | #if VERSION_PATCH != 0 | |
1 | 28 | text += fmt( ".%1", VERSION_PATCH ); |
0 | 29 | #endif |
30 | ||
31 | #if BUILD_ID == BUILD_INTERNAL | |
32 | text += "-intern"; | |
33 | #elif BUILD_ID == BUILD_ALPHA | |
34 | text += "-alpha"; | |
35 | #elif BUILD_ID == BUILD_BETA | |
36 | text += "-beta"; | |
37 | #elif BUILD_ID == BUILD_RC | |
38 | text += fmt( "-rc%1", RC_ID ); | |
39 | #elif BUILD_ID == BUILD_RELEASE | |
40 | text += "-rel"; | |
41 | #else | |
42 | # error Invalid build code! | |
43 | #endif // BUILD_ID | |
44 | ||
45 | return text; | |
46 | } |