[glibmm] DBusProxy: Add get_cached_property().



commit 75c93c1b1fb87dfafc088485c51b7cc935d9bd9e
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Oct 26 16:17:17 2010 -0400

    	DBusProxy: Add get_cached_property().
    
    	* gio/src/dbusproxy.{ccg,hg}: Add get_cached_property(), wrapping
    	g_dbus_proxy_get_cached_property().  Also add missing _IGNORE().

 ChangeLog             |    7 +++++++
 gio/src/dbusproxy.ccg |   10 ++++++++++
 gio/src/dbusproxy.hg  |   22 ++++++++++++++++++++--
 3 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fa4ea7c..7621961 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-10-26  José Alburquerque  <jaalburqu svn gnome org>
+
+	DBusProxy: Add get_cached_property().
+
+	* gio/src/dbusproxy.{ccg,hg}: Add get_cached_property(), wrapping
+	g_dbus_proxy_get_cached_property().  Also add missing _IGNORE().
+
 2.27.1:
 
 2010-10-26  José Alburquerque  <jaalburqu svn gnome org>
diff --git a/gio/src/dbusproxy.ccg b/gio/src/dbusproxy.ccg
index 975b72c..3259168 100644
--- a/gio/src/dbusproxy.ccg
+++ b/gio/src/dbusproxy.ccg
@@ -136,6 +136,16 @@ Glib::RefPtr<DBusProxy> DBusProxy::create_for_bus(BusType bus_type,
     object_path, interface_name, cancellable));
 }
 
+void DBusProxy::get_cached_property(Glib::VariantBase& property,
+  const Glib::ustring& property_name) const
+{
+  GVariant* const g_variant =
+    g_dbus_proxy_get_cached_property(const_cast<GDBusProxy*>(gobj()),
+    property_name.c_str());
+
+  property.init(g_variant, false /* no extra reference needed */);
+}
+
 void DBusProxy::call(const Glib::ustring& method_name,
   int timeout_msec, const SlotAsyncReady& slot, DBusCallFlags flags,
   const Glib::VariantBase& parameters,
diff --git a/gio/src/dbusproxy.hg b/gio/src/dbusproxy.hg
index 43e72e9..a3f56e6 100644
--- a/gio/src/dbusproxy.hg
+++ b/gio/src/dbusproxy.hg
@@ -144,7 +144,23 @@ public:
   _WRAP_METHOD(int get_default_timeout() const, g_dbus_proxy_get_default_timeout)
   _WRAP_METHOD(void set_default_timeout(int timeout_msec), g_dbus_proxy_set_default_timeout)
 
-  //TODO: _WRAP_METHOD(Variant* get_cached_property(const gchar* property_name), g_dbus_proxy_get_cached_property)
+  /** Looks up the value for a property from the cache. This call does no
+   * blocking IO.
+   *
+   * If proxy has an expected interface (see property_interface_info()), then
+   * @a property_name (for existence) is checked against it.
+   *
+   * @param property_name Property name.
+   *
+   * @param property An output parameter in which to hold to the variant
+   * instance that holds the value for @a property_name.
+   *
+   * @newin{2,26}
+   */
+  void get_cached_property(Glib::VariantBase& property,
+    const Glib::ustring& property_name) const;
+  _IGNORE(g_dbus_proxy_get_cached_property)
+
   _WRAP_METHOD(void set_cached_property(const Glib::ustring& property_name, const Glib::VariantBase& value), g_dbus_proxy_set_cached_property)
 
 #m4 _CONVERSION(`gchar**', `Glib::StringArrayHandle', `Glib::StringArrayHandle($3)')
@@ -191,6 +207,7 @@ public:
     DBusCallFlags flags = Gio::DBUS_CALL_FLAGS_NONE,
     const Glib::VariantBase& parameters = Glib::VariantBase(),
     const Glib::RefPtr<Cancellable>& cancellable = Glib::RefPtr<Cancellable>());
+  _IGNORE(g_dbus_proxy_call_sync)
 
  _WRAP_PROPERTY("g-bus-type", BusType)
  _WRAP_PROPERTY("g-connection", Glib::RefPtr<DBusConnection>)
@@ -204,7 +221,8 @@ public:
 
 #m4 _CONVERSION(`GVariant*', `const Glib::VariantBase&', `Glib::wrap($3, true)')
 
-//TODO: It's difficult to figure out conversions from/to GStrv (gchar**) to/from std::vector<Glib::ustring>
+  //TODO: It's difficult to figure out conversions from/to GStrv (gchar**)
+  //to/from std::vector<Glib::ustring>
  //_WRAP_SIGNAL(void properties_changed(const Glib::VariantBase& changed_properties, const std::vector<Glib::ustring>& invalidated_properties), g-properties-changed)
 
  _WRAP_SIGNAL(void signal(const Glib::ustring& sender_name, const Glib::ustring& signal_name, const Glib::VariantBase& parameters), "g-signal")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]