author | zautrix <zautrix> | 2005-08-19 13:29:20 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-19 13:29:20 (UTC) |
commit | 14cc7e0e2440d19cee538b10ba158f4b8c362e4e (patch) (unidiff) | |
tree | 57a79bf5a7d50ea9ea332f6634da243199b074e9 /kabc/plugins/dir | |
parent | 9014049779be6cfec02d73e19596439f0f4f9bed (diff) | |
download | kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.zip kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.tar.gz kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.tar.bz2 |
fix
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index e2b7b08..c61664b 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -65,48 +65,55 @@ using namespace KABC; | |||
65 | 65 | ||
66 | extern "C" | 66 | extern "C" |
67 | #ifdef _WIN32_ | 67 | #ifdef _WIN32_ |
68 | __declspec(dllexport) | 68 | __declspec(dllexport) |
69 | #else | 69 | #else |
70 | { | 70 | { |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | //US void *init_kabc_dir() | 73 | //US void *init_kabc_dir() |
74 | void *init_microkabc_dir() | 74 | void *init_microkabc_dir() |
75 | { | 75 | { |
76 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); | 76 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); |
77 | } | 77 | } |
78 | #ifndef _WIN32_ | 78 | #ifndef _WIN32_ |
79 | } | 79 | } |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | ResourceDir::ResourceDir( const KConfig *config ) | 82 | ResourceDir::ResourceDir( const KConfig *config ) |
83 | : Resource( config ) | 83 | : Resource( config ) |
84 | { | 84 | { |
85 | QString path; | 85 | QString path; |
86 | 86 | ||
87 | KConfig *cfg = (KConfig *)config; | 87 | KConfig *cfg = (KConfig *)config; |
88 | if ( cfg ) { | 88 | if ( cfg ) { |
89 | #ifdef _WIN32_ | ||
90 | // we use plugins on win32. the group is stored in a static variable | ||
91 | // such that group info not available on win32 plugins | ||
92 | // to fix that, it would be a looooot of work | ||
93 | if ( !cfg->tempGroup().isEmpty() ) | ||
94 | cfg->setGroup( cfg->tempGroup() ); | ||
95 | #endif | ||
89 | //US path = config->readEntry( "FilePath" ); | 96 | //US path = config->readEntry( "FilePath" ); |
90 | path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); | 97 | path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); |
91 | //US mFormatName = config->readEntry( "FileFormat" ); | 98 | //US mFormatName = config->readEntry( "FileFormat" ); |
92 | mFormatName = cfg->readEntry( "FileFormat", "vcard" ); | 99 | mFormatName = cfg->readEntry( "FileFormat", "vcard" ); |
93 | } else { | 100 | } else { |
94 | path = StdAddressBook::directoryName(); | 101 | path = StdAddressBook::directoryName(); |
95 | mFormatName = "vcard"; | 102 | mFormatName = "vcard"; |
96 | } | 103 | } |
97 | 104 | ||
98 | 105 | ||
99 | FormatFactory *factory = FormatFactory::self(); | 106 | FormatFactory *factory = FormatFactory::self(); |
100 | mFormat = factory->format( mFormatName ); | 107 | mFormat = factory->format( mFormatName ); |
101 | 108 | ||
102 | if ( !mFormat ) { | 109 | if ( !mFormat ) { |
103 | mFormatName = "vcard"; | 110 | mFormatName = "vcard"; |
104 | mFormat = factory->format( mFormatName ); | 111 | mFormat = factory->format( mFormatName ); |
105 | } | 112 | } |
106 | 113 | ||
107 | /*US | 114 | /*US |
108 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); | 115 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); |
109 | if (mFormatName == "vcard") | 116 | if (mFormatName == "vcard") |
110 | mFormat = new VCardFormatPlugin2(); | 117 | mFormat = new VCardFormatPlugin2(); |
111 | else if (mFormatName == "binary") | 118 | else if (mFormatName == "binary") |
112 | mFormat = new BinaryFormat(); | 119 | mFormat = new BinaryFormat(); |