summaryrefslogtreecommitdiff
path: root/libopie/todoevent.cpp
authorzecke <zecke>2002-04-13 16:27:19 (UTC)
committer zecke <zecke>2002-04-13 16:27:19 (UTC)
commitdef870c6fcccf2b20d7ce3821055391b18243a24 (patch) (side-by-side diff)
tree006357788654cf0e18c76640bd821cf87731d952 /libopie/todoevent.cpp
parente42465b45553f51cf7c7d24130aa3a90a6be3ddd (diff)
downloadopie-def870c6fcccf2b20d7ce3821055391b18243a24.zip
opie-def870c6fcccf2b20d7ce3821055391b18243a24.tar.gz
opie-def870c6fcccf2b20d7ce3821055391b18243a24.tar.bz2
multiple categories
Diffstat (limited to 'libopie/todoevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index 7dbf907..28b2e98 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -9,7 +9,7 @@ ToDoEvent::ToDoEvent(const ToDoEvent &event )
*this = event;
}
-ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category,
+ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
const QString &description, bool hasDate, QDate date, int uid )
{
qWarning("todoEvent c'tor" );
@@ -28,8 +28,8 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category,
}
QArray<int> ToDoEvent::categories()const
{
- QArray<int> array(1); // currently the datebook can be only in one category
- array = Qtopia::Record::idsFromString( category() );
+ QArray<int> array(m_category.count() ); // currently the datebook can be only in one category
+ array = Qtopia::Record::idsFromString( m_category.join(";") );
return array;
}
bool ToDoEvent::match( const QRegExp &regExp )const
@@ -55,14 +55,28 @@ int ToDoEvent::priority()const
{
return m_priority;
}
-QString ToDoEvent::category()const
+QStringList ToDoEvent::allCategories()const
{
return m_category;
}
+void ToDoEvent::insertCategory(const QString &str )
+{
+ m_category.append( str );
+}
+void ToDoEvent::clearCategories()
+{
+ m_category.clear();
+}
+void ToDoEvent::setCategories(const QStringList &list )
+{
+ m_category = list;
+ qWarning("todoevent: %s", list.join(";" ).latin1() );
+}
QDate ToDoEvent::date()const
{
return m_date;
}
+
QString ToDoEvent::description()const
{
return m_desc;
@@ -82,7 +96,8 @@ void ToDoEvent::setDescription(const QString &desc )
void ToDoEvent::setCategory( const QString &cat )
{
qWarning("setCategory %s", cat.latin1() );
- m_category = cat;
+ m_category.clear();
+ m_category << cat;
}
void ToDoEvent::setPriority(int prio )
{
@@ -151,7 +166,7 @@ bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const
}
bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const
{
- 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_category )
+ 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 )
return true;
return false;
}