[kupfer] browser: Fix lazy loading of result list
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] browser: Fix lazy loading of result list
- Date: Tue, 24 Nov 2009 15:14:09 +0000 (UTC)
commit 8951c93989bd0eaf3bfdc15caf9645d315d1b21e
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Nov 24 16:11:15 2009 +0100
browser: Fix lazy loading of result list
Upon every step down we check if we have enough items in the result
list to display the desired scroll amount. We should check this
exactly, else we load in 10 new result for each down key pressed.
Loading in too many results is a performance issue.
Now we only load in if current row index plus requested scroll amount
is more than the number of loaded items.
kupfer/browser.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/browser.py b/kupfer/browser.py
index 3801e26..e5b44b3 100644
--- a/kupfer/browser.py
+++ b/kupfer/browser.py
@@ -501,7 +501,7 @@ class Search (gtk.Bin):
path, col = self.table.get_cursor()
if path:
r = row_at_path(path)
- if r <= -rows_count + len(self.model):
+ if len(self.model) - rows_count <= r:
self.populate(self.show_more)
# go down only if table is visible
if table_visible:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]