author | ulf69 <ulf69> | 2004-07-14 15:19:43 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-14 15:19:43 (UTC) |
commit | 7868ec2225272318048026a602b842b38a05347f (patch) (side-by-side diff) | |
tree | 5f74a46d29caf601ca52dba4df86cefb21c98e04 /kaddressbook | |
parent | 39df2ac65017a41891cd8f856d100378129faa4b (diff) | |
download | kdepimpi-7868ec2225272318048026a602b842b38a05347f.zip kdepimpi-7868ec2225272318048026a602b842b38a05347f.tar.gz kdepimpi-7868ec2225272318048026a602b842b38a05347f.tar.bz2 |
implemented automatic update in case of external resource changes (kdirwatch)
-rw-r--r-- | kaddressbook/kabcore.cpp | 21 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 |
2 files changed, 15 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 8daca33..2b07541 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1097,28 +1097,38 @@ void KABCore::configurationChanged() { mExtensionManager->reconfigure(); } void KABCore::addressBookChanged() { -#ifndef KAB_EMBEDDED +/*US QDictIterator<AddresseeEditorDialog> it( mEditorDict ); while ( it.current() ) { if ( it.current()->dirty() ) { QString text = i18n( "Data has been changed externally. Unsaved " "changes will be lost." ); KMessageBox::information( this, text ); } 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, const char *name ) { @@ -1135,13 +1145,12 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, return mEditorDialog; } void KABCore::slotEditorDestroyed( const QString &uid ) { - qDebug("KABCore::slotEditorDestroyed called. maybe a problem! "); //mEditorDict.remove( uid ); } void KABCore::initGUI() { #ifndef KAB_EMBEDDED diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 69a98a5..6446974 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -353,14 +353,12 @@ class KABCore : public QWidget IncSearchWidget *mIncSearchWidget; ExtensionManager *mExtensionManager; KCMultiDialog *mConfigureDialog; #ifndef KAB_EMBEDDED - - KCMultiDialog *mConfigureDialog; LDAPSearchDialog *mLdapSearchDialog; #endif //KAB_EMBEDDED // QDict<AddresseeEditorDialog> mEditorDict; AddresseeEditorDialog *mEditorDialog; bool mReadWrite; bool mModified; |