Bug 45744 - Example in http://www.packagekit.org/pk-faq.html#session-methods should be updated
Summary: Example in http://www.packagekit.org/pk-faq.html#session-methods should be up...
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 07:16 UTC by Guillaume Desmottes
Modified: 2012-02-07 08:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.