summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 58ba4f4..aef0a9b 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -72,6 +72,6 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)),
this, SLOT ( channelReceived(const QCString &, const QByteArray &)) );
-#endif
-#endif
+#endif
+#endif
setOwnerField();
@@ -147,22 +147,23 @@ void Today::draw() {
// if the todolist.xml file was not modified in between, do not parse it.
if (checkIfModified()) {
+ if (todo) delete todo;
todo = new ToDoDB;
getTodo();
}
-
+
// how often refresh
QTimer::singleShot( 20*1000, this, SLOT(draw() ) );
}
-/*
+/*
* Check if the todolist.xml was modified (if there are new entries.
* Returns true if it was modified.
*/
bool Today::checkIfModified() {
-
+
QDir dir;
- QString homedir = dir.homeDirPath ();
+ QString homedir = dir.homeDirPath ();
QString time;
-
+
Config cfg("today");
cfg.setGroup("Files");
@@ -175,5 +176,5 @@ bool Today::checkIfModified() {
} else {
cfg.writeEntry("todolisttimestamp", fileTime.toString() );
- cfg.write();
+ cfg.write();
return true;
}
@@ -187,11 +188,11 @@ void Today::init() {
QDate date = QDate::currentDate();
QString time = (tr( date.toString()) );
-
+
TextLabel1->setText(QString("<font color=#FFFFFF>" + time + "</font>"));
-
+
// read config
Config cfg("today");
- cfg.setGroup("BaseConfig");
-
+ cfg.setGroup("BaseConfig");
+
// -- config file section --
// how many lines should be showed in the task section
@@ -203,5 +204,5 @@ void Today::init() {
// If location is to be showed too, 1 to activate it.
SHOW_LOCATION = cfg.readNumEntry("showlocation",1);
- // if notes should be shown
+ // if notes should be shown
SHOW_NOTES = cfg.readNumEntry("shownotes",0);
// should only later appointments be shown or all for the current day.
@@ -269,5 +270,5 @@ void Today::startConfig() {
void Today::getDates() {
QDate date = QDate::currentDate();
-
+
if (AllDateBookEvents) delete AllDateBookEvents;
AllDateBookEvents = new QWidget( );