-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 10 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 10 | ||||
-rw-r--r-- | kabc/plugins/opie/resourceopie.cpp | 12 | ||||
-rw-r--r-- | kabc/plugins/qtopia/resourceqtopia.cpp | 9 |
4 files changed, 30 insertions, 11 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index 7825c6f..52863d5 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -45,4 +45,5 @@ $Id$ | |||
45 | #include <kstandarddirs.h> | 45 | #include <kstandarddirs.h> |
46 | #include <kurlrequester.h> | 46 | #include <kurlrequester.h> |
47 | #include <kmessagebox.h> | ||
47 | 48 | ||
48 | #include "addressbook.h" | 49 | #include "addressbook.h" |
@@ -55,6 +56,4 @@ $Id$ | |||
55 | //US | 56 | //US |
56 | #include <qdir.h> | 57 | #include <qdir.h> |
57 | //US #include "../../formats/vcardformatplugin2.h" | ||
58 | //US #include "../../formats/binaryformat.h" | ||
59 | 58 | ||
60 | #include "resourcedir.h" | 59 | #include "resourcedir.h" |
@@ -346,6 +345,9 @@ void ResourceDir::pathChanged() | |||
346 | return; | 345 | return; |
347 | 346 | ||
348 | load(); | 347 | QString text( i18n( "Dir resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mPath ) ); |
349 | addressBook()->emitAddressBookChanged(); | 348 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { |
349 | load(); | ||
350 | addressBook()->emitAddressBookChanged(); | ||
351 | } | ||
350 | } | 352 | } |
351 | 353 | ||
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 9f9b00f..1d3acec 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -43,4 +43,5 @@ $Id$ | |||
43 | //US #include <ksavefile.h> | 43 | //US #include <ksavefile.h> |
44 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
45 | #include <kmessagebox.h> | ||
45 | 46 | ||
46 | #include "formatfactory.h" | 47 | #include "formatfactory.h" |
@@ -373,6 +374,11 @@ void ResourceFile::fileChanged() | |||
373 | if (!addressBook()) | 374 | if (!addressBook()) |
374 | return; | 375 | return; |
375 | load(); | 376 | |
376 | addressBook()->emitAddressBookChanged(); | 377 | |
378 | QString text( i18n( "File resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mFileName ) ); | ||
379 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { | ||
380 | load(); | ||
381 | addressBook()->emitAddressBookChanged(); | ||
382 | } | ||
377 | } | 383 | } |
378 | 384 | ||
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp index 1436508..aaee801 100644 --- a/kabc/plugins/opie/resourceopie.cpp +++ b/kabc/plugins/opie/resourceopie.cpp | |||
@@ -41,4 +41,5 @@ $Id$ | |||
41 | //US #include <ksavefile.h> | 41 | //US #include <ksavefile.h> |
42 | #include <kstandarddirs.h> | 42 | #include <kstandarddirs.h> |
43 | #include <kmessagebox.h> | ||
43 | 44 | ||
44 | //US #include "formatfactory.h" | 45 | //US #include "formatfactory.h" |
@@ -93,7 +94,5 @@ void ResourceOpie::init( const QString &fileName ) | |||
93 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); | 94 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); |
94 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); | 95 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); |
95 | 96 | ||
96 | //US opie addressbook is always readonly | ||
97 | //US setReadOnly( true ); | ||
98 | 97 | ||
99 | setFileName( fileName ); | 98 | setFileName( fileName ); |
@@ -372,4 +371,11 @@ void ResourceOpie::fileChanged() | |||
372 | if (!addressBook()) | 371 | if (!addressBook()) |
373 | return; | 372 | return; |
373 | |||
374 | QString text( i18n( "Opie resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mFileName ) ); | ||
375 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { | ||
376 | load(); | ||
377 | addressBook()->emitAddressBookChanged(); | ||
378 | } | ||
379 | |||
374 | load(); | 380 | load(); |
375 | addressBook()->emitAddressBookChanged(); | 381 | addressBook()->emitAddressBookChanged(); |
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp index 4854197..7475685 100644 --- a/kabc/plugins/qtopia/resourceqtopia.cpp +++ b/kabc/plugins/qtopia/resourceqtopia.cpp | |||
@@ -41,4 +41,5 @@ $Id$ | |||
41 | //US #include <ksavefile.h> | 41 | //US #include <ksavefile.h> |
42 | #include <kstandarddirs.h> | 42 | #include <kstandarddirs.h> |
43 | #include <kmessagebox.h> | ||
43 | 44 | ||
44 | #include <qpe/pim/addressbookaccess.h> | 45 | #include <qpe/pim/addressbookaccess.h> |
@@ -336,6 +337,10 @@ void ResourceQtopia::fileChanged() | |||
336 | if (!addressBook()) | 337 | if (!addressBook()) |
337 | return; | 338 | return; |
338 | load(); | 339 | |
339 | addressBook()->emitAddressBookChanged(); | 340 | QString text( i18n( "Qtopia resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mFileName ) ); |
341 | if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) { | ||
342 | load(); | ||
343 | addressBook()->emitAddressBookChanged(); | ||
344 | } | ||
340 | } | 345 | } |
341 | 346 | ||