summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/opie/resourceopie.cpp
Side-by-side diff
Diffstat (limited to 'kabc/plugins/opie/resourceopie.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 1222242..5559827 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -49,9 +49,9 @@ $Id$
#include <opie/ocontactaccessbackend_xml.h>
#include "resourceopieconfig.h"
#include "stdaddressbook.h"
-#include "syncwidget.h"
+#include "syncprefwidget.h"
#include "opieconverter.h"
#include "resourceopie.h"
@@ -60,9 +60,9 @@ using namespace KABC;
extern "C"
{
void *init_microkabc_opie()
{
- return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, KRES::SyncWidget>();
+ return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, SyncPrefWidget>();
}
}
ResourceOpie::ResourceOpie( const KConfig *config, bool syncable )
@@ -75,17 +75,14 @@ ResourceOpie::ResourceOpie( const KConfig *config, bool syncable )
fileName = cfg->readEntry( "FileName", fileName );
}
-// qDebug("ResourceOpie::ResourceOpie : %s", fileName.latin1() );
-
init( fileName );
}
ResourceOpie::ResourceOpie( const QString &fileName, bool syncable )
: Resource( 0, syncable )
{
-// qDebug("ResourceOpie::ResourceOpie : 3 %s", fileName.latin1());
init( fileName );
}
void ResourceOpie::init( const QString &fileName )
@@ -94,11 +91,9 @@ void ResourceOpie::init( const QString &fileName )
connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
-
setFileName( fileName );
-
}
ResourceOpie::~ResourceOpie()
{
@@ -106,9 +101,8 @@ ResourceOpie::~ResourceOpie()
delete mConverter;
if(mAccess != 0)
delete mAccess;
-
}
void ResourceOpie::writeConfig( KConfig *config )
{
@@ -250,18 +244,12 @@ bool ResourceOpie::save( Ticket *ticket )
bool ResourceOpie::lock( const QString &lockfileName )
{
qDebug("ResourceOpie::lock: %s", fileName().latin1());
-
-// qDebug("ResourceOpie::lock() %s", fileName.latin1());
kdDebug(5700) << "ResourceOpie::lock()" << endl;
QString fn = lockfileName;
-//US change the implementation how the lockfilename is getting created
-//US fn.replace( QRegExp("/"), "_" );
-//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
-
KURL url(fn);
QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
kdDebug(5700) << "-- lock name: " << lockName << endl;
@@ -301,12 +289,8 @@ void ResourceOpie::unlock( const QString &fileName )
{
qDebug("ResourceOpie::unlock() %s", fileName.latin1());
QString fn = fileName;
-//US change the implementation how the lockfilename is getting created
-//US fn.replace( QRegExp( "/" ), "_" );
-//US QString lockName = locateLocal( "data", "kabc/lock/" + fn + ".lock" );
-//US QString lockName = fn + ".lock";
KURL url(fn);
QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" );
QFile::remove( lockName );