summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/sharpdtm
authorulf69 <ulf69>2004-08-20 19:53:52 (UTC)
committer ulf69 <ulf69>2004-08-20 19:53:52 (UTC)
commita3083042bb9c69193cc43105e6c9d045bd79e8b2 (patch) (side-by-side diff)
tree6d89eb16d0661b03316117aca6f919339ef5df1d /kabc/plugins/sharpdtm
parentb42c4af4200c67802ee0cc57e10e1464903736b7 (diff)
downloadkdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.zip
kdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.tar.gz
kdepimpi-a3083042bb9c69193cc43105e6c9d045bd79e8b2.tar.bz2
merged bugfix from KDE Head: Don't KDirWatch for own changes
Diffstat (limited to 'kabc/plugins/sharpdtm') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index b63df0c..8a795e9 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -176,81 +176,83 @@ bool ResourceSharpDTM::load()
CardId id;
for (bool res=mAccess->first(); res == true; res=mAccess->next())
{
id = mAccess->cardId();
KABC::Addressee addressee;
res = mConverter->sharpToAddressee( id, mAccess, addressee );
if ( !addressee.isEmpty() && res )
{
addressee.setResource( this );
addressBook()->insertAddressee( addressee );
}
}
return true;
}
bool ResourceSharpDTM::save( Ticket *ticket )
{
qDebug("ResourceSharpDTM::save: %s", fileName().latin1());
+ mDirWatch.stopScan();
KABC::AddressBook::Iterator it;
bool res;
for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) {
CardId id = 0; // 0 means new card
KABC::Addressee addressee = (*it);
res = mAccess->startEditCard(id);
if (res == true)
{
res = mConverter->addresseeToSharp( *it, mAccess, id );
if (res == true)
{
res = mAccess->finishEditCard(&id);
if (res == false)
qDebug("Unable to append Contact: %s", addressee.formattedName().latin1());
}
else
{
qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1());
mAccess->cancelEditCard();
}
}
else
{
qDebug("Unable to add new card. Addressee: %s", addressee.formattedName().latin1());
}
}
//US mAccess->save();
+ mDirWatch.startScan();
delete ticket;
unlock( fileName() );
return true;
}
bool ResourceSharpDTM::lock( const QString &lockfileName )
{
qDebug("ResourceSharpDTM::lock: %s", fileName().latin1());
kdDebug(5700) << "ResourceSharpDTM::lock()" << endl;
QString fn = lockfileName;
KURL url(fn);
QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
kdDebug(5700) << "-- lock name: " << lockName << endl;
if (QFile::exists( lockName ))
{
qDebug("ResourceSharpDTM::lock: lockfile %s already exists. (Delete it before continuing if nobody else is accessing the resourcefile %s)", lockName.latin1(), fileName());
return false;
}