From 7868ec2225272318048026a602b842b38a05347f Mon Sep 17 00:00:00 2001 From: ulf69 Date: Wed, 14 Jul 2004 15:19:43 +0000 Subject: implemented automatic update in case of external resource changes (kdirwatch) --- (limited to 'kaddressbook') diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 8daca33..2b07541 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1100,7 +1100,7 @@ void KABCore::configurationChanged() void KABCore::addressBookChanged() { -#ifndef KAB_EMBEDDED +/*US QDictIterator it( mEditorDict ); while ( it.current() ) { if ( it.current()->dirty() ) { @@ -1111,11 +1111,21 @@ void KABCore::addressBookChanged() it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); ++it; } - +*/ + if (mEditorDialog) + { + if (mEditorDialog->dirty()) + { + QString text = i18n( "Data has been changed externally. Unsaved " + "changes will be lost." ); + KMessageBox::information( this, text ); + } + QString currentuid = mEditorDialog->addressee().uid(); + mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); + } mViewManager->refreshView(); -#else //KAB_EMBEDDED - qDebug("KABCore::addressBookChanged() finsih method"); -#endif //KAB_EMBEDDED + + } AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, @@ -1138,7 +1148,6 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, void KABCore::slotEditorDestroyed( const QString &uid ) { - qDebug("KABCore::slotEditorDestroyed called. maybe a problem! "); //mEditorDict.remove( uid ); } diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 69a98a5..6446974 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -356,8 +356,6 @@ class KABCore : public QWidget KCMultiDialog *mConfigureDialog; #ifndef KAB_EMBEDDED - - KCMultiDialog *mConfigureDialog; LDAPSearchDialog *mLdapSearchDialog; #endif //KAB_EMBEDDED // QDict mEditorDict; -- cgit v0.9.0.2