Blob Blame History Raw
From 625811155b4114b5504e6cf3e7f7888b6eb669ad Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Tue, 23 Feb 2016 14:25:26 +0100
Subject: [PATCH] Allow different logins to the same host

Allow to open connection with different usernames to the same host.

https://bugzilla.gnome.org/show_bug.cgi?id=746730
---
 vinagre/vinagre-window.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vinagre/vinagre-window.c b/vinagre/vinagre-window.c
index 09b4812..bc00d12 100644
--- a/vinagre/vinagre-window.c
+++ b/vinagre/vinagre-window.c
@@ -1103,7 +1103,7 @@ vinagre_window_conn_exists (VinagreWindow *window, VinagreConnection *conn)
 {
   VinagreConnection *c;
   VinagreTab *tab;
-  const gchar *host, *protocol;
+  const gchar *host, *protocol, *username;
   gint port;
   GList *conns, *l;
 
@@ -1111,6 +1111,7 @@ vinagre_window_conn_exists (VinagreWindow *window, VinagreConnection *conn)
   g_return_val_if_fail (VINAGRE_IS_CONNECTION (conn), NULL);
 
   host = vinagre_connection_get_host (conn);
+  username = vinagre_connection_get_username (conn);
   protocol = vinagre_connection_get_protocol (conn);
   port = vinagre_connection_get_port (conn);
 
@@ -1125,6 +1126,7 @@ vinagre_window_conn_exists (VinagreWindow *window, VinagreConnection *conn)
       c = VINAGRE_CONNECTION (l->data);
 
       if (!strcmp (host, vinagre_connection_get_host (c)) &&
+	  g_strcmp0 (username, vinagre_connection_get_username (c)) == 0 &&
 	  !strcmp (protocol, vinagre_connection_get_protocol (c)) &&
 	  port == vinagre_connection_get_port (c))
 	{
-- 
2.5.0