Fix _get_error() in the manager

Fix wrong assumption of semantics when fp_discover_devs()
returns NULL.
This commit is contained in:
Bastien Nocera
2008-05-14 18:25:40 +01:00
committed by Daniel Drake
parent 5dafd66eb8
commit 3a0152e124
3 changed files with 5 additions and 1 deletions

View File

@ -1 +1,2 @@
src/main.c src/main.c
src/manager.c

View File

@ -31,6 +31,7 @@ GQuark fprint_error_quark(void);
/* Errors */ /* Errors */
#define FPRINT_ERROR fprint_error_quark() #define FPRINT_ERROR fprint_error_quark()
typedef enum { typedef enum {
FPRINT_ERROR_INTERNAL,
FPRINT_ERROR_DISCOVER_PRINTS, FPRINT_ERROR_DISCOVER_PRINTS,
FPRINT_ERROR_PRINT_NOT_FOUND, FPRINT_ERROR_PRINT_NOT_FOUND,
FPRINT_ERROR_PRINT_LOAD, FPRINT_ERROR_PRINT_LOAD,

View File

@ -19,6 +19,7 @@
#include <dbus/dbus-glib-bindings.h> #include <dbus/dbus-glib-bindings.h>
#include <glib.h> #include <glib.h>
#include <glib/gi18n.h>
#include <libfprint/fprint.h> #include <libfprint/fprint.h>
#include <glib-object.h> #include <glib-object.h>
@ -79,7 +80,8 @@ fprint_manager_init (FprintManager *manager)
int i = 0; int i = 0;
if (!discovered_devs) { if (!discovered_devs) {
priv->last_error = g_error_new (0, 0, "NO DEVICES AVAILABLE: FIXME"); priv->last_error = g_error_new (FPRINT_ERROR, FPRINT_ERROR_INTERNAL,
_("An internal error occurred in libfprint"));
return; return;
} }