summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/formatfactory.cpp2
-rw-r--r--kabc/formatplugin.h5
-rw-r--r--kabc/kabcE.pro2
-rw-r--r--kabc/stdaddressbook.cpp6
4 files changed, 9 insertions, 6 deletions
diff --git a/kabc/formatfactory.cpp b/kabc/formatfactory.cpp
index f107ebf..f2f03c6 100644
--- a/kabc/formatfactory.cpp
+++ b/kabc/formatfactory.cpp
@@ -17,50 +17,48 @@
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#include <kdebug.h> 21#include <kdebug.h>
22#include <klocale.h> 22#include <klocale.h>
23#include <ksimpleconfig.h> 23#include <ksimpleconfig.h>
24#include <kstandarddirs.h> 24#include <kstandarddirs.h>
25#include <kstaticdeleter.h> 25#include <kstaticdeleter.h>
26 26
27#include <qfile.h> 27#include <qfile.h>
28#include <qstringlist.h> 28#include <qstringlist.h>
29 29
30#include "vcardformatplugin.h" 30#include "vcardformatplugin.h"
31 31
32#include "formatfactory.h" 32#include "formatfactory.h"
33 33
34using namespace KABC; 34using namespace KABC;
35 35
36FormatFactory *FormatFactory::mSelf = 0; 36FormatFactory *FormatFactory::mSelf = 0;
37static KStaticDeleter<FormatFactory> factoryDeleter; 37static KStaticDeleter<FormatFactory> factoryDeleter;
38 38
39FormatFactory *FormatFactory::self() 39FormatFactory *FormatFactory::self()
40{ 40{
41 kdDebug(5700) << "FormatFactory::self()" << endl;
42
43 if ( !mSelf ) { 41 if ( !mSelf ) {
44//US factoryDeleter.setObject( mSelf, new FormatFactory ); 42//US factoryDeleter.setObject( mSelf, new FormatFactory );
45 mSelf = factoryDeleter.setObject( new FormatFactory ); 43 mSelf = factoryDeleter.setObject( new FormatFactory );
46 } 44 }
47 return mSelf; 45 return mSelf;
48} 46}
49 47
50FormatFactory::FormatFactory() 48FormatFactory::FormatFactory()
51{ 49{
52 mFormatList.setAutoDelete( true ); 50 mFormatList.setAutoDelete( true );
53 51
54 // dummy entry for default format 52 // dummy entry for default format
55 FormatInfo *info = new FormatInfo; 53 FormatInfo *info = new FormatInfo;
56 info->library = "<NoLibrary>"; 54 info->library = "<NoLibrary>";
57 info->nameLabel = i18n( "vCard" ); 55 info->nameLabel = i18n( "vCard" );
58 info->descriptionLabel = i18n( "vCard Format" ); 56 info->descriptionLabel = i18n( "vCard Format" );
59 mFormatList.insert( "vcard", info ); 57 mFormatList.insert( "vcard", info );
60 58
61/*US lets enter all resources directly instead of using teh desktopfiles. 59/*US lets enter all resources directly instead of using teh desktopfiles.
62 60
63 QStringList list = KGlobal::dirs()->findAllResources( "data" ,"kabc/formats/*.desktop", true, true ); 61 QStringList list = KGlobal::dirs()->findAllResources( "data" ,"kabc/formats/*.desktop", true, true );
64 for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) 62 for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it )
65 { 63 {
66//US KSimpleConfig config( *it, true ); 64//US KSimpleConfig config( *it, true );
diff --git a/kabc/formatplugin.h b/kabc/formatplugin.h
index d784daf..40a6922 100644
--- a/kabc/formatplugin.h
+++ b/kabc/formatplugin.h
@@ -9,66 +9,65 @@
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#ifndef KABC_FORMATPLUGIN_H 28#ifndef KABC_FORMATPLUGIN_H
29#define KABC_FORMATPLUGIN_H 29#define KABC_FORMATPLUGIN_H
30 30
31#include <qfile.h> 31#include <qfile.h>
32 32
33//US #include "plugin.h" 33#include "plugin.h"
34#include "resource.h" 34#include "resource.h"
35 35
36namespace KABC { 36namespace KABC {
37 37
38class AddressBook; 38class AddressBook;
39class Addressee; 39class Addressee;
40 40
41/** 41/**
42 * @short Base class for address book formats. 42 * @short Base class for address book formats.
43 * 43 *
44 * This class provides an abstract interface for ResourceFile and 44 * This class provides an abstract interface for ResourceFile and
45 * ResourceDir formats. 45 * ResourceDir formats.
46 * 46 *
47 * @internal 47 * @internal
48 */ 48 */
49//US class FormatPlugin : public Plugin 49class FormatPlugin : public Plugin
50class FormatPlugin
51{ 50{
52public: 51public:
53 52
54 /** 53 /**
55 * Load single addressee from file. 54 * Load single addressee from file.
56 */ 55 */
57 virtual bool load( Addressee &, QFile *file ) = 0; 56 virtual bool load( Addressee &, QFile *file ) = 0;
58 57
59 /** 58 /**
60 * Load whole addressbook from file. 59 * Load whole addressbook from file.
61 */ 60 */
62 virtual bool loadAll( AddressBook *, Resource *, QFile *file ) = 0; 61 virtual bool loadAll( AddressBook *, Resource *, QFile *file ) = 0;
63 62
64 /** 63 /**
65 * Save a single Addressee to file. 64 * Save a single Addressee to file.
66 */ 65 */
67 virtual void save( const Addressee &, QFile *file ) = 0; 66 virtual void save( const Addressee &, QFile *file ) = 0;
68 67
69 /** 68 /**
70 * Save whole addressbook to file. 69 * Save whole addressbook to file.
71 */ 70 */
72 virtual void saveAll( AddressBook *, Resource *, QFile *file ) = 0; 71 virtual void saveAll( AddressBook *, Resource *, QFile *file ) = 0;
73 72
74 /** 73 /**
diff --git a/kabc/kabcE.pro b/kabc/kabcE.pro
index 6a3bbf1..840afb9 100644
--- a/kabc/kabcE.pro
+++ b/kabc/kabcE.pro
@@ -1,30 +1,30 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3TARGET = microkabc 3TARGET = microkabc
4 4
5 5
6INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../qtcompat 6INCLUDEPATH += . ./vcard/include ./vcard/include/generated ../microkde ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../qtcompat $(QPEDIR)/include
7OBJECTS_DIR = obj/$(PLATFORM) 7OBJECTS_DIR = obj/$(PLATFORM)
8MOC_DIR = moc/$(PLATFORM) 8MOC_DIR = moc/$(PLATFORM)
9DESTDIR = $(QPEDIR)/lib 9DESTDIR = $(QPEDIR)/lib
10LIBS += -lmicrokde 10LIBS += -lmicrokde
11#LIBS += -lldap 11#LIBS += -lldap
12LIBS += -L$(QPEDIR)/lib 12LIBS += -L$(QPEDIR)/lib
13DEFINES += KAB_EMBEDDED 13DEFINES += KAB_EMBEDDED
14 14
15INTERFACES = \ 15INTERFACES = \
16 16
17HEADERS = \ 17HEADERS = \
18 address.h \ 18 address.h \
19 addressbook.h \ 19 addressbook.h \
20 addressee.h \ 20 addressee.h \
21 addresseedialog.h \ 21 addresseedialog.h \
22 addresseelist.h \ 22 addresseelist.h \
23 agent.h \ 23 agent.h \
24 distributionlist.h \ 24 distributionlist.h \
25 distributionlistdialog.h \ 25 distributionlistdialog.h \
26 distributionlisteditor.h \ 26 distributionlisteditor.h \
27 field.h \ 27 field.h \
28 formatfactory.h \ 28 formatfactory.h \
29 formatplugin.h \ 29 formatplugin.h \
30 geo.h \ 30 geo.h \
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp
index 8faaaef..144a9dc 100644
--- a/kabc/stdaddressbook.cpp
+++ b/kabc/stdaddressbook.cpp
@@ -12,48 +12,54 @@
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/*US 28/*US
29#include <stdlib.h> 29#include <stdlib.h>
30 30
31#include <kapplication.h> 31#include <kapplication.h>
32#include <kcrash.h> 32#include <kcrash.h>
33#include <ksimpleconfig.h> 33#include <ksimpleconfig.h>
34*/ 34*/
35 35
36#ifndef DESKTOP_VERSION
37#include <qpe/global.h>
38#else
39#include <qdir.h>
40#endif
41
36#include "resource.h" 42#include "resource.h"
37#include <kresources/manager.h> 43#include <kresources/manager.h>
38#include <kdebug.h> 44#include <kdebug.h>
39#include <klocale.h> 45#include <klocale.h>
40#include <kstaticdeleter.h> 46#include <kstaticdeleter.h>
41#include <kstandarddirs.h> 47#include <kstandarddirs.h>
42 48
43#include "stdaddressbook.h" 49#include "stdaddressbook.h"
44 50
45using namespace KABC; 51using namespace KABC;
46 52
47StdAddressBook *StdAddressBook::mSelf = 0; 53StdAddressBook *StdAddressBook::mSelf = 0;
48bool StdAddressBook::mAutomaticSave = true; 54bool StdAddressBook::mAutomaticSave = true;
49 55
50static KStaticDeleter<StdAddressBook> addressBookDeleter; 56static KStaticDeleter<StdAddressBook> addressBookDeleter;
51 57
52QString StdAddressBook::fileName() 58QString StdAddressBook::fileName()
53{ 59{
54 return locateLocal( "data", "kabc/std.vcf" ); 60 return locateLocal( "data", "kabc/std.vcf" );
55} 61}
56 62
57QString StdAddressBook::directoryName() 63QString StdAddressBook::directoryName()
58{ 64{
59 return locateLocal( "data", "kabc/stdvcf" ); 65 return locateLocal( "data", "kabc/stdvcf" );