summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir
Unidiff
Diffstat (limited to 'kabc/plugins/dir') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/dir.pro4
-rw-r--r--kabc/plugins/dir/dirE.pro2
-rw-r--r--kabc/plugins/dir/resourcedir.cpp9
3 files changed, 5 insertions, 10 deletions
diff --git a/kabc/plugins/dir/dir.pro b/kabc/plugins/dir/dir.pro
index 0023029..0555484 100644
--- a/kabc/plugins/dir/dir.pro
+++ b/kabc/plugins/dir/dir.pro
@@ -1,18 +1,18 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabc_dir 5TARGET = microkabc_dir
6INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat 6INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat
7DESTDIR = ../../../bin 7DESTDIR = ../../../bin
8#LIBS += -lmicrokde -lmicrokabc 8#LIBS += -lmicrokde -lmicrokabc
9#LIBS += -L$(QPEDIR)/lib 9#LIBS += -L$(QPEDIR)/lib
10 10
11INTERFACES = \ 11INTERFACES = \
12 12
13HEADERS = \ 13HEADERS = \
14 resourcedir.h \ 14 resourcedir.h \
15 resourcedirconfig.h 15 resourcedirconfig.h
16 16
17SOURCES = \ 17SOURCES = \
18 resourcedir.cpp \ 18 resourcedir.cpp \
@@ -22,13 +22,13 @@ unix : {
22OBJECTS_DIR = obj/unix 22OBJECTS_DIR = obj/unix
23MOC_DIR = moc/unix 23MOC_DIR = moc/unix
24} 24}
25win32: { 25win32: {
26CONFIG += dll 26CONFIG += dll
27DEFINES += _WIN32_ 27DEFINES += _WIN32_
28OBJECTS_DIR = obj/win 28OBJECTS_DIR = obj/win
29MOC_DIR = moc/win 29MOC_DIR = moc/win
30LIBS += ../../../bin/microkdepim.lib 30LIBS += ../../../bin/microkdepim.lib
31LIBS += ../../../bin/microkcal.lib 31LIBS += ../../../bin/microkcal.lib
32LIBS += ../../../bin/microkde.lib 32LIBS += ../../../bin/microkde.lib
33LIBS += ../../../bin/microkabc.lib 33LIBS += ../../../bin/microkabc.lib
34} \ No newline at end of file 34}
diff --git a/kabc/plugins/dir/dirE.pro b/kabc/plugins/dir/dirE.pro
index aceb28a..729f4ce 100644
--- a/kabc/plugins/dir/dirE.pro
+++ b/kabc/plugins/dir/dirE.pro
@@ -1,18 +1,18 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3#release debug 3#release debug
4 4
5TARGET = microkabc_dir 5TARGET = microkabc_dir
6INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat 6INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde -lmicrokabc 10LIBS += -lmicrokde -lmicrokabc
11LIBS += -L$(QPEDIR)/lib 11LIBS += -L$(QPEDIR)/lib
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 resourcedir.h \ 16 resourcedir.h \
17 resourcedirconfig.h 17 resourcedirconfig.h
18 18
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 3cb5179..7825c6f 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -103,29 +103,27 @@ ResourceDir::ResourceDir( const KConfig *config )
103 } 103 }
104 104
105/*US 105/*US
106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); 106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
107 if (mFormatName == "vcard") 107 if (mFormatName == "vcard")
108 mFormat = new VCardFormatPlugin2(); 108 mFormat = new VCardFormatPlugin2();
109 else if (mFormatName == "binary") 109 else if (mFormatName == "binary")
110 mFormat = new BinaryFormat(); 110 mFormat = new BinaryFormat();
111 else 111 else
112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); 112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
113*/ 113*/
114 114
115/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
116 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
117 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); 116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
118 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); 117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
119*/
120 118
121 setPath( path ); 119 setPath( path );
122} 120}
123 121
124ResourceDir::~ResourceDir() 122ResourceDir::~ResourceDir()
125{ 123{
126 delete mFormat; 124 delete mFormat;
127 mFormat = 0; 125 mFormat = 0;
128} 126}
129 127
130void ResourceDir::writeConfig( KConfig *config ) 128void ResourceDir::writeConfig( KConfig *config )
131{ 129{
@@ -289,37 +287,34 @@ void ResourceDir::unlock( const QString &path )
289//US p.replace( QRegExp( "/" ), "_" ); 287//US p.replace( QRegExp( "/" ), "_" );
290//US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" ); 288//US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" );
291 KURL url(p); 289 KURL url(p);
292 QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" ); 290 QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" );
293 291
294 ::unlink( QFile::encodeName( lockName ) ); 292 ::unlink( QFile::encodeName( lockName ) );
295 QFile::remove( mLockUniqueName ); 293 QFile::remove( mLockUniqueName );
296 addressBook()->emitAddressBookUnlocked(); 294 addressBook()->emitAddressBookUnlocked();
297} 295}
298 296
299void ResourceDir::setPath( const QString &path ) 297void ResourceDir::setPath( const QString &path )
300{ 298{
301/*US ToDo: no synchronization so far. Has to be changed in the future
302 mDirWatch.stopScan(); 299 mDirWatch.stopScan();
303 mDirWatch.removeDir( mPath ); 300 mDirWatch.removeDir( mPath );
304*/ 301
305 mPath = path; 302 mPath = path;
306 303
307/*US ToDo: no synchronization so far. Has to be changed in the future
308 mDirWatch.addDir( mPath, true ); 304 mDirWatch.addDir( mPath, true );
309 mDirWatch.startScan(); 305 mDirWatch.startScan();
310*/
311 306
312//US simulate KDirWatch event 307//US simulate KDirWatch event
313 pathChanged(); 308//US pathChanged();
314 309
315} 310}
316 311
317QString ResourceDir::path() const 312QString ResourceDir::path() const
318{ 313{
319 return mPath; 314 return mPath;
320} 315}
321 316
322void ResourceDir::setFormat( const QString &format ) 317void ResourceDir::setFormat( const QString &format )
323{ 318{
324 mFormatName = format; 319 mFormatName = format;
325 320