Browse Source

Merge pull request #23 from sbalneav/master

Couple of additional error checks, remove reference to iconsdir, man …
sisyphus
Dustin Falgout 9 years ago
parent
commit
e8699b9dd0
  1. 18
      man/lightdm-webkit2-greeter.1
  2. 16
      src/lightdm-webkit2-greeter-ext.c

18
man/lightdm-webkit2-greeter.1

@ -240,6 +240,24 @@ Array\&. The users that are able to log in\&. Returns an Array of LightDMUser
objects\&. objects\&.
.RE .RE
.PP .PP
The following calls can be made to read configuration keys out of the
lightdm-webkit2-greeter configuration file\&.
.PP
config\&.get_str(section, key)\fR
.RS 4
Returns the string value associated with key under the "section" in the configuration file\&.
.RE
.PP
config\&.get_num(section, key)\fR
.RS 4
Returns the numeric value associated with key under the "section" in the configuration file\&.
.RE
.PP
config\&.get_bool(section, key)\fR
.RS 4
Returns the boolean value associated with key under the "section" in the configuration file\&.
.RE
.PP
Please see the LightDM API documentation for the complete list of calls Please see the LightDM API documentation for the complete list of calls
available\&. The lightdm-webkit2-greeter implements all of the LightDM API\&. available\&. The lightdm-webkit2-greeter implements all of the LightDM API\&.
.PP .PP

16
src/lightdm-webkit2-greeter-ext.c

@ -1039,12 +1039,15 @@ get_conf_str_cb(JSContextRef context,
} }
section = arg_to_string(context, arguments[0], exception); section = arg_to_string(context, arguments[0], exception);
if (!section) { if (!section) {
return JSValueMakeNull(context); return JSValueMakeNull(context);
} }
key = arg_to_string(context, arguments[1], exception); key = arg_to_string(context, arguments[1], exception);
if (!key) {
return JSValueMakeNull(context);
}
value = g_key_file_get_string(keyfile, section, key, &err); value = g_key_file_get_string(keyfile, section, key, &err);
if (err) { if (err) {
@ -1083,12 +1086,15 @@ get_conf_num_cb(JSContextRef context,
} }
section = arg_to_string(context, arguments[0], exception); section = arg_to_string(context, arguments[0], exception);
if (!section) { if (!section) {
return JSValueMakeNull(context); return JSValueMakeNull(context);
} }
key = arg_to_string(context, arguments[1], exception); key = arg_to_string(context, arguments[1], exception);
if (!key) {
return JSValueMakeNull(context);
}
value = g_key_file_get_integer(keyfile, section, key, &err); value = g_key_file_get_integer(keyfile, section, key, &err);
if (err) { if (err) {
@ -1123,12 +1129,15 @@ get_conf_bool_cb(JSContextRef context,
} }
section = arg_to_string(context, arguments[0], exception); section = arg_to_string(context, arguments[0], exception);
if (!section) { if (!section) {
return JSValueMakeNull(context); return JSValueMakeNull(context);
} }
key = arg_to_string(context, arguments[1], exception); key = arg_to_string(context, arguments[1], exception);
if (!key) {
return JSValueMakeNull(context);
}
value = g_key_file_get_boolean(keyfile, section, key, &err); value = g_key_file_get_boolean(keyfile, section, key, &err);
if (err) { if (err) {
@ -1200,7 +1209,6 @@ static const JSStaticValue lightdm_greeter_values[] = {
{"autologin_user", get_autologin_user_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_user", get_autologin_user_cb, NULL, kJSPropertyAttributeReadOnly},
{"autologin_guest", get_autologin_guest_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_guest", get_autologin_guest_cb, NULL, kJSPropertyAttributeReadOnly},
{"autologin_timeout", get_autologin_timeout_cb, NULL, kJSPropertyAttributeReadOnly}, {"autologin_timeout", get_autologin_timeout_cb, NULL, kJSPropertyAttributeReadOnly},
{"iconsdir", get_iconsdir_cb, NULL, kJSPropertyAttributeReadOnly},
{NULL, NULL, NULL, 0}}; {NULL, NULL, NULL, 0}};
static const JSStaticFunction lightdm_greeter_functions[] = { static const JSStaticFunction lightdm_greeter_functions[] = {

Loading…
Cancel
Save