add: tp->startDaemonIfNeeded();
context: int main(int argc, char** argv){	FUNCTIONSETUP;        KAboutData about("kpilot", I18N_NOOP("KPilot"),                         KPILOT_VERSION,                         "KPilot - Hot-sync software for unix\n\n",                         KAboutData::License_GPL,                         "(c) 1998-2000, Dan Pilone");	about.addAuthor("Dan Pilone",		I18N_NOOP("Project Leader"),		"pilone@slac.com",		"http://www.slac.com/pilone/kpilot_home/");	about.addAuthor("Adriaan de Groot",		I18N_NOOP("Maintainer"),		"adridg@cs.kun.nl",		"http://www.cs.kun.nl/~adridg/kpilot/");	about.addAuthor("Preston Brown",		I18N_NOOP("VCal conduit"));	about.addAuthor("Greg Stern",		I18N_NOOP("Abbrowser conduit"));	about.addAuthor("Chris Molnar",		I18N_NOOP("Expenses conduit"));	about.addAuthor("Heiko Purnhagen",		I18N_NOOP("Bugfixer"));	about.addAuthor("Joerg Habenicht",		I18N_NOOP("Bugfixer"));	about.addAuthor("Martin Junius",		I18N_NOOP("XML GUI"),		"mj@m-j-s.net", "http://www.m-j-s.net/kde/");        KCmdLineArgs::init(argc, argv, &about);	KCmdLineArgs::addCmdLineOptions(kpilotoptions);	KUniqueApplication::addCmdLineOptions();	KCmdLineArgs *p=KCmdLineArgs::parsedArgs();#ifdef DEBUG	debug_level=atoi(p->getOption("debug"));#endif	if (p->isSet("setup")) { run_mode='s'; } 	if (p->isSet("cs")) { run_mode='c'; }	if (!KUniqueApplication::start())	{		return 0;	}	KUniqueApplication a(true,true);	KPilotConfigSettings &c = KPilotConfig::getConfig();	(void)KPilotConfig::getDebugLevel(c);	if (c.getVersion() < KPilotConfig::ConfigurationVersion)	{		run_mode='S';	}	if (run_mode=='c')	{		CConduitSetup *cs = new CConduitSetup(0L);		int r = cs->exec();		if (r)		{			return 1;	// Dialog cancelled		}		else		{			return 0;		}	}	if ((run_mode=='s') || (run_mode=='S'))	{#ifdef DEBUG			kdDebug() << fname << ": Running setup first."				<< " (mode " << run_mode << ")"				<< endl ;#endif		KPilotConfigDialog * options = new KPilotConfigDialog (0L,			"configDialog",true);		int r = options->exec();		if (run_mode=='s')		{			if (!r)			{				return 1;			}			else			{				return 0;			}		}		if (!r) return 1;					// The options dialog may have changed the group		// while reading or writing settings (still a		// bad idea, actually).		//		c.resetGroup();	}	if (c.getVersion() < KPilotConfig::ConfigurationVersion)	{		kdWarning() << __FUNCTION__ << ": Is still not configured for use."			<< endl;		return 1;	}	QString daemonError;	QCString daemonDCOP;	int daemonPID;	if (KApplication::startServiceByDesktopPath(		"Utilities/kpilotdaemon.desktop",		QString::null,		&daemonError,		&daemonDCOP,		&daemonPID#if (KDE_VERSION >= 220)		// Startup notification was added in 2.2		,		"0"#endif		))	{		kdError() << __FUNCTION__			<< ": Can't start daemon."			<< endl;	}        KPilotInstaller *tp = new KPilotInstaller();	if (tp->status() == KPilotInstaller::Error)	{		delete tp;		tp=0;		return 1;	}        KGlobal::dirs()->addResourceType("pilotdbs", "share/apps/kpilot/DBBackup");	tp->show();	a.setMainWidget(tp);	return a.exec();}