danielfett / advancedcaching

Advanced Geocaching Tool for Linux
http://www.danielfett.de/internet-und-opensource,software,agtl
31 stars 13 forks source link

N900: 0.9.1.2 hildongui: actionsmenu is slow if cache count is high (2000+) #177

Closed aapo closed 10 years ago

aapo commented 11 years ago

Test: rm ~/.agtl/caches.db Start agtl Open Actions Menu (bottom left corner) Menu is visible instantly

Fetch big amount of caches, 2000 is enough to see effect (then caches.db is about 80MB). Start agtl Open Actions Menu (bottom left corner) Wait three or four seconds Menu is visible


hildon_plugins.py: 82 (HildonFieldnotes)

def plugin_init(self):
    self.core.connect('fieldnotes-changed', self._on_fieldnotes_changed)
    logger.info("Using Fieldnotes plugin")
def _on_fieldnotes_changed(self, core):
    self.update_fieldnotes_display()

def _get_fieldnotes_button(self):
-    self.update_fieldnotes_display()
     self.button_fieldnotes.unparent()
     return self.button_fieldnotes

Pressing actions-menu-button will call _get_fieldnotes_button, which is then calling timeconsuming update_fieldnotes_display, but I don't know any situation where it is needed, because 'fieldnotes-changed' calls it (and it happens also during startup).


Also question could be: why

c = self.conn.execute('SELECT count(*) AS cnt FROM %s WHERE logas != %d' % (self.cache_table, self.ctype.LOG_NO_LOG)) 

on provider.py:191 takes so much time when cache count is high.