author | harlekin <harlekin> | 2003-02-10 23:05:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-10 23:05:51 (UTC) |
commit | 871eadc731c0c05c553b8edc8c0e3198127057b6 (patch) (side-by-side diff) | |
tree | 88af2b393914bc6c8c479462b4e502ad6ee85062 | |
parent | 51452f8478edb77ed1eef61adff314c2d239712f (diff) | |
download | opie-871eadc731c0c05c553b8edc8c0e3198127057b6.zip opie-871eadc731c0c05c553b8edc8c0e3198127057b6.tar.gz opie-871eadc731c0c05c553b8edc8c0e3198127057b6.tar.bz2 |
fixed segfault
-rw-r--r-- | core/pim/today/plugins/datebook/datebookpluginwidget.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp index e2f492e..9a18408 100644 --- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp +++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp @@ -39,4 +39,5 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name) db = new DateBookDB; + if ( m_layoutDates ) { delete m_layoutDates; @@ -45,4 +46,6 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name) m_layoutDates->setAutoAdd( true ); + m_eventsList.setAutoDelete( true ); + readConfig(); getDates(); @@ -70,4 +73,5 @@ void DatebookPluginWidget::refresh() { delete ev; } + m_eventsList.clear(); getDates(); } @@ -79,10 +83,9 @@ void DatebookPluginWidget::getDates() { QDate date = QDate::currentDate(); - QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) ); qBubbleSort( list ); - //Config config( "qpe" ); int count=0; + qDebug( QString("List count %1" ).arg(list.count() ) ); if ( list.count() > 0 ) { @@ -90,6 +93,4 @@ void DatebookPluginWidget::getDates() { if ( count <= m_max_lines_meet ) { - QTime time = QTime::currentTime(); - if ( !m_onlyLater ) { count++; @@ -97,5 +98,5 @@ void DatebookPluginWidget::getDates() { m_eventsList.append( l ); QObject::connect ( l, SIGNAL( editEvent( const Event & ) ), l, SLOT( editEventSlot( const Event & ) ) ); - } else if ( ( time.toString() <= TimeString::dateString( (*it).event().end() ) ) ) { + } else if ( QDateTime::currentDateTime() <= (*it).event().end() ) { count++; // show only later appointments |