[virt-viewer v2 2/4] Handle virt_viewer_app_start() errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



remote_viewer_deactivated() can be calling virt_viewer_app_start()
without checking whether it returns TRUE or FALSE. It returns FALSE
when it was not successful (when it failed to parse the URI to connect
to for example, or whe the user presses Cancel in the connection dialog).

This means that if the user starts remote-viewer, enters a valid URI
in the connection dialog to which it cannot connect to
(spice://example.com:999) and then presses Cancel in the connection
dialog that appears after the connection  failure, then remote-viewer
will be sitting there with an empty window doing nothing.

This commit ensures we chain to the parent class when
virt_viewer_app_start() returns FALSE, which causes remote-viewer to
exit.
---
 src/remote-viewer.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 5d111a9..6283b4f 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -160,8 +160,9 @@ remote_viewer_deactivated(VirtViewerApp *app, gboolean connect_error)
     RemoteViewerPrivate *priv = self->priv;
 
     if (connect_error && priv->open_recent_dialog) {
-        virt_viewer_app_start(app);
-        return;
+        if (virt_viewer_app_start(app)) {
+            return;
+        }
     }
 
     VIRT_VIEWER_APP_CLASS(remote_viewer_parent_class)->deactivated(app, connect_error);
-- 
1.8.3.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux