summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir/resourcedir.cpp
authorulf69 <ulf69>2004-06-29 05:06:57 (UTC)
committer ulf69 <ulf69>2004-06-29 05:06:57 (UTC)
commitbeccf25496b482fa9eccd41f13c07e67e32f3a52 (patch) (unidiff)
tree2f50a252b93bb866c7f41beebcf539861e7f4e2c /kabc/plugins/dir/resourcedir.cpp
parentd55d405ad63c4b9e9372430ccd3f73ef927bf7d9 (diff)
downloadkdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.zip
kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.gz
kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.bz2
enable dynamic loading
Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp33
1 files changed, 14 insertions, 19 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
@@ -47,15 +47,15 @@ $Id$
47 47
48#include "addressbook.h" 48#include "addressbook.h"
49 49
50//US #include "formatfactory.h" 50#include "formatfactory.h"
51 51
52#include "resourcedirconfig.h" 52#include "resourcedirconfig.h"
53#include "stdaddressbook.h" 53#include "stdaddressbook.h"
54 54
55//US 55//US
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
60#include "resourcedir.h" 60#include "resourcedir.h"
61 61
@@ -63,11 +63,10 @@ using namespace KABC;
63 63
64extern "C" 64extern "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 }
72} 71}
73 72
@@ -89,15 +88,15 @@ ResourceDir::ResourceDir( const KConfig *config )
89 } 88 }
90 89
91 90
92/*US FormatFactory *factory = FormatFactory::self(); 91 FormatFactory *factory = FormatFactory::self();
93 mFormat = factory->format( mFormatName ); 92 mFormat = factory->format( mFormatName );
94 93
95 if ( !mFormat ) { 94 if ( !mFormat ) {
96 mFormatName = "vcard"; 95 mFormatName = "vcard";
97 mFormat = factory->format( mFormatName ); 96 mFormat = factory->format( mFormatName );
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());
102 if (mFormatName == "vcard") 101 if (mFormatName == "vcard")
103 mFormat = new VCardFormatPlugin2(); 102 mFormat = new VCardFormatPlugin2();
@@ -105,7 +104,7 @@ ResourceDir::ResourceDir( const KConfig *config )
105 mFormat = new BinaryFormat(); 104 mFormat = new BinaryFormat();
106 else 105 else
107 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); 106 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
108 107*/
109 108
110/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods 109/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
111 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 110 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
@@ -261,13 +260,9 @@ bool ResourceDir::lock( const QString &path )
261 file.close(); 260 file.close();
262 261
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 ) {
272 addressBook()->emitAddressBookLocked(); 267 addressBook()->emitAddressBookLocked();
273 return true; 268 return true;
@@ -322,9 +317,9 @@ void ResourceDir::setFormat( const QString &format )
322 if ( mFormat ) 317 if ( mFormat )
323 delete mFormat; 318 delete mFormat;
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
328qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1()); 323qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1());
329 if (mFormatName == "vcard") 324 if (mFormatName == "vcard")
330 mFormat = new VCardFormatPlugin2(); 325 mFormat = new VCardFormatPlugin2();
@@ -332,7 +327,7 @@ qDebug("ResourceDir::setFormat initialized with format %s ", format.latin1());
332 mFormat = new BinaryFormat(); 327 mFormat = new BinaryFormat();
333 else 328 else
334 qDebug("ResourceDir::setFormat format unknown !!! %s ", format.latin1()); 329 qDebug("ResourceDir::setFormat format unknown !!! %s ", format.latin1());
335 330*/
336 331
337} 332}
338 333