-rw-r--r-- | libopie/tododb.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libopie/tododb.cpp b/libopie/tododb.cpp index 10ea2f0..7814c4f 100644 --- a/libopie/tododb.cpp +++ b/libopie/tododb.cpp @@ -23,8 +23,12 @@ public: map.insert( "Priority", QString::number( (*it).priority() ) ); - if(!(*it).category().isEmpty() ){ - QArray<int> arrat(1); - arrat = Qtopia::Record::idsFromString( (*it).category() ); - map.insert( "Categories", QString::number( arrat[0] ) ); - }else - map.insert( "Categories", QString::null ); + QArray<int> arrat = (*it).categories(); + QString attr; + for(uint i=0; i < arrat.count(); i++ ){ + attr.append(QString::number(arrat[i])+";" ); + } + if(!attr.isEmpty() ) // remove the last ; + attr.remove(attr.length()-1, 1 ); + map.insert( "Categories", attr ); + //else + //map.insert( "Categories", QString::null ); map.insert( "Description", (*it).description() ); @@ -103,8 +107,5 @@ public: dummy = element->attribute("Categories" ); - dumInt = dummy.toInt(&ok ); - if(ok ) { - QArray<int> arrat(1); - arrat[0] = dumInt; - event.setCategory( Qtopia::Record::idsToString( arrat ) ); - } + QStringList ids = QStringList::split(";", dummy ); + event.setCategories( ids ); + //uid |