summaryrefslogtreecommitdiffabout
path: root/kabc/plugins
Unidiff
Diffstat (limited to 'kabc/plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/dir/resourcedir.cpp2
-rw-r--r--kabc/plugins/file/resourcefile.cpp28
-rw-r--r--kabc/plugins/ldap/resourceldap.cpp2
-rw-r--r--kabc/plugins/opie/resourceopie.cpp2
-rw-r--r--kabc/plugins/qtopia/resourceqtopia.cpp2
-rw-r--r--kabc/plugins/sharpdtm/resourcesharpdtm.cpp2
6 files changed, 14 insertions, 24 deletions
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp
index 29f1e3a..eccd482 100644
--- a/kabc/plugins/dir/resourcedir.cpp
+++ b/kabc/plugins/dir/resourcedir.cpp
@@ -62,25 +62,25 @@ $Id$
62using namespace KABC; 62using namespace KABC;
63 63
64extern "C" 64extern "C"
65#ifdef _WIN32_ 65#ifdef _WIN32_
66__declspec(dllexport) 66__declspec(dllexport)
67#else 67#else
68{ 68{
69#endif 69#endif
70 70
71//US void *init_kabc_dir() 71//US void *init_kabc_dir()
72 void *init_microkabc_dir() 72 void *init_microkabc_dir()
73 { 73 {
74 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, SyncPrefWidget>(); 74 return new KRES::PluginFactory<ResourceDir,ResourceDirConfig, SyncPrefWidgetContainer>();
75 } 75 }
76#ifndef _WIN32_ 76#ifndef _WIN32_
77} 77}
78#endif 78#endif
79 79
80ResourceDir::ResourceDir( const KConfig *config, bool syncable ) 80ResourceDir::ResourceDir( const KConfig *config, bool syncable )
81 : Resource( config, syncable ) 81 : Resource( config, syncable )
82{ 82{
83 QString path; 83 QString path;
84 84
85 KConfig *cfg = (KConfig *)config; 85 KConfig *cfg = (KConfig *)config;
86 if ( cfg ) { 86 if ( cfg ) {
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
@@ -57,44 +57,47 @@ $Id$
57using namespace KABC; 57using namespace KABC;
58 58
59extern "C" 59extern "C"
60#ifdef _WIN32_ 60#ifdef _WIN32_
61__declspec(dllexport) 61__declspec(dllexport)
62#else 62#else
63{ 63{
64#endif 64#endif
65 65
66//US void *init_kabc_file() 66//US void *init_kabc_file()
67 void *init_microkabc_file() 67 void *init_microkabc_file()
68 { 68 {
69 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig, SyncPrefWidget>(); 69 return new KRES::PluginFactory<ResourceFile,ResourceFileConfig, SyncPrefWidgetContainer>();
70 } 70 }
71#ifndef _WIN32_ 71#ifndef _WIN32_
72} 72}
73#endif 73#endif
74 74
75ResourceFile::ResourceFile( const KConfig *config, bool syncable ) 75ResourceFile::ResourceFile( const KConfig *config, bool syncable )
76 : Resource( config, syncable ) , mFormat( 0 ) 76 : Resource( config, syncable ) , mFormat( 0 )
77{ 77{
78 QString fileName, formatName; 78 QString fileName, formatName, default_fileName;
79
80 if (syncable == true)
81 default_fileName = "/home/polo/kdepim/apps/kabc/localfile.vcf";
82 else
83 default_fileName = StdAddressBook::fileName();
79 84
80 KConfig *cfg = (KConfig *)config; 85 KConfig *cfg = (KConfig *)config;
81 if ( cfg ) { 86 if ( cfg ) {
82 fileName = cfg->readEntry( "FileName", StdAddressBook::fileName() ); 87 fileName = cfg->readEntry( "FileName", default_fileName );
83 formatName = cfg->readEntry( "FileFormat", "vcard" ); 88 formatName = cfg->readEntry( "FileFormat", "vcard" );
84// qDebug("ResourceFile::ResourceFile : 1 %s, %s", fileName.latin1(), formatName.latin1() );
85 } else { 89 } else {
86 fileName = StdAddressBook::fileName(); 90 fileName = default_fileName;
87 formatName = "vcard"; 91 formatName = "vcard";
88// qDebug("ResourceFile::ResourceFile : 2 %s, %s", fileName.latin1(), formatName.latin1() );
89 } 92 }
90 93
91 init( fileName, formatName ); 94 init( fileName, formatName );
92} 95}
93 96
94ResourceFile::ResourceFile( const QString &fileName, bool syncable , 97ResourceFile::ResourceFile( const QString &fileName, bool syncable ,
95 const QString &formatName ) 98 const QString &formatName )
96 : Resource( 0, syncable ) 99 : Resource( 0, syncable )
97{ 100{
98// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); 101// qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1());
99 init( fileName, formatName ); 102 init( fileName, formatName );
100} 103}
@@ -102,37 +105,24 @@ ResourceFile::ResourceFile( const QString &fileName, bool syncable ,
102void ResourceFile::init( const QString &fileName, const QString &formatName ) 105void ResourceFile::init( const QString &fileName, const QString &formatName )
103{ 106{
104 mFormatName = formatName; 107 mFormatName = formatName;
105 108
106 FormatFactory *factory = FormatFactory::self(); 109 FormatFactory *factory = FormatFactory::self();
107 mFormat = factory->format( mFormatName ); 110 mFormat = factory->format( mFormatName );
108 111
109 if ( !mFormat ) { 112 if ( !mFormat ) {
110 mFormatName = "vcard"; 113 mFormatName = "vcard";
111 mFormat = factory->format( mFormatName ); 114 mFormat = factory->format( mFormatName );
112 } 115 }
113 116
114/*US
115//US qDebug("ResourceFile::init initialized with format %s ", formatName.latin1());
116 if (mFormatName == "vcard") {
117 mFormat = new VCardFormatPlugin2();
118// qDebug("ResourceFile::init format VCardFormatPlugin2");
119 }
120 else if (mFormatName == "binary") {
121 mFormat = new BinaryFormat();
122// qDebug("ResourceFile::init format BinaryFormat");
123 }
124 else
125 qDebug("ResourceFile::init format unknown !!! %s ", formatName.latin1());
126*/
127 117
128 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 118 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
129 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 119 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
130 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 120 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
131 121
132 setFileName( fileName ); 122 setFileName( fileName );
133} 123}
134 124
135ResourceFile::~ResourceFile() 125ResourceFile::~ResourceFile()
136{ 126{
137 delete mFormat; 127 delete mFormat;
138 mFormat = 0; 128 mFormat = 0;
diff --git a/kabc/plugins/ldap/resourceldap.cpp b/kabc/plugins/ldap/resourceldap.cpp
index 198e80a..17f115d 100644
--- a/kabc/plugins/ldap/resourceldap.cpp
+++ b/kabc/plugins/ldap/resourceldap.cpp
@@ -36,25 +36,25 @@ $Id$
36 36
37#include "resourceldap.h" 37#include "resourceldap.h"
38#include "resourceldapconfig.h" 38#include "resourceldapconfig.h"
39#include "syncprefwidget.h" 39#include "syncprefwidget.h"
40 40
41using namespace KABC; 41using namespace KABC;
42 42
43extern "C" 43extern "C"
44{ 44{
45//US void *init_kabc_ldap() 45//US void *init_kabc_ldap()
46 void *init_microkabc_ldap() 46 void *init_microkabc_ldap()
47 { 47 {
48 return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig, SyncPrefWidget>(); 48 return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig, SyncPrefWidgetContainer>();
49 } 49 }
50} 50}
51 51
52void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value ); 52void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value );
53 53
54 54
55ResourceLDAP::ResourceLDAP( const KConfig *config, bool syncable ) 55ResourceLDAP::ResourceLDAP( const KConfig *config, bool syncable )
56 : Resource( config, syncable ), mPort( 389 ), mLdap( 0 ) 56 : Resource( config, syncable ), mPort( 389 ), mLdap( 0 )
57{ 57{
58 KConfig *cfg = (KConfig *)config; 58 KConfig *cfg = (KConfig *)config;
59 if ( cfg ) { 59 if ( cfg ) {
60 mUser = cfg->readEntry( "LdapUser" ); 60 mUser = cfg->readEntry( "LdapUser" );
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 9dfd473..4b811e9 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -52,25 +52,25 @@ $Id$
52#include "stdaddressbook.h" 52#include "stdaddressbook.h"
53#include "syncprefwidget.h" 53#include "syncprefwidget.h"
54 54
55#include "opieconverter.h" 55#include "opieconverter.h"
56 56
57#include "resourceopie.h" 57#include "resourceopie.h"
58 58
59using namespace KABC; 59using namespace KABC;
60extern "C" 60extern "C"
61{ 61{
62 void *init_microkabc_opie() 62 void *init_microkabc_opie()
63 { 63 {
64 return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, SyncPrefWidget>(); 64 return new KRES::PluginFactory<ResourceOpie,ResourceOpieConfig, SyncPrefWidgetContainer>();
65 } 65 }
66} 66}
67 67
68ResourceOpie::ResourceOpie( const KConfig *config, bool syncable ) 68ResourceOpie::ResourceOpie( const KConfig *config, bool syncable )
69 : Resource( config, syncable ), mAccess(0), mConverter (0) 69 : Resource( config, syncable ), mAccess(0), mConverter (0)
70{ 70{
71 QString fileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; 71 QString fileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
72 72
73 KConfig *cfg = (KConfig *)config; 73 KConfig *cfg = (KConfig *)config;
74 if ( cfg ) { 74 if ( cfg ) {
75 fileName = cfg->readEntry( "FileName", fileName ); 75 fileName = cfg->readEntry( "FileName", fileName );
76 76
diff --git a/kabc/plugins/qtopia/resourceqtopia.cpp b/kabc/plugins/qtopia/resourceqtopia.cpp
index 5565580..93a4d33 100644
--- a/kabc/plugins/qtopia/resourceqtopia.cpp
+++ b/kabc/plugins/qtopia/resourceqtopia.cpp
@@ -49,25 +49,25 @@ $Id$
49#include "stdaddressbook.h" 49#include "stdaddressbook.h"
50 50
51#include "qtopiaconverter.h" 51#include "qtopiaconverter.h"
52#include "syncprefwidget.h" 52#include "syncprefwidget.h"
53 53
54#include "resourceqtopia.h" 54#include "resourceqtopia.h"
55 55
56using namespace KABC; 56using namespace KABC;
57extern "C" 57extern "C"
58{ 58{
59 void *init_microkabc_qtopia() 59 void *init_microkabc_qtopia()
60 { 60 {
61 return new KRES::PluginFactory<ResourceQtopia,ResourceQtopiaConfig, SyncPrefWidget>(); 61 return new KRES::PluginFactory<ResourceQtopia,ResourceQtopiaConfig, SyncPrefWidgetContainer>();
62 } 62 }
63} 63}
64 64
65ResourceQtopia::ResourceQtopia( const KConfig *config, bool syncable ) 65ResourceQtopia::ResourceQtopia( const KConfig *config, bool syncable )
66 : Resource( config, syncable ), mConverter (0) 66 : Resource( config, syncable ), mConverter (0)
67{ 67{
68 // we can not choose the filename. Therefore use the default to display 68 // we can not choose the filename. Therefore use the default to display
69 QString fileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; 69 QString fileName = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
70 init( fileName ); 70 init( fileName );
71} 71}
72 72
73ResourceQtopia::ResourceQtopia( const QString &fileName, bool syncable ) 73ResourceQtopia::ResourceQtopia( const QString &fileName, bool syncable )
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
index 70c3718..b63df0c 100644
--- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
+++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp
@@ -51,25 +51,25 @@ $Id$
51 51
52#include "syncprefwidget.h" 52#include "syncprefwidget.h"
53 53
54#include "stdaddressbook.h" 54#include "stdaddressbook.h"
55 55
56#include "sharpdtmconverter.h" 56#include "sharpdtmconverter.h"
57 57
58using namespace KABC; 58using namespace KABC;
59extern "C" 59extern "C"
60{ 60{
61 void *init_microkabc_sharpdtm() 61 void *init_microkabc_sharpdtm()
62 { 62 {
63 return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig,SyncPrefWidget>(); 63 return new KRES::PluginFactory<ResourceSharpDTM,ResourceSharpDTMConfig,SyncPrefWidgetContainer>();
64 } 64 }
65} 65}
66 66
67ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable ) 67ResourceSharpDTM::ResourceSharpDTM( const KConfig *config, bool syncable )
68 : Resource( config, syncable ), mConverter (0) 68 : Resource( config, syncable ), mConverter (0)
69{ 69{
70 // we can not choose the filename. Therefore use the default to display 70 // we can not choose the filename. Therefore use the default to display
71 71
72 QString fileName = SlZDataBase::addressbookFileName(); 72 QString fileName = SlZDataBase::addressbookFileName();
73 init( fileName ); 73 init( fileName );
74} 74}
75 75