[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim]
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <kloecker () kde ! org>
Date:       2003-06-25 21:58:13
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hi,

I don't think this is a bug in KMail:

----------  Forwarded Message  ----------
http://bugs.kde.org/show_bug.cgi?id=60304
           Summary: Deleted address still reported as email address
 already in addressbook
           Product: kmail

Version:           1.5.2 (using KDE KDE 3.1.2)
Installed from:    SuSE RPMs
Compiler:          gcc 3.2
OS:          Linux

Deleted email addresses (addressbook saved+closed) are reported as
 "email address already in your addressbook" upon new add to
 addressbook from an email message.

Workaround: close kmail and restart it.
-------------------------------------------------------


We do the following (in kmaddrbook.cpp):
=====
void KMAddrBookExternal::addEmail( const QString& addr, QWidget *parent) 
{
  QString email;
  QString name;

  KABC::Addressee::parseEmailAddress( addr, name, email );

  KABC::AddressBook *ab = KABC::StdAddressBook::self();

  KABC::Addressee::List addressees = ab->findByEmail( email );

  if ( addressees.isEmpty() ) {
[snip]
  } else {
    QString text = i18n("<qt>The email address <b>%1</b> is already in 
your "
                        "addressbook.</qt>").arg( addr );
    KMessageBox::information( parent, text );
  }
}
=====

What are we doing wrong? I could fix the problem by adding
  ab->load();
after
  KABC::AddressBook *ab = KABC::StdAddressBook::self();
But why is this necessary? Does KABC::StdAddressBook::self() create a 
static object which caches the address book data? Would listening to  
the addressBookChanged() signal in order to find out when an ab->load() 
is necessary work? Shouldn't the static object notice if the file has 
been changed and reload the file if necessary?

Regards,
Ingo


[Attachment #5 (application/pgp-signature)]

_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic