- dayNavigator->setDates(startDate, endDate);
- updateTreeView( Conference::getById(confId).start() );
+
+ int nrofFounds = 0;
+ QDate firstDateWithFounds = endDate;
+ QDate lastDateWithFounds = startDate;
+ for(QDate d=startDate; d<=endDate; d=d.addDays(1))
+ {
+ try{
+ int count = Event::getSearchResultByDate(d, confId, "start").count();
+ if(count && (firstDateWithFounds==endDate))
+ firstDateWithFounds=d;
+ if(count)
+ lastDateWithFounds=d;
+ nrofFounds+=count;
+ }
+ catch( OrmException &e ){
+ qDebug() << "Event::getSearchResultByDate failed: " << e.text();
+ }
+ catch(...){
+ qDebug() << "Event::getSearchResultByDate failed";
+ }
+ }
+
+ if(!nrofFounds)
+ {
+ // TODO: display some message
+ treeView->hide();
+ searchAgainButton->hide();
+ dayNavigator->hide();
+ header->show();
+ QMessageBox::information(
+ this,
+ QString("Keyword '%1' not found!").arg(keyword),
+ QString("No events containing '%1' found!").arg(keyword),
+ QMessageBox::Ok);
+ }
+ else
+ {
+ searchAgainButton->show();
+ dayNavigator->show();
+ treeView->show();
+ header->hide();
+
+ updateTreeView( firstDateWithFounds );
+ dayNavigator->setDates(firstDateWithFounds, lastDateWithFounds);
+ }