add: app->restoreSession();
context: int main(int argc, char *argv[]){	KAboutData aboutData(PROGRAM_NAME, I18N_NOOP("KAlarm"),		KALARM_VERSION, I18N_NOOP("       " PROGRAM_NAME "\n"		"       " PROGRAM_NAME " [-bcilLrstu] -f URL\n"		"       " PROGRAM_NAME " [-bcilLrstu] message\n"		"       " PROGRAM_NAME " [-ilLrtu] -e commandline\n"		"       " PROGRAM_NAME " --tray | --reset | --stop\n"		"       " PROGRAM_NAME " --cancelEvent eventID [--calendarURL url]\n"		"       " PROGRAM_NAME " --triggerEvent eventID [--calendarURL url]\n"		"       " PROGRAM_NAME " --handleEvent eventID [--calendarURL url]\n"		"       " PROGRAM_NAME " [generic_options]\n\n"		"KDE personal alarm message and command scheduler"),		KAboutData::License_GPL,		"(c) 2001, 2002, David Jarvie", 0L, "http://www.astrojar.org.uk/linux");	aboutData.addAuthor("David Jarvie", 0L, "software@astrojar.org.uk");	// Fetch all command line options/arguments after --exec and concatenate	// them into a single argument. Then change the leading '-'.	// This is necessary because the "!" indicator in the 'options'	// array above doesn't work (on KDE2, at least)	for (int i = 0;  i < argc;  ++i)	{		if (!strcmp(argv[i], "-e") || !strcmp(argv[i], "--exec"))		{			while (++i < argc)			{				execArguments += argv[i];				if (i < argc - 1)					execArguments += ' ';				argv[i][0] = 'x';     // in case it's an option			}			break;		}	}	KCmdLineArgs::init(argc, argv, &aboutData);	KCmdLineArgs::addCmdLineOptions(options);	KUniqueApplication::addCmdLineOptions();	if (!KAlarmApp::start())	{		// An instance of the application is already running		exit(0);	}	// This is the child instance	KAlarmApp* app = KAlarmApp::getInstance();	return app->exec();}