summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.cpp
authorulf69 <ulf69>2004-08-02 18:33:07 (UTC)
committer ulf69 <ulf69>2004-08-02 18:33:07 (UTC)
commit60a6886f06be31ec690df34dc8e3b8931c2d3bd7 (patch) (side-by-side diff)
treec4c7c15cfd3753a3342806a11fb8f5c20bb4f923 /kabc/addressbook.cpp
parent863c4c3678e59ef125c08c00e9532ded5b540f67 (diff)
downloadkdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.zip
kdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.tar.gz
kdepimpi-60a6886f06be31ec690df34dc8e3b8931c2d3bd7.tar.bz2
added support for syncable resources
Diffstat (limited to 'kabc/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp
index 0838157..20310a0 100644
--- a/kabc/addressbook.cpp
+++ b/kabc/addressbook.cpp
@@ -218,3 +218,3 @@ AddressBook::AddressBook()
{
- init(0);
+ init(0, "contact");
}
@@ -223,6 +223,13 @@ AddressBook::AddressBook( const QString &config )
{
- init(config);
+ init(config, "contact");
}
-void AddressBook::init(const QString &config)
+AddressBook::AddressBook( const QString &config, const QString &family )
+{
+ init(config, family);
+
+}
+
+// the default family is "contact"
+void AddressBook::init(const QString &config, const QString &family )
{
@@ -237,5 +244,5 @@ void AddressBook::init(const QString &config)
}
-
+
//US d->mErrorHandler = 0;
- d->mManager = new KRES::Manager<Resource>( "contact" );
+ d->mManager = new KRES::Manager<Resource>( family, false );
d->mManager->readConfig( d->mConfig );
@@ -253,3 +260,3 @@ bool AddressBook::load()
{
-
+
@@ -279,3 +286,3 @@ bool AddressBook::save( Ticket *ticket )
deleteRemovedAddressees();
-
+
return ticket->resource()->save( ticket );
@@ -358,3 +365,3 @@ void AddressBook::insertAddressee( const Addressee &a )
(*it).setRevision( QDateTime::currentDateTime() );
- (*it).setChanged( true );
+ (*it).setChanged( true );
}
@@ -437,3 +444,3 @@ Addressee::List AddressBook::findByEmail( const QString &email )
for ( it = begin(); it != end(); ++it ) {
- mailList = (*it).emails();
+ mailList = (*it).emails();
for ( QStringList::Iterator ite = mailList.begin(); ite != mailList.end(); ++ite ) {
@@ -493,5 +500,5 @@ Field::List AddressBook::fields( int category )
}
-
+
if ( category == Field::All ) return d->mAllFields;
-
+
Field::List result;
@@ -501,3 +508,3 @@ Field::List AddressBook::fields( int category )
}
-
+
return result;
@@ -543,4 +550,2 @@ bool AddressBook::addResource( Resource *resource )
{
- qDebug("AddressBook::addResource 1");
-
if ( !resource->open() ) {
@@ -574,3 +579,3 @@ QPtrList<Resource> AddressBook::resources()
// qDebug("AddressBook::resources() 1");
-
+
KRES::Manager<Resource>::ActiveIterator it;