Commit 2a633870 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Renamed qmlmodelmanager.

parent 52b04f5d
......@@ -30,7 +30,7 @@
#include "qmljscodecompletion.h"
#include "qmlexpressionundercursor.h"
#include "qmljseditor.h"
#include "qmlmodelmanagerinterface.h"
#include "qmljsmodelmanagerinterface.h"
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsbind.h>
......@@ -508,7 +508,7 @@ void FunctionArgumentWidget::updateHintText()
} } // end of namespace QmlJSEditor::Internal
CodeCompletion::CodeCompletion(QmlModelManagerInterface *modelManager, QObject *parent)
CodeCompletion::CodeCompletion(ModelManagerInterface *modelManager, QObject *parent)
: TextEditor::ICompletionCollector(parent),
m_modelManager(modelManager),
m_editor(0),
......
......@@ -41,7 +41,7 @@ class ITextEditable;
namespace QmlJSEditor {
class QmlModelManagerInterface;
class ModelManagerInterface;
namespace Internal {
......@@ -52,7 +52,7 @@ class CodeCompletion: public TextEditor::ICompletionCollector
Q_OBJECT
public:
CodeCompletion(QmlModelManagerInterface *modelManager, QObject *parent = 0);
CodeCompletion(ModelManagerInterface *modelManager, QObject *parent = 0);
virtual ~CodeCompletion();
Qt::CaseSensitivity caseSensitivity() const;
......@@ -77,7 +77,7 @@ private:
bool maybeTriggersCompletion(TextEditor::ITextEditable *editor);
bool isDelimiter(const QChar &ch) const;
QmlModelManagerInterface *m_modelManager;
ModelManagerInterface *m_modelManager;
TextEditor::ITextEditable *m_editor;
int m_startPosition;
QList<TextEditor::CompletionItem> m_completions;
......
......@@ -31,7 +31,7 @@
#include "qmljseditorconstants.h"
#include "qmljshighlighter.h"
#include "qmljseditorplugin.h"
#include "qmlmodelmanager.h"
#include "qmljsmodelmanager.h"
#include <qmljs/qmljsindenter.h>
#include <qmljs/qmljsinterpreter.h>
......@@ -583,7 +583,7 @@ QmlJSTextEditor::QmlJSTextEditor(QWidget *parent) :
baseTextDocument()->setSyntaxHighlighter(new Highlighter(document()));
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlModelManagerInterface>();
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
if (m_modelManager) {
connect(m_modelManager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
......
......@@ -45,7 +45,7 @@ class ICore;
namespace QmlJSEditor {
class QmlModelManagerInterface;
class ModelManagerInterface;
namespace Internal {
......@@ -178,7 +178,7 @@ private:
QTimer *m_updateDocumentTimer;
QTimer *m_updateUsesTimer;
QComboBox *m_methodCombo;
QmlModelManagerInterface *m_modelManager;
ModelManagerInterface *m_modelManager;
QTextCharFormat m_occurrencesFormat;
QTextCharFormat m_occurrencesUnusedFormat;
QTextCharFormat m_occurrenceRenameFormat;
......
......@@ -20,8 +20,8 @@ HEADERS += \
qmlfilewizard.h \
qmljshighlighter.h \
qmljshoverhandler.h \
qmlmodelmanager.h \
qmlmodelmanagerinterface.h
qmljsmodelmanager.h \
qmljsmodelmanagerinterface.h
SOURCES += \
qmljscodecompletion.cpp \
......@@ -33,8 +33,8 @@ SOURCES += \
qmlfilewizard.cpp \
qmljshighlighter.cpp \
qmljshoverhandler.cpp \
qmlmodelmanager.cpp \
qmlmodelmanagerinterface.cpp
qmljsmodelmanager.cpp \
qmljsmodelmanagerinterface.cpp
RESOURCES += qmljseditor.qrc
OTHER_FILES += QmlJSEditor.pluginspec QmlJSEditor.mimetypes.xml
......@@ -34,7 +34,7 @@
#include "qmljseditorfactory.h"
#include "qmljscodecompletion.h"
#include "qmljshoverhandler.h"
#include "qmlmodelmanager.h"
#include "qmljsmodelmanager.h"
#include "qmlfilewizard.h"
#include <coreplugin/icore.h>
......@@ -90,7 +90,7 @@ bool QmlJSEditorPlugin::initialize(const QStringList & /*arguments*/, QString *e
if (!core->mimeDatabase()->addMimeTypes(QLatin1String(":/qmljseditor/QmlJSEditor.mimetypes.xml"), error_message))
return false;
m_modelManager = new QmlModelManager(this);
m_modelManager = new ModelManager(this);
addAutoReleasedObject(m_modelManager);
QList<int> context;
......
......@@ -38,7 +38,7 @@ class TextEditorActionHandler;
namespace QmlJSEditor {
class QmlModelManagerInterface;
class ModelManagerInterface;
class QmlFileWizard;
namespace Internal {
......@@ -70,7 +70,7 @@ public Q_SLOTS:
private:
static QmlJSEditorPlugin *m_instance;
QmlModelManagerInterface *m_modelManager;
ModelManagerInterface *m_modelManager;
QmlFileWizard *m_wizard;
QmlJSEditorFactory *m_editor;
TextEditor::TextEditorActionHandler *m_actionHandler;
......
......@@ -61,7 +61,7 @@ HoverHandler::HoverHandler(QObject *parent)
: QObject(parent)
, m_helpEngineNeedsSetup(false)
{
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<QmlModelManagerInterface>();
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<ModelManagerInterface>();
ICore *core = ICore::instance();
QFileInfo fi(core->settings()->fileName());
......
......@@ -30,7 +30,7 @@
#ifndef QMLJSHOVERHANDLER_H
#define QMLJSHOVERHANDLER_H
#include "qmlmodelmanagerinterface.h"
#include "qmljsmodelmanagerinterface.h"
#include <QtCore/QObject>
......@@ -79,7 +79,7 @@ private:
QStringList *baseClasses) const;
private:
QmlModelManagerInterface *m_modelManager;
ModelManagerInterface *m_modelManager;
QHelpEngineCore *m_helpEngine;
QString m_helpId;
QString m_toolTip;
......
......@@ -28,7 +28,7 @@
**************************************************************************/
#include "qmljseditorconstants.h"
#include "qmlmodelmanager.h"
#include "qmljsmodelmanager.h"
#include "qmljseditor.h"
#include <coreplugin/icore.h>
......@@ -47,8 +47,8 @@ using namespace QmlJS;
using namespace QmlJSEditor;
using namespace QmlJSEditor::Internal;
QmlModelManager::QmlModelManager(QObject *parent):
QmlModelManagerInterface(parent),
ModelManager::ModelManager(QObject *parent):
ModelManagerInterface(parent),
m_core(Core::ICore::instance())
{
m_synchronizer.setCancelOnWait(true);
......@@ -59,19 +59,19 @@ QmlModelManager::QmlModelManager(QObject *parent):
this, SLOT(onDocumentUpdated(QmlJS::Document::Ptr)));
}
Snapshot QmlModelManager::snapshot() const
Snapshot ModelManager::snapshot() const
{
QMutexLocker locker(&m_mutex);
return _snapshot;
}
void QmlModelManager::updateSourceFiles(const QStringList &files)
void ModelManager::updateSourceFiles(const QStringList &files)
{
refreshSourceFiles(files);
}
QFuture<void> QmlModelManager::refreshSourceFiles(const QStringList &sourceFiles)
QFuture<void> ModelManager::refreshSourceFiles(const QStringList &sourceFiles)
{
if (sourceFiles.isEmpty()) {
return QFuture<void>();
......@@ -79,7 +79,7 @@ QFuture<void> QmlModelManager::refreshSourceFiles(const QStringList &sourceFiles
const QMap<QString, WorkingCopy> workingCopy = buildWorkingCopyList();
QFuture<void> result = QtConcurrent::run(&QmlModelManager::parse,
QFuture<void> result = QtConcurrent::run(&ModelManager::parse,
workingCopy, sourceFiles,
this);
......@@ -104,7 +104,7 @@ QFuture<void> QmlModelManager::refreshSourceFiles(const QStringList &sourceFiles
return result;
}
QMap<QString, QmlModelManager::WorkingCopy> QmlModelManager::buildWorkingCopyList()
QMap<QString, ModelManager::WorkingCopy> ModelManager::buildWorkingCopyList()
{
QMap<QString, WorkingCopy> workingCopy;
Core::EditorManager *editorManager = m_core->editorManager();
......@@ -123,20 +123,20 @@ QMap<QString, QmlModelManager::WorkingCopy> QmlModelManager::buildWorkingCopyLis
return workingCopy;
}
void QmlModelManager::emitDocumentUpdated(Document::Ptr doc)
void ModelManager::emitDocumentUpdated(Document::Ptr doc)
{ emit documentUpdated(doc); }
void QmlModelManager::onDocumentUpdated(Document::Ptr doc)
void ModelManager::onDocumentUpdated(Document::Ptr doc)
{
QMutexLocker locker(&m_mutex);
_snapshot.insert(doc);
}
void QmlModelManager::parse(QFutureInterface<void> &future,
void ModelManager::parse(QFutureInterface<void> &future,
QMap<QString, WorkingCopy> workingCopy,
QStringList files,
QmlModelManager *modelManager)
ModelManager *modelManager)
{
Core::MimeDatabase *db = Core::ICore::instance()->mimeDatabase();
Core::MimeType jsSourceTy = db->findByType(QLatin1String("application/javascript"));
......@@ -186,7 +186,7 @@ void QmlModelManager::parse(QFutureInterface<void> &future,
}
// Check whether fileMimeType is the same or extends knownMimeType
bool QmlModelManager::matchesMimeType(const Core::MimeType &fileMimeType, const Core::MimeType &knownMimeType)
bool ModelManager::matchesMimeType(const Core::MimeType &fileMimeType, const Core::MimeType &knownMimeType)
{
Core::MimeDatabase *db = Core::ICore::instance()->mimeDatabase();
......
......@@ -27,10 +27,10 @@
**
**************************************************************************/
#ifndef QMLMODELMANAGER_H
#define QMLMODELMANAGER_H
#ifndef QMLJSMODELMANAGER_H
#define QMLJSMODELMANAGER_H
#include "qmlmodelmanagerinterface.h"
#include "qmljsmodelmanagerinterface.h"
#include <qmljs/qmljsdocument.h>
......@@ -46,12 +46,12 @@ class MimeType;
namespace QmlJSEditor {
namespace Internal {
class QmlModelManager: public QmlModelManagerInterface
class ModelManager: public ModelManagerInterface
{
Q_OBJECT
public:
QmlModelManager(QObject *parent = 0);
ModelManager(QObject *parent = 0);
virtual QmlJS::Snapshot snapshot() const;
virtual void updateSourceFiles(const QStringList &files);
......@@ -80,7 +80,7 @@ protected:
static void parse(QFutureInterface<void> &future,
QMap<QString, WorkingCopy> workingCopy,
QStringList files,
QmlModelManager *modelManager);
ModelManager *modelManager);
private:
static bool matchesMimeType(const Core::MimeType &fileMimeType, const Core::MimeType &knownMimeType);
......@@ -95,4 +95,4 @@ private:
} // namespace Internal
} // namespace QmlJSEditor
#endif // QMLMODELMANAGER_H
#endif // QMLJSMODELMANAGER_H
......@@ -27,15 +27,15 @@
**
**************************************************************************/
#include "qmlmodelmanagerinterface.h"
#include "qmljsmodelmanagerinterface.h"
using namespace QmlJSEditor;
QmlModelManagerInterface::QmlModelManagerInterface(QObject *parent):
ModelManagerInterface::ModelManagerInterface(QObject *parent):
QObject(parent)
{
}
QmlModelManagerInterface::~QmlModelManagerInterface()
ModelManagerInterface::~ModelManagerInterface()
{
}
......@@ -27,8 +27,8 @@
**
**************************************************************************/
#ifndef QMLMODELMANAGERINTERFACE_H
#define QMLMODELMANAGERINTERFACE_H
#ifndef QMLJSMODELMANAGERINTERFACE_H
#define QMLJSMODELMANAGERINTERFACE_H
#include "qmljseditor_global.h"
......@@ -44,13 +44,13 @@ class Snapshot;
namespace QmlJSEditor {
class QMLJSEDITOR_EXPORT QmlModelManagerInterface: public QObject
class QMLJSEDITOR_EXPORT ModelManagerInterface: public QObject
{
Q_OBJECT
public:
QmlModelManagerInterface(QObject *parent = 0);
virtual ~QmlModelManagerInterface();
ModelManagerInterface(QObject *parent = 0);
virtual ~ModelManagerInterface();
virtual QmlJS::Snapshot snapshot() const = 0;
virtual void updateSourceFiles(const QStringList &files) = 0;
......@@ -61,4 +61,4 @@ signals:
} // namespace QmlJSEditor
#endif // QMLMODELMANAGERINTERFACE_H
#endif // QMLJSMODELMANAGERINTERFACE_H
......@@ -42,7 +42,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/modemanager.h>
#include <qmljseditor/qmlmodelmanagerinterface.h>
#include <qmljseditor/qmljsmodelmanagerinterface.h>
#include <utils/synchronousprocess.h>
......@@ -85,7 +85,7 @@ const int DEFAULT_DEBUG_SERVER_PORT(3768);
QmlProject::QmlProject(Manager *manager, const QString &fileName)
: m_manager(manager),
m_fileName(fileName),
m_modelManager(ExtensionSystem::PluginManager::instance()->getObject<QmlJSEditor::QmlModelManagerInterface>()),
m_modelManager(ExtensionSystem::PluginManager::instance()->getObject<QmlJSEditor::ModelManagerInterface>()),
m_fileWatcher(new ProjectExplorer::FileWatcher(this)),
m_targetFactory(new QmlTargetFactory(this))
{
......
......@@ -47,7 +47,7 @@
#include <QtDeclarative/QmlEngine>
namespace QmlJSEditor {
class QmlModelManagerInterface;
class ModelManagerInterface;
}
namespace QmlProjectManager {
......@@ -198,7 +198,7 @@ private:
QString m_fileName;
Internal::QmlProjectFile *m_file;
QString m_projectName;
QmlJSEditor::QmlModelManagerInterface *m_modelManager;
QmlJSEditor::ModelManagerInterface *m_modelManager;
// plain format
QStringList m_files;
......
......@@ -43,7 +43,7 @@
#include <texteditor/texteditoractionhandler.h>
#include <projectexplorer/taskwindow.h>
#include <qmljseditor/qmlmodelmanagerinterface.h>
#include <qmljseditor/qmljsmodelmanagerinterface.h>
#include <QtCore/QtPlugin>
......@@ -88,7 +88,7 @@ void QmlProjectPlugin::extensionsInitialized()
ProjectExplorer::TaskWindow *taskWindow = pluginManager->getObject<ProjectExplorer::TaskWindow>();
m_qmlTaskManager->setTaskWindow(taskWindow);
QmlJSEditor::QmlModelManagerInterface *modelManager = pluginManager->getObject<QmlJSEditor::QmlModelManagerInterface>();
QmlJSEditor::ModelManagerInterface *modelManager = pluginManager->getObject<QmlJSEditor::ModelManagerInterface>();
Q_ASSERT(modelManager);
connect(modelManager, SIGNAL(documentUpdated(QmlJS::Document::Ptr)),
m_qmlTaskManager, SLOT(documentUpdated(QmlJS::Document::Ptr)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment