mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
Fix return value for GetDefaultDevice
Tell the front-end there's no devices available when there isn't any, instead of erroring out.
This commit is contained in:
committed by
Daniel Drake
parent
64e415aaac
commit
69e987b335
@ -43,6 +43,7 @@ typedef enum {
|
||||
FPRINT_ERROR_NO_ENROLLED_PRINTS, /* No prints are enrolled */
|
||||
FPRINT_ERROR_NO_ACTION_IN_PROGRESS, /* No actions currently in progress */
|
||||
FPRINT_ERROR_INVALID_FINGERNAME, /* the finger name passed was invalid */
|
||||
FPRINT_ERROR_NO_SUCH_DEVICE, /* device does not exist */
|
||||
} FprintError;
|
||||
|
||||
/* Manager */
|
||||
|
||||
@ -185,6 +185,8 @@ static gboolean fprint_manager_get_default_device(FprintManager *manager,
|
||||
*device = get_device_path (elem->data);
|
||||
return TRUE;
|
||||
} else {
|
||||
g_set_error (error, FPRINT_ERROR, FPRINT_ERROR_NO_SUCH_DEVICE,
|
||||
"No devices available");
|
||||
*device = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
@ -214,6 +216,7 @@ fprint_error_get_type (void)
|
||||
ENUM_ENTRY (FPRINT_ERROR_NO_ENROLLED_PRINTS, "NoEnrolledPrints"),
|
||||
ENUM_ENTRY (FPRINT_ERROR_NO_ACTION_IN_PROGRESS, "NoActionInProgress"),
|
||||
ENUM_ENTRY (FPRINT_ERROR_INVALID_FINGERNAME, "InvalidFingername"),
|
||||
ENUM_ENTRY (FPRINT_ERROR_NO_SUCH_DEVICE, "NoSuchDevice"),
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
etype = g_enum_register_static ("FprintError", values);
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE node PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" [
|
||||
<!ENTITY ERROR_NO_SUCH_DEVICE "net.reactivated.Fprint.Error.NoSuchDevice">
|
||||
]>
|
||||
<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd">
|
||||
<interface name="net.reactivated.Fprint.Manager">
|
||||
<annotation name="org.freedesktop.DBus.GLib.CSymbol"
|
||||
@ -14,7 +18,8 @@
|
||||
<doc:doc>
|
||||
<doc:description>
|
||||
<doc:para>
|
||||
Enumerate all the fingerprint readers attached to the system.
|
||||
Enumerate all the fingerprint readers attached to the system. If there are
|
||||
no devices available, an empty array is returned.
|
||||
</doc:para>
|
||||
</doc:description>
|
||||
</doc:doc>
|
||||
@ -33,6 +38,10 @@
|
||||
Returns the default fingerprint reader device.
|
||||
</doc:para>
|
||||
</doc:description>
|
||||
|
||||
<doc:errors>
|
||||
<doc:error name="&ERROR_NO_SUCH_DEVICE;">if the device does not exist</doc:error>
|
||||
</doc:errors>
|
||||
</doc:doc>
|
||||
</method>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user