Bug 45744

Summary: Example in http://www.packagekit.org/pk-faq.html#session-methods should be updated
Product: PackageKit Reporter: Guillaume Desmottes <guillaume.desmottes>
Component: GeneralAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Guillaume Desmottes 2012-02-07 07:16:01 UTC
http://www.packagekit.org/pk-faq.html#session-methods

- The signature of this function changed, it's now (uass)
- GDBus is the future.

Here is a simple, not error safe, port to GDBus, but using the sync API makes me cry.


  xid = GDK_WINDOW_XID (gtk_widget_get_window (dialog));

  proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
      G_DBUS_PROXY_FLAGS_NONE, NULL,
      "org.freedesktop.PackageKit",
      "/org/freedesktop/PackageKit",
      "org.freedesktop.PackageKit.Modify",
      NULL, &error);
  g_assert_no_error (error);

  g_dbus_proxy_call_sync (proxy, "InstallPackageNames",
      g_variant_new ("(u^a&ss)", xid, packages, ""),
      G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
  g_assert_no_error (error);
Comment 1 Richard Hughes 2012-02-07 08:45:11 UTC
commit d414e4233b6801d75dee5423a545c838fd975265
Author: Richard Hughes <richard@hughsie.com>
Date:   Tue Feb 7 16:43:41 2012 +0000

    Port the session example code to GDBus
    
    Resolves: https://bugs.freedesktop.org/show_bug.cgi?id=45744

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.