summaryrefslogtreecommitdiffabout
path: root/kaddressbook/xxport
Unidiff
Diffstat (limited to 'kaddressbook/xxport') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/xxport/opie/opie_xxport.cpp14
-rw-r--r--kaddressbook/xxport/opie/opie_xxportE.pro3
2 files changed, 14 insertions, 3 deletions
diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp
index d1def18..8ee0725 100644
--- a/kaddressbook/xxport/opie/opie_xxport.cpp
+++ b/kaddressbook/xxport/opie/opie_xxport.cpp
@@ -102,29 +102,39 @@ bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString
102 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false); 102 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false);
103 103
104 if ( !access ) { 104 if ( !access ) {
105 qDebug("Unable to access file() %s", fileName.latin1()); 105 qDebug("Unable to access file() %s", fileName.latin1());
106 addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) ); 106 addressBook()->error( i18n( "Unable to access file '%1'." ).arg( fileName ) );
107 return false; 107 return false;
108 } 108 }
109 109
110 KABC::OpieConverter mConverter;
111
112 bool res = mConverter.init();
113 if (!res)
114 {
115 QString text( i18n( "Unable to initialize opie converter.<br>Most likely a problem with the category file." ) );
116 qDebug(text);
117 KMessageBox::error( parentWidget(), text );
118 delete access;
119 return false;
120 }
121
110 //Now check if the file has already entries, and ask the user if he wants to delete them first. 122 //Now check if the file has already entries, and ask the user if he wants to delete them first.
111 OContactAccess::List contactList = access->allRecords(); 123 OContactAccess::List contactList = access->allRecords();
112 if (contactList.count() > 0) 124 if (contactList.count() > 0)
113 { 125 {
114 QString text( i18n( "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?" ) ); 126 QString text( i18n( "Do you want to remove<br>all existing entries from<br>%1<br>before exporting.?" ) );
115 if ( KMessageBox::questionYesNo( parentWidget(), text.arg( fileName ) ) == KMessageBox::Yes ) { 127 if ( KMessageBox::questionYesNo( parentWidget(), text.arg( fileName ) ) == KMessageBox::Yes ) {
116 // Clean the database.. 128 // Clean the database..
117 access->clear(); 129 access->clear();
118 } 130 }
119 } 131 }
120 132
121 KABC::OpieConverter mConverter;
122 bool res;
123 133
124 KABC::Addressee::List::ConstIterator it; 134 KABC::Addressee::List::ConstIterator it;
125 for ( it = list.begin(); it != list.end(); ++it ) { 135 for ( it = list.begin(); it != list.end(); ++it ) {
126 OContact c; 136 OContact c;
127 KABC::Addressee addressee = (*it); 137 KABC::Addressee addressee = (*it);
128 138
129 res = mConverter.addresseeToOpie( *it, c ); 139 res = mConverter.addresseeToOpie( *it, c );
130 if (res == true) 140 if (res == true)
diff --git a/kaddressbook/xxport/opie/opie_xxportE.pro b/kaddressbook/xxport/opie/opie_xxportE.pro
index a660a48..c373e37 100644
--- a/kaddressbook/xxport/opie/opie_xxportE.pro
+++ b/kaddressbook/xxport/opie/opie_xxportE.pro
@@ -3,18 +3,19 @@ CONFIG += qt warn_on
3TARGET = kaddrbk_opie_xxport 3TARGET = kaddrbk_opie_xxport
4 4
5OBJECTS_DIR = obj/$(PLATFORM) 5OBJECTS_DIR = obj/$(PLATFORM)
6MOC_DIR = moc/$(PLATFORM) 6MOC_DIR = moc/$(PLATFORM)
7DESTDIR = $(QPEDIR)/lib 7DESTDIR = $(QPEDIR)/lib
8 8
9DEFINES += KAB_EMBEDDED 9DEFINES += KAB_EMBEDDED
10 10
11INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../kabc/converter/opie ../../../microkde ../../../microkde/kdeui ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat $(QPEDIR)/include 11INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../kabc/converter/opie ../../../microkde ../../../microkde/kdeui ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../qtcompat $(OPIEDIR)/include
12LIBS += -L$(QPEDIR)/lib 12LIBS += -L$(QPEDIR)/lib
13LIBS += -L$(OPIEDIR)/lib
13LIBS += -lmicrokde 14LIBS += -lmicrokde
14LIBS += -lmicrokabc 15LIBS += -lmicrokabc
15LIBS += -lopie 16LIBS += -lopie
16LIBS += -lqpe 17LIBS += -lqpe
17LIBS += -lqte 18LIBS += -lqte
18LIBS += -lmicrokabc_opieconverter 19LIBS += -lmicrokabc_opieconverter
19 20
20INTERFACES = \ 21INTERFACES = \