summaryrefslogtreecommitdiff
path: root/libopie
Side-by-side diff
Diffstat (limited to 'libopie') (more/less context) (show whitespace changes)
-rw-r--r--libopie/pim/opimrecord.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/libopie/pim/opimrecord.cpp b/libopie/pim/opimrecord.cpp
index e510f4e..88b6fde 100644
--- a/libopie/pim/opimrecord.cpp
+++ b/libopie/pim/opimrecord.cpp
@@ -1,54 +1,70 @@
+#include <qpe/categories.h>
+#include <qpe/categoryselect.h>
+
#include "opimrecord.h"
OPimRecord::OPimRecord( int uid )
: Qtopia::Record() {
setUid( uid );
}
OPimRecord::~OPimRecord() {
}
OPimRecord::OPimRecord( const OPimRecord& rec )
: Qtopia::Record( rec )
{
(*this) = rec;
}
OPimRecord &OPimRecord::operator=( const OPimRecord& rec) {
Qtopia::Record::operator=( rec );
m_relations = rec.m_relations;
return *this;
}
+/*
+ * category names
+ */
QStringList OPimRecord::categoryNames()const {
QStringList list;
+ QArray<int> cats = categories();
+ Categories catDB;
+ catDB.load( categoryFileName() );
+
+ for (uint i = 0; i < cats.count(); i++ ) {
+ list << catDB.label("Todo List", cats[i] );
+ }
return list;
}
void OPimRecord::setCategoryNames( const QStringList& ) {
}
void OPimRecord::addCategoryName( const QString& ) {
+ Categories catDB;
+ catDB.load( categoryFileName() );
+
}
bool OPimRecord::isEmpty()const {
return ( uid() == 0 );
}
QStringList OPimRecord::relatedApps()const{
QStringList list;
QMap<QString, QArray<int> >::ConstIterator it;
for ( it = m_relations.begin(); it != m_relations.end(); ++it ) {
list << it.key();
}
return list;
}
QArray<int> OPimRecord::relations(const QString& app )const {
QArray<int> tmp;
QMap<QString, QArray<int> >::ConstIterator it;
it = m_relations.find( app);
if ( it != m_relations.end() )
tmp = it.data();
return tmp;
}
void OPimRecord::clearRelation( const QString& app ) {
m_relations.remove( app );
}