summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
Unidiff
Diffstat (limited to 'core/pim/today/plugins/datebook/datebookpluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/datebook/datebookpluginwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
index a8ce059..c6aa2a6 100644
--- a/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
+++ b/core/pim/today/plugins/datebook/datebookpluginwidget.cpp
@@ -38,46 +38,47 @@ DatebookPluginWidget::DatebookPluginWidget( QWidget *parent, const char* name)
38DatebookPluginWidget::~DatebookPluginWidget() { 38DatebookPluginWidget::~DatebookPluginWidget() {
39 delete db; 39 delete db;
40} 40}
41 41
42 42
43void DatebookPluginWidget::readConfig() { 43void DatebookPluginWidget::readConfig() {
44 Config cfg( "todaydatebookplugin" ); 44 Config cfg( "todaydatebookplugin" );
45 cfg.setGroup( "config" ); 45 cfg.setGroup( "config" );
46 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 ); 46 m_max_lines_meet = cfg.readNumEntry( "maxlinesmeet", 5 );
47 m_show_location = cfg.readNumEntry( "showlocation", 1 ); 47 m_show_location = cfg.readNumEntry( "showlocation", 1 );
48 m_show_notes = cfg.readNumEntry( "shownotes", 0 ); 48 m_show_notes = cfg.readNumEntry( "shownotes", 0 );
49 m_onlyLater = cfg.readNumEntry( "onlylater", 1 ); 49 m_onlyLater = cfg.readNumEntry( "onlylater", 1 );
50 m_moreDays = cfg.readNumEntry( "moredays", 0 );
50} 51}
51 52
52 53
53/** 54/**
54 * Get all events that are in the datebook xml file for today 55 * Get all events that are in the datebook xml file for today
55 */ 56 */
56void DatebookPluginWidget::getDates() { 57void DatebookPluginWidget::getDates() {
57 58
58 59
59 QDate date = QDate::currentDate(); 60 QDate date = QDate::currentDate();
60 61
61 QVBoxLayout* layoutDates = new QVBoxLayout( this ); 62 QVBoxLayout* layoutDates = new QVBoxLayout( this );
62 layoutDates->setSpacing( 1 ); 63 layoutDates->setSpacing( 1 );
63 layoutDates->setMargin( 1 ); 64 layoutDates->setMargin( 1 );
64 65
65 if ( db ) { 66 if ( db ) {
66 delete db; 67 delete db;
67 } 68 }
68 69
69 db = new DateBookDB; 70 db = new DateBookDB;
70 71
71 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date ); 72 QValueList<EffectiveEvent> list = db->getEffectiveEvents( date, date.addDays( m_moreDays ) );
72 73
73 qBubbleSort( list ); 74 qBubbleSort( list );
74 75
75 Config config( "qpe" ); 76 Config config( "qpe" );
76 77
77 int count=0; 78 int count=0;
78 79
79 if ( list.count() > 0 ) { 80 if ( list.count() > 0 ) {
80 81
81 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); it!=list.end(); ++it ) { 82 for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); it!=list.end(); ++it ) {
82 83
83 if ( count <= m_max_lines_meet ) { 84 if ( count <= m_max_lines_meet ) {