summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/dir/resourcedir.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/dir/resourcedir.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 6ea2f4b..3cb5179 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -53,32 +53,38 @@ $Id$
53#include "stdaddressbook.h" 53#include "stdaddressbook.h"
54 54
55//US 55//US
56#include <qdir.h> 56#include <qdir.h>
57//US #include "../../formats/vcardformatplugin2.h" 57//US #include "../../formats/vcardformatplugin2.h"
58//US #include "../../formats/binaryformat.h" 58//US #include "../../formats/binaryformat.h"
59 59
60#include "resourcedir.h" 60#include "resourcedir.h"
61 61
62using namespace KABC; 62using namespace KABC;
63 63
64extern "C" 64extern "C"
65#ifdef _WIN32_
66__declspec(dllexport)
67#else
65{ 68{
69#endif
70
66//US void *init_kabc_dir() 71//US void *init_kabc_dir()
67 void *init_microkabc_dir() 72 void *init_microkabc_dir()
68 { 73 {
69 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); 74 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>();
70 } 75 }
76#ifndef _WIN32_
71} 77}
72 78#endif
73 79
74ResourceDir::ResourceDir( const KConfig *config ) 80ResourceDir::ResourceDir( const KConfig *config )
75 : Resource( config ) 81 : Resource( config )
76{ 82{
77 QString path; 83 QString path;
78 84
79 KConfig *cfg = (KConfig *)config; 85 KConfig *cfg = (KConfig *)config;
80 if ( cfg ) { 86 if ( cfg ) {
81//US path = config->readEntry( "FilePath" ); 87//US path = config->readEntry( "FilePath" );
82 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); 88 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() );
83//US mFormatName = config->readEntry( "FileFormat" ); 89//US mFormatName = config->readEntry( "FileFormat" );
84 mFormatName = cfg->readEntry( "FileFormat", "vcard" ); 90 mFormatName = cfg->readEntry( "FileFormat", "vcard" );
@@ -114,24 +120,25 @@ ResourceDir::ResourceDir( const KConfig *config )
114 120
115 setPath( path ); 121 setPath( path );
116} 122}
117 123
118ResourceDir::~ResourceDir() 124ResourceDir::~ResourceDir()
119{ 125{
120 delete mFormat; 126 delete mFormat;
121 mFormat = 0; 127 mFormat = 0;
122} 128}
123 129
124void ResourceDir::writeConfig( KConfig *config ) 130void ResourceDir::writeConfig( KConfig *config )
125{ 131{
132 config->setGroup( "Resource_" + identifier() );
126 Resource::writeConfig( config ); 133 Resource::writeConfig( config );
127 134
128 config->writeEntry( "FilePath", mPath ); 135 config->writeEntry( "FilePath", mPath );
129 config->writeEntry( "FileFormat", mFormatName ); 136 config->writeEntry( "FileFormat", mFormatName );
130} 137}
131 138
132Ticket *ResourceDir::requestSaveTicket() 139Ticket *ResourceDir::requestSaveTicket()
133{ 140{
134 kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl; 141 kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl;
135 142
136 if ( !addressBook() ) return 0; 143 if ( !addressBook() ) return 0;
137 144