summaryrefslogtreecommitdiffabout
path: root/kabc/converter
Side-by-side diff
Diffstat (limited to 'kabc/converter') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/converter/opie/opieconverter.cpp33
-rw-r--r--kabc/converter/opie/opieconverter.h2
2 files changed, 4 insertions, 31 deletions
diff --git a/kabc/converter/opie/opieconverter.cpp b/kabc/converter/opie/opieconverter.cpp
index b4e9f1c..0b6a55e 100644
--- a/kabc/converter/opie/opieconverter.cpp
+++ b/kabc/converter/opie/opieconverter.cpp
@@ -67,13 +67,13 @@ void OpieConverter::deinit()
{
delete catDB;
catDB = 0;
}
}
-bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
+bool OpieConverter::opieToAddressee( const OContact &contact, Addressee &addr )
{
// name
addr.setFormattedName(contact.fileAs());
addr.setFamilyName( contact.lastName() );
addr.setGivenName( contact.firstName() );
addr.setAdditionalName( contact.middleName() );
@@ -226,21 +226,17 @@ bool OpieConverter::opieToAddressee( OContact &contact, Addressee &addr )
//US QString groups() const { return find( Qtopia::Groups ); }
//US QStringList groupList() const;
QStringList cats = contact.categoryNames("Contacts");
+ addr.setCategories( cats );
// for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
// qDebug("Cat: %s", (*it).latin1());
// }
-
- addr.setCategories( contact.categoryNames("Contacts") );
-// qDebug("Groups: %s", contact.groups().latin1());
-// addr.setCategories( contact.groupList() );
-
return true;
}
bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
{
@@ -337,39 +333,16 @@ bool OpieConverter::addresseeToOpie( const Addressee &addr, OContact &contact )
// other
contact.setNotes(addr.note());
//US QString groups() const { return find( Qtopia::Groups ); }
//US QStringList groupList() const;
-/*US
- QStringList cats = contact.categoryNames("Contacts");
- for ( QStringList::Iterator it = cats.begin(); it != cats.end(); ++it ) {
- qDebug("Cat: %s", (*it).latin1());
- }
-*/
-
-// addr.setCategories( contact.categoryNames("Contacts") );
-// contact.categoryNames("Contacts");
-// contact.setCategoryNames(addr.categories());
-
-/*US
- QStringList cats = addr.categories();
- QArray<int> cat(cats.count());
- int counter = 0;
- for ( QStringList::ConstIterator it = cats.begin(); it != cats.end(); ++it )
- cat[counter] = (*it).toInt();
-
- contact.setCategories( cat );
-*/
-
- Categories catDB;
- catDB.load( categoryFileName() );
QStringList cats = addr.categories();
QArray<int> iar;
if ( !cats.isEmpty() ) {
- QArray<int> iar = catDB.ids("contact", cats);
+ QArray<int> iar = catDB->ids("contact", cats);
contact.setCategories(iar);
}
return true;
}
diff --git a/kabc/converter/opie/opieconverter.h b/kabc/converter/opie/opieconverter.h
index 7d2ad85..c7e691f 100644
--- a/kabc/converter/opie/opieconverter.h
+++ b/kabc/converter/opie/opieconverter.h
@@ -57,13 +57,13 @@ public:
/**
* Converts a vcard string to an addressee.
*
* @param contact The opie contact.
* @param addr The addressee.
*/
- bool opieToAddressee( OContact &contact, Addressee &addr );
+ bool opieToAddressee( const OContact &contact, Addressee &addr );
/**
* Converts an addressee to a vcard string.
*
* @param addr The addressee.
* @param contact The opie contact.