author | zecke <zecke> | 2002-11-15 15:31:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-11-15 15:31:47 (UTC) |
commit | 5a6e66edad1070f624d54320278d00372f112213 (patch) (side-by-side diff) | |
tree | ab1028759194edace4c79cf90d18dc1362a84aa9 /libopie2/opiepim/core/opimrecord.cpp | |
parent | 05f56fbbbe9ea5546f7503f4852fcab9c5b10a00 (diff) | |
download | opie-5a6e66edad1070f624d54320278d00372f112213.zip opie-5a6e66edad1070f624d54320278d00372f112213.tar.gz opie-5a6e66edad1070f624d54320278d00372f112213.tar.bz2 |
Add the implementation for the XRef Manager
Add it to libopie.pro
Adjust OPimRecord to use the new manager
The backends do not support xref yet
Diffstat (limited to 'libopie2/opiepim/core/opimrecord.cpp') (more/less context) (show 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 @@ -22,5 +22,5 @@ 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; @@ -53,59 +53,5 @@ 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; @@ -120,5 +66,5 @@ QString OPimRecord::crossToString()const { return str; -} + }*/ /* if uid = 1 assign a new one */ void OPimRecord::setUid( int uid ) { @@ -131,2 +77,5 @@ Qtopia::UidGen &OPimRecord::uidGen() { return m_uidGen; } +OPimXRefManager &OPimRecord::xrefmanager() { + return m_xrefman; +} |