-rw-r--r-- | core/pim/today/today.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 51aba69..7cef035 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -70,16 +70,17 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) | |||
70 | #if defined(Q_WS_QWS) | 70 | #if defined(Q_WS_QWS) |
71 | #if !defined(QT_NO_COP) | 71 | #if !defined(QT_NO_COP) |
72 | QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); | 72 | QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); |
73 | connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), | 73 | connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), |
74 | this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); | 74 | this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); |
75 | #endif | 75 | #endif |
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | db = NULL; | ||
78 | setOwnerField(); | 79 | setOwnerField(); |
79 | todo = new ToDoDB; | 80 | todo = new ToDoDB; |
80 | getTodo(); | 81 | getTodo(); |
81 | draw(); | 82 | draw(); |
82 | autoStart(); | 83 | autoStart(); |
83 | } | 84 | } |
84 | 85 | ||
85 | /* | 86 | /* |
@@ -204,17 +205,17 @@ void Today::init() { | |||
204 | MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5); | 205 | MAX_LINES_MEET = cfg.readNumEntry("maxlinesmeet",5); |
205 | // If location is to be showed too, 1 to activate it. | 206 | // If location is to be showed too, 1 to activate it. |
206 | SHOW_LOCATION = cfg.readNumEntry("showlocation",1); | 207 | SHOW_LOCATION = cfg.readNumEntry("showlocation",1); |
207 | // if notes should be shown | 208 | // if notes should be shown |
208 | SHOW_NOTES = cfg.readNumEntry("shownotes",0); | 209 | SHOW_NOTES = cfg.readNumEntry("shownotes",0); |
209 | // should only later appointments be shown or all for the current day. | 210 | // should only later appointments be shown or all for the current day. |
210 | ONLY_LATER = cfg.readNumEntry("onlylater",1); | 211 | ONLY_LATER = cfg.readNumEntry("onlylater",1); |
211 | 212 | ||
212 | db = new DateBookDB; | 213 | //db = new DateBookDB; |
213 | } | 214 | } |
214 | 215 | ||
215 | /* | 216 | /* |
216 | * The method for the configuration dialog. | 217 | * The method for the configuration dialog. |
217 | */ | 218 | */ |
218 | void Today::startConfig() { | 219 | void Today::startConfig() { |
219 | 220 | ||
220 | conf = new todayconfig ( this, "", true ); | 221 | conf = new todayconfig ( this, "", true ); |
@@ -269,17 +270,22 @@ void Today::startConfig() { | |||
269 | * Get all events that are in the datebook xml file for today | 270 | * Get all events that are in the datebook xml file for today |
270 | */ | 271 | */ |
271 | void Today::getDates() { | 272 | void Today::getDates() { |
272 | QDate date = QDate::currentDate(); | 273 | QDate date = QDate::currentDate(); |
273 | 274 | ||
274 | if (AllDateBookEvents) delete AllDateBookEvents; | 275 | if (AllDateBookEvents) delete AllDateBookEvents; |
275 | AllDateBookEvents = new QWidget( ); | 276 | AllDateBookEvents = new QWidget( ); |
276 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); | 277 | QVBoxLayout* layoutDates = new QVBoxLayout(AllDateBookEvents); |
277 | 278 | ||
279 | if (db) { | ||
280 | delete db; | ||
281 | } | ||
282 | db = new DateBookDB; | ||
283 | |||
278 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); | 284 | QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date); |
279 | 285 | ||
280 | qBubbleSort(list); | 286 | qBubbleSort(list); |
281 | // printf("Get dates\n"); | 287 | // printf("Get dates\n"); |
282 | 288 | ||
283 | Config config( "qpe" ); | 289 | Config config( "qpe" ); |
284 | // if 24 h format | 290 | // if 24 h format |
285 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); | 291 | //bool ampm = config.readBoolEntry( "AMPM", TRUE ); |