rem: void SyncStack::nextAction(SyncAction *b) { FUNCTIONSETUP;  if (b) { #ifdef DEBUG DEBUGDAEMON << fname << ": Completed action " << b->name() << endl; #endif delete b; }  if (isEmpty()) { emit syncDone(this); return; }  SyncAction *a = nextAction();  if (!a) { kdWarning() << k_funcinfo << ": NULL action on stack." << endl; return; }  #ifdef DEBUG DEBUGDAEMON << fname << ": Will run action " << a->name() << endl; #endif  QObject::connect(a, SIGNAL(logMessage(const QString &)), this, SIGNAL(logMessage(const QString &))); QObject::connect(a, SIGNAL(logError(const QString &)), this, SIGNAL(logMessage(const QString &))); QObject::connect(a, SIGNAL(logProgress(const QString &, int)), this, SIGNAL(logProgress(const QString &, int))); QObject::connect(a, SIGNAL(syncDone(SyncAction *)), this, SLOT(nextAction(SyncAction *)));  QTimer::singleShot(0,a,SLOT(exec())); }
add: SyncAction *nextAction() { return SyncActionStack.pop(); };
context: void SyncStack::nextAction(SyncAction *b){	FUNCTIONSETUP;	if (b)	{#ifdef DEBUG		DEBUGDAEMON << fname			<< ": Completed action "			<< b->name()			<< endl;#endif		delete b;	}	if (isEmpty())	{		emit syncDone(this);		return;	}	SyncAction *a = nextAction();	if (!a)	{		kdWarning() << k_funcinfo			<< ": NULL action on stack."			<< endl;		return;	}#ifdef DEBUG	DEBUGDAEMON << fname		<< ": Will run action "		<< a->name()		<< endl;#endif	QObject::connect(a, SIGNAL(logMessage(const QString &)),		this, SIGNAL(logMessage(const QString &)));	QObject::connect(a, SIGNAL(logError(const QString &)),		this, SIGNAL(logMessage(const QString &)));	QObject::connect(a, SIGNAL(logProgress(const QString &, int)),		this, SIGNAL(logProgress(const QString &, int)));	QObject::connect(a, SIGNAL(syncDone(SyncAction *)),		this, SLOT(nextAction(SyncAction *)));	QTimer::singleShot(0,a,SLOT(exec()));}