diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2011-12-30 12:37:40 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-03 15:53:22 +0100 |
commit | 1dc81e3d556da4abef195803a6c2742bf40ff8a5 (patch) | |
tree | 22bd62566788249bf8fabc7f864cec44bbc9b7cf /tools | |
parent | 5f6b0ec78e4db900789c40afd05b71e1e846bcc1 (diff) |
Added JsonDbClient::setAutoReconnect()
Made it optional to automatically reconnect to the server if the connection is
lost.
Also added explicit connectToServer() and disconnectFromServer() functions.
Change-Id: I578c2024f474b515e2dfa009ff4150020bc4378d
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/jsondb-client/client.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp index 70197e02..c45616b9 100644 --- a/tools/jsondb-client/client.cpp +++ b/tools/jsondb-client/client.cpp @@ -321,7 +321,8 @@ void Client::usage() { std::stringstream out; out << "Valid commands:" << std::endl - << std::endl + << " connect" << std::endl + << " disconnect" << std::endl << "Direct database commands - these take an explict object" << std::endl << " create [partition:<name>] OBJECT" << std::endl << " update [partition:<name>] OBJECT" << std::endl @@ -490,6 +491,10 @@ bool Client::processCommand(const QString &command) qDebug() << "Sending changesSince: " << stateNumber << "types: " << types; mRequests << mConnection->changesSince(stateNumber, types, partition); + } else if (cmd == "connect") { + mConnection->connectToServer(); + } else if (cmd == "disconnect") { + mConnection->disconnectFromServer(); } else if (!cmd.isEmpty()) { InputThread::print("Unrecognized command: " % cmd); usage(); |