summaryrefslogtreecommitdiffabout
path: root/kabc
authorulf69 <ulf69>2004-07-15 05:06:06 (UTC)
committer ulf69 <ulf69>2004-07-15 05:06:06 (UTC)
commit59f727076930aada485db6531d4084f2bfe0b928 (patch) (unidiff)
treed68ab61d9f78759d36d8ccb2cdd3312987bf7917 /kabc
parent2ada2bfd67b5488115268e6667e55a9b4b297fa2 (diff)
downloadkdepimpi-59f727076930aada485db6531d4084f2bfe0b928.zip
kdepimpi-59f727076930aada485db6531d4084f2bfe0b928.tar.gz
kdepimpi-59f727076930aada485db6531d4084f2bfe0b928.tar.bz2
ask for readwrite resources if the user wants them to reload in the case of an
external change.
Diffstat (limited to 'kabc') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp6
-rw-r--r--kabc/plugins/file/resourcefile.cpp6
-rw-r--r--kabc/plugins/opie/resourceopie.cpp10
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp5
4 files changed, 23 insertions, 4 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
@@ -44,6 +44,7 @@ $Id$
44#include <klocale.h> 44#include <klocale.h>
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"
49 50
@@ -54,8 +55,6 @@ $Id$
54 55
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"
61 60
@@ -345,9 +344,12 @@ void ResourceDir::pathChanged()
345 if ( !addressBook() ) 344 if ( !addressBook() )
346 return; 345 return;
347 346
347 QString text( i18n( "Dir resource '%1'<br> has been changed by third party.<br>Do you want to reload?").arg( mPath ) );
348 if ( readOnly() || KMessageBox::questionYesNo( 0, text ) == KMessageBox::Yes ) {
348 load(); 349 load();
349 addressBook()->emitAddressBookChanged(); 350 addressBook()->emitAddressBookChanged();
350} 351}
352}
351 353
352void ResourceDir::removeAddressee( const Addressee& addr ) 354void ResourceDir::removeAddressee( const Addressee& addr )
353{ 355{
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
@@ -42,6 +42,7 @@ $Id$
42#include <klocale.h> 42#include <klocale.h>
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"
47 48
@@ -372,9 +373,14 @@ void ResourceFile::fileChanged()
372 // we are fully constructed 373 // we are fully constructed
373 if (!addressBook()) 374 if (!addressBook())
374 return; 375 return;
376
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 ) {
375 load(); 380 load();
376 addressBook()->emitAddressBookChanged(); 381 addressBook()->emitAddressBookChanged();
377} 382}
383}
378 384
379void ResourceFile::removeAddressee( const Addressee &addr ) 385void ResourceFile::removeAddressee( const Addressee &addr )
380{ 386{
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
@@ -40,6 +40,7 @@ $Id$
40#include <klocale.h> 40#include <klocale.h>
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"
45//US #include <qpe/qpeapplication.h> 46//US #include <qpe/qpeapplication.h>
@@ -93,8 +94,6 @@ 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 );
100 99
@@ -371,6 +370,13 @@ void ResourceOpie::fileChanged()
371 // we are fully constructed 370 // we are fully constructed
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();
376} 382}
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
@@ -40,6 +40,7 @@ $Id$
40#include <klocale.h> 40#include <klocale.h>
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>
45 46
@@ -335,9 +336,13 @@ void ResourceQtopia::fileChanged()
335 // we are fully constructed 336 // we are fully constructed
336 if (!addressBook()) 337 if (!addressBook())
337 return; 338 return;
339
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 ) {
338 load(); 342 load();
339 addressBook()->emitAddressBookChanged(); 343 addressBook()->emitAddressBookChanged();
340} 344}
345}
341 346
342void ResourceQtopia::removeAddressee( const Addressee &addr ) 347void ResourceQtopia::removeAddressee( const Addressee &addr )
343{ 348{