author | ulf69 <ulf69> | 2004-07-14 15:19:43 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-14 15:19:43 (UTC) |
commit | 7868ec2225272318048026a602b842b38a05347f (patch) (unidiff) | |
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 | |||
@@ -1100,7 +1100,7 @@ void KABCore::configurationChanged() | |||
1100 | 1100 | ||
1101 | void KABCore::addressBookChanged() | 1101 | void KABCore::addressBookChanged() |
1102 | { | 1102 | { |
1103 | #ifndef KAB_EMBEDDED | 1103 | /*US |
1104 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); | 1104 | QDictIterator<AddresseeEditorDialog> it( mEditorDict ); |
1105 | while ( it.current() ) { | 1105 | while ( it.current() ) { |
1106 | if ( it.current()->dirty() ) { | 1106 | if ( it.current()->dirty() ) { |
@@ -1111,11 +1111,21 @@ void KABCore::addressBookChanged() | |||
1111 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); | 1111 | it.current()->setAddressee( mAddressBook->findByUid( it.currentKey() ) ); |
1112 | ++it; | 1112 | ++it; |
1113 | } | 1113 | } |
1114 | 1114 | */ | |
1115 | if (mEditorDialog) | ||
1116 | { | ||
1117 | if (mEditorDialog->dirty()) | ||
1118 | { | ||
1119 | QString text = i18n( "Data has been changed externally. Unsaved " | ||
1120 | "changes will be lost." ); | ||
1121 | KMessageBox::information( this, text ); | ||
1122 | } | ||
1123 | QString currentuid = mEditorDialog->addressee().uid(); | ||
1124 | mEditorDialog->setAddressee( mAddressBook->findByUid( currentuid ) ); | ||
1125 | } | ||
1115 | mViewManager->refreshView(); | 1126 | mViewManager->refreshView(); |
1116 | #else //KAB_EMBEDDED | 1127 | |
1117 | qDebug("KABCore::addressBookChanged() finsih method"); | 1128 | |
1118 | #endif //KAB_EMBEDDED | ||
1119 | } | 1129 | } |
1120 | 1130 | ||
1121 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | 1131 | AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, |
@@ -1138,7 +1148,6 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | |||
1138 | 1148 | ||
1139 | void KABCore::slotEditorDestroyed( const QString &uid ) | 1149 | void KABCore::slotEditorDestroyed( const QString &uid ) |
1140 | { | 1150 | { |
1141 | qDebug("KABCore::slotEditorDestroyed called. maybe a problem! "); | ||
1142 | //mEditorDict.remove( uid ); | 1151 | //mEditorDict.remove( uid ); |
1143 | } | 1152 | } |
1144 | 1153 | ||
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 | |||
356 | KCMultiDialog *mConfigureDialog; | 356 | KCMultiDialog *mConfigureDialog; |
357 | 357 | ||
358 | #ifndef KAB_EMBEDDED | 358 | #ifndef KAB_EMBEDDED |
359 | |||
360 | KCMultiDialog *mConfigureDialog; | ||
361 | LDAPSearchDialog *mLdapSearchDialog; | 359 | LDAPSearchDialog *mLdapSearchDialog; |
362 | #endif //KAB_EMBEDDED | 360 | #endif //KAB_EMBEDDED |
363 | // QDict<AddresseeEditorDialog> mEditorDict; | 361 | // QDict<AddresseeEditorDialog> mEditorDict; |