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

@ -119,6 +119,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
{
GError *error = NULL;
GArray *fingers;
GHashTable *props;
guint i;
int fingernum;
@ -130,7 +131,10 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
return;
}
g_print("Fingerprints for user %s:\n", username);
if (!net_reactivated_Fprint_Device_get_properties(dev, &props, &error))
g_error("GetProperties failed: %s", error->message);
g_print("Fingerprints for user %s on %s:\n", username, (char *) g_hash_table_lookup (props, "Name"));
for (i = 0; i < fingers->len; i++) {
fingernum = g_array_index(fingers, guint32, i);
g_print(" - #%d: %s\n", fingernum, fingerstr(fingernum));
@ -138,6 +142,7 @@ static void list_fingerprints(DBusGProxy *dev, const char *username)
fingernum = g_array_index(fingers, guint32, 0);
g_array_free(fingers, TRUE);
g_hash_table_destroy (props);
}
int main(int argc, char **argv)