Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index 52863d5..d978e61 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp @@ -58,4 +58,5 @@ $Id$ #include "resourcedir.h" +#include "syncwidget.h" using namespace KABC; @@ -63,5 +64,5 @@ using namespace KABC; extern "C" #ifdef _WIN32_ -__declspec(dllexport) +__declspec(dllexport) #else { @@ -71,5 +72,5 @@ __declspec(dllexport) void *init_microkabc_dir() { - return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); + return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, KRES::SyncWidget>(); } #ifndef _WIN32_ @@ -77,6 +78,6 @@ __declspec(dllexport) #endif -ResourceDir::ResourceDir( const KConfig *config ) - : Resource( config ) +ResourceDir::ResourceDir( const KConfig *config, bool syncable ) + : Resource( config, syncable ) { QString path; @@ -102,5 +103,5 @@ ResourceDir::ResourceDir( const KConfig *config ) } -/*US +/*US //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); if (mFormatName == "vcard") @@ -111,5 +112,5 @@ ResourceDir::ResourceDir( const KConfig *config ) qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); */ - + connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); @@ -126,6 +127,6 @@ ResourceDir::~ResourceDir() void ResourceDir::writeConfig( KConfig *config ) -{ - config->setGroup( "Resource_" + identifier() ); +{ + config->setGroup( "Resource_" + identifier() ); Resource::writeConfig( config ); @@ -242,8 +243,8 @@ bool ResourceDir::lock( const QString &path ) //US p.replace( QRegExp("/"), "_" ); //US QString lockName = locateLocal( "data", "kabc/lock/" + p + ".lock" ); - KURL url(p); + KURL url(p); QString lockName = locateLocal( "data", "kabc/lock/" + url.fileName() + ".lock" ); - - + + kdDebug(5700) << "-- lock name: " << lockName << endl; @@ -253,8 +254,8 @@ bool ResourceDir::lock( const QString &path ) lockUniqueName = p + KApplication::randomString( 8 ); - url = lockUniqueName; + url = lockUniqueName; //US mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); mLockUniqueName = locateLocal( "data", "kabc/lock/" + url.fileName() ); - + kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; @@ -286,5 +287,5 @@ void ResourceDir::unlock( const QString &path ) //US p.replace( QRegExp( "/" ), "_" ); //US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" ); - KURL url(p); + KURL url(p); QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" ); @@ -298,5 +299,5 @@ void ResourceDir::setPath( const QString &path ) mDirWatch.stopScan(); mDirWatch.removeDir( mPath ); - + mPath = path; @@ -304,5 +305,5 @@ void ResourceDir::setPath( const QString &path ) mDirWatch.startScan(); -//US simulate KDirWatch event +//US simulate KDirWatch event //US pathChanged(); @@ -323,5 +324,5 @@ void ResourceDir::setFormat( const QString &format ) FormatFactory *factory = FormatFactory::self(); mFormat = factory->format( mFormatName ); -/*US +/*US qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1()); if (mFormatName == "vcard") |