From kde-core-devel Tue Feb 12 12:31:03 2002 From: Cornelius Schumacher Date: Tue, 12 Feb 2002 12:31:03 +0000 To: kde-core-devel Subject: PATCH: port of knode to kabc X-MARC-Message: https://marc.info/?l=kde-core-devel&m=101351716304698 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_RR6FVFJ1CA7VCJSU33OR" --------------Boundary-00=_RR6FVFJ1CA7VCJSU33OR Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 8bit This patch makes knode use kabc instead of kab. Is it ok to commit? --------------Boundary-00=_RR6FVFJ1CA7VCJSU33OR Content-Type: text/x-diff; charset="iso-8859-15"; name="kabc.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="kabc.patch" ? kabc.patch Index: Makefile.am =================================================================== RCS file: /home/kde/kdenetwork/knode/Makefile.am,v retrieving revision 1.37 diff -u -p -r1.37 Makefile.am --- Makefile.am 2001/08/28 08:19:47 1.37 +++ Makefile.am 2002/02/12 12:28:05 @@ -128,7 +128,7 @@ noinst_HEADERS = knconfigmanager.h \ knode_LDFLAGS = $(all_libraries) $(KDE_RPATH) -knode_LDADD = -lkdeprint $(top_builddir)/libkdenetwork/libkdenetwork.la -lkspell $(LIB_KAB) $(LIB_KFILE) $(LIBPTHREAD) $(LIBRESOLV) +knode_LDADD = -lkdeprint $(top_builddir)/libkdenetwork/libkdenetwork.la -lkspell -lkabc $(LIB_KFILE) $(LIBPTHREAD) $(LIBRESOLV) knode_METASOURCES = AUTO appsdir = $(kde_appsdir)/Internet Index: kncomposer.cpp =================================================================== RCS file: /home/kde/kdenetwork/knode/kncomposer.cpp,v retrieving revision 1.129 diff -u -p -r1.129 kncomposer.cpp --- kncomposer.cpp 2002/01/28 00:50:56 1.129 +++ kncomposer.cpp 2002/02/12 12:28:05 @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include @@ -1211,30 +1211,13 @@ void KNComposer::slotGroupsChanged(const void KNComposer::slotToBtnClicked() { - KabAPI *kab; - AddressBook::Entry entry; - KabKey key; - QString path; - - kab=new KabAPI(this); - if(kab->init()!=AddressBook::NoError) { - KMessageBox::error(this, i18n("Cannot initialize the addressbook")); - delete kab; - return; - } + KABC::Addressee a = KABC::AddresseeDialog::getAddressee( this ); + if ( a.isEmpty() ) return; - if(kab->exec()) { - if(kab->getEntry(entry, key)!=AddressBook::NoError) { - KMessageBox::error(this, i18n("Cannot read addressbook entry")); - } - else { - QString to=v_iew->t_o->text(); - if(!to.isEmpty()) to+=", "; - to+=entry.emails.first().latin1(); - v_iew->t_o->setText(to); - } - } - delete kab; + QString to=v_iew->t_o->text(); + if(!to.isEmpty()) to+=", "; + to+=a.fullEmail(); + v_iew->t_o->setText(to); } --------------Boundary-00=_RR6FVFJ1CA7VCJSU33OR--