qmljs: added qmljsconstants.h

Moved Document::Language, Import::Type and StaticAnalysis::Severity
enums to qmljsconstants.h and renamed values removing the redundant
part.
Thus the effective length changed little or improved
(Document::QmlLanguage => Language::Qml).

The separate file allows better reuse of enum values without introducing
circular dependencies.

Change-Id: I5186d7c04f5d3f6c289068b919be5ff1ff118326
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2013-10-16 14:59:28 +02:00
parent ab71755326
commit 0a4310d314
37 changed files with 280 additions and 231 deletions

View File

@@ -258,7 +258,7 @@ void ScopeChain::update() const
m_all += m_cppContextProperties;
// the root scope in js files doesn't see instantiating components
if (m_document->language() != Document::JavaScriptLanguage || m_jsScopes.count() != 1) {
if (m_document->language() != Language::JavaScript || m_jsScopes.count() != 1) {
if (m_qmlComponentScope) {
foreach (const QmlComponentChain *parent, m_qmlComponentScope->instantiatingComponents())
collectScopes(parent, &m_all);
@@ -312,8 +312,8 @@ void ScopeChain::initializeRootScope()
if (!m_document->bind()->isJsLibrary()) {
foreach (Document::Ptr otherDoc, snapshot) {
foreach (const ImportInfo &import, otherDoc->bind()->imports()) {
if ((import.type() == ImportInfo::FileImport && m_document->fileName() == import.path())
|| (import.type() == ImportInfo::QrcFileImport
if ((import.type() == ImportType::File && m_document->fileName() == import.path())
|| (import.type() == ImportType::QrcFile
&& ModelManagerInterface::instance()->filesAtQrcPath(import.path())
.contains(m_document->fileName()))) {
QmlComponentChain *component = new QmlComponentChain(otherDoc);