* Converts a D-Bus response for a RequiresSlot to a struct RequiresSlot * item. * * @param result The destination RequiresSlot where the data is to be put * @param indata A GVariant object containing the response from a D-Bus * call. The type string is strict and needs to match * between the sender (D-Bus service) and the receiver
| 257 | * (this class). |
| 258 | */ |
| 259 | struct RequiresSlot deserialize(GVariant *indata) |
| 260 | { |
| 261 | struct RequiresSlot result; |
| 262 | |
| 263 | if (!indata) |
| 264 | { |
| 265 | throw RequiresQueueException("indata GVariant pointer is NULL"); |
| 266 | } |
| 267 | |
| 268 | std::string data_type = std::string(g_variant_get_type_string(indata)); |
| 269 | if ("(uuussb)" != data_type) |
| 270 | { |
| 271 | throw RequiresQueueException("Failed parsing the requires queue result"); |
| 272 | } |
| 273 | |
| 274 | result.type = glib2::Value::Extract<ClientAttentionType>(indata, 0); |
| 275 | result.group = glib2::Value::Extract<ClientAttentionGroup>(indata, 1); |
| 276 | result.id = glib2::Value::Extract<uint32_t>(indata, 2); |
| 277 | result.name = glib2::Value::Extract<std::string>(indata, 3); |
| 278 | result.user_description = glib2::Value::Extract<std::string>(indata, 4); |
| 279 | result.hidden_input = glib2::Value::Extract<bool>(indata, 5); |
| 280 | return result; |
| 281 | } |
| 282 | }; |
nothing calls this directly
no test coverage detected