MCPcopy Create free account
hub / github.com/Alexays/Waybar / getOptionalStringProperty

Function getOptionalStringProperty

src/modules/bluetooth.cpp:52–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52auto getOptionalStringProperty(GDBusProxy* proxy, const char* property_name)
53 -> std::optional<std::string> {
54 auto gvar = g_dbus_proxy_get_cached_property(proxy, property_name);
55 if (gvar) {
56 std::string property_value = g_variant_get_string(gvar, NULL);
57 g_variant_unref(gvar);
58 return property_value;
59 }
60
61 return std::nullopt;
62}
63
64auto getStringProperty(GDBusProxy* proxy, const char* property_name) -> std::string {
65 auto property_value = getOptionalStringProperty(proxy, property_name);

Callers 2

getStringPropertyFunction · 0.85
getDevicePropertiesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected