Skip to content

[WIP] Add a C++ encapsulation of an xfconf channel

Ghost User requested to merge (removed):cpp into master

The goal of this patch is to increase programmer productivity when writing xfconf handling code. For example, it enables replacement of the following three C statements:

    const char *property_base = ...;
    ...
  1 gchar *property = g_strconcat(property_base, "/uptime/enabled", NULL);
  2 xfconf_g_property_bind(channel, property, G_TYPE_BOOLEAN, config, "uptime-enabled");
  3 g_free (property);

with a single C++ statement:

    std::string property_base;
    ...
  1 channel->property_bind(property_base + "/uptime/enabled", G_TYPE_BOOLEAN, config, "uptime-enabled");

In another piece of code, it potentially enables replacement of 5 C statements with 2 C++ statements:

    std::string property_base;
    ...
  1 std::string suffix = "enabled";
  2 channel->property_bind(property_base + "/uptime/" + suffix, G_TYPE_BOOLEAN, config, "uptime-" + suffix);

@skunnyk @andreldm @ochosi Please provide some feedback and thoughts. If xfconf C++ wrappers are acceptable, they can be released in xfconf 4.16.1 so that plugins that are going to be rewritten from RC files to xfconf can begin to use the C++ interface if the plugin maintainers and contributors choose to do so.

Merge request reports