From: APTX Date: Mon, 10 Jan 2011 13:13:39 +0000 (+0100) Subject: Configurable server info X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=70f01323ca84aa53977fce08a613b12269491a81;p=tim.git Configurable server info --- diff --git a/main.cpp b/main.cpp index 9c157bd..767ee67 100644 --- a/main.cpp +++ b/main.cpp @@ -8,13 +8,20 @@ int main(int argc, char *argv[]) { - QString serverUrl = "http://localhost/tim/index.php"; - QString tcphost = "localhost"; + QString serverUrl = "http://aptx.dyndns.org/~aptx/tim-server/"; + QString tcphost = "aptx.dyndns.org"; int tcpport = 8547; QApplication app(argc, argv); QCoreApplication::setApplicationName("Tim Game"); + if (app.arguments().size() >= 4) + { + serverUrl = app.arguments()[1]; + tcphost = app.arguments()[2]; + tcpport = app.arguments()[3].toInt(); + } + TimGame timGame(serverUrl); ChatClient chatClient(tcphost, tcpport); diff --git a/qml/tim-game/Components/ScoreModel.qml b/qml/tim-game/Components/ScoreModel.qml index 6214b07..bd0fb76 100644 --- a/qml/tim-game/Components/ScoreModel.qml +++ b/qml/tim-game/Components/ScoreModel.qml @@ -7,7 +7,7 @@ Item { id: wrapper XmlListModel { id: scoreModel - source: "http://localhost/tim/index.php?a=score" + source: timGame.serverUrl + "?a=score" query: "/message/scores/entry" XmlRole { name: "position"; query: "position/string()" }