After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 456970 - Orca says "0 items" for tree tables that use NODE_CHILD_OF relationship
Orca says "0 items" for tree tables that use NODE_CHILD_OF relationship
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: speech
2.19.x
Other All
: Normal normal
: 2.20.0
Assigned To: Joanmarie Diggs (IRC: joanie)
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-07-14 22:20 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2008-07-22 19:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
proposed patch (4.37 KB, patch)
2007-08-31 02:19 UTC, Joanmarie Diggs (IRC: joanie)
reviewed Details | Review
added comments to the new method; also going with expanded rather than expandable (4.62 KB, patch)
2007-08-31 18:13 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2007-07-14 22:20:44 UTC
There seem to be a couple of different ways that hierarchy gets represented in tree tables.  If  object1 is contained in object2 an app might:

1. make object1 be a child of object2, or
2. set the NODE_CHILD_OF relationship for object1 pointing to object2, but do not make object1 be a child of object2.

An example of the first method can be seen in Evolution's tree table of mail folders.  Examples of the second method can be seen in:

1. GTK demo (both in the widget list and in the tree store example)
2. Orca's Preferences dialog (keybindings page)
3. Thunderbird (tree table of mail folders)

We are not handling the second method and are therefore saying "0 items" in each of these cases.

speechgenerator.py's _getSpeechForTableCell() does a check on items that have STATE_EXPANDED, and if the childCount is 0 Orca announces zero items.  _getSpeechForTableCell() needs to also check for the NODE_CHILD_OF relationship.  Seems easy enough to do.  However, it got me to thinking:  I don't think we ever give the number of items in an expanded tree table cell other than 0, not when we land on the item nor in whereAmI.  Is this the desired behavior?
Comment 1 Joanmarie Diggs (IRC: joanie) 2007-07-14 22:21:13 UTC
Mike, your thoughts please.
Comment 2 Mike Pedersen 2007-07-24 20:51:25 UTC
When in verbose mode this would be nice information to have.
Comment 3 Joanmarie Diggs (IRC: joanie) 2007-08-21 13:57:29 UTC
Note to self:  FF3 Bookmarks Manager has another example of this.
Comment 4 Joanmarie Diggs (IRC: joanie) 2007-08-31 02:19:34 UTC
Created attachment 94682 [details] [review]
proposed patch

In my original bug report, I cited Evolution as an example where NODE_CHILD_OF was not used.  I was wrong.  At least that's no longer the case in Gutsy.  I can not find any examples of trees where the childCount can be used to figure out how many items to report.  If you know of any, please pass them along.  In the meantime....

This patch:

* Stops saying "0 items" whenever it can.  Two places where it cannot 
  without some hackery:

   1. Firefox's Manage Bookmarks window.  See this bug: 
      https://bugzilla.mozilla.org/show_bug.cgi?id=394387
      Only cells with expanders should have STATE_EXPANDABLE 
      and expand/collapse actions

   2. Evolution's message list when messages are viewed as a thread.
      See bug: http://bugzilla.gnome.org/show_bug.cgi?id=433019

* Reports the number of items contained in an expanded item at the 
  "verbose" level.  Note that I thought this could be done without a
   new string.  But all of our item count strings are different.  We
   have "O items" and "item x of y", but not "x items" (that I've found
   anyway).  So this will have to be for post 2.20.

I've tested this in Thunderbird, Evolution, and GTK-Demo.  It seems to work...
Comment 5 Willie Walker 2007-08-31 12:47:18 UTC
The '0 items' stuff was added as part of bug 319666.  Not sure if the effects of this patch have an adverse effect on bug 319666.  Can you please check (I'm sure you probably already have) and verify that 319666 is still in the 'fixed' column with this patch?

In addition, the getChildNodes method seems a little brute force and could pose some performance problems for tables with lots of rows, but I'm not sure of a better way to accomplish the task.
Comment 6 Willie Walker 2007-08-31 14:56:45 UTC
> In addition, the getChildNodes method seems a little brute force and could pose
> some performance problems for tables with lots of rows, but I'm not sure of a
> better way to accomplish the task.

In IRC, Joanie showed me it wasn't brute force.  My apologies.  Thanks Joanie!
Comment 7 Willie Walker 2007-08-31 18:00:29 UTC
Joanie and I chatted about this patch and agree it is the right way to go.  She'll add a little more documentation, but the code seems good.  Mike, please test for GNOME 2.19.92.  

Mike, also remember to note the issue with reviewing folders that refresh slowly in nautilus.  It might be a separate bug.
Comment 8 Joanmarie Diggs (IRC: joanie) 2007-08-31 18:13:54 UTC
Created attachment 94719 [details] [review]
added comments to the new method; also going with expanded rather than expandable

This really is the same patch for all intents and purposes.

I added comments to getChildNodes().  Also, before getChildNodes() just cared about STATE_EXPANDABLE.  It worked if something was collapsed in so far as it bailed immediately, returned 0 items, and didn't complain. :-)  However, if we're never going to want to get the nodes of a collapsed item anyway, we might as well just look at objects that have STATE_EXPANDED.

Mike please test.
Comment 9 Mike Pedersen 2007-09-01 00:38:29 UTC
This works great.  thanks 
Comment 10 Willie Walker 2007-09-01 07:47:49 UTC
Thanks Mike!  Joanie, please commit to gnome-2-20 and trunk.
Comment 11 Joanmarie Diggs (IRC: joanie) 2007-09-01 19:26:05 UTC
Thanks guys.  Patch committed to gnome-2-20 branch and to trunk.  Moving to pending.
Comment 12 Willie Walker 2007-09-04 14:44:47 UTC
From Mike's comment in comment #9, I think we can mark this as verified.  Please close as FIXED and thanks for your hard work!