From 49c5ad320f16383aed85e16a273519844978e9c9 Mon Sep 17 00:00:00 2001 From: pavelpa Date: Fri, 22 Jan 2010 14:11:38 +0000 Subject: [PATCH] fixed problem with storing conference ID to AppSettings --- src/gui/mainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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(); -- 2.39.5