summaryrefslogtreecommitdiff
path: root/libopie
authorzecke <zecke>2002-04-27 18:10:51 (UTC)
committer zecke <zecke>2002-04-27 18:10:51 (UTC)
commit0c3303957aa56abb12c0cc4db1493eea5a995f28 (patch) (unidiff)
treea0b7ea7cc21e31a45deca6f0c0d0a2be70fe1b25 /libopie
parent24cfee06815c460fdaa8e34f4b3a7cc9f4b008dd (diff)
downloadopie-0c3303957aa56abb12c0cc4db1493eea5a995f28.zip
opie-0c3303957aa56abb12c0cc4db1493eea5a995f28.tar.gz
opie-0c3303957aa56abb12c0cc4db1493eea5a995f28.tar.bz2
Update TODO
Update todoevent.cpp I almost forgot about this \n -> <br> inside the RichText remove oconfig cause it was bogus. We can achieve the same with Config(path, Config::File );
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/TODO7
-rw-r--r--libopie/libopie.pro4
-rw-r--r--libopie/oconfig.cpp45
-rw-r--r--libopie/oconfig.h48
-rw-r--r--libopie/todoevent.cpp2
5 files changed, 3 insertions, 103 deletions
diff --git a/libopie/TODO b/libopie/TODO
index d49910c..98baf72 100644
--- a/libopie/TODO
+++ b/libopie/TODO
@@ -1,20 +1,13 @@
1- xmltree done 1- xmltree done
2 2
3- tododb 3- tododb
4 - set Alarms 4 - set Alarms
5 - multiple categories
6 - Attendees
7 5
8- OFileSelector 6- OFileSelector
9 - fix the weird view change bug delete m_pseudoLayout crash
10 - DocLnk when not in Document Mode ( and vice versa ) 7 - DocLnk when not in Document Mode ( and vice versa )
11 - MultipleDocuments 8 - MultipleDocuments
12 - TreeView have a own OFileSelectorItem for this
13 - IconView add a QIconView to the widgetstack
14 - Move OFileSelectorItem to it's own files 9 - Move OFileSelectorItem to it's own files
15 - add functions to access the member variables
16 - debug
17 - new Dirs created inside the listview 10 - new Dirs created inside the listview
18 11
19- Clickable labels? 12- Clickable labels?
20 Harlekin you wanted them in the libs? \ No newline at end of file 13 Harlekin you wanted them in the libs? \ No newline at end of file
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index b19426e..b2ecd07 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qte warn_on release 2CONFIG += qte warn_on release
3 HEADERS = ofontmenu.h ofileselector.h ofiledialog.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h oconfig.h colordialog.h colorpopupmenu.h 3 HEADERS = ofontmenu.h ofileselector.h ofiledialog.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h colordialog.h colorpopupmenu.h
4 SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp oconfig.cpp colordialog.cpp colorpopupmenu.cpp 4 SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp colordialog.cpp colorpopupmenu.cpp
5 TARGET = opie 5 TARGET = opie
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7DESTDIR = $(QTDIR)/lib$(PROJMAK) 7DESTDIR = $(QTDIR)/lib$(PROJMAK)
8#VERSION = 1.0.0 8#VERSION = 1.0.0
diff --git a/libopie/oconfig.cpp b/libopie/oconfig.cpp
deleted file mode 100644
index d051d54..0000000
--- a/libopie/oconfig.cpp
+++ b/dev/null
@@ -1,45 +0,0 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Holger Freyther <freyther@kde.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#include <opie/oconfig.h>
30
31OConfig::OConfig(const QString &file)
32 : Config("tmpopie" )
33{
34 filename = file;
35 read();
36}
37OConfig::~OConfig()
38{
39 // Config will write the file for us
40}
41QString OConfig::fileName() const
42{
43 return filename;
44}
45
diff --git a/libopie/oconfig.h b/libopie/oconfig.h
deleted file mode 100644
index f6227d1..0000000
--- a/libopie/oconfig.h
+++ b/dev/null
@@ -1,48 +0,0 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Holger 'zecke' Freyther<freyther@kde.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29
30#include <qpe/config.h>
31
32#ifndef opieconfig_h
33#define opieconfig_h
34
35/** It supports all Config items + it lets you decide
36 * which file to use.
37 */
38
39class OConfig : public Config {
40 public:
41 OConfig( const QString &filename );
42 ~OConfig();
43 QString fileName() const;
44 void read( ) { Config::read(); };
45};
46
47#endif
48
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index 5537b77..b820150 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -1,235 +1,235 @@
1 1
2#include <opie/todoevent.h> 2#include <opie/todoevent.h>
3 3
4 4
5#include <qpe/palmtopuidgen.h> 5#include <qpe/palmtopuidgen.h>
6#include <qpe/stringutil.h> 6#include <qpe/stringutil.h>
7#include <qpe/palmtoprecord.h> 7#include <qpe/palmtoprecord.h>
8 8
9#include <qpe/stringutil.h> 9#include <qpe/stringutil.h>
10#include <qpe/categories.h> 10#include <qpe/categories.h>
11#include <qpe/categoryselect.h> 11#include <qpe/categoryselect.h>
12 12
13#include <qobject.h> 13#include <qobject.h>
14 14
15ToDoEvent::ToDoEvent(const ToDoEvent &event ) 15ToDoEvent::ToDoEvent(const ToDoEvent &event )
16{ 16{
17 *this = event; 17 *this = event;
18} 18}
19 19
20ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category, 20ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
21 const QString &description, bool hasDate, QDate date, int uid ) 21 const QString &description, bool hasDate, QDate date, int uid )
22{ 22{
23 m_date = date; 23 m_date = date;
24 m_isCompleted = completed; 24 m_isCompleted = completed;
25 m_hasDate = hasDate; 25 m_hasDate = hasDate;
26 m_priority = priority; 26 m_priority = priority;
27 m_category = category; 27 m_category = category;
28 m_desc = Qtopia::simplifyMultiLineSpace(description ); 28 m_desc = Qtopia::simplifyMultiLineSpace(description );
29 if (uid == -1 ) { 29 if (uid == -1 ) {
30 Qtopia::UidGen *uidgen = new Qtopia::UidGen(); 30 Qtopia::UidGen *uidgen = new Qtopia::UidGen();
31 uid = uidgen->generate(); 31 uid = uidgen->generate();
32 delete uidgen; 32 delete uidgen;
33 }// generate the ids 33 }// generate the ids
34 m_uid = uid; 34 m_uid = uid;
35} 35}
36QArray<int> ToDoEvent::categories()const 36QArray<int> ToDoEvent::categories()const
37{ 37{
38 QArray<int> array(m_category.count() ); // currently the datebook can be only in one category 38 QArray<int> array(m_category.count() ); // currently the datebook can be only in one category
39 array = Qtopia::Record::idsFromString( m_category.join(";") ); 39 array = Qtopia::Record::idsFromString( m_category.join(";") );
40 return array; 40 return array;
41} 41}
42bool ToDoEvent::match( const QRegExp &regExp )const 42bool ToDoEvent::match( const QRegExp &regExp )const
43{ 43{
44 if( QString::number( m_priority ).find( regExp ) != -1 ){ 44 if( QString::number( m_priority ).find( regExp ) != -1 ){
45 return true; 45 return true;
46 }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){ 46 }else if( m_hasDate && m_date.toString().find( regExp) != -1 ){
47 return true; 47 return true;
48 }else if(m_desc.find( regExp ) != -1 ){ 48 }else if(m_desc.find( regExp ) != -1 ){
49 return true; 49 return true;
50 } 50 }
51 return false; 51 return false;
52} 52}
53bool ToDoEvent::isCompleted() const 53bool ToDoEvent::isCompleted() const
54{ 54{
55 return m_isCompleted; 55 return m_isCompleted;
56} 56}
57bool ToDoEvent::hasDate() const 57bool ToDoEvent::hasDate() const
58{ 58{
59 return m_hasDate; 59 return m_hasDate;
60} 60}
61int ToDoEvent::priority()const 61int ToDoEvent::priority()const
62{ 62{
63 return m_priority; 63 return m_priority;
64} 64}
65QStringList ToDoEvent::allCategories()const 65QStringList ToDoEvent::allCategories()const
66{ 66{
67 return m_category; 67 return m_category;
68} 68}
69void ToDoEvent::insertCategory(const QString &str ) 69void ToDoEvent::insertCategory(const QString &str )
70{ 70{
71 m_category.append( str ); 71 m_category.append( str );
72} 72}
73void ToDoEvent::clearCategories() 73void ToDoEvent::clearCategories()
74{ 74{
75 m_category.clear(); 75 m_category.clear();
76} 76}
77void ToDoEvent::setCategories(const QStringList &list ) 77void ToDoEvent::setCategories(const QStringList &list )
78{ 78{
79 m_category = list; 79 m_category = list;
80} 80}
81QDate ToDoEvent::date()const 81QDate ToDoEvent::date()const
82{ 82{
83 return m_date; 83 return m_date;
84} 84}
85 85
86QString ToDoEvent::description()const 86QString ToDoEvent::description()const
87{ 87{
88 return m_desc; 88 return m_desc;
89} 89}
90void ToDoEvent::setCompleted( bool completed ) 90void ToDoEvent::setCompleted( bool completed )
91{ 91{
92 m_isCompleted = completed; 92 m_isCompleted = completed;
93} 93}
94void ToDoEvent::setHasDate( bool hasDate ) 94void ToDoEvent::setHasDate( bool hasDate )
95{ 95{
96 m_hasDate = hasDate; 96 m_hasDate = hasDate;
97} 97}
98void ToDoEvent::setDescription(const QString &desc ) 98void ToDoEvent::setDescription(const QString &desc )
99{ 99{
100 m_desc = Qtopia::simplifyMultiLineSpace(desc ); 100 m_desc = Qtopia::simplifyMultiLineSpace(desc );
101} 101}
102void ToDoEvent::setCategory( const QString &cat ) 102void ToDoEvent::setCategory( const QString &cat )
103{ 103{
104 qWarning("setCategory %s", cat.latin1() ); 104 qWarning("setCategory %s", cat.latin1() );
105 m_category.clear(); 105 m_category.clear();
106 m_category << cat; 106 m_category << cat;
107} 107}
108void ToDoEvent::setPriority(int prio ) 108void ToDoEvent::setPriority(int prio )
109{ 109{
110 m_priority = prio; 110 m_priority = prio;
111} 111}
112void ToDoEvent::setDate( QDate date ) 112void ToDoEvent::setDate( QDate date )
113{ 113{
114 m_date = date; 114 m_date = date;
115} 115}
116bool ToDoEvent::isOverdue( ) 116bool ToDoEvent::isOverdue( )
117{ 117{
118 if( m_hasDate ) 118 if( m_hasDate )
119 return QDate::currentDate() > m_date; 119 return QDate::currentDate() > m_date;
120 return false; 120 return false;
121} 121}
122 122
123/*! 123/*!
124 Returns a richt text string 124 Returns a richt text string
125*/ 125*/
126QString ToDoEvent::richText() const 126QString ToDoEvent::richText() const
127{ 127{
128 QString text; 128 QString text;
129 QStringList catlist; 129 QStringList catlist;
130 130
131 // Description of the todo 131 // Description of the todo
132 if ( !description().isEmpty() ){ 132 if ( !description().isEmpty() ){
133 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 133 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
134 text += Qtopia::escapeString(description() ) + "<br>"; 134 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
135 } 135 }
136 text += "<b>" + QObject::tr( "Priority:") +" </b>" 136 text += "<b>" + QObject::tr( "Priority:") +" </b>"
137 + QString::number( priority() ) + "<br>"; 137 + QString::number( priority() ) + "<br>";
138 if (hasDate() ){ 138 if (hasDate() ){
139 text += "<b>" + QObject::tr( "Deadline:") + " </b>"; 139 text += "<b>" + QObject::tr( "Deadline:") + " </b>";
140 text += date().toString(); 140 text += date().toString();
141 text += "<br>"; 141 text += "<br>";
142 } 142 }
143 143
144 // Open database of all categories and get the list of 144 // Open database of all categories and get the list of
145 // the categories this todoevent belongs to. 145 // the categories this todoevent belongs to.
146 // Then print them... 146 // Then print them...
147 // I am not sure whether there is no better way doing this !? 147 // I am not sure whether there is no better way doing this !?
148 Categories catdb; 148 Categories catdb;
149 catdb.load( categoryFileName() ); 149 catdb.load( categoryFileName() );
150 catlist = allCategories(); 150 catlist = allCategories();
151 151
152 text += "<b>" + QObject::tr( "Category:") + "</b> "; 152 text += "<b>" + QObject::tr( "Category:") + "</b> ";
153 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) { 153 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) {
154 text += catdb.label ("todo", (*it).toInt()); 154 text += catdb.label ("todo", (*it).toInt());
155 } 155 }
156 text += "<br>"; 156 text += "<br>";
157 return text; 157 return text;
158} 158}
159 159
160bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ 160bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{
161 if( !hasDate() && !toDoEvent.hasDate() ) return true; 161 if( !hasDate() && !toDoEvent.hasDate() ) return true;
162 if( !hasDate() && toDoEvent.hasDate() ) return true; 162 if( !hasDate() && toDoEvent.hasDate() ) return true;
163 if( hasDate() && toDoEvent.hasDate() ){ 163 if( hasDate() && toDoEvent.hasDate() ){
164 if( date() == toDoEvent.date() ){ // let's the priority decide 164 if( date() == toDoEvent.date() ){ // let's the priority decide
165 return priority() < toDoEvent.priority(); 165 return priority() < toDoEvent.priority();
166 }else{ 166 }else{
167 return date() < toDoEvent.date(); 167 return date() < toDoEvent.date();
168 } 168 }
169 } 169 }
170 return false; 170 return false;
171} 171}
172bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const 172bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const
173{ 173{
174 if( !hasDate() && !toDoEvent.hasDate() ) return true; 174 if( !hasDate() && !toDoEvent.hasDate() ) return true;
175 if( !hasDate() && toDoEvent.hasDate() ) return true; 175 if( !hasDate() && toDoEvent.hasDate() ) return true;
176 if( hasDate() && toDoEvent.hasDate() ){ 176 if( hasDate() && toDoEvent.hasDate() ){
177 if( date() == toDoEvent.date() ){ // let's the priority decide 177 if( date() == toDoEvent.date() ){ // let's the priority decide
178 return priority() <= toDoEvent.priority(); 178 return priority() <= toDoEvent.priority();
179 }else{ 179 }else{
180 return date() <= toDoEvent.date(); 180 return date() <= toDoEvent.date();
181 } 181 }
182 } 182 }
183 return true; 183 return true;
184} 184}
185bool ToDoEvent::operator>(const ToDoEvent &toDoEvent )const 185bool ToDoEvent::operator>(const ToDoEvent &toDoEvent )const
186{ 186{
187 if( !hasDate() && !toDoEvent.hasDate() ) return false; 187 if( !hasDate() && !toDoEvent.hasDate() ) return false;
188 if( !hasDate() && toDoEvent.hasDate() ) return false; 188 if( !hasDate() && toDoEvent.hasDate() ) return false;
189 if( hasDate() && toDoEvent.hasDate() ){ 189 if( hasDate() && toDoEvent.hasDate() ){
190 if( date() == toDoEvent.date() ){ // let's the priority decide 190 if( date() == toDoEvent.date() ){ // let's the priority decide
191 return priority() > toDoEvent.priority(); 191 return priority() > toDoEvent.priority();
192 }else{ 192 }else{
193 return date() > toDoEvent.date(); 193 return date() > toDoEvent.date();
194 } 194 }
195 } 195 }
196 return false; 196 return false;
197} 197}
198bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const 198bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const
199{ 199{
200 if( !hasDate() && !toDoEvent.hasDate() ) return true; 200 if( !hasDate() && !toDoEvent.hasDate() ) return true;
201 if( !hasDate() && toDoEvent.hasDate() ) return false; 201 if( !hasDate() && toDoEvent.hasDate() ) return false;
202 if( hasDate() && toDoEvent.hasDate() ){ 202 if( hasDate() && toDoEvent.hasDate() ){
203 if( date() == toDoEvent.date() ){ // let's the priority decide 203 if( date() == toDoEvent.date() ){ // let's the priority decide
204 return priority() > toDoEvent.priority(); 204 return priority() > toDoEvent.priority();
205 }else{ 205 }else{
206 return date() > toDoEvent.date(); 206 return date() > toDoEvent.date();
207 } 207 }
208 } 208 }
209 return true; 209 return true;
210} 210}
211bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const 211bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const
212{ 212{
213 if( m_date == toDoEvent.m_date && m_isCompleted == toDoEvent.m_isCompleted && m_hasDate == toDoEvent.m_hasDate && m_priority == toDoEvent.m_priority && m_category == toDoEvent.m_category && m_desc == toDoEvent.m_desc ) 213 if( m_date == toDoEvent.m_date && m_isCompleted == toDoEvent.m_isCompleted && m_hasDate == toDoEvent.m_hasDate && m_priority == toDoEvent.m_priority && m_category == toDoEvent.m_category && m_desc == toDoEvent.m_desc )
214 return true; 214 return true;
215 return false; 215 return false;
216} 216}
217ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item ) 217ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
218{ 218{
219 m_date = item.m_date; 219 m_date = item.m_date;
220 m_isCompleted = item.m_isCompleted; 220 m_isCompleted = item.m_isCompleted;
221 m_hasDate = item.m_hasDate; 221 m_hasDate = item.m_hasDate;
222 m_priority = item.m_priority; 222 m_priority = item.m_priority;
223 m_category = item.m_category; 223 m_category = item.m_category;
224 m_desc = item.m_desc; 224 m_desc = item.m_desc;
225 m_uid = item.m_uid; 225 m_uid = item.m_uid;
226 return *this; 226 return *this;
227} 227}
228 228
229 229
230 230
231 231
232 232
233 233
234 234
235 235