summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-02-17 19:21:45 (UTC)
committer harlekin <harlekin>2002-02-17 19:21:45 (UTC)
commit39c6f8a9e734f200de4b67f55e159a6ccce38940 (patch) (side-by-side diff)
tree3574ddf0d7b99deca02d4ca8c1a71e8ef72cf99f
parent687d0c760684392c89f4e99fbf803c8f4d67b2b1 (diff)
downloadopie-39c6f8a9e734f200de4b67f55e159a6ccce38940.zip
opie-39c6f8a9e734f200de4b67f55e159a6ccce38940.tar.gz
opie-39c6f8a9e734f200de4b67f55e159a6ccce38940.tar.bz2
fixed stupid bug
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 0f6e598..7a2d0c9 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -137,155 +137,154 @@ void Today::startConfig()
cfg.writeEntry("maxlinestask",maxlinestask);
cfg.writeEntry("maxcharclip", maxcharclip);
cfg.writeEntry("maxlinesmeet",maxmeet);
cfg.writeEntry("showlocation",location);
cfg.writeEntry("shownotes", notes);
cfg.writeEntry("onlylater", onlylater);
// sync it to "disk"
cfg.write();
draw();
}
/*
* Get all events that are in the datebook xml file for today
*/
void Today::getDates()
{
QDate date = QDate::currentDate();
QTime time = QTime::currentTime();
QValueList<EffectiveEvent> list = db->getEffectiveEvents(date, date);
Config config( "qpe" );
// if 24 h format
// bool ampm = config.readBoolEntry( "AMPM", TRUE );
int count=0;
if ( list.count() > 0 ) {
QString msg;
for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin();
it!=list.end(); ++it ) {
count++;
if ( count <= MAX_LINES_MEET )
{
//only get events past current time (start or end??)
//cout << time.toString() << endl;
//cout << TimeString::dateString((*it).event().end()) << endl;
// still some bug in here, 1 h off
// decide if to get all day or only later appointments
if (!ONLY_LATER)
{
msg += "<B>" + (*it).description() + "</B>";
// include location or not
if (SHOW_LOCATION == 1)
{
msg+= "<BR>" + (*it).location();
}
msg += "<BR>"
// start time of event
+ TimeString::timeString(QTime((*it).event().start().time()) )
// end time of event
+ "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) )
+ "<BR>";
// include possible note or not
if (SHOW_NOTES == 1)
{
msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
}
}
- else if ((time.toString() <= TimeString::dateString((*it).event().end())) && ONLY_LATER )
+ else if ((time.toString() <= TimeString::dateString((*it).event().end())) )
{
msg += "<B>" + (*it).description() + "</B>";
// include location or not
if (SHOW_LOCATION == 1)
{
msg+= "<BR>" + (*it).location();
}
msg += "<BR>"
// start time of event
+ TimeString::timeString(QTime((*it).event().start().time()) )
// end time of event
+ "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) )
+ "<BR>";
// include possible note or not
if (SHOW_NOTES == 1)
{
msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>";
}
}
}
-
- if (msg.isEmpty())
- {
- msg = "No more appointments today";
- }
}
+ if (msg.isEmpty())
+ {
+ msg = "No more appointments today";
+ }
DatesField->setText(msg);
}
}
/*
* Parse in the todolist.xml
*
*/
QList<TodoItem> Today::loadTodo(const char *filename)
{
DOM *todo;
ELE *tasks;
ELE **tasklist;
ATT **attlist;
int i, j;
char *description;
int completed;
int priority;
TodoItem *tmp;
QList<TodoItem> loadtodolist;
todo = minidom_load(filename);
tasks = todo->el;
tasks = tasks->el[0]; /*!DOCTYPE-quickhack*/
if(tasks)
{
tasklist = tasks->el;
i = 0;
while((tasklist) && (tasklist[i]))
{
attlist = tasklist[i]->at;
j = 0;
description = NULL;
priority = -1;
completed = -1;
while((attlist) && (attlist[j]))
{
if(!attlist[i]->name) continue;
if(!strcmp(attlist[j]->name, "Description"))
{
description = attlist[j]->value;
}
// get Completed tag (0 or 1)
if(!strcmp(attlist[j]->name, "Completed"))
{
QString s = attlist[j]->name;
if(s == "Completed")
{
completed = QString(attlist[j]->value).toInt();
}
}
// get Priority (1 to 5)
if(!strcmp(attlist[j]->name, "Priority"))
{
QString s = attlist[j]->name;
if(s == "Priority")
{
priority = QString(attlist[j]->value).toInt();
}
}
j++;
}
if(description)