From c3a704f5acda9cf9fee66e5c0b1b864f3b7dd852 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Wed, 04 Aug 2004 22:45:22 +0000 Subject: final changes for addressbook sync config dialog --- (limited to 'kabc/plugins/file/resourcefile.cpp') diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index d98efc8..da2e4d7 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -66,7 +66,7 @@ __declspec(dllexport) //US void *init_kabc_file() void *init_microkabc_file() { - return new KRES::PluginFactory(); + return new KRES::PluginFactory(); } #ifndef _WIN32_ } @@ -75,17 +75,20 @@ __declspec(dllexport) ResourceFile::ResourceFile( const KConfig *config, bool syncable ) : Resource( config, syncable ) , mFormat( 0 ) { - QString fileName, formatName; + QString fileName, formatName, default_fileName; + + if (syncable == true) + default_fileName = "/home/polo/kdepim/apps/kabc/localfile.vcf"; + else + default_fileName = StdAddressBook::fileName(); KConfig *cfg = (KConfig *)config; if ( cfg ) { - fileName = cfg->readEntry( "FileName", StdAddressBook::fileName() ); + fileName = cfg->readEntry( "FileName", default_fileName ); formatName = cfg->readEntry( "FileFormat", "vcard" ); -// qDebug("ResourceFile::ResourceFile : 1 %s, %s", fileName.latin1(), formatName.latin1() ); } else { - fileName = StdAddressBook::fileName(); + fileName = default_fileName; formatName = "vcard"; -// qDebug("ResourceFile::ResourceFile : 2 %s, %s", fileName.latin1(), formatName.latin1() ); } init( fileName, formatName ); @@ -111,19 +114,6 @@ void ResourceFile::init( const QString &fileName, const QString &formatName ) mFormat = factory->format( mFormatName ); } -/*US -//US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1()); - 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()); -*/ connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); -- cgit v0.9.0.2