From 5a8b5b892441a65319e39c1a8f305cf0b49edf17 Mon Sep 17 00:00:00 2001 From: Tasuku Suzuki Date: Wed, 14 Apr 2010 08:08:52 +0200 Subject: Fix QT_NO_DESKTOPSERVICES Merge-request: 2359 Reviewed-by: Alexis Menard --- src/declarative/qml/qdeclarativeengine.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index e2f810e..8462c65 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -212,10 +212,13 @@ QDeclarativeScriptEngine::QDeclarativeScriptEngine(QDeclarativeEnginePrivate *pr newQMetaObject(StaticQtMetaObject::get()); globalObject().setProperty(QLatin1String("Qt"), qtObject); +#ifndef QT_NO_DESKTOPSERVICES offlineStoragePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation).replace(QLatin1Char('/'), QDir::separator()) + QDir::separator() + QLatin1String("QML") + QDir::separator() + QLatin1String("OfflineStorage"); - +#else + qWarning("offlineStoragePath is not set by default with QT_NO_DESKTOPSERVICES"); +#endif qt_add_qmlxmlhttprequest(this); qt_add_qmlsqldatabase(this); @@ -1214,7 +1217,10 @@ QScriptValue QDeclarativeEnginePrivate::desktopOpenUrl(QScriptContext *ctxt, QSc { if(ctxt->argumentCount() < 1) return e->newVariant(QVariant(false)); - bool ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString())); + bool ret = false; +#ifndef QT_NO_DESKTOPSERVICES + ret = QDesktopServices::openUrl(QUrl(ctxt->argument(0).toString())); +#endif return e->newVariant(QVariant(ret)); } -- cgit v0.12