aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml')
-rw-r--r--src/qml/jsruntime/qv4dateobject.cpp14
-rw-r--r--src/qml/jsruntime/qv4engine.cpp2
-rw-r--r--src/qml/qml/qqmldirparser.cpp4
-rw-r--r--src/qml/qml/qqmlimport.cpp11
-rw-r--r--src/qml/qml/qqmltypeloader.cpp5
-rw-r--r--src/qml/qml/v8/qv8engine.cpp3
6 files changed, 33 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp
index a6e1f47d91..83032c4dc3 100644
--- a/src/qml/jsruntime/qv4dateobject.cpp
+++ b/src/qml/jsruntime/qv4dateobject.cpp
@@ -609,7 +609,15 @@ static inline QString ToLocaleTimeString(double t)
static double getLocalTZA()
{
-#ifndef Q_OS_WIN
+#ifdef Q_OS_WIN
+ TIME_ZONE_INFORMATION tzInfo;
+ GetTimeZoneInformation(&tzInfo);
+ return -tzInfo.Bias * 60.0 * 1000.0;
+#elif defined(Q_OS_NACL_NEWLIB)
+ // ### tzset hidden behind __STRICT_ANSI__
+ qWarning("Not implemented: getLocalTZA()");
+ return 0;
+#else
struct tm t;
time_t curr;
tzset();
@@ -619,10 +627,6 @@ static double getLocalTZA()
gmtime_r(&curr, &t);
time_t globl = mktime(&t);
return (double(locl) - double(globl)) * 1000.0;
-#else
- TIME_ZONE_INFORMATION tzInfo;
- GetTimeZoneInformation(&tzInfo);
- return -tzInfo.Bias * 60.0 * 1000.0;
#endif
}
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 2560f065cf..284a9ea88a 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -113,7 +113,7 @@ QT_WARNING_DISABLE_MSVC(4172) // MSVC 2015: warning C4172: returning address of
quintptr getStackLimit()
{
quintptr stackLimit;
-#if USE(PTHREADS) && !OS(QNX)
+#if USE(PTHREADS) && !OS(QNX) && !defined(Q_OS_NACL)
# if OS(DARWIN)
pthread_t thread_self = pthread_self();
void *stackTop = pthread_get_stackaddr_np(thread_self);
diff --git a/src/qml/qml/qqmldirparser.cpp b/src/qml/qml/qqmldirparser.cpp
index 57b50733ea..ca3e620996 100644
--- a/src/qml/qml/qqmldirparser.cpp
+++ b/src/qml/qml/qqmldirparser.cpp
@@ -100,6 +100,10 @@ bool QQmlDirParser::parse(const QString &source)
_plugins.clear();
_components.clear();
_scripts.clear();
+#ifdef Q_OS_NACL
+ // ### Work around "only one module identifier" error below
+ _typeNamespace.clear();
+#endif
_designerSupported = false;
quint16 lineNumber = 0;
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index d538199520..10cb377929 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -1206,6 +1206,10 @@ bool QQmlImportsPrivate::validateQmldirVersion(const QQmlTypeLoader::QmldirConte
}
}
+#ifdef Q_OS_NACL
+ // ### This check triggers on NaCl: lowest_min/highest_min do not
+ // get set to senisble values. Disabling allows loading to continue.
+#else
if (lowest_min > vmin || highest_min < vmin) {
QQmlError error;
error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin));
@@ -1213,6 +1217,7 @@ bool QQmlImportsPrivate::validateQmldirVersion(const QQmlTypeLoader::QmldirConte
return false;
}
+#endif
return true;
}
@@ -1565,7 +1570,13 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
// Search order is applicationDirPath(), $QML2_IMPORT_PATH, QLibraryInfo::Qml2ImportsPath
+#ifdef Q_OS_NACL
+ // Hardcode the qml imports to "qml/" relative to the app nexe.
+ // This should perhaps be set via Qml2Imports in qt.conf.
+ QString installImportsPath = QStringLiteral("qml/");
+#else
QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
+#endif
addImportPath(installImportsPath);
// env import paths
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 1e671542be..dd6de8f9b3 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1706,9 +1706,14 @@ Returns a QQmlQmldirData for \a url. The QQmlQmldirData may be cached.
*/
QQmlQmldirData *QQmlTypeLoader::getQmldir(const QUrl &url)
{
+#ifdef Q_OS_NACL
+ // ### NaCl asserts here on urls like "qml/QtQuick.2.1/qmldir",
+ // which are relative urls we want to load over the network.
+#else
Q_ASSERT(!url.isRelative() &&
(QQmlFile::urlToLocalFileOrQrc(url).isEmpty() ||
!QDir::isRelativePath(QQmlFile::urlToLocalFileOrQrc(url))));
+#endif
LockHolder<QQmlTypeLoader> holder(this);
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index dae932e705..0915b8f80b 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -123,11 +123,14 @@ QV8Engine::QV8Engine(QJSEngine* qq)
, m_xmlHttpRequestData(0)
, m_listModelData(0)
{
+
+#ifndef Q_OS_NACL
#ifdef Q_PROCESSOR_X86_32
if (!qCpuHasFeature(SSE2)) {
qFatal("This program requires an X86 processor that supports SSE2 extension, at least a Pentium 4 or newer");
}
#endif
+#endif
QML_MEMORY_SCOPE_STRING("QV8Engine::QV8Engine");
qMetaTypeId<QJSValue>();