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.cpp | 15 |
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 | ||
66 | void TodolistPluginWidget:: refresh() { | 66 | void TodolistPluginWidget:: refresh() { |
67 | todo->reload(); | ||
68 | getTodo(); | ||
69 | } | ||
70 | |||
71 | void 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 | ||