Comment 7 for bug 1047466

Revision history for this message
Heath Paddock (heathbar) wrote :

I am no python wizard, but I noticed this entry frequently showing up in the log:

ERROR in cuttlefish.engine.Engine: local variable 'icon' referenced before assignment
Traceback (most recent call last):
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/CuttlefishWindow.py", line 224, in on_tvActions_cursor_changed
    self._actionUI.setup(self._editAction)
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/ui.py", line 106, in setup
    self._elements = self._editor.begin()
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/plugins/run.py", line 111, in begin
    'name': SelectAppParam('Application')
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/params.py", line 231, in __init__
    self._list_entries(t.get_root_directory())
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/params.py", line 258, in _list_entries
    self._list_entries(iter.get_directory())
  File "/opt/extras.ubuntu.com/cuttlefish/cuttlefish/params.py", line 256, in _list_entries
    self._model.append([appinfo.get_executable(), icon, appinfo.get_name()])
UnboundLocalError: local variable 'icon' referenced before assignment

So I edited /opt/extras.ubuntu.com/cuttlefish/cuttlefish/params.py.
After line 239 (i = appinfo.get_icon()) and before line 240 (try:) I added:

icon = self._theme.load_icon('application-x-executable', self._size, Gtk.IconLookupFlags.USE_BUILTIN)

Now it works.