aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/debugger/debugger.pri2
-rw-r--r--src/qml/debugger/qqmldebugclient.cpp4
-rw-r--r--src/qml/debugger/qqmldebughelper.cpp70
-rw-r--r--src/qml/debugger/qqmldebughelper_p.h84
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp40
-rw-r--r--src/qml/debugger/qqmldebugservice.cpp2
-rw-r--r--src/qml/debugger/qqmlenginedebug.cpp2
-rw-r--r--src/qml/debugger/qqmlenginedebugservice.cpp4
-rw-r--r--src/qml/debugger/qqmlinspectorservice.cpp2
-rw-r--r--src/qml/qml/ftw/qfastmetabuilder.cpp3
-rw-r--r--src/qml/qml/qqmlcompiler.cpp8
-rw-r--r--src/qml/qml/qqmlengine.cpp2
-rw-r--r--src/qml/qml/qqmlscript.cpp2
-rw-r--r--src/qml/qml/v4/qv4irbuilder.cpp2
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp4
15 files changed, 38 insertions, 193 deletions
diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri
index 10ca9706c4..f85663c01f 100644
--- a/src/qml/debugger/debugger.pri
+++ b/src/qml/debugger/debugger.pri
@@ -4,7 +4,6 @@ SOURCES += \
$$PWD/qqmldebugclient.cpp \
$$PWD/qqmlenginedebug.cpp \
$$PWD/qqmlprofilerservice.cpp \
- $$PWD/qqmldebughelper.cpp \
$$PWD/qqmldebugserver.cpp \
$$PWD/qqmlinspectorservice.cpp \
$$PWD/qv8debugservice.cpp \
@@ -19,7 +18,6 @@ HEADERS += \
$$PWD/qqmldebugclient_p.h \
$$PWD/qqmlenginedebug_p.h \
$$PWD/qqmlprofilerservice_p.h \
- $$PWD/qqmldebughelper_p.h \
$$PWD/qqmldebugserver_p.h \
$$PWD/qqmldebugserverconnection_p.h \
$$PWD/qqmldebugstatesdelegate_p.h \
diff --git a/src/qml/debugger/qqmldebugclient.cpp b/src/qml/debugger/qqmldebugclient.cpp
index 12276b48fa..fcb0861c21 100644
--- a/src/qml/debugger/qqmldebugclient.cpp
+++ b/src/qml/debugger/qqmldebugclient.cpp
@@ -52,8 +52,8 @@
QT_BEGIN_NAMESPACE
const int protocolVersion = 1;
-const QString serverId = QLatin1String("QQmlDebugServer");
-const QString clientId = QLatin1String("QQmlDebugClient");
+const QString serverId = QLatin1String("QDeclarativeDebugServer");
+const QString clientId = QLatin1String("QDeclarativeDebugClient");
class QQmlDebugClientPrivate : public QObjectPrivate
{
diff --git a/src/qml/debugger/qqmldebughelper.cpp b/src/qml/debugger/qqmldebughelper.cpp
deleted file mode 100644
index 7158b3609d..0000000000
--- a/src/qml/debugger/qqmldebughelper.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qqmldebughelper_p.h"
-
-#include <QtCore/QAbstractAnimation>
-#include <QtQml/QJSEngine>
-
-#include <private/qqmlengine_p.h>
-#include <private/qabstractanimation_p.h>
-#include <private/qqmlengine_p.h>
-
-QT_BEGIN_NAMESPACE
-
-void QQmlDebugHelper::setAnimationSlowDownFactor(qreal factor)
-{
- QUnifiedTimer *timer = QUnifiedTimer::instance();
- timer->setSlowModeEnabled(factor != 1.0);
- timer->setSlowdownFactor(factor);
-}
-
-void QQmlDebugHelper::enableDebugging() {
- qWarning("QQmlDebugHelper::enableDebugging() is deprecated! Add CONFIG += declarative_debug to your .pro file instead.");
-#ifndef QQML_NO_DEBUG_PROTOCOL
- if (!QQmlEnginePrivate::qml_debugging_enabled) {
- qWarning("Qml debugging is enabled. Only use this in a safe environment!");
- }
- QQmlEnginePrivate::qml_debugging_enabled = true;
-#endif
-}
-
-QT_END_NAMESPACE
diff --git a/src/qml/debugger/qqmldebughelper_p.h b/src/qml/debugger/qqmldebughelper_p.h
deleted file mode 100644
index 5d2bcc2be0..0000000000
--- a/src/qml/debugger/qqmldebughelper_p.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QQMLDEBUGHELPER_P_H
-#define QQMLDEBUGHELPER_P_H
-
-#include <private/qtqmlglobal_p.h>
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-QT_BEGIN_HEADER
-
-QT_BEGIN_NAMESPACE
-
-class QQmlEngine;
-
-#ifndef QT_BUILD_QML_LIB
-#warning Use of this header file is deprecated! Add CONFIG += declarative_debug to your .pro file instead.
-#endif
-
-// Helper methods to access private API through a stable interface
-// This is used in the qmljsdebugger library of QtCreator.
-class Q_QML_EXPORT QQmlDebugHelper
-{
-public:
- static void setAnimationSlowDownFactor(qreal factor);
-
- // Enables remote debugging functionality
- // Only use this for debugging in a safe environment!
- static void enableDebugging();
-};
-
-QT_END_NAMESPACE
-
-QT_END_HEADER
-
-#endif // QQMLDEBUGHELPER_P_H
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index 8d5c597a78..e70632d925 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -60,21 +60,21 @@ QT_BEGIN_NAMESPACE
handshake:
1. Client sends
- "QQmlDebugServer" 0 version pluginNames
+ "QDeclarativeDebugServer" 0 version pluginNames
version: an int representing the highest protocol version the client knows
pluginNames: plugins available on client side
2. Server sends
- "QQmlDebugClient" 0 version pluginNames pluginVersions
+ "QDeclarativeDebugClient" 0 version pluginNames pluginVersions
version: an int representing the highest protocol version the client & server know
pluginNames: plugins available on server side. plugins both in the client and server message are enabled.
client plugin advertisement
1. Client sends
- "QQmlDebugServer" 1 pluginNames
+ "QDeclarativeDebugServer" 1 pluginNames
server plugin advertisement
1. Server sends
- "QQmlDebugClient" 1 pluginNames pluginVersions
+ "QDeclarativeDebugClient" 1 pluginNames pluginVersions
plugin communication:
- Everything send with a header different to "QQmlDebugServer" is sent to the appropriate plugin.
+ Everything send with a header different to "QDeclarativeDebugServer" is sent to the appropriate plugin.
*/
const int protocolVersion = 1;
@@ -155,7 +155,7 @@ void QQmlDebugServerPrivate::advertisePlugins()
pluginNames << service->name();
pluginVersions << service->version();
}
- out << QString(QLatin1String("QQmlDebugClient")) << 1 << pluginNames << pluginVersions;
+ out << QString(QLatin1String("QDeclarativeDebugClient")) << 1 << pluginNames << pluginVersions;
}
QMetaObject::invokeMethod(q, "_q_sendMessages", Qt::QueuedConnection, Q_ARG(QList<QByteArray>, QList<QByteArray>() << message));
@@ -180,12 +180,12 @@ QQmlDebugServerConnection *QQmlDebugServerPrivate::loadConnectionPlugin(
foreach (const QString &pluginPath, pluginCandidates) {
if (qmlDebugVerbose())
- qDebug() << "QQmlDebugServer: Trying to load plugin " << pluginPath << "...";
+ qDebug() << "QML Debugger: Trying to load plugin " << pluginPath << "...";
loader.setFileName(pluginPath);
if (!loader.load()) {
if (qmlDebugVerbose())
- qDebug() << "QQmlDebugServer: Error while loading: " << loader.errorString();
+ qDebug() << "QML Debugger: Error while loading: " << loader.errorString();
continue;
}
if (QObject *instance = loader.instance())
@@ -193,13 +193,13 @@ QQmlDebugServerConnection *QQmlDebugServerPrivate::loadConnectionPlugin(
if (connection) {
if (qmlDebugVerbose())
- qDebug() << "QQmlDebugServer: Plugin successfully loaded.";
+ qDebug() << "QML Debugger: Plugin successfully loaded.";
return connection;
}
if (qmlDebugVerbose())
- qDebug() << "QQmlDebugServer: Plugin does not implement interface QQmlDebugServerConnection.";
+ qDebug() << "QML Debugger: Plugin does not implement interface QQmlDebugServerConnection.";
loader.unload();
}
@@ -217,7 +217,7 @@ void QQmlDebugServerThread::run()
connection->setPort(m_port, m_block);
} else {
QCoreApplicationPrivate *appD = static_cast<QCoreApplicationPrivate*>(QObjectPrivate::get(qApp));
- qWarning() << QString::fromAscii("QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ qWarning() << QString::fromAscii("QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
"Remote debugger plugin has not been found.").arg(appD->qmljsDebugArgumentsString());
}
@@ -263,7 +263,7 @@ QQmlDebugServer *QQmlDebugServer::instance()
if (!appD->qmljsDebugArgumentsString().isEmpty()) {
if (!QQmlEnginePrivate::qml_debugging_enabled) {
qWarning() << QString::fromLatin1(
- "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
"Debugging has not been enabled.").arg(
appD->qmljsDebugArgumentsString());
return 0;
@@ -299,7 +299,7 @@ QQmlDebugServer *QQmlDebugServer::instance()
} else {
qWarning() << QString::fromLatin1(
- "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
"Format is -qmljsdebugger=port:<port>[,block]").arg(
appD->qmljsDebugArgumentsString());
}
@@ -307,7 +307,7 @@ QQmlDebugServer *QQmlDebugServer::instance()
#else
if (!appD->qmljsDebugArgumentsString().isEmpty()) {
qWarning() << QString::fromLatin1(
- "QQmlDebugServer: Ignoring \"-qmljsdebugger=%1\". "
+ "QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
"QtQml is not configured for debugging.").arg(
appD->qmljsDebugArgumentsString());
}
@@ -354,7 +354,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
QString name;
in >> name;
- if (name == QLatin1String("QQmlDebugServer")) {
+ if (name == QLatin1String("QDeclarativeDebugServer")) {
int op = -1;
in >> op;
if (op == 0) {
@@ -373,7 +373,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
pluginVersions << service->version();
}
- out << QString(QLatin1String("QQmlDebugClient")) << 0 << protocolVersion << pluginNames << pluginVersions;
+ out << QString(QLatin1String("QDeclarativeDebugClient")) << 0 << protocolVersion << pluginNames << pluginVersions;
}
d->connection->send(QList<QByteArray>() << helloAnswer);
@@ -389,7 +389,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
iter.value()->stateChanged(newState);
}
- qWarning("QQmlDebugServer: Connection established");
+ qWarning("QML Debugger: Connection established.");
d->messageArrivedCondition.wakeAll();
} else if (op == 1) {
@@ -414,7 +414,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
}
} else {
- qWarning("QQmlDebugServer: Invalid control message %d", op);
+ qWarning("QML Debugger: Invalid control message %d.", op);
d->connection->disconnect();
return;
}
@@ -427,7 +427,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
QReadLocker(&d->pluginsLock);
QHash<QString, QQmlDebugService *>::Iterator iter = d->plugins.find(name);
if (iter == d->plugins.end()) {
- qWarning() << "QQmlDebugServer: Message received for missing plugin" << name;
+ qWarning() << "QML Debugger: Message received for missing plugin" << name << ".";
} else {
(*iter)->messageReceived(message);
@@ -435,7 +435,7 @@ void QQmlDebugServer::receiveMessage(const QByteArray &message)
d->messageArrivedCondition.wakeAll();
}
} else {
- qWarning("QQmlDebugServer: Invalid hello message");
+ qWarning("QML Debugger: Invalid hello message.");
}
}
diff --git a/src/qml/debugger/qqmldebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp
index 9eb9489566..a1cc4fe0a3 100644
--- a/src/qml/debugger/qqmldebugservice.cpp
+++ b/src/qml/debugger/qqmldebugservice.cpp
@@ -140,7 +140,7 @@ struct ObjectReferenceHash
};
}
-Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash);
+Q_GLOBAL_STATIC(ObjectReferenceHash, objectReferenceHash)
/*!
diff --git a/src/qml/debugger/qqmlenginedebug.cpp b/src/qml/debugger/qqmlenginedebug.cpp
index 597e7aeb04..65af181f1b 100644
--- a/src/qml/debugger/qqmlenginedebug.cpp
+++ b/src/qml/debugger/qqmlenginedebug.cpp
@@ -96,7 +96,7 @@ public:
QQmlEngineDebugClient::QQmlEngineDebugClient(QQmlDebugConnection *client,
QQmlEngineDebugPrivate *p)
- : QQmlDebugClient(QLatin1String("QQmlEngine"), client), priv(p)
+ : QQmlDebugClient(QLatin1String("QDeclarativeEngine"), client), priv(p)
{
}
diff --git a/src/qml/debugger/qqmlenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp
index be2e826bdf..114d7ef63f 100644
--- a/src/qml/debugger/qqmlenginedebugservice.cpp
+++ b/src/qml/debugger/qqmlenginedebugservice.cpp
@@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE
-Q_GLOBAL_STATIC(QQmlEngineDebugService, qmlEngineDebugService);
+Q_GLOBAL_STATIC(QQmlEngineDebugService, qmlEngineDebugService)
QQmlEngineDebugService *QQmlEngineDebugService::instance()
{
@@ -67,7 +67,7 @@ QQmlEngineDebugService *QQmlEngineDebugService::instance()
}
QQmlEngineDebugService::QQmlEngineDebugService(QObject *parent)
- : QQmlDebugService(QLatin1String("QQmlEngine"), 1, parent),
+ : QQmlDebugService(QLatin1String("QDeclarativeEngine"), 1, parent),
m_watch(new QQmlWatcher(this)),
m_statesDelegate(0)
{
diff --git a/src/qml/debugger/qqmlinspectorservice.cpp b/src/qml/debugger/qqmlinspectorservice.cpp
index 508d12eefa..c494045bff 100644
--- a/src/qml/debugger/qqmlinspectorservice.cpp
+++ b/src/qml/debugger/qqmlinspectorservice.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QQmlInspectorService, serviceInstance)
QQmlInspectorService::QQmlInspectorService()
- : QQmlDebugService(QLatin1String("QQmlObserverMode"), 1)
+ : QQmlDebugService(QLatin1String("QDeclarativeObserverMode"), 1)
, m_currentInspectorPlugin(0)
{
registerService();
diff --git a/src/qml/qml/ftw/qfastmetabuilder.cpp b/src/qml/qml/ftw/qfastmetabuilder.cpp
index 02f50911ea..08ea76b37e 100644
--- a/src/qml/qml/ftw/qfastmetabuilder.cpp
+++ b/src/qml/qml/ftw/qfastmetabuilder.cpp
@@ -197,7 +197,8 @@ void QFastMetaBuilder::setProperty(int index, const StringRef &name, const Strin
QMetaType::Type mtype, PropertyFlag flags, int notifySignal)
{
Q_ASSERT(!m_data.isEmpty());
- Q_ASSERT(!name.isEmpty() && !type.isEmpty());
+ Q_ASSERT(!name.isEmpty());
+ Q_ASSERT(!type.isEmpty());
QMetaObjectPrivate *p = priv(m_data);
Q_ASSERT(index < p->propertyCount);
diff --git a/src/qml/qml/qqmlcompiler.cpp b/src/qml/qml/qqmlcompiler.cpp
index 23c4adc7b4..9304a75fbf 100644
--- a/src/qml/qml/qqmlcompiler.cpp
+++ b/src/qml/qml/qqmlcompiler.cpp
@@ -2865,7 +2865,8 @@ bool QQmlCompiler::buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mod
for (Object::DynamicProperty *p = obj->dynamicProperties.first(); p; p = obj->dynamicProperties.next(p)) {
// Reserve space for name
- p->nameRef = builder.newString(p->name.utf8length());
+ if (p->type != Object::DynamicProperty::Alias || resolveAlias)
+ p->nameRef = builder.newString(p->name.utf8length());
int propertyType = 0;
bool readonly = false;
@@ -3102,7 +3103,7 @@ bool QQmlCompiler::buildDynamicMeta(QQmlScript::Object *obj, DynamicMetaMode mod
// Allocate default property if necessary
if (defaultProperty)
- strcpy(defPropRef.data(), "DefaultProperty");
+ defPropRef.load("DefaultProperty");
// Now allocate signals
for (Object::DynamicSignal *s = obj->dynamicSignals.first(); s; s = obj->dynamicSignals.next(s)) {
@@ -3231,6 +3232,8 @@ bool QQmlCompiler::compileAlias(QFastMetaBuilder &builder,
int propIndex, int aliasIndex,
Object::DynamicProperty &prop)
{
+ Q_ASSERT(!prop.nameRef.isEmpty());
+ Q_ASSERT(prop.typeRef.isEmpty());
if (!prop.defaultValue)
COMPILE_EXCEPTION(obj, tr("No property alias location"));
@@ -3325,7 +3328,6 @@ bool QQmlCompiler::compileAlias(QFastMetaBuilder &builder,
VMD *vmd = (QQmlVMEMetaData *)data.data();
*(vmd->aliasData() + aliasIndex) = aliasData;
- prop.nameRef = builder.newString(prop.name.utf8length());
prop.resolvedCustomTypeName = pool->NewByteArray(typeName);
prop.typeRef = builder.newString(typeName.length());
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 54c9d048df..90b8bcd8bb 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -996,7 +996,7 @@ QQmlDebuggingEnabler::QQmlDebuggingEnabler()
{
#ifndef QQML_NO_DEBUG_PROTOCOL
if (!QQmlEnginePrivate::qml_debugging_enabled) {
- qWarning("Qml debugging is enabled. Only use this in a safe environment!");
+ qWarning("QML debugging is enabled. Only use this in a safe environment.");
}
QQmlEnginePrivate::qml_debugging_enabled = true;
#endif
diff --git a/src/qml/qml/qqmlscript.cpp b/src/qml/qml/qqmlscript.cpp
index d1c2faa138..db59a7266f 100644
--- a/src/qml/qml/qqmlscript.cpp
+++ b/src/qml/qml/qqmlscript.cpp
@@ -924,7 +924,7 @@ bool ProcessAST::visit(AST::UiPublicMember *node)
{ "int", strlen("int"), Object::DynamicProperty::Int, "int", strlen("int") },
{ "bool", strlen("bool"), Object::DynamicProperty::Bool, "bool", strlen("bool") },
{ "double", strlen("double"), Object::DynamicProperty::Real, "double", strlen("double") },
- { "real", strlen("real"), Object::DynamicProperty::Real, "qreal", strlen("qreal") },
+ { "real", strlen("real"), Object::DynamicProperty::Real, "double", strlen("double") },
{ "string", strlen("string"), Object::DynamicProperty::String, "QString", strlen("QString") },
{ "url", strlen("url"), Object::DynamicProperty::Url, "QUrl", strlen("QUrl") },
{ "color", strlen("color"), Object::DynamicProperty::Color, "QColor", strlen("QColor") },
diff --git a/src/qml/qml/v4/qv4irbuilder.cpp b/src/qml/qml/v4/qv4irbuilder.cpp
index 0efb2686df..32581a072c 100644
--- a/src/qml/qml/v4/qv4irbuilder.cpp
+++ b/src/qml/qml/v4/qv4irbuilder.cpp
@@ -684,7 +684,7 @@ bool QV4IRBuilder::visit(AST::CallExpression *ast)
//ExprResult base = expression(ast->base);
QString id;
for (int i = 0; i < names.size(); ++i) {
- if (! i)
+ if (i)
id += QLatin1Char('.');
id += names.at(i);
}
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 8101408ced..143ccee960 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1188,9 +1188,7 @@ v8::Handle<v8::Value> qsTranslate(const v8::Arguments &args)
QCoreApplication::Encoding encoding = QCoreApplication::UnicodeUTF8;
if (args.Length() > 3) {
QString encStr = v8engine->toString(args[3]);
- if (encStr == QLatin1String("CodecForTr")) {
- encoding = QCoreApplication::CodecForTr;
- } else if (encStr == QLatin1String("UnicodeUTF8")) {
+ if (encStr == QLatin1String("UnicodeUTF8")) {
encoding = QCoreApplication::UnicodeUTF8;
} else {
QString msg = QString::fromLatin1("qsTranslate(): invalid encoding '%0'").arg(encStr);