From 5cc4ce743c461f8763f2328d3020acf01eac0974 Mon Sep 17 00:00:00 2001 From: Martin Kampas Date: Wed, 14 Sep 2016 10:47:44 +0200 Subject: LiveNodeEngine: Fix UpdatesAsOverlay flag handling Code polishing on 88c9de5 led to the result that UpdatesAsOverlay could not be really disabled. Change-Id: Id338cafe48a8bb3d3d0aeef8e0e08c5287286aaa Reviewed-by: Juergen Bocklage-Ryannel --- src/livenodeengine.cpp | 7 ++++++- src/livenodeengine.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/livenodeengine.cpp b/src/livenodeengine.cpp index d28fd05..fd146c8 100644 --- a/src/livenodeengine.cpp +++ b/src/livenodeengine.cpp @@ -87,7 +87,7 @@ const char OVERLAY_PATH_SEPARATOR = '-'; * With this option enabled, updates can be received even if workspace * is read only. Updates will be stored in a writable overlay stacked * over the original workspace with the help of - * QQmlAbstractUrlInterceptor. Implies \l AllowUpdates. + * QQmlAbstractUrlInterceptor. Requires \l AllowUpdates. * * \sa {QmlLive Runtime} */ @@ -530,6 +530,11 @@ void LiveNodeEngine::setWorkspace(const QString &path, WorkspaceOptions options) if (m_workspaceOptions & LoadDummyData) QmlHelper::loadDummyData(m_qmlEngine, m_workspace.absolutePath()); + if ((m_workspaceOptions & UpdatesAsOverlay) && !(m_workspaceOptions & AllowUpdates)) { + qWarning() << "Got UpdatesAsOverlay without AllowUpdates. Enabling AllowUpdates."; + m_workspaceOptions |= AllowUpdates; + } + if (m_workspaceOptions & UpdatesAsOverlay) initOverlay(); diff --git a/src/livenodeengine.h b/src/livenodeengine.h index 0d9e0ef..ce8a56f 100644 --- a/src/livenodeengine.h +++ b/src/livenodeengine.h @@ -49,7 +49,7 @@ public: NoWorkspaceOption = 0x0, LoadDummyData = 0x1, AllowUpdates = 0x2, - UpdatesAsOverlay = 0x4 | AllowUpdates + UpdatesAsOverlay = 0x4 }; Q_DECLARE_FLAGS(WorkspaceOptions, WorkspaceOption) #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) -- cgit v1.2.3