+
+ is_number = TRUE;
+ s = g_variant_get_string(option->value, NULL);
+ for (i = 0; i < (int)strlen(s); i++) {
+ if (!isdigit(s[i]))
+ is_number = FALSE;
+ }
+
+ if (is_number) {
+ /* Integer option value */
+ g_hash_table_insert(opts, option->key,
+ g_variant_new_int64(strtoull(s, NULL, 10)));
+ } else {
+ /* String option value */
+ g_hash_table_insert(opts, option->key, option->value);
+ }