summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
Unidiff
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index 85647b1..ae0b334 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -1,93 +1,93 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <klocale.h> 20#include <klocale.h>
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapp.h>
23 23
24#include <kiconloader.h> 24#include <kiconloader.h>
25#include "kotodoviewitem.h" 25#include "kotodoviewitem.h"
26#include "kotodoview.h" 26#include "kotodoview.h"
27#include "koprefs.h" 27#include "koprefs.h"
28 28
29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) 29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo)
30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
31{ 31{
32 construct(); 32 construct();
33} 33}
34 34
35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) 35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
37{ 37{
38 construct(); 38 construct();
39} 39}
40 40
41QString KOTodoViewItem::key(int column,bool) const 41QString KOTodoViewItem::key(int column,bool) const
42{ 42{
43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
44 if (it == mKeyMap.end()) { 44 if (it == mKeyMap.end()) {
45 return text(column); 45 return text(column).lower();
46 } else { 46 } else {
47 return *it; 47 return *it;
48 } 48 }
49} 49}
50 50
51void KOTodoViewItem:: setup() 51void KOTodoViewItem:: setup()
52{ 52{
53 53
54 int h = 20; 54 int h = 20;
55 if ( listView () ) { 55 if ( listView () ) {
56 QFontMetrics fm ( listView ()->font () ); 56 QFontMetrics fm ( listView ()->font () );
57 h = fm.height(); 57 h = fm.height();
58 } 58 }
59 setHeight( h ); 59 setHeight( h );
60 60
61} 61}
62void KOTodoViewItem::setSortKey(int column,const QString &key) 62void KOTodoViewItem::setSortKey(int column,const QString &key)
63{ 63{
64 mKeyMap.insert(column,key); 64 mKeyMap.insert(column,key);
65} 65}
66 66
67#if QT_VERSION >= 300 67#if QT_VERSION >= 300
68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, 68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
69 int y,int h) 69 int y,int h)
70{ 70{
71 QListViewItem::paintBranches(p,cg,w,y,h); 71 QListViewItem::paintBranches(p,cg,w,y,h);
72} 72}
73#else 73#else
74#endif 74#endif
75 75
76void KOTodoViewItem::construct() 76void KOTodoViewItem::construct()
77{ 77{
78 // qDebug("KOTodoViewItem::construct() "); 78 // qDebug("KOTodoViewItem::construct() ");
79 m_init = true; 79 m_init = true;
80 QString keyd = "=="; 80 QString keyd = "==";
81 QString keyt = "=="; 81 QString keyt = "==";
82 82
83 setOn(mTodo->isCompleted()); 83 setOn(mTodo->isCompleted());
84 setText(0,mTodo->summary()); 84 setText(0,mTodo->summary());
85 setText(1,QString::number(mTodo->priority())); 85 setText(1,QString::number(mTodo->priority()));
86 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 86 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
87 if (mTodo->percentComplete()<100) { 87 if (mTodo->percentComplete()<100) {
88 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 88 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
89 else setSortKey(2,QString::number(mTodo->percentComplete())); 89 else setSortKey(2,QString::number(mTodo->percentComplete()));
90 } 90 }
91 else { 91 else {
92 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 92 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
93 else setSortKey(2,QString::number(99)); 93 else setSortKey(2,QString::number(99));