Changeset 3655d06


Ignore:
Timestamp:
09/06/11 21:14:52 (10 years ago)
Author:
Stefan Strahl <stef@…>
Branches:
master, qt5
Children:
1006c4f
Parents:
4bf728f
Message:

Fixed ticket #20

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r4bf728f r3655d06  
    155155void MainWindow::useConference(int id)
    156156{
     157    if (id == -1)  // in case no conference is active
     158    {
     159        unsetConference();
     160        return;
     161    }
    157162    try {
    158163        Conference::getById(Conference::activeConference()).update("active",0);
     
    179184    } catch (OrmException& e) {
    180185        // cannon set an active conference
    181         unsetConference();
     186        unsetConference();   // TODO: as no active conference is now correctly managed this should be handled as a fatal error
    182187        return;
    183188    }
     
    188193{
    189194    int confId = Conference::activeConference();
    190     Conference active = Conference::getById(confId);
    191     QDate startDate = active.start();
    192     QDate endDate = active.end();
    193 
    194     // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
    195     dayTabContainer->setDates(startDate, endDate);
    196     tracksTabContainer->setDates(startDate, endDate);
    197     roomsTabContainer->setDates(startDate, endDate);
    198     favsTabContainer->setDates(startDate, endDate);
    199     searchTabContainer->setDates(startDate, endDate);
    200     searchTabContainer->searchAgainClicked();
    201     nowTabContainer->updateTreeView(QDate::currentDate());
     195    if (confId != -1)   // only init tabs if a conference is active
     196    {
     197        Conference active = Conference::getById(confId);
     198        QDate startDate = active.start();
     199        QDate endDate = active.end();
     200
     201        // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
     202        dayTabContainer->setDates(startDate, endDate);
     203        tracksTabContainer->setDates(startDate, endDate);
     204        roomsTabContainer->setDates(startDate, endDate);
     205        favsTabContainer->setDates(startDate, endDate);
     206        searchTabContainer->setDates(startDate, endDate);
     207        searchTabContainer->searchAgainClicked();
     208        nowTabContainer->updateTreeView(QDate::currentDate());
     209    }
    202210}
    203211
  • src/sql/sqlengine.cpp

    r4bf728f r3655d06  
    5959        QString allSqlStatements = file.readAll();
    6060        foreach(QString sql, allSqlStatements.split(";")) {
     61            if (sql.trimmed().length() == 0)     // do not execute empty queries like the last character from create_tables.sql
     62                continue;
    6163            QSqlQuery query(database);
    62             if (!query.exec(sql)) qDebug() << "Could not execute query" << query.lastError();
     64            if (!query.exec(sql)) qDebug() << "Could not execute query '" << sql << "' error:" << query.lastError();
    6365        }
    6466    }
Note: See TracChangeset for help on using the changeset viewer.