summaryrefslogtreecommitdiff
path: root/core/pim/today/plugins/todolist/todopluginwidget.cpp
authorharlekin <harlekin>2003-12-05 11:20:37 (UTC)
committer harlekin <harlekin>2003-12-05 11:20:37 (UTC)
commit2b37759fc317b5efd9b371210b16117f7d346455 (patch) (unidiff)
treef99beb5ff1c886f9b41a2d3a34300f8f121cf738 /core/pim/today/plugins/todolist/todopluginwidget.cpp
parent1ef5137234e2b7cd0be2a220a86d848503196269 (diff)
downloadopie-2b37759fc317b5efd9b371210b16117f7d346455.zip
opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.gz
opie-2b37759fc317b5efd9b371210b16117f7d346455.tar.bz2
today in HEAD up to date
Diffstat (limited to 'core/pim/today/plugins/todolist/todopluginwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/todolist/todopluginwidget.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/pim/today/plugins/todolist/todopluginwidget.cpp b/core/pim/today/plugins/todolist/todopluginwidget.cpp
index 15081ec..0364f94 100644
--- a/core/pim/today/plugins/todolist/todopluginwidget.cpp
+++ b/core/pim/today/plugins/todolist/todopluginwidget.cpp
@@ -62,9 +62,16 @@ void TodolistPluginWidget::readConfig() {
62 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 ); 62 m_maxLinesTask = cfg.readNumEntry( "maxlinestask", 5 );
63 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 ); 63 m_maxCharClip = cfg.readNumEntry( "maxcharclip", 38 );
64} 64}
65 65
66void TodolistPluginWidget:: refresh() { 66void TodolistPluginWidget:: refresh() {
67 todo->reload();
68 getTodo();
69}
70
71void TodolistPluginWidget::reinitialize() {
72 readConfig();
73 todo->reload();
67 getTodo(); 74 getTodo();
68} 75}
69 76
70/** 77/**
@@ -78,17 +85,17 @@ void TodolistPluginWidget::getTodo() {
78 int count = 0; 85 int count = 0;
79 int ammount = 0; 86 int ammount = 0;
80 87
81 // get overdue todos first 88 // get overdue todos first
82 m_list = todo->overDue(); 89 m_list = todo->sorted( true, 3, 2, 1);
83 90
84 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) { 91 for ( m_it = m_list.begin(); m_it != m_list.end(); ++m_it ) {
85 if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) { 92 if (!(*m_it).isCompleted() && ( ammount < m_maxLinesTask ) ) {
86 QString desc = (*m_it).summary(); 93 QString desc = (*m_it).summary();
87 if( desc.isEmpty() ) { 94 if( desc.isEmpty() ) {
88 desc = (*m_it).description(); 95 desc = (*m_it).description();
89 } 96 }
90 tmpout += "<font color=#e00000><b>-" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>"; 97 tmpout += "<font color=#e00000><b>[" + QString("%1").arg((*m_it).priority() ) + "]" + desc.mid( 0, m_maxCharClip ) + "</b></font><br>";
91 ammount++ ; 98 ammount++ ;
92 } 99 }
93 } 100 }
94 101
@@ -103,9 +110,9 @@ void TodolistPluginWidget::getTodo() {
103 QString desc = (*m_it).summary(); 110 QString desc = (*m_it).summary();
104 if( desc.isEmpty() ) { 111 if( desc.isEmpty() ) {
105 desc = (*m_it).description(); 112 desc = (*m_it).description();
106 } 113 }
107 tmpout += "<b>-</b>" + desc.mid( 0, m_maxCharClip ) + "<br>"; 114 tmpout += "<b> [" + QString("%1").arg((*m_it).priority() ) + "] </b>" + desc.mid( 0, m_maxCharClip ) + "<br>";
108 ammount++; 115 ammount++;
109 } 116 }
110 } 117 }
111 118