summaryrefslogtreecommitdiffabout
path: root/kabc/plugins
Side-by-side diff
Diffstat (limited to 'kabc/plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/opie/resourceopie.cpp16
-rw-r--r--kabc/plugins/opie/resourceopieconfig.cpp11
-rw-r--r--kabc/plugins/opie/resourceopieconfig.h3
3 files changed, 16 insertions, 14 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
@@ -98,5 +98,5 @@ void ResourceOpie::init( const QString &fileName )
*/
//US opie addressbook is always readonly
- setReadOnly( true );
+//US setReadOnly( true );
setFileName( fileName );
@@ -113,5 +113,5 @@ void ResourceOpie::writeConfig( KConfig *config )
{
//US opie addressbook is always readonly
- setReadOnly( true );
+//US setReadOnly( true );
Resource::writeConfig( config );
@@ -195,11 +195,21 @@ bool ResourceOpie::load()
access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
+ bool res = false;
if (mConverter == 0)
+ {
mConverter = new OpieConverter();
+ res = mConverter->init();
+ if ( !res )
+ {
+ qDebug("Unable to initialize opie converter. Most likely a problem with the category file");
+ addressBook()->error( i18n( "Unable to initialize opie converter. Most likely a problem with the category file" ) );
+ delete access;
+ return false;
+ }
+ }
OContactAccess::List::Iterator it;
OContactAccess::List allList = access->allRecords();
- bool res = false;
for ( it = allList.begin(); it != allList.end(); ++it )
{
diff --git a/kabc/plugins/opie/resourceopieconfig.cpp b/kabc/plugins/opie/resourceopieconfig.cpp
index f4cc4f9..eef9cc9 100644
--- a/kabc/plugins/opie/resourceopieconfig.cpp
+++ b/kabc/plugins/opie/resourceopieconfig.cpp
@@ -63,13 +63,5 @@ ResourceOpieConfig::ResourceOpieConfig( QWidget* parent, const char* name )
mainLayout->addWidget( label, 0, 0 );
mainLayout->addWidget( mFileNameEdit, 0, 1 );
-
-//US mInEditMode = false;
-}
-/*US
-void ResourceOpieConfig::setEditMode( bool value )
-{
- mInEditMode = value;
}
-*/
void ResourceOpieConfig::loadSettings( KRES::Resource *res )
@@ -86,4 +78,7 @@ void ResourceOpieConfig::loadSettings( KRES::Resource *res )
if ( mFileNameEdit->url().isEmpty() )
mFileNameEdit->setURL( QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml" );
+
+ //US Opie resources are ReadOnly by definition
+ emit setPersistentReadOnly( true );
}
diff --git a/kabc/plugins/opie/resourceopieconfig.h b/kabc/plugins/opie/resourceopieconfig.h
index 533b7f4..8cc192c 100644
--- a/kabc/plugins/opie/resourceopieconfig.h
+++ b/kabc/plugins/opie/resourceopieconfig.h
@@ -43,6 +43,4 @@ public:
ResourceOpieConfig( QWidget* parent = 0, const char* name = 0 );
-//US void setEditMode( bool value );
-
public slots:
void loadSettings( KRES::Resource *resource );
@@ -54,5 +52,4 @@ protected slots:
private:
KURLRequester* mFileNameEdit;
-//US bool mInEditMode;
};