Bug 94253 - on startup the focused (selected) address is random
Summary: on startup the focused (selected) address is random
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kab3
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Koenig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-02 02:13 UTC by Rudolf Kollien
Modified: 2009-08-05 16:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
This shows the kaddressbook plugin view after startup (243.92 KB, image/jpeg)
2006-10-30 13:36 UTC, Rudolf Kollien
Details
This shows the kaddressbook standalone view after startup (231.97 KB, image/jpeg)
2006-10-30 13:37 UTC, Rudolf Kollien
Details
another standalone startup, first backend element selected (57.66 KB, image/png)
2006-10-30 13:49 UTC, Malte S. Stretz
Details
After patching first entry is not selected (70.21 KB, image/jpeg)
2007-02-14 12:47 UTC, gmud
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rudolf Kollien 2004-12-02 02:13:23 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs
OS:                Linux

When starting kaddressbook the positioning of the view and/or address is confusing. 

I use the "rolodex" view which needs more space than available on the screen. So i can/must scroll horizontally to see all addresses.

Sometimes one of the alphabeticaly first addresses are focused and the view is positioned correct (f.e. first address, the first address is shown in the left-adjusted view). The other time the (or one of the first) adresses are focused (let's say selected) but the view is positioned centered. So you can't see the focused address without scrolling. Another startup of kaddressbook the view is centered and one of the aphabetically "middle-sorted" address is focused (say the view is positioned correct).

Couldn't find out on which scheme this happens. 

This happens on table view to.

Wouldn't it be better to always focus on the first DISPLAYED address. So f.e sorting is honored? An alternative (which i DON'T prefer) is to remember the last focused (selected) address.

BTW: I'm using two addressbooks. The focused address comes from one or the other addressbook. No scheme identifiable.
Comment 1 Tobias Koenig 2005-04-04 00:58:19 UTC
*** Bug 102920 has been marked as a duplicate of this bug. ***
Comment 2 Rudolf Kollien 2005-12-15 15:36:17 UTC
Seems to work in 3.5.0
Comment 3 Malte S. Stretz 2005-12-15 18:18:10 UTC
Nope, I still see a variation of what I described in bug 102920:  The first address in my std.vcf (aka the first loaded contact) has the focus, although it is only the dotted version now.  The effect:  On startup KAddressbook jumps to a contact roughly in the middle of my address book which is still a bit odd.
Comment 4 Philip Rodrigues 2006-09-22 15:09:08 UTC
*** Bug 127566 has been marked as a duplicate of this bug. ***
Comment 5 Martin Steigerwald 2006-10-28 19:14:37 UTC
Rudolf, can you provide any reproducable step by step testcases? Or any hints on how you use KAddressBook when you see this bug?
Comment 6 Rudolf Kollien 2006-10-30 13:11:10 UTC
Hello,
it is very funny: When using the kaddressbook plugin inside of kontact, the view is positioned in the way, that the alphabetical first address is shown as the first address on screen. But when using kaddressbook _standalone_, than the display starts with a random contact. On startup you can see that the display flashes and than is so positioned, that a random address is the first on screen. The sort order is correct. Currently the display starts with a contact beginning with "H". When i scroll to left (with the horizontal scroll bar), i can see the (sorted) addresses before "H".

I don't know how i could give you a good testcase. I have some addressbooks, open kaddressbook standalone and the bug appears. I unfortunately cannot confirm to Malte that the first contact in the vcf is used. I is not the first and not the last. I changes time by time, don't know when. It isn't the last contact used and not the last contact edited. It's randomly. I try to send you a screenshot. But it's some work to mask the contacts.
Comment 7 Rudolf Kollien 2006-10-30 13:36:00 UTC
Created attachment 18325 [details]
This shows the kaddressbook plugin view after startup

This screenshot shows the view of the kaddressbook plugin in kontact after
startup (switching initially to the plugin after kontact was startup)
Comment 8 Rudolf Kollien 2006-10-30 13:37:33 UTC
Created attachment 18326 [details]
This shows the kaddressbook standalone view after startup

This screenshot shows the view immediately after kaddressbook is startup. Here
you can see, that the first shown contact starts with "H" and not with "A" as
it should.
Comment 9 Malte S. Stretz 2006-10-30 13:49:37 UTC
Created attachment 18327 [details]
another standalone startup, first backend element selected

Hmmm... here its still always the first contact from the data base.  Now that I
switched to a directory backend, it is the contact with the lowest
(alphabetical) id (see attached screenshot).

When the app starts up, the item is first actually selected (details in right
pane) and then deselected again, only leaving the focus rectangle.
Comment 10 gmud 2006-10-30 14:49:53 UTC
The behaviour I described in #127566 still exists in 3.5.3 (Kontact 3.5.5).
Comment 11 Rudolf Kollien 2006-10-30 15:53:09 UTC
Now when i start kaddressbook standalone, every time i get another contact displayed as "first on screen".

The main differences between Maltes and mine scenario is:
- i use vcf-files
- displaying starts with "wrong" contact, but the contact currently isn't focused (no rectangle around).
- i use "rolodex" view

I use multiple active addressbooks stored in vcf-files. Some are local, some reside on a smb share. And - some contacts are "hidden" because of a filter on categories.

Malte: what happens if you view your contacts inside kaddressbooks kontact plugin?
Comment 12 Malte S. Stretz 2006-10-30 16:03:35 UTC
Inside Kontact I've got the same behaviour:  Till is selected after I started it.  Also in Rolodex though I don't see the focus rectangle after the contact gets unselected (try list view I guess you'll have it there, too).

As you've got several backends, is it possible that it always selects one of the first contacts in any of this (with randomly changing vcf file)?
Comment 13 Rudolf Kollien 2006-10-30 16:17:01 UTC
When i switch to table view i can reproduce Maltes report: in my case always the first contact of one of the vcf-files is selected. Regardless of plugin or standalone. And it is always the same vcf-file concerned! 

But in rolodex view i never get this in the plugin and completely random when standalone. I searched all backends and the contacts "first shown" are sometimes in the middle of a file, at the end or start (but till now it never happened that it was the first or last). And it isn't always a contact from the same backend.
Comment 14 Rudolf Kollien 2006-10-30 23:51:26 UTC
Crazy, crazy, crazy! 

My above written comments are true for the newest KDE 3.5.5 version of SuSE RPMs, installed on a SuSE 9.3. But only for this!

I can confirm ALL the comments of Malte when using the newest KDE 3.5.5 version of SuSE RPMs on a SuSE 10.1!!!!!!!

It seems, there are differences. Mostly in the rolodex view. In my 10.1 box at home i get the identical behavor standalone as well in the plugin :-(
Comment 15 Malte S. Stretz 2006-10-31 00:27:30 UTC
Hehe.  Weird.  Just for the records:  I tried it on Gentoo and since this bug is open for quite some time with different versions of gcc and different libs etc.
Comment 16 Tobias Koenig 2007-02-13 19:36:21 UTC
SVN commit 633292 by tokoe:

Always select the first entry of the view on startup.

In KDE 4 we'll have a much better view handling!

BUG:94253


 M  +10 -1     kabcore.cpp  


--- branches/KDE/3.5/kdepim/kaddressbook/kabcore.cpp #633291:633292
@@ -965,15 +965,24 @@
 
 void KABCore::addressBookChanged()
 {
+  const QStringList selectedUids = mViewManager->selectedUids();
+
   mAddressBookChangedTimer->stop();
 
   if ( mJumpButtonBar )
     mJumpButtonBar->updateButtons();
 
   mSearchManager->reload();
+
   mViewManager->setSelected( QString::null, false );
-  setContactSelected( QString::null );
 
+  QString uid = QString::null;
+  if ( !selectedUids.isEmpty() )
+    uid = selectedUids.first();
+
+  mViewManager->setSelected( uid, true );
+  setContactSelected( uid );
+
   updateCategories();
 }
 
Comment 17 gmud 2007-02-14 12:40:28 UTC
Sorry, but your patch doesn't work. It jumps to an "early" entry in the addressbook, but not the first one "alphabetically".
Comment 18 gmud 2007-02-14 12:47:38 UTC
Created attachment 19682 [details]
After patching first entry is not selected
Comment 19 Tobias Koenig 2009-08-05 16:19:48 UTC
The development of the old KAddressBook will be discontinued for KDE 4.4.
Since the new application has the same name, but a completly new code base we close all bug reports against the old version and ask the submitters to resend there reports against the new product.