summaryrefslogtreecommitdiffstats
path: root/kaddressbook
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-17 02:27:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-17 02:27:43 +0000
commit8f37a4f755113e7440ae985111d36985d500cc95 (patch)
tree3750f2ad5f3ffaac64a98b5fc1a0389838296669 /kaddressbook
parent6d83f2c4e31c985122f6de9dab69d9f1d727b48a (diff)
downloadtdepim-8f37a4f755113e7440ae985111d36985d500cc95.tar.gz
tdepim-8f37a4f755113e7440ae985111d36985d500cc95.zip
Slew of fixes and upgrades, including:
Added kaddressbook automatic sync Added carddav autosync options Added DCOP calls for kaddressbook and korganizer manual resync Repaired Kontact refresh button through above mentioned DCOP calls git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1164528 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook')
-rw-r--r--kaddressbook/kabcore.cpp10
-rw-r--r--kaddressbook/kabcore.h5
-rw-r--r--kaddressbook/kaddressbook_part.cpp6
-rw-r--r--kaddressbook/kaddressbook_part.h1
-rw-r--r--kaddressbook/kaddressbookiface.h2
-rw-r--r--kaddressbook/kaddressbookmain.cpp6
-rw-r--r--kaddressbook/kaddressbookmain.h1
7 files changed, 31 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index e15854768..427cb79ab 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -877,6 +877,16 @@ void KABCore::save()
}
}
+void KABCore::load()
+{
+ TQPtrList<KABC::Resource> resources = mAddressBook->resources();
+ TQPtrListIterator<KABC::Resource> it( resources );
+ while ( it.current() ) {
+ mAddressBook->load();
+ ++it;
+ }
+}
+
void KABCore::setJumpButtonBarVisible( bool visible )
{
if ( visible ) {
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 5a3b0c4b1..ac2975106 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -332,6 +332,11 @@ class KDE_EXPORT KABCore : public KAB::Core
void save();
/**
+ Loads the contents of the AddressBook from disk.
+ */
+ void load();
+
+ /**
Shows the edit dialog for the given uid. If the uid is TQString::null,
the method will try to find a selected addressee in the view.
*/
diff --git a/kaddressbook/kaddressbook_part.cpp b/kaddressbook/kaddressbook_part.cpp
index 3acb85aab..34e651846 100644
--- a/kaddressbook/kaddressbook_part.cpp
+++ b/kaddressbook/kaddressbook_part.cpp
@@ -154,6 +154,12 @@ bool KAddressbookPart::handleCommandLine()
return mCore->handleCommandLine( this );
}
+void KAddressbookPart::syncAllResources()
+{
+ mCore->save();
+ mCore->load();
+}
+
void KAddressbookPart::guiActivateEvent( KParts::GUIActivateEvent *e )
{
kdDebug(5720) << "KAddressbookPart::guiActivateEvent" << endl;
diff --git a/kaddressbook/kaddressbook_part.h b/kaddressbook/kaddressbook_part.h
index 43691f7e4..b0a2c391c 100644
--- a/kaddressbook/kaddressbook_part.h
+++ b/kaddressbook/kaddressbook_part.h
@@ -59,6 +59,7 @@ class KAddressbookPart: public KParts::ReadOnlyPart, virtual public KAddressBook
virtual void exit();
virtual bool openURL( const KURL &url );
virtual bool handleCommandLine();
+ virtual void syncAllResources();
protected:
virtual bool openFile();
diff --git a/kaddressbook/kaddressbookiface.h b/kaddressbook/kaddressbookiface.h
index 448955e81..ffdf941ec 100644
--- a/kaddressbook/kaddressbookiface.h
+++ b/kaddressbook/kaddressbookiface.h
@@ -67,6 +67,8 @@ class KDE_EXPORT KAddressBookIface : virtual public DCOPObject
virtual void loadProfile( const TQString& path ) = 0;
virtual void saveToProfile( const TQString& path ) const = 0;
+
+ virtual void syncAllResources() = 0;
};
#endif
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 7f521a0c6..f54c18828 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -129,6 +129,12 @@ bool KAddressBookMain::handleCommandLine()
return mCore->handleCommandLine( this );
}
+void KAddressBookMain::syncAllResources()
+{
+ mCore->save();
+ mCore->load();
+}
+
void KAddressBookMain::saveProperties( KConfig* )
{
}
diff --git a/kaddressbook/kaddressbookmain.h b/kaddressbook/kaddressbookmain.h
index 4c9f69fe6..aa1bb4ebd 100644
--- a/kaddressbook/kaddressbookmain.h
+++ b/kaddressbook/kaddressbookmain.h
@@ -61,6 +61,7 @@ class KAddressBookMain : public KMainWindow, virtual public KAddressBookIface
virtual void save();
virtual void exit();
virtual bool handleCommandLine();
+ virtual void syncAllResources();
protected:
void initActions();