I was tring to be succient
record1 ()
{
...
if ((asbuiltEnabled)) {
answered = false;
emit action ("toolbar", "1whatpage");
QElapsedTimer timer;
for (timer.start (); !timer.hasExpired (2000); ) {
if (answered == true) {
*dbg << "answered " << timer.elapsed () << "ms page " << page[1] << "\n"; dbg->flush ();
answered = false;
break;
}
}
if (timer.elapsed () > 1990)
asbuiltEnabled = false;
}
*dbg << "emit 1record " << QDateTime::currentDateTime ().toString (" hh:mm:ss.z\n"); dbg->flush ();
emit action ("toolbar", QString ("1record %1").arg (page[1]));
page[1] = 0;
}
}
void MainWindow::dbusAction (const QString &nickname, const QString &text)
{
..
else if (text.contains ("page")) {
*dbg << "------------- page [" << text.left (1).toInt () << "] = " << text.right (1).toInt () << " set answered=true\n";
page[text.left (1).toInt ()] = text.right (1).toInt ();
answered = true;
}
}