Thank you Colin, that makes sense -- and it all works now!<div><br></div><div>The following is not for you, but for those who are looking through the mailing list archives for this in the future.</div><div><br></div><div>An example on how to do what Colin describes:</div>
<div><br></div><div><div>#ifndef G_VALUE_INIT</div><div>#define G_VALUE_INIT {0,{{0}}}</div><div>#endif</div></div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">        </span>private gboolean query_pid_for_dbus_support_and_aid(self,const GPid pid,gchar** OUT_new_aid, DBusGProxy** OUT_new_proxy_main, DBusGProxy** OUT_new_proxy_prop)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>gboolean ret = FALSE;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>char* bus_name = NULL;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>DBusGProxy* proxy_main = NULL;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>DBusGProxy* proxy_prop = NULL;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>GError* error = NULL;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>GValue value = G_VALUE_INIT;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>do</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>{</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>bus_name = g_strdup_printf(&quot;org.ude.application.pid_%d&quot;,pid);</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>proxy_main = dbus_g_proxy_new_for_name_owner(selfp-&gt;dbus,bus_name,&quot;/org/ude/application&quot;,&quot;org.ude.application&quot;,&amp;error);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>if (NULL == proxy_main) {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>ret = FALSE;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>break;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>proxy_prop = dbus_g_proxy_new_for_name_owner(selfp-&gt;dbus,bus_name,&quot;/org/ude/application&quot;,&quot;org.freedesktop.DBus.Properties&quot;,&amp;error);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>if (NULL == proxy_prop) {</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>ret = FALSE;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>g_print(&quot;!%s() could not get org.freedesktop.DBus.Properties proxy for pid %d error:%s\n&quot;,__GOB_FUNCTION__,pid,error-&gt;message);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>break;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>if (dbus_g_proxy_call(proxy_prop,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  &quot;Get&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  &amp;error,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  G_TYPE_STRING,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  &quot;org.ude.application&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  G_TYPE_STRING,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  &quot;ApplicationIdentifier&quot;,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  G_TYPE_INVALID,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  G_TYPE_VALUE,</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  &amp;value,</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  G_TYPE_INVALID</div><div><span class="Apple-tab-span" style="white-space:pre">                                                                </span>  ))</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>// success</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>ret = TRUE;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if (NULL != OUT_new_aid) {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>*OUT_new_aid = g_value_dup_string(&amp;value);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if (NULL != OUT_new_proxy_main) {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>*OUT_new_proxy_main = g_object_ref(proxy_main);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>if (NULL != OUT_new_proxy_prop) {</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>*OUT_new_proxy_prop = g_object_ref(proxy_prop);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>ret = FALSE;</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>g_warning(&quot;%s() unable to call get on ApplicationIdentifier ABORTing update!&quot;,__GOB_FUNCTION__);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>break;</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>while (0);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>if (G_IS_VALUE(&amp;value)) { g_value_unset (&amp;value); }</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if (NULL != bus_name) { g_free(bus_name); bus_name = NULL; }</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>if (NULL != proxy_main) { g_object_unref(proxy_main); proxy_main = NULL; }</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>if (NULL != proxy_prop) { g_object_unref(proxy_prop); proxy_prop = NULL; }</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>if (NULL != error) { g_error_free(error); error = NULL; }</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return ret;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<br><div class="gmail_quote">On Fri, Mar 26, 2010 at 8:19 AM, Colin Walters <span dir="ltr">&lt;<a href="mailto:walters@verbum.org">walters@verbum.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<div class="im"><br>
On Fri, Mar 26, 2010 at 1:22 AM, Dan Saul &lt;<a href="mailto:daniel.saul@gmail.com">daniel.saul@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt; Newbie question here. Using DbusG, how do I fetch a property?<br>
<br>
</div>There&#39;s no shortcut or &quot;sugar&quot; for this in dbus-glib currently; you<br>
need to create a proxy for org.freedesktop.DBus.Properties like you<br>
would for any other interface , and call the &quot;Get&quot; method manually.<br>
</blockquote></div><br></div>