]> Some of my projects - tim.git/commitdiff
Configurable server info
authorAPTX <marek321@gmail.com>
Mon, 10 Jan 2011 13:13:39 +0000 (14:13 +0100)
committerAPTX <marek321@gmail.com>
Mon, 10 Jan 2011 13:13:39 +0000 (14:13 +0100)
main.cpp
qml/tim-game/Components/ScoreModel.qml

index 9c157bd5cb9ac8adf678462c98c6c09a9b8195fe..767ee67ffa18e4fc1daaccf241ae72e326c10a6e 100644 (file)
--- 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);
 
index 6214b075ab92b8dd6ff066039edddae12043a029..bd0fb761e25f2e663f5bba2a212812c6772147d7 100644 (file)
@@ -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()" }