src/main.cpp

Wed, 17 Jul 2013 00:31:04 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Wed, 17 Jul 2013 00:31:04 +0300
changeset 2
1d544788a8b3
parent 1
c9b22c06307c
child 3
d0b278fd29d5
permissions
-rw-r--r--

argh

#include <QApplication>
#include "types.h"
#include "config.h"

// =============================================================================
// -----------------------------------------------------------------------------
int main( int argc, char* argv[] ) {
	QApplication app( argc, argv );
	
	for( int i = 1; i < argc; ++i ) {
		str arg = argv[i];
		
		if( arg == "--config" ) {
			ConfigBox* dlg = new ConfigBox;
			dlg->show();
		}
	}
	
	print( "Hello world! This is " APPNAME " %1\n", versionString() );
	return app.exec();
}

// =============================================================================
// -----------------------------------------------------------------------------
QString versionString() {
	str text = fmt( "v%1.%2", VERSION_MAJOR, VERSION_MINOR );
#if VERSION_PATCH != 0
	text += fmt( ".%1", VERSION_PATCH );
#endif
	
#if BUILD_ID == BUILD_INTERNAL
	text += "-intern";
#elif BUILD_ID == BUILD_ALPHA
	text += "-alpha";
#elif BUILD_ID == BUILD_BETA
	text += "-beta";
#elif BUILD_ID == BUILD_RC
	text += fmt( "-rc%1", RC_ID );
#elif BUILD_ID == BUILD_RELEASE
	text += "-rel";
#else
# error Invalid build code!
#endif // BUILD_ID
	
	return text;
}

mercurial