summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/file/resourcefile.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/file/resourcefile.cpp
parentd55d405ad63c4b9e9372430ccd3f73ef927bf7d9 (diff)
downloadkdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.zip
kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.gz
kdepimpi-beccf25496b482fa9eccd41f13c07e67e32f3a52.tar.bz2
enable dynamic loading
Diffstat (limited to 'kabc/plugins/file/resourcefile.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/file/resourcefile.cpp36
1 files changed, 18 insertions, 18 deletions
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
@@ -43,14 +43,14 @@ $Id$
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45 45
46//US #include "formatfactory.h" 46#include "formatfactory.h"
47 47
48#include "resource.h" 48#include "resource.h"
49#include "resourcefileconfig.h" 49#include "resourcefileconfig.h"
50#include "stdaddressbook.h" 50#include "stdaddressbook.h"
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
55 55
56#include "resourcefile.h" 56#include "resourcefile.h"
@@ -59,11 +59,10 @@ using namespace KABC;
59 59
60extern "C" 60extern "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 }
68} 67}
69 68
@@ -99,15 +98,15 @@ void ResourceFile::init( const QString &fileName, const QString &formatName )
99{ 98{
100 mFormatName = formatName; 99 mFormatName = 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
105 if ( !mFormat ) { 104 if ( !mFormat ) {
106 mFormatName = "vcard"; 105 mFormatName = "vcard";
107 mFormat = factory->format( mFormatName ); 106 mFormat = factory->format( mFormatName );
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());
112 if (mFormatName == "vcard") { 111 if (mFormatName == "vcard") {
113 mFormat = new VCardFormatPlugin2(); 112 mFormat = new VCardFormatPlugin2();
@@ -119,6 +118,7 @@ void ResourceFile::init( const QString &fileName, const QString &formatName )
119 } 118 }
120 else 119 else
121 qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1()); 120 qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1());
121*/
122 122
123/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods 123/*US we have no KDirWatch. SO simulate the signals from inside the apropriate methods
124 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 124 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
@@ -217,8 +217,8 @@ bool ResourceFile::save( Ticket *ticket )
217 217
218/*US we use a simpler method to create a backupfile 218/*US we use a simpler method to create a backupfile
219 219
220 (void) KSaveFile::backupFile( mFileName, QString::null /*directory*/ 220 (void) KSaveFile::backupFile( mFileName, QString::null
221/*US ,extension ); 221 ,extension );
222 222
223 KSaveFile saveFile( mFileName ); 223 KSaveFile saveFile( mFileName );
224 bool ok = false; 224 bool ok = false;
@@ -286,9 +286,8 @@ bool ResourceFile::lock( const QString &fileName )
286 file.close(); 286 file.close();
287 287
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
293 if ( result == 0 ) { 292 if ( result == 0 ) {
294 addressBook()->emitAddressBookLocked(); 293 addressBook()->emitAddressBookLocked();
@@ -342,9 +341,9 @@ void ResourceFile::setFormat( const QString &format )
342 mFormatName = format; 341 mFormatName = format;
343 delete mFormat; 342 delete mFormat;
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());
349 if (mFormatName == "vcard") { 348 if (mFormatName == "vcard") {
350 mFormat = new VCardFormatPlugin2(); 349 mFormat = new VCardFormatPlugin2();
@@ -356,6 +355,7 @@ void ResourceFile::setFormat( const QString &format )
356 } 355 }
357 else 356 else
358 qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1()); 357 qDebug("ResourceFile::setFormat format unknown !!! %s ", format.latin1());
358*/
359 359
360} 360}
361 361