After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 578238 - Assumes packagekit is always available if compiled with packagekit support
Assumes packagekit is always available if compiled with packagekit support
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
2.26.x
Other All
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-07 13:14 UTC by James Westby
Modified: 2009-04-08 11:23 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
detect the presence of packagekit on the session bus at runtime (8.83 KB, patch)
2009-04-07 18:34 UTC, James Westby
none Details | Review

Description James Westby 2009-04-07 13:14:14 UTC
Hi,

If nautilus is compiled with packagekit support for installing applications
when a user tries to open a file with unknown mime type then it assumes
packagekit is always available. However, packagekit is a dbus service, so
it doesn't have to be.

If packagekit isn't installed then you get the "search for applications"
dialog, and then immediately an error. Nautilus should instead check whether
packagekit is available before showing the dialog.

Thanks,

James


Other information:
Comment 1 James Westby 2009-04-07 18:34:41 UTC
Created attachment 132289 [details] [review]
detect the presence of packagekit on the session bus at runtime

Hi,

Here's my proposed patch to detect packagekit at runtime, and show
the unhelpful dialog if it is not present on the bus.

PackageKit doesn't support activation on the session bus currently,
so this is good enough. If that ever changes then this may want to
try and start it instead of just looking for it.

I would appreciate review and testing of this as I spend most of my
time coding single threaded python, so there's a high chance of
problems. I may seek inclusion of this change in to the Ubuntu
packages to attempt to give those who want to use PackageKit a
better experience. (As we don't have it by default we should
really turn of this feature in gconf. Even with this change
there is a secondary issue that our PackageKit is too old
to have the right method, so this still fails, so we may
disable it anyway, I'm going to talk to seb128 about it).

Thanks,

James
Comment 2 Alexander Larsson 2009-04-08 10:13:45 UTC
Its kinda g_warning happy in case packagekit is not around. Maybe we should drop that.
Comment 3 Alexander Larsson 2009-04-08 10:16:16 UTC
otherwise it looks good to me, i've asked the packagekit author (who did the initial work on this in nautilus) to look at it too.
Comment 4 Richard Hughes 2009-04-08 10:21:00 UTC
cc1: warnings being treated as errors
nautilus-mime-actions.c: In function ‘packagekit_present_dbus_call_notify_cb’:
nautilus-mime-actions.c:1343: error: unused variable ‘remote’

I'll test it in a few minutes.
Comment 5 Richard Hughes 2009-04-08 10:51:12 UTC
Seems to work fine for me when the compile error is fixed.
Comment 6 Alexander Larsson 2009-04-08 11:13:11 UTC
commited.
Comment 7 James Westby 2009-04-08 11:23:49 UTC
Thanks.