diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-08-30 09:19:56 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-08-30 10:17:32 +0200 |
commit | 9c1cb774a155c72e8f8d08663d67120fa7b2c57b (patch) | |
tree | 2ce3f0bbf2676f2b459dc0a4e571123a8929b985 /src/libs | |
parent | 930e7b711d5d1da847e063401b1f2b62dc135a22 (diff) | |
download | qt-creator-9c1cb774a155c72e8f8d08663d67120fa7b2c57b.tar.gz |
QmlJS: Improve ModelManagerInterface API, add docs.
Change-Id: Ic65d767cbad85de89dffaac66d9e80d8d467f04a
Reviewed-on: http://codereview.qt.nokia.com/3851
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.cpp | 18 | ||||
-rw-r--r-- | src/libs/qmljs/qmljsmodelmanagerinterface.h | 4 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp index fb43abc65a..96aac5619d 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp @@ -34,6 +34,24 @@ using namespace QmlJS; +/*! + \class QmlJS::ModelManagerInterface + \brief Interface to the global state of the QmlJS code model. + \sa QmlJS::Document QmlJS::Snapshot QmlJSTools::Internal::ModelManager + + The ModelManagerInterface is an interface for global state and actions in + the QmlJS code model. It is implemented by \l{QmlJSTools::Internal::ModelManager} + and the instance can be accessed through ModelManagerInterface::instance(). + + One of its primary concerns is to keep the Snapshots it + maintains up to date by parsing documents and finding QML modules. + + It has a Snapshot that contains only valid Documents, + accessible through ModelManagerInterface::snapshot() and a Snapshot with + potentially more recent, but invalid documents that is exposed through + ModelManagerInterface::newestSnapshot(). +*/ + static ModelManagerInterface *g_instance = 0; ModelManagerInterface::ModelManagerInterface(QObject *parent) diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.h b/src/libs/qmljs/qmljsmodelmanagerinterface.h index 17530e4359..c021341e5d 100644 --- a/src/libs/qmljs/qmljsmodelmanagerinterface.h +++ b/src/libs/qmljs/qmljsmodelmanagerinterface.h @@ -119,7 +119,9 @@ public: static ModelManagerInterface *instance(); virtual WorkingCopy workingCopy() const = 0; - virtual QmlJS::Snapshot snapshot(bool preferValid = true) const = 0; + + virtual QmlJS::Snapshot snapshot() const = 0; + virtual QmlJS::Snapshot newestSnapshot() const = 0; virtual void updateSourceFiles(const QStringList &files, bool emitDocumentOnDiskChanged) = 0; |