From: pavelpa Date: Fri, 22 Jan 2010 14:11:38 +0000 (+0000) Subject: fixed problem with storing conference ID to AppSettings X-Git-Tag: 0.5.0~210 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/49c5ad320f16383aed85e16a273519844978e9c9 fixed problem with storing conference ID to AppSettings --- diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index a1dfe56..025593c 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -177,9 +177,17 @@ void MainWindow::importSchedule() { ImportScheduleDialog dialog(mSqlEngine,this); dialog.exec(); - - if(Conference::getAll().count()) + + QList confs = Conference::getAll(); + if(!confs.count()) // no conference(s) in the DB + { + AppSettings::setConfId(0); // no conference in the DB + } + else { + if(AppSettings::confId() == 0) + AppSettings::setConfId(confs[0].id()); + // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates QDate aStartDate = Conference::getById(AppSettings::confId()).start(); QDate aEndDate = Conference::getById(AppSettings::confId()).end();