From kde-pim Wed Jul 28 16:43:54 2004 From: Reinhold Kainhofer Date: Wed, 28 Jul 2004 16:43:54 +0000 To: kde-pim Subject: [Kde-pim] [PATCH] Make KAddressbook's embedded contact editor work Message-Id: <200407281843.58693.reinhold () kainhofer ! com> X-MARC-Message: https://marc.info/?l=kde-pim&m=109103311531720 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_Nf9BB7RbA3GTXBs" --Boundary-00=_Nf9BB7RbA3GTXBs Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Here's a patch for kaddressbook that fixes the refresh / focus stealing problem in kaddressbook's embedded editor (in connection with the list view). If you entered any character in any of the fields, the cursor would jump to the end of the name field. This problem is still there for the card view, but I'm working on that, too. Okay to commit? Reinhold -- ------------------------------------------------------------------ Reinhold Kainhofer, Vienna, Austria email: reinhold@kainhofer.com, http://reinhold.kainhofer.com/ * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at * Deltasoft mathematics, http://www.deltasoft.at/ --Boundary-00=_Nf9BB7RbA3GTXBs Content-Type: text/x-diff; charset="us-ascii"; name="2004-07-28_KAddressbook_EmbeddedEditorUnusable1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2004-07-28_KAddressbook_EmbeddedEditorUnusable1.patch" ? 2004-07-28_KAddressbook_EmbeddedEditorUnusable1.patch ? cvs.diff Index: addresseeeditorwidget.cpp =================================================================== RCS file: /home/kde/kdepim/kaddressbook/addresseeeditorwidget.cpp,v retrieving revision 1.85 diff -u -p -3 -w -b -B -r1.85 addresseeeditorwidget.cpp --- addresseeeditorwidget.cpp 26 Jul 2004 15:49:21 -0000 1.85 +++ addresseeeditorwidget.cpp 28 Jul 2004 16:43:27 -0000 @@ -89,6 +89,7 @@ AddresseeEditorWidget::~AddresseeEditorW void AddresseeEditorWidget::setAddressee( const KABC::Addressee &addr ) { + if ( mAddressee.uid() != addr.uid() ) { mAddressee = addr; bool readOnly = ( !addr.resource() ? false : addr.resource()->readOnly() ); @@ -98,6 +99,7 @@ void AddresseeEditorWidget::setAddressee mNameEdit->setFocus(); } +} const KABC::Addressee &AddresseeEditorWidget::addressee() { @@ -762,15 +764,15 @@ void AddresseeEditorWidget::emitModified { mDirty = true; + if ( isExtension() && !mBlockSignals ) { KABC::Addressee::List list; - if ( isExtension() && !mBlockSignals ) { save(); list.append( mAddressee ); - } emit modified( list ); } +} void AddresseeEditorWidget::dateChanged( QDate ) { Index: views/kaddressbooktableview.cpp =================================================================== RCS file: /home/kde/kdepim/kaddressbook/views/kaddressbooktableview.cpp,v retrieving revision 1.20 diff -u -p -3 -w -b -B -r1.20 kaddressbooktableview.cpp --- views/kaddressbooktableview.cpp 17 Jun 2004 00:06:10 -0000 1.20 +++ views/kaddressbooktableview.cpp 28 Jul 2004 16:43:27 -0000 @@ -219,6 +219,7 @@ void KAddressBookTableView::readConfig(K void KAddressBookTableView::refresh(QString uid) { +kdDebug()<<"Refresh called with uid "<( it.current() ); + QPtrList selectedItems( mListView->selectedItems() ); + QListViewItem *it; + for ( it = selectedItems.first(); it; it = selectedItems.next() ) { + ceItem = dynamic_cast( it ); if ( ceItem && ceItem->addressee().uid() == uid ) { ceItem->refresh(); return; } - ++it; } - refresh( QString::null ); } } --Boundary-00=_Nf9BB7RbA3GTXBs Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-pim mailing list kde-pim@mail.kde.org https://mail.kde.org/mailman/listinfo/kde-pim kde-pim home page at http://pim.kde.org/ --Boundary-00=_Nf9BB7RbA3GTXBs--