d588620e70bf15da29cc242e4ae8d86977e8f36a from master; fix hang if you cancel a paused...
[dcpomatic.git] / src / wx / servers_list_dialog.cc
index 49d91fca404be51ab9a3aa1ba7c56155c9d3b593..299ce2f20aee0c2e339515a7049655994afca96c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 */
 
 #include <boost/lexical_cast.hpp>
+#include "lib/server_finder.h"
 #include "servers_list_dialog.h"
 #include "wx_util.h"
 
@@ -60,21 +61,12 @@ ServersListDialog::ServersListDialog (wxWindow* parent)
        s->Layout ();
        s->SetSizeHints (this);
        
-       _server_finder.ServerFound.connect (boost::bind (&ServersListDialog::server_found, this, _1));
+       _server_finder_connection = ServerFinder::instance()->connect (boost::bind (&ServersListDialog::server_found, this, _1));
 }
 
 void
 ServersListDialog::server_found (ServerDescription s)
 {
-       list<ServerDescription>::const_iterator i = _servers.begin();
-       while (i != _servers.end() && i->host_name() != s.host_name()) {
-               ++i;
-       }
-
-       if (i != _servers.end ()) {
-               return;
-       }
-
        wxListItem list_item;
        int const n = _list->GetItemCount ();
        list_item.SetId (n);