author | ulf69 <ulf69> | 2004-06-29 05:06:57 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-06-29 05:06:57 (UTC) |
commit | beccf25496b482fa9eccd41f13c07e67e32f3a52 (patch) (unidiff) | |
tree | 2f50a252b93bb866c7f41beebcf539861e7f4e2c /kabc/plugins | |
parent | d55d405ad63c4b9e9372430ccd3f73ef927bf7d9 (diff) | |
download | kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.zip kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.gz kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.bz2 |
enable dynamic loading
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 33 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 36 |
2 files changed, 32 insertions, 37 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index f354a9e..be19821 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -49,3 +49,3 @@ $Id$ | |||
49 | 49 | ||
50 | //US #include "formatfactory.h" | 50 | #include "formatfactory.h" |
51 | 51 | ||
@@ -56,4 +56,4 @@ $Id$ | |||
56 | #include <qdir.h> | 56 | #include <qdir.h> |
57 | #include <formats/vcardformatplugin2.h> | 57 | //US #include "../../formats/vcardformatplugin2.h" |
58 | #include <formats/binaryformat.h> | 58 | //US #include "../../formats/binaryformat.h" |
59 | 59 | ||
@@ -65,7 +65,6 @@ extern "C" | |||
65 | { | 65 | { |
66 | void *init_kabc_dir() | 66 | //US void *init_kabc_dir() |
67 | void *init_microkabc_dir() | ||
67 | { | 68 | { |
68 | qDebug("resourcedir.cpp : init_kabc_dir has to be changed"); | 69 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); |
69 | //US return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); | ||
70 | return 0; | ||
71 | } | 70 | } |
@@ -91,3 +90,3 @@ ResourceDir::ResourceDir( const KConfig *config ) | |||
91 | 90 | ||
92 | /*US FormatFactory *factory = FormatFactory::self(); | 91 | FormatFactory *factory = FormatFactory::self(); |
93 | mFormat = factory->format( mFormatName ); | 92 | mFormat = factory->format( mFormatName ); |
@@ -98,4 +97,4 @@ ResourceDir::ResourceDir( const KConfig *config ) | |||
98 | } | 97 | } |
99 | */ | ||
100 | 98 | ||
99 | /*US | ||
101 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); | 100 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); |
@@ -107,3 +106,3 @@ ResourceDir::ResourceDir( const KConfig *config ) | |||
107 | qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); | 106 | qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); |
108 | 107 | */ | |
109 | 108 | ||
@@ -263,9 +262,5 @@ bool ResourceDir::lock( const QString &path ) | |||
263 | // Create lock file | 262 | // Create lock file |
264 | #ifdef _WIN32_ | ||
265 | int result = 0; | ||
266 | qDebug("WARNING: ResourceDir::lock cannot link "); | ||
267 | #else | ||
268 | int result = ::link( QFile::encodeName( mLockUniqueName ), | 263 | int result = ::link( QFile::encodeName( mLockUniqueName ), |
269 | QFile::encodeName( lockName ) ); | 264 | QFile::encodeName( lockName ) ); |
270 | #endif | 265 | |
271 | if ( result == 0 ) { | 266 | if ( result == 0 ) { |
@@ -324,5 +319,5 @@ void ResourceDir::setFormat( const QString &format ) | |||
324 | 319 | ||
325 | //US FormatFactory *factory = FormatFactory::self(); | 320 | FormatFactory *factory = FormatFactory::self(); |
326 | //US mFormat = factory->format( mFormatName ); | 321 | mFormat = factory->format( mFormatName ); |
327 | 322 | /*US | |
328 | qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1()); | 323 | qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1()); |
@@ -334,3 +329,3 @@ qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1()); | |||
334 | qDebug("ResourceDir::setFormat format unknown !!! %s ", format.latin1()); | 329 | qDebug("ResourceDir::setFormat format unknown !!! %s ", format.latin1()); |
335 | 330 | */ | |
336 | 331 | ||
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index d30ed2f..80af841 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -45,3 +45,3 @@ $Id$ | |||
45 | 45 | ||
46 | //US #include "formatfactory.h" | 46 | #include "formatfactory.h" |
47 | 47 | ||
@@ -51,4 +51,4 @@ $Id$ | |||
51 | 51 | ||
52 | #include <formats/vcardformatplugin2.h> | 52 | //US #include "../../formats/vcardformatplugin2.h" |
53 | #include <formats/binaryformat.h> | 53 | //US #include "../../formats/binaryformat.h" |
54 | 54 | ||
@@ -61,7 +61,6 @@ extern "C" | |||
61 | { | 61 | { |
62 | void *init_kabc_file() | 62 | //US void *init_kabc_file() |
63 | void *init_microkabc_file() | ||
63 | { | 64 | { |
64 | qDebug("!!!resourcefile.cpp : init_kabc_file has to be changed"); | 65 | return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); |
65 | //US return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); | ||
66 | return 0; | ||
67 | } | 66 | } |
@@ -101,4 +100,4 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) | |||
101 | 100 | ||
102 | /*US FormatFactory *factory = FormatFactory::self(); | 101 | FormatFactory *factory = FormatFactory::self(); |
103 | mFormat = factory->format( mFormatName ); | 102 | mFormat = factory->format( mFormatName ); |
104 | 103 | ||
@@ -108,4 +107,4 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) | |||
108 | } | 107 | } |
109 | */ | ||
110 | 108 | ||
109 | /*US | ||
111 | //US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1()); | 110 | //US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1()); |
@@ -121,2 +120,3 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) | |||
121 | qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1()); | 120 | qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1()); |
121 | */ | ||
122 | 122 | ||
@@ -219,4 +219,4 @@ bool ResourceFile::save( Ticket *ticket ) | |||
219 | 219 | ||
220 | (void) KSaveFile::backupFile( mFileName, QString::null /*directory*/ | 220 | (void) KSaveFile::backupFile( mFileName, QString::null |
221 | /*US ,extension ); | 221 | ,extension ); |
222 | 222 | ||
@@ -288,5 +288,4 @@ bool ResourceFile::lock( const QString &fileName ) | |||
288 | // Create lock file | 288 | // Create lock file |
289 | int result = 0;//::link( QFile::encodeName( mLockUniqueName ), | 289 | int result = ::link( QFile::encodeName( mLockUniqueName ), |
290 | // QFile::encodeName( lockName ) ); | 290 | QFile::encodeName( lockName ) ); |
291 | qDebug("lock files %s, %s needs to be fixed", mLockUniqueName.latin1(), lockName.latin1() ); | ||
292 | 291 | ||
@@ -344,5 +343,5 @@ void ResourceFile::setFormat( const QString &format ) | |||
344 | 343 | ||
345 | //US FormatFactory *factory = FormatFactory::self(); | 344 | FormatFactory *factory = FormatFactory::self(); |
346 | //US mFormat = factory->format( mFormatName ); | 345 | mFormat = factory->format( mFormatName ); |
347 | 346 | /*US | |
348 | //qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1()); | 347 | //qDebug("ResourceFile::setFormat initialized with format %s ", format.latin1()); |
@@ -358,2 +357,3 @@ void ResourceFile::setFormat( const QString &format ) | |||
358 | qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1()); | 357 | qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1()); |
358 | */ | ||
359 | 359 | ||