Ignore:
Timestamp:
01/27/10 16:31:10 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
a790a90
Parents:
07ae23a
Message:

removed appsettings

  • created 'active' column in 'conference' table
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/mainwindow.cpp

    r07ae23a r0bb39f5  
    11#include "mainwindow.h"
    2 #include <appsettings.h>
    32
    43#include <QTreeView>
     
    2827    setupUi(this);
    2928
    30     // Sanity check for existence of any Conference in the DB
    31     // it AppSettings::confId() is 0, but there are any Conference(s) in the DB
    32     // set the confId in the AppSettings for the ID of the first conference in the DB
     29    int confId = Conference::activeConference();
     30
    3331    QList<Conference> confs = Conference::getAll();
    34     if(!confs.count()) // no conference(s) in the DB
     32    if(confs.count())
    3533    {
    36         AppSettings::setConfId(0); // no conference in the DB
    37     }
    38     else
    39     {
    40         if(AppSettings::confId() == 0)
    41             AppSettings::setConfId(confs[0].id());
    42 
    4334        setWindowTitle(confs[0].title());
    4435    }
     
    6253    if(Conference::getAll().count()) // no conference(s) in the DB
    6354    {
    64         QDate startDate = Conference::getById(AppSettings::confId()).start();
    65         QDate endDate = Conference::getById(AppSettings::confId()).end();
     55        QDate startDate = Conference::getById(confId).start();
     56        QDate endDate = Conference::getById(confId).end();
    6657        //
    6758        dayTabContainer->setDates(startDate, endDate);
     
    7162        searchTabContainer->setDates(startDate, endDate);
    7263        //
    73         conferenceTitle->setText(Conference::getById(AppSettings::confId()).title());
    74         conferenceSubtitle->setText(Conference::getById(AppSettings::confId()).subtitle());
    75         conferenceWhere->setText(Conference::getById(AppSettings::confId()).city() + ", " + Conference::getById(AppSettings::confId()).venue());
     64        conferenceTitle->setText(Conference::getById(confId).title());
     65        conferenceSubtitle->setText(Conference::getById(confId).subtitle());
     66        conferenceWhere->setText(Conference::getById(confId).city() + ", " + Conference::getById(confId).venue());
    7667        conferenceWhen->setText(
    77                 Conference::getById(AppSettings::confId()).start().toString("dd-MM-yyyy")
     68                Conference::getById(confId).start().toString("dd-MM-yyyy")
    7869                + ", " +
    79                 Conference::getById(AppSettings::confId()).end().toString("dd-MM-yyyy"));
     70                Conference::getById(confId).end().toString("dd-MM-yyyy"));
    8071    }
    8172
     
    9990
    10091    QList<Conference> confs = Conference::getAll();
    101     if(!confs.count()) // no conference(s) in the DB
     92    if(confs.count())
    10293    {
    103         AppSettings::setConfId(0); // no conference in the DB
    104     }
    105     else
    106     {
    107         if(AppSettings::confId() == 0)
    108             AppSettings::setConfId(confs[0].id());
    109 
    11094        // 'dayNavigator' emits signal 'dateChanged' after setting valid START:END dates
    111         QDate startDate = Conference::getById(AppSettings::confId()).start();
    112         QDate endDate = Conference::getById(AppSettings::confId()).end();
     95        QDate startDate = Conference::getById(Conference::activeConference()).start();
     96        QDate endDate = Conference::getById(Conference::activeConference()).end();
    11397        dayTabContainer->setDates(startDate, endDate);
    11498        tracksTabContainer->setDates(startDate, endDate);
Note: See TracChangeset for help on using the changeset viewer.