hugosenari / Kupfer-Plugins

My kupfer plugins install with Kupfer
https://github.com/kupferlauncher/kupfer/
11 stars 2 forks source link

Issue #7 fix #8

Closed hugosenari closed 7 years ago

hugosenari commented 7 years ago

Fix #7

@khurshid-alam can you help-me reviewing/testing this changes?

Changes:

khurshid-alam commented 7 years ago

Alright. I am trying this now.

khurshid-alam commented 7 years ago

I think it is interfering with other plugins as they are using same sources name (i.e ContactsSource). I have fileaction plugin enabled. I try to open a contact it gives:

Traceback (most recent call last):
  File "/usr/share/kupfer/kupfer/ui/browser.py", line 1849, in _activate
    self.data_controller.activate(ui_ctx=self._make_gui_ctx())
  File "/usr/share/kupfer/kupfer/core/data.py", line 811, in activate
    res, ret = ctx.run(leaf, action, sobject, ui_ctx=ui_ctx)
  File "/usr/share/kupfer/kupfer/core/commandexec.py", line 327, in run
    ret = activate_action(execution_token, obj, action, iobj)
  File "/usr/share/kupfer/kupfer/core/commandexec.py", line 81, in activate_action
    return _activate_action_single(obj, action, iobj, kwargs)
  File "/usr/share/kupfer/kupfer/core/commandexec.py", line 89, in _activate_action_single
    ret = action.activate(obj, **kwargs)
  File "/usr/share/kupfer/kupfer/obj/fileactions.py", line 54, in activate
    self.activate_multiple((leaf, ), ctx)
  File "/usr/share/kupfer/kupfer/obj/fileactions.py", line 60, in activate_multiple
    app = self.default_application_for_leaf(obj)
  File "/usr/share/kupfer/kupfer/obj/fileactions.py", line 38, in default_application_for_leaf
    gfile = leaf.get_gfile()
AttributeError: 'EmpathyContact' object has no attribute 'get_gfile'
khurshid-alam commented 7 years ago

After disabling both thunderbird and file action plugin I made it work. I think we should change the contact source name to something else. For example

__kupfer_sources__ = ("EmpathyContactsSource", )

?

khurshid-alam commented 7 years ago

So it works rather well. We only need to sort out file file action thing. If a certain action for common leaf is not intended then we could use valid_for_item(self, item) for that certain action or leaf.

khurshid-alam commented 7 years ago

It seems like false alarm. I cleared cache for kupfer. And after that it works (with Thunderbird plugin disabled). So it's solved. Thanks.