Diffstat (limited to 'libopie2/opiepim/core/opimrecord.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimrecord.cpp | 63 |
1 files changed, 6 insertions, 57 deletions
diff --git a/libopie2/opiepim/core/opimrecord.cpp b/libopie2/opiepim/core/opimrecord.cpp index 21cf131..0e3be9d 100644 --- a/libopie2/opiepim/core/opimrecord.cpp +++ b/libopie2/opiepim/core/opimrecord.cpp @@ -21,7 +21,7 @@ OPimRecord::OPimRecord( const OPimRecord& rec ) OPimRecord &OPimRecord::operator=( const OPimRecord& rec) { Qtopia::Record::operator=( rec ); - m_relations = rec.m_relations; + m_xrefman = rec.m_xrefman; return *this; } @@ -52,61 +52,7 @@ void OPimRecord::addCategoryName( const QString& ) { 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 ); -} -void OPimRecord::addRelation( const QString& app, int id ) { - - QMap<QString, QArray<int> >::Iterator it; - QArray<int> tmp; - - it = m_relations.find( app ); - if ( it == m_relations.end() ) { - tmp.resize(1 ); - tmp[0] = id; - }else{ - tmp = it.data(); - tmp.resize( tmp.size() + 1 ); - tmp[tmp.size() - 1] = id; - } - m_relations.replace( app, tmp ); -} -void OPimRecord::setRelations( const QString& app, QArray<int> ids ) { - - QMap<QString, QArray<int> >::Iterator it; - QArray<int> tmp; - - it = m_relations.find( app); - if ( it == m_relations.end() ) { - tmp = ids; - }else{ - tmp = it.data(); - int offset = tmp.size()-1; - tmp.resize( tmp.size() + ids.size() ); - for (uint i = 0; i < ids.size(); i++ ) { - tmp[offset+i] = ids[i]; - } - - } - m_relations.replace( app, tmp ); -} -QString OPimRecord::crossToString()const { +/*QString OPimRecord::crossToString()const { QString str; QMap<QString, QArray<int> >::ConstIterator it; for (it = m_relations.begin(); it != m_relations.end(); ++it ) { @@ -119,7 +65,7 @@ QString OPimRecord::crossToString()const { //qWarning("IDS " + str ); return str; -} + }*/ /* if uid = 1 assign a new one */ void OPimRecord::setUid( int uid ) { if ( uid == 1) @@ -130,3 +76,6 @@ void OPimRecord::setUid( int uid ) { Qtopia::UidGen &OPimRecord::uidGen() { return m_uidGen; } +OPimXRefManager &OPimRecord::xrefmanager() { + return m_xrefman; +} |