summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/opie/resourceopie.cpp
Unidiff
Diffstat (limited to 'kabc/plugins/opie/resourceopie.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/kabc/plugins/opie/resourceopie.cpp b/kabc/plugins/opie/resourceopie.cpp
index 3b2a6b7..a7d271f 100644
--- a/kabc/plugins/opie/resourceopie.cpp
+++ b/kabc/plugins/opie/resourceopie.cpp
@@ -97,7 +97,7 @@ void ResourceOpie::init( const QString &fileName )
97 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); 97 connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) );
98*/ 98*/
99 //US opie addressbook is always readonly 99 //US opie addressbook is always readonly
100 setReadOnly( true ); 100//US setReadOnly( true );
101 101
102 setFileName( fileName ); 102 setFileName( fileName );
103 103
@@ -112,7 +112,7 @@ ResourceOpie::~ResourceOpie()
112void ResourceOpie::writeConfig( KConfig *config ) 112void ResourceOpie::writeConfig( KConfig *config )
113{ 113{
114 //US opie addressbook is always readonly 114 //US opie addressbook is always readonly
115 setReadOnly( true ); 115//US setReadOnly( true );
116 116
117 Resource::writeConfig( config ); 117 Resource::writeConfig( config );
118 118
@@ -194,13 +194,23 @@ bool ResourceOpie::load()
194 194
195 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available 195 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
196 196
197 bool res = false;
197 if (mConverter == 0) 198 if (mConverter == 0)
199 {
198 mConverter = new OpieConverter(); 200 mConverter = new OpieConverter();
201 res = mConverter->init();
202 if ( !res )
203 {
204 qDebug("Unable to initialize opie converter. Most likely a problem with the category file");
205 addressBook()->error( i18n( "Unable to initialize opie converter. Most likely a problem with the category file" ) );
206 delete access;
207 return false;
208 }
209 }
199 210
200 211
201 OContactAccess::List::Iterator it; 212 OContactAccess::List::Iterator it;
202 OContactAccess::List allList = access->allRecords(); 213 OContactAccess::List allList = access->allRecords();
203 bool res = false;
204 for ( it = allList.begin(); it != allList.end(); ++it ) 214 for ( it = allList.begin(); it != allList.end(); ++it )
205 { 215 {
206 OContact c = (*it); 216 OContact c = (*it);