qmljs: fixing attributes naming (code style)

Change-Id: I3d5916483b99a8d6839b9cb6b9bde119a9da351a
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
This commit is contained in:
Fawzi Mohamed
2014-02-13 11:11:40 +01:00
parent d24cb60d48
commit 13349331e8
3 changed files with 19 additions and 18 deletions

View File

@@ -121,6 +121,8 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
ModelManagerInterface::~ModelManagerInterface() ModelManagerInterface::~ModelManagerInterface()
{ {
m_cppQmlTypesUpdater.cancel();
m_cppQmlTypesUpdater.waitForFinished();
Q_ASSERT(g_instance == this); Q_ASSERT(g_instance == this);
g_instance = 0; g_instance = 0;
} }
@@ -248,13 +250,13 @@ void ModelManagerInterface::loadQmlTypeDescriptionsInternal(const QString &resou
Snapshot ModelManagerInterface::snapshot() const Snapshot ModelManagerInterface::snapshot() const
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
return _validSnapshot; return m_validSnapshot;
} }
Snapshot ModelManagerInterface::newestSnapshot() const Snapshot ModelManagerInterface::newestSnapshot() const
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
return _newestSnapshot; return m_newestSnapshot;
} }
void ModelManagerInterface::updateSourceFiles(const QStringList &files, void ModelManagerInterface::updateSourceFiles(const QStringList &files,
@@ -321,8 +323,8 @@ void ModelManagerInterface::removeFiles(const QStringList &files)
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
foreach (const QString &file, files) { foreach (const QString &file, files) {
_validSnapshot.remove(file); m_validSnapshot.remove(file);
_newestSnapshot.remove(file); m_newestSnapshot.remove(file);
} }
} }
@@ -459,7 +461,7 @@ void ModelManagerInterface::updateProjectInfo(const ProjectInfo &pinfo, ProjectE
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
oldInfo = m_projects.value(p); oldInfo = m_projects.value(p);
m_projects.insert(p, pinfo); m_projects.insert(p, pinfo);
snapshot = _validSnapshot; snapshot = m_validSnapshot;
} }
if (oldInfo.qmlDumpPath != pinfo.qmlDumpPath if (oldInfo.qmlDumpPath != pinfo.qmlDumpPath
@@ -551,8 +553,8 @@ void ModelManagerInterface::updateDocument(Document::Ptr doc)
{ {
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
_validSnapshot.insert(doc); m_validSnapshot.insert(doc);
_newestSnapshot.insert(doc, true); m_newestSnapshot.insert(doc, true);
} }
emit documentUpdated(doc); emit documentUpdated(doc);
} }
@@ -564,8 +566,8 @@ void ModelManagerInterface::updateLibraryInfo(const QString &path, const Library
{ {
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
_validSnapshot.insertLibraryInfo(path, info); m_validSnapshot.insertLibraryInfo(path, info);
_newestSnapshot.insertLibraryInfo(path, info); m_newestSnapshot.insertLibraryInfo(path, info);
} }
// only emit if we got new useful information // only emit if we got new useful information
if (info.isValid()) if (info.isValid())
@@ -1013,7 +1015,7 @@ void ModelManagerInterface::updateImportPaths()
// check if any file in the snapshot imports something new in the new paths // check if any file in the snapshot imports something new in the new paths
Snapshot snapshot = _validSnapshot; Snapshot snapshot = m_validSnapshot;
QStringList importedFiles; QStringList importedFiles;
QSet<QString> scannedPaths; QSet<QString> scannedPaths;
QSet<QString> newLibraries; QSet<QString> newLibraries;
@@ -1195,7 +1197,7 @@ LibraryInfo ModelManagerInterface::builtins(const Document::Ptr &doc) const
if (!info.isValid()) if (!info.isValid())
return LibraryInfo(); return LibraryInfo();
return _validSnapshot.libraryInfo(info.qtImportsPath); return m_validSnapshot.libraryInfo(info.qtImportsPath);
} }
ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx, ViewerContext ModelManagerInterface::completeVContext(const ViewerContext &vCtx,
@@ -1241,12 +1243,12 @@ void ModelManagerInterface::resetCodeModel()
QMutexLocker locker(&m_mutex); QMutexLocker locker(&m_mutex);
// find all documents currently in the code model // find all documents currently in the code model
foreach (Document::Ptr doc, _validSnapshot) foreach (Document::Ptr doc, m_validSnapshot)
documents.append(doc->fileName()); documents.append(doc->fileName());
// reset the snapshot // reset the snapshot
_validSnapshot = Snapshot(); m_validSnapshot = Snapshot();
_newestSnapshot = Snapshot(); m_newestSnapshot = Snapshot();
} }
// start a reparse thread // start a reparse thread

View File

@@ -247,9 +247,10 @@ protected:
void updateImportPaths(); void updateImportPaths();
void loadQmlTypeDescriptionsInternal(const QString &path); void loadQmlTypeDescriptionsInternal(const QString &path);
private:
mutable QMutex m_mutex; mutable QMutex m_mutex;
QmlJS::Snapshot _validSnapshot; QmlJS::Snapshot m_validSnapshot;
QmlJS::Snapshot _newestSnapshot; QmlJS::Snapshot m_newestSnapshot;
QStringList m_allImportPaths; QStringList m_allImportPaths;
QStringList m_defaultImportPaths; QStringList m_defaultImportPaths;
QmlJS::QmlLanguageBundles m_activeBundles; QmlJS::QmlLanguageBundles m_activeBundles;

View File

@@ -203,8 +203,6 @@ ModelManager::ModelManager(QObject *parent):
ModelManager::~ModelManager() ModelManager::~ModelManager()
{ {
m_cppQmlTypesUpdater.cancel();
m_cppQmlTypesUpdater.waitForFinished();
} }
void ModelManager::delayedInitialization() void ModelManager::delayedInitialization()