Bug 72758 - Address dialog loses recent addresses
Summary: Address dialog loses recent addresses
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-16 14:46 UTC by Cornelius Schumacher
Modified: 2007-09-14 12:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cornelius Schumacher 2004-01-16 14:46:09 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

Open the address selection dialog from the composer, click on the "Addressbook" button. KAddressBook starts. Click on "New Contact" in KAddressbook. Result: The "Recent Addresses" item in the left tree of the address selection dialog is magically removed.
Comment 1 Tobias Koenig 2004-02-05 22:37:11 UTC
Subject: kdepim/libkdepim

CVS commit by tokoe: 

Update also the 'Recent addresses' group...
That fixes #72758

CCMAIL:72758-done@bugs.kde.org


  M +20 -6     addressesdialog.cpp   1.23
  M +1 -0      addressesdialog.h   1.10


--- kdepim/libkdepim/addressesdialog.cpp  #1.22:1.23
@@ -67,4 +67,6 @@ struct AddressesDialog::AddressesDialogP
 
   QDict<AddresseeViewItem>     groupDict;
+
+  KABC::Addressee::List       recentAddresses;
 };
 // privates end
@@ -273,5 +275,15 @@ AddressesDialog::setSelectedBCC( const Q
 
 void
-AddressesDialog::setRecentAddresses( const KABC::Addressee::List& addr )
+AddressesDialog::setRecentAddresses( const KABC::Addressee::List& list )
+{
+  d->recentAddresses = list;
+
+  updateRecentAddresses();
+
+  checkForSingleAvailableGroup();
+}
+
+void
+AddressesDialog::updateRecentAddresses()
 {
   static const QString &recentGroup = KGlobal::staticQString( i18n( "Recent Addresses" ) );
@@ -284,13 +297,11 @@ AddressesDialog::setRecentAddresses( con
   }
 
-  for( KABC::Addressee::List::ConstIterator it = addr.begin();
-       it != addr.end(); ++it ) {
+  KABC::Addressee::List::ConstIterator it;
+  for ( it = d->recentAddresses.begin(); it != d->recentAddresses.end(); ++it )
     addAddresseeToAvailable( *it, d->recent );
-  }
+
   if ( d->recent->childCount() > 0 ) {
     d->recent->setVisible( true );
   }
-
-  checkForSingleAvailableGroup();
 }
 
@@ -376,4 +387,7 @@ AddressesDialog::updateAvailableAddresse
   }
 
+  d->recent = 0;
+  updateRecentAddresses();
+
   addDistributionLists();
   if ( d->personal->childCount() > 0 ) {

--- kdepim/libkdepim/addressesdialog.h  #1.9:1.10
@@ -178,4 +178,5 @@ namespace KPIM {
     // it is recursive, but should only ever recurse once so should be fine
     void unmapSelectedAddress(AddresseeViewItem* item);
+    void updateRecentAddresses();
 
     struct AddressesDialogPrivate;