-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginwidget.cpp | 12 | ||||
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginwidget.h | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index 9a18408..3a7360d 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -39,5 +39,4 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name) db = new DateBookDB; - if ( m_layoutDates ) { delete m_layoutDates; @@ -69,8 +68,4 @@ void DatebookPluginWidget::readConfig() { void DatebookPluginWidget::refresh() { - DateBookEvent* ev; - for ( ev = m_eventsList.first(); ev != 0; ev = m_eventsList.next() ) { - delete ev; - } m_eventsList.clear(); getDates(); @@ -87,5 +82,4 @@ void DatebookPluginWidget::getDates() { int count = 0; - qDebug( QString("List count %1" ).arg(list.count() ) ); if ( list.count() > 0 ) { @@ -97,4 +91,5 @@ void DatebookPluginWidget::getDates() { DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); m_eventsList.append( l ); + l->show(); QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); } else if ( QDateTime::currentDateTime() <= (*it).event().end() ) { @@ -103,4 +98,5 @@ void DatebookPluginWidget::getDates() { DateBookEvent *l = new DateBookEvent( *it, this, m_show_location, m_show_notes ); m_eventsList.append( l ); + l->show(); QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); } @@ -109,8 +105,12 @@ void DatebookPluginWidget::getDates() { if ( m_onlyLater && count == 0 ) { QLabel* noMoreEvents = new QLabel( this ); + m_eventsList.append( noMoreEvents ); + noMoreEvents->show(); noMoreEvents->setText( QObject::tr( "No more appointments today" ) ); } } else { QLabel* noEvents = new QLabel( this ); + m_eventsList.append( noEvents ); + noEvents->show(); noEvents->setText( QObject::tr( "No appointments today" ) ); } diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.h b/core/pim/today/plugins/datebook/datebookpluginwidget.h index 8380bc7..e10f059 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.h +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.h @@ -21,4 +21,5 @@ #include <qwidget.h> #include <qlayout.h> +#include <qguardedptr.h> #include <qlist.h> @@ -39,6 +40,6 @@ public: private: DateBookDB* db; - QVBoxLayout* m_layoutDates; - QList<DateBookEvent> m_eventsList; + QGuardedPtr<QVBoxLayout> m_layoutDates; + QList<QWidget> m_eventsList; void readConfig(); void getDates(); |