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
@@ -26,97 +26,97 @@ $Id$
26*/ 26*/
27 27
28 28
29#include <sys/types.h> 29#include <sys/types.h>
30#include <sys/stat.h> 30#include <sys/stat.h>
31#ifndef _WIN32_ 31#ifndef _WIN32_
32#include <unistd.h> 32#include <unistd.h>
33#endif 33#endif
34 34
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qwidget.h> 37#include <qwidget.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42//US #include <kgenericfactory.h> 42//US #include <kgenericfactory.h>
43#include <kglobal.h> 43#include <kglobal.h>
44#include <klocale.h> 44#include <klocale.h>
45#include <kstandarddirs.h> 45#include <kstandarddirs.h>
46#include <kurlrequester.h> 46#include <kurlrequester.h>
47#include <kmessagebox.h> 47#include <kmessagebox.h>
48 48
49#include "addressbook.h" 49#include "addressbook.h"
50 50
51#include "formatfactory.h" 51#include "formatfactory.h"
52 52
53#include "resourcedirconfig.h" 53#include "resourcedirconfig.h"
54#include "stdaddressbook.h" 54#include "stdaddressbook.h"
55 55
56//US 56//US
57#include <qdir.h> 57#include <qdir.h>
58 58
59#include "resourcedir.h" 59#include "resourcedir.h"
60#include "syncprefwidget.h" 60#include "syncprefwidget.h"
61 61
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 ) {
87//US path = config->readEntry( "FilePath" ); 87//US path = config->readEntry( "FilePath" );
88 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); 88 path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() );
89//US mFormatName = config->readEntry( "FileFormat" ); 89//US mFormatName = config->readEntry( "FileFormat" );
90 mFormatName = cfg->readEntry( "FileFormat", "vcard" ); 90 mFormatName = cfg->readEntry( "FileFormat", "vcard" );
91 } else { 91 } else {
92 path = StdAddressBook::directoryName(); 92 path = StdAddressBook::directoryName();
93 mFormatName = "vcard"; 93 mFormatName = "vcard";
94 } 94 }
95 95
96 96
97 FormatFactory *factory = FormatFactory::self(); 97 FormatFactory *factory = FormatFactory::self();
98 mFormat = factory->format( mFormatName ); 98 mFormat = factory->format( mFormatName );
99 99
100 if ( !mFormat ) { 100 if ( !mFormat ) {
101 mFormatName = "vcard"; 101 mFormatName = "vcard";
102 mFormat = factory->format( mFormatName ); 102 mFormat = factory->format( mFormatName );
103 } 103 }
104 104
105/*US 105/*US
106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); 106//US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1());
107 if (mFormatName == "vcard") 107 if (mFormatName == "vcard")
108 mFormat = new VCardFormatPlugin2(); 108 mFormat = new VCardFormatPlugin2();
109 else if (mFormatName == "binary") 109 else if (mFormatName == "binary")
110 mFormat = new BinaryFormat(); 110 mFormat = new BinaryFormat();
111 else 111 else
112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); 112 qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1());
113*/ 113*/
114 114
115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); 115 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) );
116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); 116 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) );
117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); 117 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) );
118 118
119 setPath( path ); 119 setPath( path );
120} 120}
121 121
122ResourceDir::~ResourceDir() 122ResourceDir::~ResourceDir()
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
@@ -21,154 +21,144 @@
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#ifndef _WIN32_ 30#ifndef _WIN32_
31#include <unistd.h> 31#include <unistd.h>
32#endif 32#endif
33 33
34#include <qfile.h> 34#include <qfile.h>
35#include <qfileinfo.h> 35#include <qfileinfo.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qtimer.h> 37#include <qtimer.h>
38 38
39#include <kapplication.h> 39#include <kapplication.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <klocale.h> 42#include <klocale.h>
43//US #include <ksavefile.h> 43//US #include <ksavefile.h>
44#include <kstandarddirs.h> 44#include <kstandarddirs.h>
45#include <kmessagebox.h> 45#include <kmessagebox.h>
46 46
47#include "formatfactory.h" 47#include "formatfactory.h"
48 48
49#include "resource.h" 49#include "resource.h"
50#include "resourcefileconfig.h" 50#include "resourcefileconfig.h"
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52 52
53#include "resourcefile.h" 53#include "resourcefile.h"
54#include "syncprefwidget.h" 54#include "syncprefwidget.h"
55 55
56 56
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}
101 104
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;
139} 129}
140 130
141void ResourceFile::writeConfig( KConfig *config ) 131void ResourceFile::writeConfig( KConfig *config )
142{ 132{
143 133
144 config->setGroup( "Resource_" + identifier() ); 134 config->setGroup( "Resource_" + identifier() );
145 Resource::writeConfig( config ); 135 Resource::writeConfig( config );
146 136
147 config->writeEntry( "FileName", mFileName ); 137 config->writeEntry( "FileName", mFileName );
148 config->writeEntry( "FileFormat", mFormatName ); 138 config->writeEntry( "FileFormat", mFormatName );
149 139
150// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1()); 140// qDebug("ResourceFile::writeConfig format %s, %s", mFileName.latin1(), mFormatName.latin1());
151 141
152} 142}
153 143
154Ticket *ResourceFile::requestSaveTicket() 144Ticket *ResourceFile::requestSaveTicket()
155{ 145{
156 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; 146 kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl;
157 147
158 if ( !addressBook() ) return 0; 148 if ( !addressBook() ) return 0;
159 149
160 if ( !lock( mFileName ) ) { 150 if ( !lock( mFileName ) ) {
161 kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" 151 kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '"
162 << mFileName << "'" << endl; 152 << mFileName << "'" << endl;
163 return 0; 153 return 0;
164 } 154 }
165 return createTicket( this ); 155 return createTicket( this );
166} 156}
167 157
168 158
169bool ResourceFile::doOpen() 159bool ResourceFile::doOpen()
170{ 160{
171 QFile file( mFileName ); 161 QFile file( mFileName );
172 162
173 if ( !file.exists() ) { 163 if ( !file.exists() ) {
174 // try to create the file 164 // try to create the file
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
@@ -1,96 +1,96 @@
1/* 1/*
2 This file is part of libkabc. 2 This file is part of libkabc.
3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
4 4
5 This library is free software; you can redistribute it and/or 5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public 6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either 7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version. 8 version 2 of the License, or (at your option) any later version.
9 9
10 This library is distributed in the hope that it will be useful, 10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <kdebug.h> 28#include <kdebug.h>
29#include <kglobal.h> 29#include <kglobal.h>
30#include <klineedit.h> 30#include <klineedit.h>
31#include <klocale.h> 31#include <klocale.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <kstringhandler.h> 33#include <kstringhandler.h>
34 34
35#include <stdlib.h> 35#include <stdlib.h>
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" );
61 mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) ); 61 mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) );
62 mDn = cfg->readEntry( "LdapDn" ); 62 mDn = cfg->readEntry( "LdapDn" );
63 mHost = cfg->readEntry( "LdapHost" ); 63 mHost = cfg->readEntry( "LdapHost" );
64 mPort = cfg->readNumEntry( "LdapPort", 389 ); 64 mPort = cfg->readNumEntry( "LdapPort", 389 );
65 mFilter = cfg->readEntry( "LdapFilter" ); 65 mFilter = cfg->readEntry( "LdapFilter" );
66 mAnonymous = cfg->readBoolEntry( "LdapAnonymous" ); 66 mAnonymous = cfg->readBoolEntry( "LdapAnonymous" );
67 67
68 QStringList attributes = cfg->readListEntry( "LdapAttributes" ); 68 QStringList attributes = cfg->readListEntry( "LdapAttributes" );
69 for ( uint pos = 0; pos < attributes.count(); pos += 2 ) 69 for ( uint pos = 0; pos < attributes.count(); pos += 2 )
70 mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); 70 mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] );
71 } 71 }
72 72
73 /** 73 /**
74 If you want to add new attributes, append them here, add a 74 If you want to add new attributes, append them here, add a
75 translation string in the ctor of AttributesDialog and 75 translation string in the ctor of AttributesDialog and
76 handle them in the load() method below. 76 handle them in the load() method below.
77 These are the default values from 77 These are the default values from
78 */ 78 */
79 if ( mAttributes.count() == 0 ) { 79 if ( mAttributes.count() == 0 ) {
80 mAttributes.insert( "commonName", "cn" ); 80 mAttributes.insert( "commonName", "cn" );
81 mAttributes.insert( "formattedName", "displayName" ); 81 mAttributes.insert( "formattedName", "displayName" );
82 mAttributes.insert( "familyName", "sn" ); 82 mAttributes.insert( "familyName", "sn" );
83 mAttributes.insert( "givenName", "givenName" ); 83 mAttributes.insert( "givenName", "givenName" );
84 mAttributes.insert( "mail", "mail" ); 84 mAttributes.insert( "mail", "mail" );
85 mAttributes.insert( "mailAlias", "" ); 85 mAttributes.insert( "mailAlias", "" );
86 mAttributes.insert( "phoneNumber", "telephoneNumber" ); 86 mAttributes.insert( "phoneNumber", "telephoneNumber" );
87 mAttributes.insert( "uid", "uid" ); 87 mAttributes.insert( "uid", "uid" );
88 } 88 }
89} 89}
90 90
91void ResourceLDAP::writeConfig( KConfig *config ) 91void ResourceLDAP::writeConfig( KConfig *config )
92{ 92{
93 Resource::writeConfig( config ); 93 Resource::writeConfig( config );
94 94
95 config->writeEntry( "LdapUser", mUser ); 95 config->writeEntry( "LdapUser", mUser );
96 config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); 96 config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) );
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
@@ -16,97 +16,97 @@
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <unistd.h> 30#include <unistd.h>
31 31
32#include <qdir.h> 32#include <qdir.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qfileinfo.h> 34#include <qfileinfo.h>
35#include <qregexp.h> 35#include <qregexp.h>
36 36
37#include <kapplication.h> 37#include <kapplication.h>
38#include <kconfig.h> 38#include <kconfig.h>
39#include <kdebug.h> 39#include <kdebug.h>
40#include <klocale.h> 40#include <klocale.h>
41//US #include <ksavefile.h> 41//US #include <ksavefile.h>
42#include <kstandarddirs.h> 42#include <kstandarddirs.h>
43#include <kmessagebox.h> 43#include <kmessagebox.h>
44 44
45//US #include "formatfactory.h" 45//US #include "formatfactory.h"
46//US #include <qpe/qpeapplication.h> 46//US #include <qpe/qpeapplication.h>
47 47
48#include <opie/ocontactaccess.h> 48#include <opie/ocontactaccess.h>
49#include <opie/ocontactaccessbackend_xml.h> 49#include <opie/ocontactaccessbackend_xml.h>
50 50
51#include "resourceopieconfig.h" 51#include "resourceopieconfig.h"
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
77 } 77 }
78 78
79 init( fileName ); 79 init( fileName );
80} 80}
81 81
82ResourceOpie::ResourceOpie( const QString &fileName, bool syncable ) 82ResourceOpie::ResourceOpie( const QString &fileName, bool syncable )
83 : Resource( 0, syncable ) 83 : Resource( 0, syncable )
84{ 84{
85 init( fileName ); 85 init( fileName );
86} 86}
87 87
88void ResourceOpie::init( const QString &fileName ) 88void ResourceOpie::init( const QString &fileName )
89{ 89{
90 qDebug("ResourceOpie::init()"); 90 qDebug("ResourceOpie::init()");
91 91
92 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 92 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
93 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 93 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
94 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 94 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
95 95
96 setFileName( fileName ); 96 setFileName( fileName );
97} 97}
98 98
99ResourceOpie::~ResourceOpie() 99ResourceOpie::~ResourceOpie()
100{ 100{
101 if (mConverter != 0) 101 if (mConverter != 0)
102 delete mConverter; 102 delete mConverter;
103 103
104 if(mAccess != 0) 104 if(mAccess != 0)
105 delete mAccess; 105 delete mAccess;
106} 106}
107 107
108void ResourceOpie::writeConfig( KConfig *config ) 108void ResourceOpie::writeConfig( KConfig *config )
109{ 109{
110 Resource::writeConfig( config ); 110 Resource::writeConfig( config );
111 111
112 config->writeEntry( "FileName", fileName() ); 112 config->writeEntry( "FileName", fileName() );
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
@@ -13,97 +13,97 @@
13 Library General Public License for more details. 13 Library General Public License for more details.
14 14
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27#include <sys/types.h> 27#include <sys/types.h>
28#include <sys/stat.h> 28#include <sys/stat.h>
29#include <unistd.h> 29#include <unistd.h>
30 30
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qfileinfo.h> 33#include <qfileinfo.h>
34#include <qregexp.h> 34#include <qregexp.h>
35//US #include <qtimer.h> 35//US #include <qtimer.h>
36 36
37#include <kapplication.h> 37#include <kapplication.h>
38#include <kconfig.h> 38#include <kconfig.h>
39#include <kdebug.h> 39#include <kdebug.h>
40#include <klocale.h> 40#include <klocale.h>
41//US #include <ksavefile.h> 41//US #include <ksavefile.h>
42#include <kstandarddirs.h> 42#include <kstandarddirs.h>
43#include <kmessagebox.h> 43#include <kmessagebox.h>
44 44
45#include <qpe/pim/addressbookaccess.h> 45#include <qpe/pim/addressbookaccess.h>
46 46
47 47
48#include "resourceqtopiaconfig.h" 48#include "resourceqtopiaconfig.h"
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 )
74 : Resource( 0, syncable ) 74 : Resource( 0, syncable )
75{ 75{
76 init( fileName ); 76 init( fileName );
77} 77}
78 78
79void ResourceQtopia::init( const QString &fileName ) 79void ResourceQtopia::init( const QString &fileName )
80{ 80{
81 81
82 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 82 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
83 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 83 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
84 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 84 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
85 85
86 setFileName( fileName ); 86 setFileName( fileName );
87} 87}
88 88
89ResourceQtopia::~ResourceQtopia() 89ResourceQtopia::~ResourceQtopia()
90{ 90{
91 if (mConverter != 0) 91 if (mConverter != 0)
92 delete mConverter; 92 delete mConverter;
93 93
94 if(mAccess != 0) 94 if(mAccess != 0)
95 delete mAccess; 95 delete mAccess;
96} 96}
97 97
98void ResourceQtopia::writeConfig( KConfig *config ) 98void ResourceQtopia::writeConfig( KConfig *config )
99{ 99{
100 Resource::writeConfig( config ); 100 Resource::writeConfig( config );
101} 101}
102 102
103Ticket *ResourceQtopia::requestSaveTicket() 103Ticket *ResourceQtopia::requestSaveTicket()
104{ 104{
105 kdDebug(5700) << "ResourceQtopia::requestSaveTicket()" << endl; 105 kdDebug(5700) << "ResourceQtopia::requestSaveTicket()" << endl;
106 106
107 qDebug("ResourceQtopia::requestSaveTicket: %s", fileName().latin1()); 107 qDebug("ResourceQtopia::requestSaveTicket: %s", fileName().latin1());
108 108
109 if ( !addressBook() ) return 0; 109 if ( !addressBook() ) return 0;
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
@@ -15,97 +15,97 @@
15 You should have received a copy of the GNU Library General Public License 15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to 16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19*/ 19*/
20 20
21/* 21/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (c) 2004 Ulf Schenk
24 24
25$Id$ 25$Id$
26*/ 26*/
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <unistd.h> 30#include <unistd.h>
31 31
32#include <qdir.h> 32#include <qdir.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qfileinfo.h> 34#include <qfileinfo.h>
35#include <qregexp.h> 35#include <qregexp.h>
36//US #include <qtimer.h> 36//US #include <qtimer.h>
37 37
38#include <kapplication.h> 38#include <kapplication.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <kdebug.h> 40#include <kdebug.h>
41#include <klocale.h> 41#include <klocale.h>
42//US #include <ksavefile.h> 42//US #include <ksavefile.h>
43#include <kstandarddirs.h> 43#include <kstandarddirs.h>
44#include <kmessagebox.h> 44#include <kmessagebox.h>
45 45
46#include <sl/slzdb.h> 46#include <sl/slzdb.h>
47 47
48 48
49#include "resourcesharpdtmconfig.h" 49#include "resourcesharpdtmconfig.h"
50#include "resourcesharpdtm.h" 50#include "resourcesharpdtm.h"
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
76ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable ) 76ResourceSharpDTM::ResourceSharpDTM( const QString &fileName, bool syncable )
77 : Resource( 0, syncable ) 77 : Resource( 0, syncable )
78{ 78{
79 init( fileName ); 79 init( fileName );
80} 80}
81 81
82void ResourceSharpDTM::init( const QString &fileName ) 82void ResourceSharpDTM::init( const QString &fileName )
83{ 83{
84 84
85 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); 85 connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) );
86 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); 86 connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) );
87 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 87 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
88 88
89 setFileName( fileName ); 89 setFileName( fileName );
90} 90}
91 91
92ResourceSharpDTM::~ResourceSharpDTM() 92ResourceSharpDTM::~ResourceSharpDTM()
93{ 93{
94 if (mConverter != 0) 94 if (mConverter != 0)
95 delete mConverter; 95 delete mConverter;
96 96
97 if(mAccess != 0) 97 if(mAccess != 0)
98 delete mAccess; 98 delete mAccess;
99} 99}
100 100
101void ResourceSharpDTM::writeConfig( KConfig *config ) 101void ResourceSharpDTM::writeConfig( KConfig *config )
102{ 102{
103 Resource::writeConfig( config ); 103 Resource::writeConfig( config );
104} 104}
105 105
106Ticket *ResourceSharpDTM::requestSaveTicket() 106Ticket *ResourceSharpDTM::requestSaveTicket()
107{ 107{
108 kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket()" << endl; 108 kdDebug(5700) << "ResourceSharpDTM::requestSaveTicket()" << endl;
109 109
110 qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1()); 110 qDebug("ResourceSharpDTM::requestSaveTicket: %s", fileName().latin1());
111 111