From 8f37a4f755113e7440ae985111d36985d500cc95 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 17 Aug 2010 02:27:43 +0000 Subject: 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 --- kaddressbook/kabcore.cpp | 10 ++++++++++ kaddressbook/kabcore.h | 5 +++++ kaddressbook/kaddressbook_part.cpp | 6 ++++++ kaddressbook/kaddressbook_part.h | 1 + kaddressbook/kaddressbookiface.h | 2 ++ kaddressbook/kaddressbookmain.cpp | 6 ++++++ kaddressbook/kaddressbookmain.h | 1 + 7 files changed, 31 insertions(+) (limited to 'kaddressbook') 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 resources = mAddressBook->resources(); + TQPtrListIterator 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 @@ -331,6 +331,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(); -- cgit v1.2.1