int main(int argc, char *argv[]) {

	VersionUpdateConfig *config = malloc(sizeof(VersionUpdateConfig));
	initGlobalVar();
	parseArgs(config, argc, argv);

	pthread_t tid;
	int ret = pthread_create(&tid, NULL, (void *)intervalWork, (void *)config);
	if(ret != 0) {
		fprintf(stderr, "create thread error\n", NULL);
		exit(1);
	}

	char buffer[DEFAULT_BUF_LEN];

	for(;;) {
		int nBytesRead = read(0,buffer, sizeof(buffer));
		if(nBytesRead == 0) {
			exit(2);
		}
		if(errno == EINTR) {
			continue;
		}
		if(debug) {
			fprintf(stdout,"%s\n", buffer);
		}
	}
}
SwitchLayout::SwitchLayout(QWidget *parent) : QWidget(parent)
{
    initGlobalVar(parent);
}