-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 26 | ||||
-rw-r--r-- | libopie2/opiepim/core/opimrecord.h | 4 |
2 files changed, 23 insertions, 7 deletions
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index 95de1df..d8f73c7 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp @@ -3,5 +3,7 @@ OPimRecord::OPimRecord( int uid ) : Qtopia::Record() { + setUid( uid ); + /* assign a new UID */ if ( uid == 1 ) assignUid(); @@ -9,5 +11,5 @@ OPimRecord::OPimRecord( int uid ) OPimRecord::~OPimRecord() { } -OPimRecord::OPimRecord( OPimRecord& rec ) +OPimRecord::OPimRecord( const OPimRecord& rec ) : Qtopia::Record( rec ) { @@ -16,7 +18,7 @@ OPimRecord::OPimRecord( OPimRecord& rec ) OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { - /* how do I call the parent copy operator ? */ - setUid( rec.uid() ); - setCategories( rec.categories() ); + Qtopia::Record::operator=( rec ); + m_relations = rec.m_relations; + return *this; } @@ -26,5 +28,5 @@ QStringList OPimRecord::categoryNames()const { return list; } -void OPimRecord::setCategoryName( const QStringList& ) { +void OPimRecord::setCategoryNames( const QStringList& ) { } @@ -89,2 +91,16 @@ void OPimRecord::setRelations( const QString& app, QArray<int> ids ) { m_relations.replace( app, tmp ); } +QString OPimRecord::crossToString()const { + QString str; + QMap<QString, QArray<int> >::ConstIterator it; + for (it = m_relations.begin(); it != m_relations.end(); ++it ) { + QArray<int> id = it.data(); + for ( uint i = 0; i < id.size(); ++i ) { + str += it.key() + "," + QString::number( i ) + ";"; + } + } + str = str.remove( str.length()-1, 1); // strip the ; + //qWarning("IDS " + str ); + + return str; +} diff --git a/libopie2/opiepim/core/opimrecord.h b/libopie2/opiepim/core/opimrecord.h index a0e0413..18112d4 100644 --- a/libopie2/opiepim/core/opimrecord.h +++ b/libopie2/opiepim/core/opimrecord.h @@ -20,5 +20,5 @@ public: * copy c'tor */ - OPimRecord( OPimRecord& rec ); + OPimRecord( const OPimRecord& rec ); /** @@ -35,5 +35,5 @@ public: * set category names they will be resolved */ - void setCategoryName( const QStringList& ); + void setCategoryNames( const QStringList& ); /** |