Changeset 0bb39f5 in confclerk_git for src/gui/mainwindow.cpp
- Timestamp:
- 01/27/10 16:31:10 (13 years ago)
- Branches:
- master, qt5
- Children:
- a790a90
- Parents:
- 07ae23a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/mainwindow.cpp
r07ae23a r0bb39f5 1 1 #include "mainwindow.h" 2 #include <appsettings.h>3 2 4 3 #include <QTreeView> … … 28 27 setupUi(this); 29 28 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 33 31 QList<Conference> confs = Conference::getAll(); 34 if( !confs.count()) // no conference(s) in the DB32 if(confs.count()) 35 33 { 36 AppSettings::setConfId(0); // no conference in the DB37 }38 else39 {40 if(AppSettings::confId() == 0)41 AppSettings::setConfId(confs[0].id());42 43 34 setWindowTitle(confs[0].title()); 44 35 } … … 62 53 if(Conference::getAll().count()) // no conference(s) in the DB 63 54 { 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(); 66 57 // 67 58 dayTabContainer->setDates(startDate, endDate); … … 71 62 searchTabContainer->setDates(startDate, endDate); 72 63 // 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()); 76 67 conferenceWhen->setText( 77 Conference::getById( AppSettings::confId()).start().toString("dd-MM-yyyy")68 Conference::getById(confId).start().toString("dd-MM-yyyy") 78 69 + ", " + 79 Conference::getById( AppSettings::confId()).end().toString("dd-MM-yyyy"));70 Conference::getById(confId).end().toString("dd-MM-yyyy")); 80 71 } 81 72 … … 99 90 100 91 QList<Conference> confs = Conference::getAll(); 101 if( !confs.count()) // no conference(s) in the DB92 if(confs.count()) 102 93 { 103 AppSettings::setConfId(0); // no conference in the DB104 }105 else106 {107 if(AppSettings::confId() == 0)108 AppSettings::setConfId(confs[0].id());109 110 94 // '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(); 113 97 dayTabContainer->setDates(startDate, endDate); 114 98 tracksTabContainer->setDates(startDate, endDate);
Note: See TracChangeset
for help on using the changeset viewer.