summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/olaccess/resourceolaccess.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/olaccess/resourceolaccess.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/olaccess/resourceolaccess.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/kabc/plugins/olaccess/resourceolaccess.cpp b/kabc/plugins/olaccess/resourceolaccess.cpp
index 7113e0e..c7c9874 100644
--- a/kabc/plugins/olaccess/resourceolaccess.cpp
+++ b/kabc/plugins/olaccess/resourceolaccess.cpp
@@ -9,102 +9,103 @@
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 <sys/types.h> 28#include <sys/types.h>
29#include <sys/stat.h> 29#include <sys/stat.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 45
46#include <libkdepim/ksyncprofile.h> 46#include <libkdepim/ksyncprofile.h>
47 47
48#include "resourceolaccessconfig.h" 48#include "resourceolaccessconfig.h"
49#include "resourceolaccess.h" 49#include "resourceolaccess.h"
50 50
51#include "stdaddressbook.h" 51#include "stdaddressbook.h"
52 52
53#include "olaccessconverter.h" 53#include "olaccessconverter.h"
54//#define ALLOW_LOCKING 54//#define ALLOW_LOCKING
55using namespace KABC; 55using namespace KABC;
56extern "C" 56extern "C"
57{ 57__declspec(dllexport)
58
58 void *init_microkabc_olaccess() 59 void *init_microkabc_olaccess()
59 { 60 {
60 return new KRES::PluginFactory<Resourceolaccess,ResourceolaccessConfig>(); 61 return new KRES::PluginFactory<Resourceolaccess,ResourceolaccessConfig>();
61 } 62 }
62} 63
63 64
64Resourceolaccess::Resourceolaccess( const KConfig *config ) 65Resourceolaccess::Resourceolaccess( const KConfig *config )
65 : Resource( config ), mConverter (0) 66 : Resource( config ), mConverter (0)
66{ 67{
67 // 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
68 //mAccess = 0; 69 //mAccess = 0;
69 QString fileName;// = SlZDataBase::addressbookFileName(); 70 QString fileName;// = SlZDataBase::addressbookFileName();
70 init( fileName ); 71 init( fileName );
71} 72}
72 73
73Resourceolaccess::Resourceolaccess( const QString &fileName ) 74Resourceolaccess::Resourceolaccess( const QString &fileName )
74 : Resource( 0 ) 75 : Resource( 0 )
75{ 76{
76 //mAccess = 0; 77 //mAccess = 0;
77 init( fileName ); 78 init( fileName );
78} 79}
79 80
80void Resourceolaccess::init( const QString &fileName ) 81void Resourceolaccess::init( const QString &fileName )
81{ 82{
82 if (mConverter == 0) { 83 if (mConverter == 0) {
83 mConverter = new OlaccessConverter(); 84 mConverter = new OlaccessConverter();
84 bool res = mConverter->init(); 85 bool res = mConverter->init();
85 if ( !res ) 86 if ( !res )
86 { 87 {
87 QString msg("Unable to initialize sharp converter. Most likely a problem with the category file"); 88 QString msg("Unable to initialize sharp converter. Most likely a problem with the category file");
88 qDebug(msg); 89 qDebug(msg);
89 return; 90 return;
90 } 91 }
91 } 92 }
92 setFileName( fileName ); 93 setFileName( fileName );
93} 94}
94 95
95Resourceolaccess::~Resourceolaccess() 96Resourceolaccess::~Resourceolaccess()
96{ 97{
97 if (mConverter != 0) 98 if (mConverter != 0)
98 delete mConverter; 99 delete mConverter;
99 100
100 //if(mAccess != 0) 101 //if(mAccess != 0)
101 //delete mAccess; 102 //delete mAccess;
102} 103}
103 104
104void Resourceolaccess::writeConfig( KConfig *config ) 105void Resourceolaccess::writeConfig( KConfig *config )
105{ 106{
106 Resource::writeConfig( config ); 107 Resource::writeConfig( config );
107} 108}
108 109
109Ticket *Resourceolaccess::requestSaveTicket() 110Ticket *Resourceolaccess::requestSaveTicket()
110{ 111{