author | ulf69 <ulf69> | 2004-07-14 14:52:15 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-07-14 14:52:15 (UTC) |
commit | cf7175c9a6b96cd11fb7f3cba459f5223aa4aacb (patch) (side-by-side diff) | |
tree | e14057a10fba52a7b2881f5bacb0d266e415bd83 /kabc | |
parent | 80b35ebb50cac5007c074a4900f518f48f704eac (diff) | |
download | kdepimpi-cf7175c9a6b96cd11fb7f3cba459f5223aa4aacb.zip kdepimpi-cf7175c9a6b96cd11fb7f3cba459f5223aa4aacb.tar.gz kdepimpi-cf7175c9a6b96cd11fb7f3cba459f5223aa4aacb.tar.bz2 |
added changes to support the kdirwatch implementation
-rw-r--r-- | kabc/distributionlist.cpp | 5 | ||||
-rw-r--r-- | kabc/distributionlist.h | 2 | ||||
-rw-r--r-- | kabc/kabc.pro | 2 | ||||
-rw-r--r-- | kabc/kabcE.pro | 2 | ||||
-rw-r--r-- | kabc/plugins/dir/dir.pro | 4 | ||||
-rw-r--r-- | kabc/plugins/dir/dirE.pro | 2 | ||||
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 9 | ||||
-rw-r--r-- | kabc/plugins/file/file.pro | 4 | ||||
-rw-r--r-- | kabc/plugins/file/fileE.pro | 2 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 14 | ||||
-rw-r--r-- | kabc/plugins/opie/opieE.pro | 2 |
11 files changed, 16 insertions, 32 deletions
diff --git a/kabc/distributionlist.cpp b/kabc/distributionlist.cpp index 0735aba..1fb186e 100644 --- a/kabc/distributionlist.cpp +++ b/kabc/distributionlist.cpp @@ -257,39 +257,36 @@ bool DistributionListManager::save() cfg.sync(); return true; } DistributionListWatcher* DistributionListWatcher::mSelf = 0; DistributionListWatcher::DistributionListWatcher() : QObject( 0, "DistributionListWatcher" ) { -/*US + mDirWatch = new KDirWatch; mDirWatch->addFile( locateLocal( "data", "kabc/distlists" ) ); connect( mDirWatch, SIGNAL( dirty( const QString& ) ), SIGNAL( changed() ) ); mDirWatch->startScan(); -*/ } DistributionListWatcher::~DistributionListWatcher() { -/*US delete mDirWatch; mDirWatch = 0; -*/ } DistributionListWatcher *DistributionListWatcher::self() { if ( !mSelf ) mSelf = new DistributionListWatcher(); return mSelf; } //US #include "distributionlist.moc" diff --git a/kabc/distributionlist.h b/kabc/distributionlist.h index 5f091b1..584f287 100644 --- a/kabc/distributionlist.h +++ b/kabc/distributionlist.h @@ -201,17 +201,17 @@ class DistributionListWatcher : public QObject * This signal is emmitted whenever the distribution lists has * changed (if a list was added or removed, when a list was * renamed or the entries of the list changed). */ void changed(); protected: DistributionListWatcher(); ~DistributionListWatcher(); private: static DistributionListWatcher* mSelf; -//US KDirWatch *mDirWatch; + KDirWatch *mDirWatch; }; } #endif diff --git a/kabc/kabc.pro b/kabc/kabc.pro index 4a8d73a..a8cd695 100644 --- a/kabc/kabc.pro +++ b/kabc/kabc.pro @@ -1,22 +1,22 @@ TEMPLATE = lib CONFIG += qt warn_on #release debug DESTDIR=../bin TARGET = microkabc include( ../variables.pri ) -INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../qtcompat ../microkde/kdeui +INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kio/kfile ../microkde/kio/kio ../qtcompat ../microkde/kdeui #LIBS += -lmicrokde -lldap LIBS += -L$(QPEDIR)/lib DEFINES += KAB_EMBEDDED DESKTOP_VERSION unix : { OBJECTS_DIR = obj/unix MOC_DIR = moc/unix } win32: { DEFINES += _WIN32_ OBJECTS_DIR = obj/win diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro index 840afb9..bc1c0ed 100644 --- a/kabc/kabcE.pro +++ b/kabc/kabcE.pro @@ -1,18 +1,18 @@ TEMPLATE = lib CONFIG += qt warn_on TARGET = microkabc -INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../qtcompat $(QPEDIR)/include +INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../qtcompat $(QPEDIR)/include OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib LIBS += -lmicrokde #LIBS += -lldap LIBS += -L$(QPEDIR)/lib DEFINES += KAB_EMBEDDED INTERFACES = \ HEADERS = \ address.h \ 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 @@ 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 \ @@ -22,13 +22,13 @@ 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,18 +1,18 @@ 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 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 ) } /*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 ) { @@ -289,37 +287,34 @@ void ResourceDir::unlock( const QString &path ) //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; diff --git a/kabc/plugins/file/file.pro b/kabc/plugins/file/file.pro index 7cf7c58..32555a2 100644 --- a/kabc/plugins/file/file.pro +++ b/kabc/plugins/file/file.pro @@ -1,18 +1,18 @@ TEMPLATE = lib CONFIG += qt warn_on release #release debug TARGET = microkabc_file -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 = \ resourcefile.h \ resourcefileconfig.h SOURCES = \ @@ -23,13 +23,13 @@ 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/file/fileE.pro b/kabc/plugins/file/fileE.pro index 2d17a8f..d19a26d 100644 --- a/kabc/plugins/file/fileE.pro +++ b/kabc/plugins/file/fileE.pro @@ -1,18 +1,18 @@ TEMPLATE = lib CONFIG += qt warn_on release #release debug TARGET = microkabc_file -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 = \ resourcefile.h \ resourcefileconfig.h diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 2d20706..9f9b00f 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -40,28 +40,24 @@ $Id$ #include <kconfig.h> #include <kdebug.h> #include <klocale.h> //US #include <ksavefile.h> #include <kstandarddirs.h> #include "formatfactory.h" #include "resource.h" #include "resourcefileconfig.h" #include "stdaddressbook.h" -//US #include "../../formats/vcardformatplugin2.h" -//US #include "../../formats/binaryformat.h" - - #include "resourcefile.h" using namespace KABC; extern "C" #ifdef _WIN32_ __declspec(dllexport) #else { #endif //US void *init_kabc_file() @@ -117,29 +113,27 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) if (mFormatName == "vcard") { mFormat = new VCardFormatPlugin2(); // qDebug("ResourceFile::init format VCardFormatPlugin2"); } else if (mFormatName == "binary") { mFormat = new BinaryFormat(); // qDebug("ResourceFile::init format BinaryFormat"); } else qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1()); */ -/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods 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 ); } ResourceFile::~ResourceFile() { delete mFormat; mFormat = 0; } void ResourceFile::writeConfig( KConfig *config ) { @@ -317,37 +311,35 @@ void ResourceFile::unlock( const QString &fileName ) //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 ); QFile::remove( mLockUniqueName ); addressBook()->emitAddressBookUnlocked(); } void ResourceFile::setFileName( const QString &fileName ) { -/*US ToDo: no synchronization so far. Has to be changed in the future mDirWatch.stopScan(); mDirWatch.removeFile( mFileName ); -*/ + mFileName = fileName; -/*US ToDo: no synchronization so far. Has to be changed in the future mDirWatch.addFile( mFileName ); mDirWatch.startScan(); -*/ + //US simulate KDirWatch event - fileChanged(); +//US fileChanged(); } QString ResourceFile::fileName() const { return mFileName; } void ResourceFile::setFormat( const QString &format ) { mFormatName = format; delete mFormat; diff --git a/kabc/plugins/opie/opieE.pro b/kabc/plugins/opie/opieE.pro index 75a5dab..4048cc0 100644 --- a/kabc/plugins/opie/opieE.pro +++ b/kabc/plugins/opie/opieE.pro @@ -1,18 +1,18 @@ TEMPLATE = lib CONFIG += qt warn_on #release debug TARGET = microkabc_opie -INCLUDEPATH += ../.. ../../converter/opie ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat $(QPEDIR)/include $(OPIEDIR)/include +INCLUDEPATH += ../.. ../../converter/opie ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../qtcompat $(QPEDIR)/include $(OPIEDIR)/include OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR = $(QPEDIR)/lib LIBS += -lmicrokde LIBS += -lmicrokabc LIBS += -L$(QPEDIR)/lib LIBS += -L$(OPIEDIR)/lib LIBS += -lopie LIBS += -lqpe LIBS += -lqte |