summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/todolist/todopluginwidget.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/today/plugins/todolist/todopluginwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp
index 773e5cf..3242dac 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.cpp
+++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp
@@ -31,14 +31,28 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
: QWidget( parent, name ) {
- todoLabel = 0l;
todo = 0l;
+ layoutTodo = 0l;
+ todoLabel = 0l;
if ( todo ) {
delete todo;
}
-
todo = new OTodoAccess();
todo->load();
+ if ( layoutTodo ) {
+ delete layoutTodo;
+ }
+ layoutTodo = new QVBoxLayout( this );
+ layoutTodo->setAutoAdd( true );
+
+
+ if ( todoLabel ) {
+ delete todoLabel;
+ }
+ todoLabel = new OClickableLabel( this );
+
+ connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) );
+
readConfig();
getTodo();
@@ -47,4 +61,6 @@ TodolistPluginWidget::TodolistPluginWidget( QWidget *parent, const char* name )
TodolistPluginWidget::~TodolistPluginWidget() {
delete todo;
+ delete todoLabel;
+ delete layoutTodo;
}
@@ -57,4 +73,7 @@ void TodolistPluginWidget::readConfig() {
}
+void TodolistPluginWidget:: refresh() {
+ getTodo();
+}
/**
@@ -63,12 +82,4 @@ void TodolistPluginWidget::readConfig() {
void TodolistPluginWidget::getTodo() {
- QVBoxLayout* layoutTodo = new QVBoxLayout( this );
-
- if ( todoLabel ) {
- delete todoLabel;
- }
-
- todoLabel = new OClickableLabel( this );
- connect( todoLabel, SIGNAL( clicked() ), this, SLOT( startTodolist() ) );
QString output;
@@ -119,5 +130,4 @@ void TodolistPluginWidget::getTodo() {
}
todoLabel->setText( output );
- layoutTodo->addWidget( todoLabel );
}