ack series,
On Wed, Jun 19, 2013 at 5:33 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
As there is no easy way to know if the SpiceSmartcardManager
has an associated software reader or not, it's better to report
failure instead of g_return_if_fail on attempts to use
spice_smartcard_manager_insert/remove_card with no software reader
available.
---
gtk/smartcard-manager.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/gtk/smartcard-manager.c b/gtk/smartcard-manager.c
index 51f228a..3b86dfb 100644
--- a/gtk/smartcard-manager.c
+++ b/gtk/smartcard-manager.c
@@ -552,7 +552,8 @@ gboolean spice_smartcard_manager_insert_card(SpiceSmartcardManager *manager)
{
VCardEmulError status;
- g_return_val_if_fail(manager->priv->software_reader != NULL, FALSE);
+ if (manager->priv->software_reader != NULL)
+ return FALSE;
status = vcard_emul_force_card_insert(manager->priv->software_reader);
@@ -574,7 +575,8 @@ gboolean spice_smartcard_manager_remove_card(SpiceSmartcardManager *manager)
{
VCardEmulError status;
- g_return_val_if_fail(manager->priv->software_reader != NULL, FALSE);
+ if (manager->priv->software_reader != NULL)
+ return FALSE;
status = vcard_emul_force_card_remove(manager->priv->software_reader);
--
1.8.2.1
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel
--
Marc-André Lureau
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel