summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libopie/oprocess.h2
-rw-r--r--libopie/tododb.cpp8
-rw-r--r--libopie/todoevent.cpp19
-rw-r--r--libopie/todoevent.h11
4 files changed, 36 insertions, 4 deletions
diff --git a/libopie/oprocess.h b/libopie/oprocess.h
index ce3c87d..fd726b4 100644
--- a/libopie/oprocess.h
+++ b/libopie/oprocess.h
@@ -26,3 +26,3 @@
26// e9025461@student.tuwien.ac.at 26// e9025461@student.tuwien.ac.at
27// Ported by Holger Freyther 27// Ported by Holger Freyther to the Open Palmtop Integrated Environment
28// 28//
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp
index 6b10ec2..1e40c40 100644
--- a/libopie/tododb.cpp
+++ b/libopie/tododb.cpp
@@ -26,2 +26,3 @@ public:
26 map.insert( "Priority", QString::number( (*it).priority() ) ); 26 map.insert( "Priority", QString::number( (*it).priority() ) );
27 map.insert( "Progress", QString::number( (*it).progress() ) );
27 map.insert( "Summary", (*it).summary() ); 28 map.insert( "Summary", (*it).summary() );
@@ -84,2 +85,9 @@ public:
84 if(ok ) event.setCompleted( dumInt == 0 ? false : true ); 85 if(ok ) event.setCompleted( dumInt == 0 ? false : true );
86 // progress
87 dummy = element->attribute("Progress" );
88 {
89 ushort dumShort = dummy.toUShort(&ok);
90 event.setProgress( dumShort );
91
92 }
85 // hasDate 93 // hasDate
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index fb7073c..b35ac9d 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -23,2 +23,3 @@ ToDoEvent::ToDoEvent(bool completed, int priority,
23 const QString &description, 23 const QString &description,
24 ushort progress,
24 bool hasDate, QDate date, int uid ) 25 bool hasDate, QDate date, int uid )
@@ -31,2 +32,3 @@ ToDoEvent::ToDoEvent(bool completed, int priority,
31 m_sum = summary; 32 m_sum = summary;
33 m_prog = progress;
32 m_desc = Qtopia::simplifyMultiLineSpace(description ); 34 m_desc = Qtopia::simplifyMultiLineSpace(description );
@@ -80,2 +82,6 @@ QString ToDoEvent::summary() const
80} 82}
83ushort ToDoEvent::progress() const
84{
85 return m_prog;
86}
81void ToDoEvent::insertCategory(const QString &str ) 87void ToDoEvent::insertCategory(const QString &str )
@@ -141,3 +147,6 @@ bool ToDoEvent::isOverdue( )
141} 147}
142 148void ToDoEvent::setProgress(ushort progress )
149{
150 m_prog = progress;
151}
143/*! 152/*!
@@ -155,3 +164,3 @@ QString ToDoEvent::richText() const
155 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 164 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
156 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; 165 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br><br><br>";
157 } 166 }
@@ -159,2 +168,4 @@ QString ToDoEvent::richText() const
159 + QString::number( priority() ) + "<br>"; 168 + QString::number( priority() ) + "<br>";
169 text += "<b>" + QObject::tr( "Progress:") + " </b>"
170 + QString::number( progress() ) + " %<br>";
160 if (hasDate() ){ 171 if (hasDate() ){
@@ -188,3 +199,3 @@ bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{
188 if( !hasDate() && !toDoEvent.hasDate() ) return true; 199 if( !hasDate() && !toDoEvent.hasDate() ) return true;
189 if( !hasDate() && toDoEvent.hasDate() ) return true; 200 if( !hasDate() && toDoEvent.hasDate() ) return false;
190 if( hasDate() && toDoEvent.hasDate() ){ 201 if( hasDate() && toDoEvent.hasDate() ){
@@ -240,2 +251,3 @@ bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const
240 if( m_priority == toDoEvent.m_priority && 251 if( m_priority == toDoEvent.m_priority &&
252 m_priority == toDoEvent.m_prog &&
241 m_isCompleted == toDoEvent.m_isCompleted && 253 m_isCompleted == toDoEvent.m_isCompleted &&
@@ -259,2 +271,3 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
259 m_sum = item.m_sum; 271 m_sum = item.m_sum;
272 m_prog = item.m_prog;
260 return *this; 273 return *this;
diff --git a/libopie/todoevent.h b/libopie/todoevent.h
index 7454241..de4623f 100644
--- a/libopie/todoevent.h
+++ b/libopie/todoevent.h
@@ -28,2 +28,3 @@ class ToDoEvent {
28 const QString &description = QString::null, 28 const QString &description = QString::null,
29 ushort progress = 0,
29 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 ); 30 bool hasDate = false, QDate date = QDate::currentDate(), int uid = -1 );
@@ -49,2 +50,6 @@ class ToDoEvent {
49 50
51 /**
52 * progress as ushort 0, 20, 40, 60, 80 or 100%
53 */
54 ushort progress() const;
50 /* 55 /*
@@ -117,2 +122,7 @@ class ToDoEvent {
117 /** 122 /**
123 * Set the progress.
124 */
125 void setProgress( ushort progress );
126
127 /**
118 * set the end date 128 * set the end date
@@ -147,2 +157,3 @@ class ToDoEvent {
147 int m_uid; 157 int m_uid;
158 ushort m_prog;
148}; 159};