426
429
dbusmenu_server_finalize (GObject *object)
431
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object);
433
if (priv->icon_dirs != NULL) {
434
g_strfreev(priv->icon_dirs);
435
priv->icon_dirs = NULL;
428
438
G_OBJECT_CLASS (dbusmenu_server_parent_class)->finalize (object);
744
754
return g_variant_new_uint32(DBUSMENU_VERSION_NUMBER);
745
755
} else if (g_strcmp0(property, "TextDirection") == 0) {
746
756
return g_variant_new_string(dbusmenu_text_direction_get_nick(priv->text_direction));
757
} else if (g_strcmp0(property, "IconThemePath") == 0) {
758
GVariant * dirs = NULL;
760
if (priv->icon_dirs != NULL) {
761
dirs = g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1);
763
dirs = g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0);
747
767
} else if (g_strcmp0(property, "Status") == 0) {
748
768
return g_variant_new_string(dbusmenu_status_get_nick(priv->status));
1731
* dbusmenu_server_get_icon_paths:
1732
* @server: The #DbusmenuServer to get the icon paths from
1734
* Gets the stored and exported icon paths from the server.
1736
* Return value: (transfer none): A NULL-terminated list of icon paths with
1737
* memory managed by the server. Duplicate if you want
1741
dbusmenu_server_get_icon_paths (DbusmenuServer * server)
1743
g_return_val_if_fail(DBUSMENU_IS_SERVER(server), NULL);
1744
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
1745
return priv->icon_dirs;
1749
dbusmenu_server_set_icon_paths:
1750
@server: The #DbusmenuServer to set the icon paths on
1752
Sets the icon paths for the server. This will replace previously
1753
set icon theme paths.
1756
dbusmenu_server_set_icon_paths (DbusmenuServer * server, GStrv icon_paths)
1758
g_return_if_fail(DBUSMENU_IS_SERVER(server));
1759
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
1761
if (priv->icon_dirs != NULL) {
1762
g_strfreev(priv->icon_dirs);
1763
priv->icon_dirs = NULL;
1766
if (icon_paths != NULL) {
1767
priv->icon_dirs = g_strdupv(icon_paths);
1770
if (priv->bus != NULL && priv->dbusobject != NULL) {
1771
GVariantBuilder params;
1772
g_variant_builder_init(¶ms, G_VARIANT_TYPE_TUPLE);
1773
g_variant_builder_add_value(¶ms, g_variant_new_string(DBUSMENU_INTERFACE));
1774
GVariant * items = NULL;
1775
if (priv->icon_dirs != NULL) {
1776
GVariant * dict = g_variant_new_dict_entry(g_variant_new_string("IconThemePath"), g_variant_new_strv((const gchar * const *)priv->icon_dirs, -1));
1777
items = g_variant_new_array(NULL, &dict, 1);
1779
items = g_variant_new_array(G_VARIANT_TYPE("{sv}"), NULL, 0);
1781
g_variant_builder_add_value(¶ms, items);
1782
g_variant_builder_add_value(¶ms, g_variant_new_array(G_VARIANT_TYPE_STRING, NULL, 0));
1783
GVariant * vparams = g_variant_builder_end(¶ms);
1785
g_dbus_connection_emit_signal(priv->bus,
1788
"org.freedesktop.DBus.Properties",
1789
"PropertiesChanged",