From 17e96f64d6b66fac5f0e206492149d461e2ad900 Mon Sep 17 00:00:00 2001 From: harlekin Date: Wed, 20 Feb 2002 20:04:58 +0000 Subject: new release fixing several bugs, look at changelog .-) --- (limited to 'core/pim/today/today.cpp') diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 7a2d0c9..bed3a74 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include //#include //#include @@ -58,12 +60,7 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) QObject::connect( (QObject*)PushButton1, SIGNAL( clicked() ), this, SLOT(startConfig() ) ); QObject::connect( (QObject*)TodoButton, SIGNAL( clicked() ), this, SLOT(startTodo() ) ); QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startDatebook() ) ); - QObject::connect( (QObject*)DatesButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); - - QDate date = QDate::currentDate(); - QString time = (date.toString()); - TextLabel1->setText(time); - db = new DateBookDB; + QObject::connect( (QObject*)MailButton, SIGNAL( clicked() ), this, SLOT(startMail() ) ); draw(); } @@ -76,12 +73,18 @@ void Today::draw() getMail(); getTodo(); // how often refresh - QTimer::singleShot( 30*1000, this, SLOT(draw()) ); + QTimer::singleShot( 5*1000, this, SLOT(draw()) ); } void Today::init() { + QDate date = QDate::currentDate(); + QString time = (date.toString()); + + TextLabel1->setText("" +time + ""); + db = new DateBookDB; + // read config Config cfg("today"); cfg.setGroup("BaseConfig"); @@ -147,6 +150,7 @@ void Today::startConfig() } + /* * Get all events that are in the datebook xml file for today */ @@ -158,7 +162,7 @@ void Today::getDates() Config config( "qpe" ); // if 24 h format - // bool ampm = config.readBoolEntry( "AMPM", TRUE ); + //bool ampm = config.readBoolEntry( "AMPM", TRUE ); int count=0; @@ -180,20 +184,24 @@ void Today::getDates() // decide if to get all day or only later appointments if (!ONLY_LATER) { - msg += "" + (*it).description() + ""; - // include location or not - if (SHOW_LOCATION == 1) - { + msg += "" + (*it).description() + ""; + if ( (*it).event().hasAlarm() ) + { + msg += " [with alarm]"; + } + // include location or not + if (SHOW_LOCATION == 1) + { msg+= "
" + (*it).location(); - } - msg += "
" - // start time of event - + TimeString::timeString(QTime((*it).event().start().time()) ) - // end time of event - + " - " + TimeString::timeString(QTime((*it).event().end().time()) ) - + "
"; - // include possible note or not - if (SHOW_NOTES == 1) + } + msg += "
" + // start time of event + + TimeString::timeString(QTime((*it).event().start().time()) ) + // end time of event + + " - " + TimeString::timeString(QTime((*it).event().end().time()) ) + + "
"; + // include possible note or not + if (SHOW_NOTES == 1) { msg += " note:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "
"; } @@ -201,6 +209,10 @@ void Today::getDates() else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { msg += "" + (*it).description() + ""; + if ( (*it).event().hasAlarm() ) + { + msg += " [with alarm]"; + } // include location or not if (SHOW_LOCATION == 1) { @@ -230,7 +242,6 @@ void Today::getDates() /* * Parse in the todolist.xml - * */ QList Today::loadTodo(const char *filename) { @@ -262,7 +273,8 @@ QList Today::loadTodo(const char *filename) completed = -1; while((attlist) && (attlist[j])) { - if(!attlist[i]->name) continue; + // SEGFAULT HERE WITH MORE THAN 7 ENTRIES + if(!attlist[j]->name) continue; if(!strcmp(attlist[j]->name, "Description")) { description = attlist[j]->value; -- cgit v0.9.0.2