diff options
author | Jamey Hicks <jamey.hicks@nokia.com> | 2012-03-01 17:14:02 -0500 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-02 17:33:06 +0100 |
commit | 96dde3cfc0f07d3d94b88407192c74c90b4401d4 (patch) | |
tree | 4185a11baacff18a16b7e86b762a78a852aa8cab /tools | |
parent | cd78fd163e32ff1e1e661cd8f7518889bc94bb85 (diff) |
added load command to jsondb-client.
Change-Id: I5240d38a1615dfe70fa24122a4a0b13b424f69a6
Reviewed-by: Kevin Simons <kevin.simons@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/jsondb-client/client.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp index 7a47ae3a..ae0316cc 100644 --- a/tools/jsondb-client/client.cpp +++ b/tools/jsondb-client/client.cpp @@ -56,6 +56,7 @@ QT_USE_NAMESPACE const char* InputThread::commands[] = { "changesSince", "create {\"", "help", + "load", "notify create [?", "notify remove [?", "notify update [?", @@ -373,6 +374,7 @@ void Client::usage() << " remove [partition:<name>] QUERY" << std::endl << " find [partition:<name>] QUERY" << std::endl << " changesSince [partition:<name>] STATENUMBER [type1 type2 ...]" << std::endl + << " load FILE1 FILE2 ..." << std::endl << std::endl << "Convenience functions" << std::endl << " query STRING [limit]" << std::endl @@ -517,6 +519,14 @@ bool Client::processCommand(const QString &command) this, SLOT(onRequestError(QtJsonDb::QJsonDbRequest::ErrorCode,QString))); pushRequest(request); mConnection->send(request); + } else if (cmd == "load") { + QStringList filenames = rest.split(' '); + for (int i = 0; i < filenames.size(); i++) { + QString filename = filenames[i]; + if (filename.startsWith('"')) + filenames[i] = filename.mid(1, filename.size()-2); + } + loadFiles(filenames); } else if (cmd == "changesSince") { qWarning() << "Not yet supported"; } else if (cmd == "connect") { @@ -566,7 +576,7 @@ void Client::loadNextFile() if (mFilesToLoad.isEmpty()) { if (mTerminate) emit terminate(); - else + else if (!mInputThread) interactiveMode(); return; } |