Updated licenses to all files
[vlc-remote] / accountdialog.cpp
index 7ca7502..4c8a5fa 100644 (file)
@@ -1,3 +1,20 @@
+/*   VLC-REMOTE for MAEMO 5
+*   Copyright (C) 2010 Schutz Sacha <istdasklar@gmail.com>, Dru Moore <usr@dru-id.co.uk>
+*   This program is free software; you can redistribute it and/or modify
+*   it under the terms of the GNU General Public License version 2,
+*   or (at your option) any later version, as published by the Free
+*   Software Foundation
+*
+*   This program is distributed in the hope that it will be useful,
+*   but WITHOUT ANY WARRANTY; without even the implied warranty of
+*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*   GNU General Public License for more details
+*
+*   You should have received a copy of the GNU General Public
+*   License along with this program; if not, write to the
+*   Free Software Foundation, Inc.,
+*   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+*/
 #include "accountdialog.h"
 #include "ui_accountdialog.h"
 #include "newaccountdialog.h"
@@ -115,17 +132,22 @@ QListWidgetItem AccountDialog::asyncTestItem(const QListWidgetItem& item)
     QTcpSocket * socket = new QTcpSocket;
     QSettings settings;
     QString host = settings.value("account/"+item.text()).toString();
-    QStringList hostSplit = host.split(":");
-    QString ip   = hostSplit.at(0);
-    QString port = hostSplit.at(1);
 
+    if(host.contains(":"))
+    {
+        QStringList hostSplit = host.split(":");
+        QString ip   = hostSplit.at(0);
+        QString port = hostSplit.at(1);
+        socket->connectToHost(ip,port.toInt());
+    }
 
-    socket->connectToHost(ip,port.toInt());
+    else
+        socket->connectToHost(host,8080);
 
     if (socket->waitForConnected(1000))
         newItem.setIcon(QIcon::fromTheme("widgets_tickmark_list"));
     else
-         newItem.setIcon(QIcon::fromTheme("statusarea_presence_busy_error"));
+        newItem.setIcon(QIcon::fromTheme("statusarea_presence_busy_error"));
 
     return newItem;