<div dir="ltr"><div>ack series,<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jun 19, 2013 at 5:33 PM, Christophe Fergeau <span dir="ltr"><<a href="mailto:cfergeau@redhat.com" target="_blank">cfergeau@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">As there is no easy way to know if the SpiceSmartcardManager<br>
has an associated software reader or not, it's better to report<br>
failure instead of g_return_if_fail on attempts to use<br>
spice_smartcard_manager_insert/remove_card with no software reader<br>
available.<br>
---<br>
gtk/smartcard-manager.c | 6 ++++--<br>
1 file changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/gtk/smartcard-manager.c b/gtk/smartcard-manager.c<br>
index 51f228a..3b86dfb 100644<br>
--- a/gtk/smartcard-manager.c<br>
+++ b/gtk/smartcard-manager.c<br>
@@ -552,7 +552,8 @@ gboolean spice_smartcard_manager_insert_card(SpiceSmartcardManager *manager)<br>
{<br>
VCardEmulError status;<br>
<br>
- g_return_val_if_fail(manager->priv->software_reader != NULL, FALSE);<br>
+ if (manager->priv->software_reader != NULL)<br>
+ return FALSE;<br>
<br>
status = vcard_emul_force_card_insert(manager->priv->software_reader);<br>
<br>
@@ -574,7 +575,8 @@ gboolean spice_smartcard_manager_remove_card(SpiceSmartcardManager *manager)<br>
{<br>
VCardEmulError status;<br>
<br>
- g_return_val_if_fail(manager->priv->software_reader != NULL, FALSE);<br>
+ if (manager->priv->software_reader != NULL)<br>
+ return FALSE;<br>
<br>
status = vcard_emul_force_card_remove(manager->priv->software_reader);<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.8.2.1<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div>