summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/xxport/opie/opie_xxport.cpp4
-rw-r--r--kaddressbook/xxport/vcard_xxport.cpp8
-rw-r--r--libkdepim/libkdepimE.pro2
-rw-r--r--microkde/kdialogbase.cpp3
4 files changed, 11 insertions, 6 deletions
diff --git a/kaddressbook/xxport/opie/opie_xxport.cpp b/kaddressbook/xxport/opie/opie_xxport.cpp
index f30a205..d1def18 100644
--- a/kaddressbook/xxport/opie/opie_xxport.cpp
+++ b/kaddressbook/xxport/opie/opie_xxport.cpp
@@ -121,49 +121,49 @@ bool OpieXXPort::exportContacts( const KABC::AddresseeList &list, const QString
121 KABC::OpieConverter mConverter; 121 KABC::OpieConverter mConverter;
122 bool res; 122 bool res;
123 123
124 KABC::Addressee::List::ConstIterator it; 124 KABC::Addressee::List::ConstIterator it;
125 for ( it = list.begin(); it != list.end(); ++it ) { 125 for ( it = list.begin(); it != list.end(); ++it ) {
126 OContact c; 126 OContact c;
127 KABC::Addressee addressee = (*it); 127 KABC::Addressee addressee = (*it);
128 128
129 res = mConverter.addresseeToOpie( *it, c ); 129 res = mConverter.addresseeToOpie( *it, c );
130 if (res == true) 130 if (res == true)
131 { 131 {
132 res = access->add(c); 132 res = access->add(c);
133 if (res == false) 133 if (res == false)
134 qDebug("Unable to append Contact %s", c.fullName().latin1()); 134 qDebug("Unable to append Contact %s", c.fullName().latin1());
135 } 135 }
136 else 136 else
137 { 137 {
138 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1()); 138 qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
139 } 139 }
140 } 140 }
141 141
142 access->save(); 142 access->save();
143 143
144 delete access; 144 delete access;
145 delete backend; 145//US the deletion of the access object deletes the backend object as well.
146 146
147 return true; 147 return true;
148} 148}
149 149
150KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const 150KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
151{ 151{
152 KABC::AddresseeList adrlst; 152 KABC::AddresseeList adrlst;
153 153
154 QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml"; 154 QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
155 155
156#ifndef KAB_EMBEDDED 156#ifndef KAB_EMBEDDED
157 QString fileName = KFileDialog::getOpenFileName( name ); 157 QString fileName = KFileDialog::getOpenFileName( name );
158#else //KAB_EMBEDDED 158#else //KAB_EMBEDDED
159 QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() ); 159 QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() );
160#endif //KAB_EMBEDDED 160#endif //KAB_EMBEDDED
161 161
162 if ( fileName.isEmpty() ) 162 if ( fileName.isEmpty() )
163 return KABC::AddresseeList(); 163 return KABC::AddresseeList();
164 164
165 OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName ); 165 OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName );
166 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false); 166 OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false);
167 167
168 if ( !access ) { 168 if ( !access ) {
169 qDebug("Unable to access file() %s", fileName.latin1()); 169 qDebug("Unable to access file() %s", fileName.latin1());
@@ -174,29 +174,29 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
174 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available 174 access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
175 175
176 KABC::OpieConverter mConverter; 176 KABC::OpieConverter mConverter;
177 bool res = false; 177 bool res = false;
178 178
179 179
180 OContactAccess::List::Iterator it; 180 OContactAccess::List::Iterator it;
181 OContactAccess::List allList = access->allRecords(); 181 OContactAccess::List allList = access->allRecords();
182 for ( it = allList.begin(); it != allList.end(); ++it ) 182 for ( it = allList.begin(); it != allList.end(); ++it )
183 { 183 {
184 OContact c = (*it); 184 OContact c = (*it);
185 185
186 KABC::Addressee addressee; 186 KABC::Addressee addressee;
187 187
188 res = mConverter.opieToAddressee( c, addressee ); 188 res = mConverter.opieToAddressee( c, addressee );
189 189
190 if ( !addressee.isEmpty() && res ) { 190 if ( !addressee.isEmpty() && res ) {
191 adrlst.append( addressee ); 191 adrlst.append( addressee );
192 } 192 }
193 193
194// qDebug("found %s", c.fullName().latin1()); 194// qDebug("found %s", c.fullName().latin1());
195 } 195 }
196 196
197 delete access; 197 delete access;
198 delete backend; 198//US the deletion of the access object deletes the backend object as well.
199 199
200 return adrlst; 200 return adrlst;
201 201
202} 202}
diff --git a/kaddressbook/xxport/vcard_xxport.cpp b/kaddressbook/xxport/vcard_xxport.cpp
index c017f5b..54d0cbd 100644
--- a/kaddressbook/xxport/vcard_xxport.cpp
+++ b/kaddressbook/xxport/vcard_xxport.cpp
@@ -158,57 +158,61 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
158 158
159 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 159 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
160 addrList = parseVCard( data ); 160 addrList = parseVCard( data );
161 161
162 if ( !url.isLocalFile() ) 162 if ( !url.isLocalFile() )
163 KIO::NetAccess::removeTempFile( fileName ); 163 KIO::NetAccess::removeTempFile( fileName );
164 164
165 } else { 165 } else {
166 QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" ); 166 QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" );
167 KMessageBox::error( parentWidget(), text.arg( url.url() ), caption ); 167 KMessageBox::error( parentWidget(), text.arg( url.url() ), caption );
168 } 168 }
169 169
170 } 170 }
171 171
172 172
173#else //KAB_EMBEDDED 173#else //KAB_EMBEDDED
174 174
175 175
176 if ( !XXPortManager::importData.isEmpty() ) 176 if ( !XXPortManager::importData.isEmpty() )
177 addrList = parseVCard( XXPortManager::importData ); 177 addrList = parseVCard( XXPortManager::importData );
178 else { 178 else {
179 if ( XXPortManager::importURL.isEmpty() ) 179 if ( XXPortManager::importURL.isEmpty() )
180 { 180 {
181 fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() ); 181 fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
182 if ( fileName.isEmpty() )
183 return addrList;
184
182 } 185 }
183 else 186 else
184 { 187 {
185//US url = XXPortManager::importURL; 188//US url = XXPortManager::importURL;
186 qDebug("VCardXXPort::importContacts Urls at the moment not supported"); 189 qDebug("VCardXXPort::importContacts Urls at the moment not supported");
190 if ( url.isEmpty() )
191 return addrList;
192
187 } 193 }
188 194
189 if ( url.isEmpty() )
190 return addrList;
191 195
192 QFile file( fileName ); 196 QFile file( fileName );
193 197
194 file.open( IO_ReadOnly ); 198 file.open( IO_ReadOnly );
195 QByteArray rawData = file.readAll(); 199 QByteArray rawData = file.readAll();
196 file.close(); 200 file.close();
197 201
198 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 ); 202 QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
199 addrList = parseVCard( data ); 203 addrList = parseVCard( data );
200 204
201 } 205 }
202#endif //KAB_EMBEDDED 206#endif //KAB_EMBEDDED
203 207
204 return addrList; 208 return addrList;
205} 209}
206 210
207KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const 211KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
208{ 212{
209 KABC::VCardConverter converter; 213 KABC::VCardConverter converter;
210 KABC::AddresseeList addrList; 214 KABC::AddresseeList addrList;
211 215
212 uint numVCards = data.contains( "BEGIN:VCARD", false ); 216 uint numVCards = data.contains( "BEGIN:VCARD", false );
213 QStringList dataList = QStringList::split( "\r\n\r\n", data ); 217 QStringList dataList = QStringList::split( "\r\n\r\n", data );
214 218
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro
index 414ac2b..b267d22 100644
--- a/libkdepim/libkdepimE.pro
+++ b/libkdepim/libkdepimE.pro
@@ -1,28 +1,28 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3TARGET = microkdepim 3TARGET = microkdepim
4INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore 4INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore $(QPEDIR)/include
5INCLUDEPATH += . .. 5INCLUDEPATH += . ..
6LIBS += -lmicrokde 6LIBS += -lmicrokde
7LIBS += -L$(QPEDIR)/lib 7LIBS += -L$(QPEDIR)/lib
8OBJECTS_DIR = obj/$(PLATFORM) 8OBJECTS_DIR = obj/$(PLATFORM)
9MOC_DIR = moc/$(PLATFORM) 9MOC_DIR = moc/$(PLATFORM)
10DESTDIR=$(QPEDIR)/lib 10DESTDIR=$(QPEDIR)/lib
11 11
12 12
13INTERFACES = \ 13INTERFACES = \
14 14
15HEADERS = \ 15HEADERS = \
16 categoryeditdialog.h \ 16 categoryeditdialog.h \
17 categoryeditdialog_base.h \ 17 categoryeditdialog_base.h \
18 categoryselectdialog.h \ 18 categoryselectdialog.h \
19 categoryselectdialog_base.h \ 19 categoryselectdialog_base.h \
20 kdateedit.h \ 20 kdateedit.h \
21 kdatepicker.h \ 21 kdatepicker.h \
22 kinputdialog.h \ 22 kinputdialog.h \
23 kincidenceformatter.h \ 23 kincidenceformatter.h \
24 kpimprefs.h \ 24 kpimprefs.h \
25 kprefs.h \ 25 kprefs.h \
26 kprefsdialog.h \ 26 kprefsdialog.h \
27 addresseeview.h \ 27 addresseeview.h \
28 ksyncprofile.h 28 ksyncprofile.h
diff --git a/microkde/kdialogbase.cpp b/microkde/kdialogbase.cpp
index 2251207..489474a 100644
--- a/microkde/kdialogbase.cpp
+++ b/microkde/kdialogbase.cpp
@@ -238,50 +238,51 @@ void KDialogBase::showButton( ButtonCode id, bool show )
238} 238}
239 239
240int KDialogBase::pageIndex( QWidget *widget ) const 240int KDialogBase::pageIndex( QWidget *widget ) const
241{ 241{
242 return 0; 242 return 0;
243} 243}
244 244
245 245
246bool KDialogBase::showPage( int index ) 246bool KDialogBase::showPage( int index )
247{ 247{
248 tabWidget()->setCurrentPage( index );return false; 248 tabWidget()->setCurrentPage( index );return false;
249} 249}
250 250
251QFrame *KDialogBase::plainPage() 251QFrame *KDialogBase::plainPage()
252{ 252{
253 if ( !mPlainPage ) { 253 if ( !mPlainPage ) {
254 mPlainPage = new QFrame( this ); 254 mPlainPage = new QFrame( this );
255 setMainWidget( mPlainPage ); 255 setMainWidget( mPlainPage );
256 } 256 }
257 return mPlainPage; 257 return mPlainPage;
258} 258}
259 259
260void KDialogBase::slotOk() 260void KDialogBase::slotOk()
261{ 261{
262 qDebug("KDialogBase::slotOk");
262 emit okClicked(); 263 emit okClicked();
263 QDialog::accept(); 264 accept();
264} 265}
265 266
266void KDialogBase::slotApply() 267void KDialogBase::slotApply()
267{ 268{
268 emit applyClicked(); 269 emit applyClicked();
269} 270}
270 271
271void KDialogBase::slotCancel() 272void KDialogBase::slotCancel()
272{ 273{
273 emit cancelClicked(); 274 emit cancelClicked();
274 reject(); 275 reject();
275} 276}
276 277
277void KDialogBase::slotClose() 278void KDialogBase::slotClose()
278{ 279{
279 emit closeClicked(); 280 emit closeClicked();
280 reject(); 281 reject();
281} 282}
282 283
283void KDialogBase::slotUser1() 284void KDialogBase::slotUser1()
284{ 285{
285 emit user1Clicked(); 286 emit user1Clicked();
286} 287}
287void KDialogBase::slotUser2() 288void KDialogBase::slotUser2()