Add device name property

Add GetProperties method, with a single "Name" properties into
the hashtable.
Use the device name property in the PAM module, and in the list test.
This commit is contained in:
Bastien Nocera
2008-11-19 15:22:29 +00:00
committed by Daniel Drake
parent 69c131f723
commit 924e08d2e8
5 changed files with 46 additions and 8 deletions

View File

@ -54,6 +54,9 @@ static void fprint_device_list_enrolled_fingers(FprintDevice *rdev,
static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
const char *username,
DBusGMethodInvocation *context);
static void fprint_device_get_properties (FprintDevice *rdev,
GHashTable **props,
DBusGMethodInvocation *context);
#include "device-dbus-glue.h"
@ -1034,3 +1037,22 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
dbus_g_method_return(context);
}
static void
fprint_device_get_properties (FprintDevice *rdev,
GHashTable **props,
DBusGMethodInvocation *context)
{
FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(rdev);
GHashTable *table;
struct fp_driver *driver;
const char *driver_name;
table = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
driver = fp_dscv_dev_get_driver (priv->ddev);
driver_name = fp_driver_get_full_name (driver);
g_hash_table_insert (table, "Name", g_strdup (driver_name));
*props = table;
}