commit/StationPlaylist: josephsl: Track Tool optimization 3 (6.0-dev): Cache child positions.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 12 Aug 2015 18:12:33 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/987bfcc1f0f6/
Changeset: 987bfcc1f0f6
Branch: 6.0/trackToolSysListView32
User: josephsl
Date: 2015-08-12 18:12:18+00:00
Summary: Track Tool optimization 3 (6.0-dev): Cache child positions.

Affected #: 1 file

diff --git a/addon/appModules/tracktool.py b/addon/appModules/tracktool.py
index 6541f5a..c1cd08e 100755
--- a/addon/appModules/tracktool.py
+++ b/addon/appModules/tracktool.py
@@ -121,7 +121,7 @@ class AppModule(appModuleHandler.AppModule):

# Various column reading scripts (row with fake navigation should not
be used).
# 6.0: Cache column header indecies.
- #headerToIndex={}
+ headerToIndex={}

def announceColumnContent(self, headerText):
item = api.getFocusObject()
@@ -132,10 +132,13 @@ class AppModule(appModuleHandler.AppModule):
# Translators: Presented when no tracks are added to
Track Tool.
ui.message(_("No tracks added"))
else:
- columnHeaders = item.parent.children[-1].children
- for header in columnHeaders:
- if header.name == headerText:
- pos = columnHeaders.index(header)
+ # Cached values always takes precedence.
+ if headerText not in self.headerToIndex:
+ columnHeaders =
item.parent.children[-1].children
+ for header in columnHeaders:
+ if header.name == headerText:
+ self.headerToIndex[headerText]
= columnHeaders.index(header)
+ pos = self.headerToIndex[headerText]
try:
item.announceColumnContent(pos,
columnHeader=headerText)
except AttributeError:

Repository URL: https://bitbucket.org/nvdaaddonteam/stationplaylist/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/StationPlaylist: josephsl: Track Tool optimization 3 (6.0-dev): Cache child positions. - commits-noreply