summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir
Side-by-side diff
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,34 +1,34 @@
TEMPLATE = lib
CONFIG += qt warn_on release
#release debug
TARGET = microkabc_dir
-INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat
+INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat
DESTDIR = ../../../bin
#LIBS += -lmicrokde -lmicrokabc
#LIBS += -L$(QPEDIR)/lib
INTERFACES = \
HEADERS = \
resourcedir.h \
resourcedirconfig.h
SOURCES = \
resourcedir.cpp \
resourcedirconfig.cpp
unix : {
OBJECTS_DIR = obj/unix
MOC_DIR = moc/unix
}
win32: {
CONFIG += dll
DEFINES += _WIN32_
OBJECTS_DIR = obj/win
MOC_DIR = moc/win
LIBS += ../../../bin/microkdepim.lib
LIBS += ../../../bin/microkcal.lib
LIBS += ../../../bin/microkde.lib
LIBS += ../../../bin/microkabc.lib
-} \ No newline at end of file
+}
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,21 +1,21 @@
TEMPLATE = lib
CONFIG += qt warn_on release
#release debug
TARGET = microkabc_dir
-INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat
+INCLUDEPATH += ../.. ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat
OBJECTS_DIR = obj/$(PLATFORM)
MOC_DIR = moc/$(PLATFORM)
DESTDIR = $(QPEDIR)/lib
LIBS += -lmicrokde -lmicrokabc
LIBS += -L$(QPEDIR)/lib
INTERFACES = \
HEADERS = \
resourcedir.h \
resourcedirconfig.h
SOURCES = \
resourcedir.cpp \
resourcedirconfig.cpp
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
@@ -91,53 +91,51 @@ ResourceDir::ResourceDir( const KConfig *config )
} else {
path = StdAddressBook::directoryName();
mFormatName = "vcard";
}
FormatFactory *factory = FormatFactory::self();
mFormat = factory->format( mFormatName );
if ( !mFormat ) {
mFormatName = "vcard";
mFormat = factory->format( mFormatName );
}
/*US
//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
if (mFormatName == "vcard")
mFormat = new VCardFormatPlugin2();
else if (mFormatName == "binary")
mFormat = new BinaryFormat();
else
qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
*/
-/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
-*/
setPath( path );
}
ResourceDir::~ResourceDir()
{
delete mFormat;
mFormat = 0;
}
void ResourceDir::writeConfig( KConfig *config )
{
config->setGroup( "Resource_" + identifier() );
Resource::writeConfig( config );
config->writeEntry( "FilePath", mPath );
config->writeEntry( "FileFormat", mFormatName );
}
Ticket *ResourceDir::requestSaveTicket()
{
kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl;
if ( !addressBook() ) return 0;
@@ -277,61 +275,58 @@ bool ResourceDir::lock( const QString &path )
return true;
}
// TODO: check stat
return false;
}
void ResourceDir::unlock( const QString &path )
{
QString p = path;
//US change the implementation how the lockfilename is getting created
//US p.replace( QRegExp( "/" ), "_" );
//US QString lockName = locate( "data", "kabc/lock/" + p + ".lock" );
KURL url(p);
QString lockName = locate( "data", "kabc/lock/" + url.fileName() + ".lock" );
::unlink( QFile::encodeName( lockName ) );
QFile::remove( mLockUniqueName );
addressBook()->emitAddressBookUnlocked();
}
void ResourceDir::setPath( const QString &path )
{
-/*US ToDo: no synchronization so far. Has to be changed in the future
mDirWatch.stopScan();
mDirWatch.removeDir( mPath );
-*/
+
mPath = path;
-/*US ToDo: no synchronization so far. Has to be changed in the future
mDirWatch.addDir( mPath, true );
mDirWatch.startScan();
-*/
//US simulate KDirWatch event
- pathChanged();
+//US pathChanged();
}
QString ResourceDir::path() const
{
return mPath;
}
void ResourceDir::setFormat( const QString &format )
{
mFormatName = format;
if ( mFormat )
delete mFormat;
FormatFactory *factory = FormatFactory::self();
mFormat = factory->format( mFormatName );
/*US
qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1());
if (mFormatName == "vcard")
mFormat = new VCardFormatPlugin2();
else if (mFormatName == "binary")
mFormat = new BinaryFormat();
else