summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show 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
KABC::OpieConverter mConverter;
bool res;
KABC::Addressee::List::ConstIterator it;
for ( it = list.begin(); it != list.end(); ++it ) {
OContact c;
KABC::Addressee addressee = (*it);
res = mConverter.addresseeToOpie( *it, c );
if (res == true)
{
res = access->add(c);
if (res == false)
qDebug("Unable to append Contact %s", c.fullName().latin1());
}
else
{
qDebug("Unable to convert Addressee %s", addressee.formattedName().latin1());
}
}
access->save();
delete access;
- delete backend;
+//US the deletion of the access object deletes the backend object as well.
return true;
}
KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
{
KABC::AddresseeList adrlst;
QString name = QDir::homeDirPath() + "/Applications/addressbook/addressbook.xml";
#ifndef KAB_EMBEDDED
QString fileName = KFileDialog::getOpenFileName( name );
#else //KAB_EMBEDDED
QString fileName = KFileDialog::getOpenFileName( name, i18n("Load file"), parentWidget() );
#endif //KAB_EMBEDDED
if ( fileName.isEmpty() )
return KABC::AddresseeList();
OContactAccessBackend_XML* backend = new OContactAccessBackend_XML( "KA/Pi", fileName );
OContactAccess* access = new OContactAccess("KA/Pi", 0l, backend, false);
if ( !access ) {
qDebug("Unable to access file() %s", fileName.latin1());
@@ -174,29 +174,29 @@ KABC::AddresseeList OpieXXPort::importContacts( const QString& ) const
access -> setReadAhead( 32 ); // Use ReadAhead-Cache if available
KABC::OpieConverter mConverter;
bool res = false;
OContactAccess::List::Iterator it;
OContactAccess::List allList = access->allRecords();
for ( it = allList.begin(); it != allList.end(); ++it )
{
OContact c = (*it);
KABC::Addressee addressee;
res = mConverter.opieToAddressee( c, addressee );
if ( !addressee.isEmpty() && res ) {
adrlst.append( addressee );
}
// qDebug("found %s", c.fullName().latin1());
}
delete access;
- delete backend;
+//US the deletion of the access object deletes the backend object as well.
return adrlst;
}
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,58 +158,62 @@ KABC::AddresseeList VCardXXPort::importContacts( const QString& ) const
QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
addrList = parseVCard( data );
if ( !url.isLocalFile() )
KIO::NetAccess::removeTempFile( fileName );
} else {
QString text = i18n( "<qt>Unable to access <b>%1</b>.</qt>" );
KMessageBox::error( parentWidget(), text.arg( url.url() ), caption );
}
}
#else //KAB_EMBEDDED
if ( !XXPortManager::importData.isEmpty() )
addrList = parseVCard( XXPortManager::importData );
else {
if ( XXPortManager::importURL.isEmpty() )
{
fileName = KFileDialog::getOpenFileName( QString::null, i18n("Select vCard to Import"), parentWidget() );
+ if ( fileName.isEmpty() )
+ return addrList;
+
}
else
{
//US url = XXPortManager::importURL;
qDebug("VCardXXPort::importContacts Urls at the moment not supported");
- }
-
if ( url.isEmpty() )
return addrList;
+ }
+
+
QFile file( fileName );
file.open( IO_ReadOnly );
QByteArray rawData = file.readAll();
file.close();
QString data = QString::fromUtf8( rawData.data(), rawData.size() + 1 );
addrList = parseVCard( data );
}
#endif //KAB_EMBEDDED
return addrList;
}
KABC::AddresseeList VCardXXPort::parseVCard( const QString &data ) const
{
KABC::VCardConverter converter;
KABC::AddresseeList addrList;
uint numVCards = data.contains( "BEGIN:VCARD", false );
QStringList dataList = QStringList::split( "\r\n\r\n", data );
for ( uint i = 0; i < numVCards && i < dataList.count(); ++i ) {
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 @@
TEMPLATE = lib
CONFIG += qt warn_on
TARGET = microkdepim
-INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore
+INCLUDEPATH += ../microkde ../qtcompat ../libkabcwrap ../microkde/kdecore $(QPEDIR)/include
INCLUDEPATH += . ..
LIBS += -lmicrokde
LIBS += -L$(QPEDIR)/lib
OBJECTS_DIR = obj/$(PLATFORM)
MOC_DIR = moc/$(PLATFORM)
DESTDIR=$(QPEDIR)/lib
INTERFACES = \
HEADERS = \
categoryeditdialog.h \
categoryeditdialog_base.h \
categoryselectdialog.h \
categoryselectdialog_base.h \
kdateedit.h \
kdatepicker.h \
kinputdialog.h \
kincidenceformatter.h \
kpimprefs.h \
kprefs.h \
kprefsdialog.h \
addresseeview.h \
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 )
}
int KDialogBase::pageIndex( QWidget *widget ) const
{
return 0;
}
bool KDialogBase::showPage( int index )
{
tabWidget()->setCurrentPage( index );return false;
}
QFrame *KDialogBase::plainPage()
{
if ( !mPlainPage ) {
mPlainPage = new QFrame( this );
setMainWidget( mPlainPage );
}
return mPlainPage;
}
void KDialogBase::slotOk()
{
+ qDebug("KDialogBase::slotOk");
emit okClicked();
- QDialog::accept();
+ accept();
}
void KDialogBase::slotApply()
{
emit applyClicked();
}
void KDialogBase::slotCancel()
{
emit cancelClicked();
reject();
}
void KDialogBase::slotClose()
{
emit closeClicked();
reject();
}
void KDialogBase::slotUser1()
{
emit user1Clicked();
}
void KDialogBase::slotUser2()