summaryrefslogtreecommitdiffstats
path: root/kaddressbook
diff options
context:
space:
mode:
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();