summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKevin Simons <kevin.simons@nokia.com>2012-03-22 21:12:17 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-23 16:23:44 +0100
commitc68229f8afc6ca1df4f8153c5a2b19215bc5bdf9 (patch)
tree6080ec8b908827978993c1d930554826a39570a6 /tools
parent84998d9d781a2e2fd318112f27cf0e2f098b82ad (diff)
QLatin1Literal -> QLatin1String in jsondb-client
Also fixed a typo Change-Id: I6bd1a322f12d629b2998b36406018657a270a02c Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/jsondb-client/client.cpp8
-rw-r--r--tools/jsondb-client/jsondbproxy.cpp20
-rw-r--r--tools/jsondb-client/main.cpp8
3 files changed, 18 insertions, 18 deletions
diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp
index decc202b..018bda7a 100644
--- a/tools/jsondb-client/client.cpp
+++ b/tools/jsondb-client/client.cpp
@@ -495,7 +495,7 @@ bool Client::processCommand(const QString &command)
else if (s == QLatin1String("update"))
action = QtJsonDb::QJsonDbWatcher::Updated;
if (action == QtJsonDb::QJsonDbWatcher::Action(0)) {
- InputThread::print("uknown notification type" % s);
+ InputThread::print("unknown notification type" % s);
return false;
}
actions |= action;
@@ -613,12 +613,12 @@ void Client::loadNextFile()
}
QFileInfo info(mFilesToLoad.first());
- if (info.suffix() == QLatin1Literal("json")) {
+ if (info.suffix() == QLatin1String("json")) {
loadJsonFile(info.filePath());
- } else if (info.suffix() == QLatin1Literal("qml")) {
+ } else if (info.suffix() == QLatin1String("qml")) {
loadQmlFile(info.filePath());
#ifndef QTJSONDB_NO_DEPRECATED
- } else if (info.suffix() == QLatin1Literal("js")) {
+ } else if (info.suffix() == QLatin1String("js")) {
loadJavaScriptFile(info.filePath());
#endif
} else {
diff --git a/tools/jsondb-client/jsondbproxy.cpp b/tools/jsondb-client/jsondbproxy.cpp
index 53112202..650f9105 100644
--- a/tools/jsondb-client/jsondbproxy.cpp
+++ b/tools/jsondb-client/jsondbproxy.cpp
@@ -67,9 +67,9 @@ QVariantMap _waitForResponse(QtJsonDb::QJsonDbRequest *request) {
res.insert(QLatin1Literal("result"), data);
} else {
QVariantMap error;
- error.insert(QLatin1Literal("code"), 1);
- error.insert(QLatin1Literal("message"), "Error processing request");
- res.insert(QLatin1Literal("error"), error);
+ error.insert(QLatin1String("code"), 1);
+ error.insert(QLatin1String("message"), "Error processing request");
+ res.insert(QLatin1String("error"), error);
}
return res;
}
@@ -84,9 +84,9 @@ JsonDbProxy::JsonDbProxy(QtJsonDb::QJsonDbConnection *conn, QObject *parent) :
QVariantMap JsonDbProxy::find(QVariantMap object)
{
QtJsonDb::QJsonDbReadRequest *request = new QtJsonDb::QJsonDbReadRequest(this);
- request->setQuery(object.value(QLatin1Literal("query")).toString());
- if (object.contains(QLatin1Literal("limit")))
- request->setQueryLimit(object.value(QLatin1Literal("limit")).toInt());
+ request->setQuery(object.value(QLatin1String("query")).toString());
+ if (object.contains(QLatin1String("limit")))
+ request->setQueryLimit(object.value(QLatin1String("limit")).toInt());
mConnection->send(request);
return _waitForResponse(request);
}
@@ -95,8 +95,8 @@ QVariantMap JsonDbProxy::create(QVariantMap object)
{
// handle the to-be-deprecated _id property
QtJsonDb::QJsonDbObject obj = QJsonObject::fromVariantMap(object);
- if (obj.uuid().isNull() && obj.contains(QLatin1Literal("_id"))) {
- obj.setUuid(QtJsonDb::QJsonDbObject::createUuidFromString(obj.value(QLatin1Literal("_id")).toString()));
+ if (obj.uuid().isNull() && obj.contains(QLatin1String("_id"))) {
+ obj.setUuid(QtJsonDb::QJsonDbObject::createUuidFromString(obj.value(QLatin1String("_id")).toString()));
obj.remove(QLatin1String("_id"));
}
QtJsonDb::QJsonDbCreateRequest *request = new QtJsonDb::QJsonDbCreateRequest(QList<QJsonObject>() << obj,
@@ -126,8 +126,8 @@ QVariantMap JsonDbProxy::createList(QVariantList list)
QList<QJsonObject> objects;
foreach (const QVariant &object, list) {
QtJsonDb::QJsonDbObject obj = QJsonObject::fromVariantMap(object.toMap());
- if (!obj.uuid().isNull() && obj.contains(QLatin1Literal("_id"))) {
- obj.setUuid(QtJsonDb::QJsonDbObject::createUuidFromString(obj.value(QLatin1Literal("_id")).toString()));
+ if (!obj.uuid().isNull() && obj.contains(QLatin1String("_id"))) {
+ obj.setUuid(QtJsonDb::QJsonDbObject::createUuidFromString(obj.value(QLatin1String("_id")).toString()));
obj.remove(QLatin1String("_id"));
}
objects << obj;
diff --git a/tools/jsondb-client/main.cpp b/tools/jsondb-client/main.cpp
index 1a1867f1..b389131b 100644
--- a/tools/jsondb-client/main.cpp
+++ b/tools/jsondb-client/main.cpp
@@ -94,17 +94,17 @@ int main(int argc, char * argv[])
continue;
}
- if (arg == QLatin1Literal("-help")) {
+ if (arg == QLatin1String("-help")) {
usage(progname);
- } else if (arg == QLatin1Literal("-debug")) {
+ } else if (arg == QLatin1String("-debug")) {
debug = true;
- } else if (arg == QLatin1Literal("-load")) {
+ } else if (arg == QLatin1String("-load")) {
if (args.isEmpty()) {
cout << "Must specify a file to load" << endl;
usage(progname, 1);
}
filesToLoad << args.takeFirst();
- } else if (arg == QLatin1Literal("-terminate")) {
+ } else if (arg == QLatin1String("-terminate")) {
terminate = true;
} else {
cout << "Unknown argument " << qPrintable(arg) << endl;