Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
925c686d
Commit
925c686d
authored
Nov 11, 2009
by
Kai Koehne
Browse files
Listening Qml syntax errors in Tasks window
parent
a4757613
Changes
14
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmleditor/qmldocument.cpp
View file @
925c686d
...
...
@@ -32,8 +32,8 @@
#include "qmljsast_p.h"
#include "qmljslexer_p.h"
#include "qmljsparser_p.h"
#include "qmljsengine_p.h"
#include "qmljsnodepool_p.h"
#include "qmljsastfwd_p.h"
using
namespace
QmlEditor
;
using
namespace
QmlJS
;
...
...
src/plugins/qmleditor/qmldocument.h
View file @
925c686d
...
...
@@ -35,10 +35,9 @@
#include <QtCore/QSharedPointer>
#include <QtCore/QString>
#include "qmleditor_global.h"
#include "qmljsengine_p.h"
#include "qmljsastfwd_p.h"
#include "qmlsymbol.h"
#include <qmleditor/qmleditor_global.h>
#include <qmleditor/parser/qmljsengine_p.h>
#include <qmleditor/qmlsymbol.h>
namespace
QmlEditor
{
...
...
src/plugins/qmleditor/qmleditor.cpp
View file @
925c686d
...
...
@@ -398,8 +398,8 @@ ScriptEditor::ScriptEditor(QWidget *parent) :
m_modelManager
=
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
QmlModelManagerInterface
>
();
if
(
m_modelManager
)
{
connect
(
m_modelManager
,
SIGNAL
(
documentUpdated
(
QmlDocument
::
Ptr
)),
this
,
SLOT
(
onDocumentUpdated
(
QmlDocument
::
Ptr
)));
connect
(
m_modelManager
,
SIGNAL
(
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)),
this
,
SLOT
(
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)));
}
}
...
...
@@ -447,7 +447,7 @@ void ScriptEditor::updateDocumentNow()
m_modelManager
->
updateSourceFiles
(
QStringList
()
<<
fileName
);
}
void
ScriptEditor
::
onDocumentUpdated
(
QmlDocument
::
Ptr
doc
)
void
ScriptEditor
::
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
)
{
if
(
file
()
->
fileName
()
!=
doc
->
fileName
())
return
;
...
...
src/plugins/qmleditor/qmleditor.h
View file @
925c686d
...
...
@@ -113,7 +113,7 @@ public slots:
virtual
void
setFontSettings
(
const
TextEditor
::
FontSettings
&
);
private
slots
:
void
onDocumentUpdated
(
QmlDocument
::
Ptr
doc
);
void
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
);
void
updateDocument
();
void
updateDocumentNow
();
...
...
src/plugins/qmleditor/qmlmodelmanager.cpp
View file @
925c686d
...
...
@@ -52,9 +52,10 @@ QmlModelManager::QmlModelManager(QObject *parent):
{
m_synchronizer
.
setCancelOnWait
(
true
);
qRegisterMetaType
<
QmlDocument
::
Ptr
>
(
"QmlDocument::Ptr"
);
qRegisterMetaType
<
QmlEditor
::
QmlDocument
::
Ptr
>
(
"
QmlEditor::
QmlDocument::Ptr"
);
connect
(
this
,
SIGNAL
(
documentUpdated
(
QmlDocument
::
Ptr
)),
this
,
SLOT
(
onDocumentUpdated
(
QmlDocument
::
Ptr
)));
connect
(
this
,
SIGNAL
(
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)),
this
,
SLOT
(
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)));
}
Snapshot
QmlModelManager
::
snapshot
()
const
...
...
@@ -122,7 +123,7 @@ QMap<QString, QString> QmlModelManager::buildWorkingCopyList()
void
QmlModelManager
::
emitDocumentUpdated
(
QmlDocument
::
Ptr
doc
)
{
emit
documentUpdated
(
doc
);
}
void
QmlModelManager
::
onDocumentUpdated
(
QmlDocument
::
Ptr
doc
)
void
QmlModelManager
::
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
)
{
QMutexLocker
locker
(
&
m_mutex
);
...
...
src/plugins/qmleditor/qmlmodelmanager.h
View file @
925c686d
...
...
@@ -58,13 +58,11 @@ public:
Q_SIGNALS:
void
projectPathChanged
(
const
QString
&
projectPath
);
void
documentUpdated
(
QmlDocument
::
Ptr
doc
);
void
aboutToRemoveFiles
(
const
QStringList
&
files
);
private
Q_SLOTS
:
// this should be executed in the GUI thread.
void
onDocumentUpdated
(
QmlDocument
::
Ptr
doc
);
void
onDocumentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
);
protected:
QFuture
<
void
>
refreshSourceFiles
(
const
QStringList
&
sourceFiles
);
...
...
src/plugins/qmleditor/qmlmodelmanagerinterface.h
View file @
925c686d
...
...
@@ -32,8 +32,10 @@
#include <QObject>
#include <QStringList>
#include <QSharedPointer>
#include <qmleditor/qmleditor_global.h>
#include <qmleditor/qmldocument.h>
namespace
QmlEditor
{
...
...
@@ -49,6 +51,9 @@ public:
virtual
Snapshot
snapshot
()
const
=
0
;
virtual
void
updateSourceFiles
(
const
QStringList
&
files
)
=
0
;
signals:
void
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
);
};
}
...
...
src/plugins/qmleditor/qmlsymbol.h
View file @
925c686d
...
...
@@ -4,7 +4,7 @@
#include <QList>
#include <QString>
#include
"
qmljsastfwd_p.h
"
#include
<qmleditor/parser/
qmljsastfwd_p.h
>
namespace
QmlEditor
{
...
...
src/plugins/qmlprojectmanager/qmlprojectconstants.h
View file @
925c686d
...
...
@@ -49,6 +49,8 @@ const char *const PROJECT_KIND = "QML";
const
char
*
const
FILES_EDITOR
=
".qmlproject Editor"
;
const
char
*
const
FILES_MIMETYPE
=
QMLMIMETYPE
;
const
char
*
const
TASK_CATEGORY_QML
=
"Task.Category.Qml"
;
}
// namespace Constants
}
// namespace QmlProjectManager
...
...
src/plugins/qmlprojectmanager/qmlprojectmanager.pro
View file @
925c686d
...
...
@@ -10,6 +10,7 @@ HEADERS = qmlproject.h \
qmlprojectwizard
.
h
\
qmlnewprojectwizard
.
h
\
qmlprojectfileseditor
.
h
\
qmltaskmanager
.
h
\
qmlmakestep
.
h
SOURCES
=
qmlproject
.
cpp
\
qmlprojectplugin
.
cpp
\
...
...
@@ -18,6 +19,7 @@ SOURCES = qmlproject.cpp \
qmlprojectwizard
.
cpp
\
qmlnewprojectwizard
.
cpp
\
qmlprojectfileseditor
.
cpp
\
qmltaskmanager
.
cpp
\
qmlmakestep
.
cpp
RESOURCES
+=
qmlproject
.
qrc
...
...
src/plugins/qmlprojectmanager/qmlprojectplugin.cpp
View file @
925c686d
...
...
@@ -35,19 +35,26 @@
#include "qmlprojectfileseditor.h"
#include "qmlproject.h"
#include "qmlmakestep.h"
#include "qmltaskmanager.h"
#include <extensionsystem/pluginmanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/mimedatabase.h>
#include <texteditor/texteditoractionhandler.h>
#include <projectexplorer/taskwindow.h>
#include <qmleditor/qmlmodelmanagerinterface.h>
#include <QtCore/QtPlugin>
using
namespace
QmlProjectManager
;
using
namespace
QmlProjectManager
::
Internal
;
QmlProjectPlugin
::
QmlProjectPlugin
()
:
m_projectFilesEditorFactory
(
0
)
QmlProjectPlugin
::
QmlProjectPlugin
()
:
m_projectFilesEditorFactory
(
0
),
m_qmlTaskManager
(
0
)
{
}
QmlProjectPlugin
::~
QmlProjectPlugin
()
...
...
@@ -76,6 +83,8 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
m_projectFilesEditorFactory
=
new
ProjectFilesFactory
(
manager
,
actionHandler
);
addObject
(
m_projectFilesEditorFactory
);
m_qmlTaskManager
=
new
QmlTaskManager
(
this
);
addAutoReleasedObject
(
manager
);
addAutoReleasedObject
(
new
QmlRunConfigurationFactory
);
addAutoReleasedObject
(
new
QmlNewProjectWizard
);
...
...
@@ -86,6 +95,15 @@ bool QmlProjectPlugin::initialize(const QStringList &, QString *errorMessage)
}
void
QmlProjectPlugin
::
extensionsInitialized
()
{
}
{
ExtensionSystem
::
PluginManager
*
pluginManager
=
ExtensionSystem
::
PluginManager
::
instance
();
ProjectExplorer
::
TaskWindow
*
taskWindow
=
pluginManager
->
getObject
<
ProjectExplorer
::
TaskWindow
>
();
m_qmlTaskManager
->
setTaskWindow
(
taskWindow
);
QmlEditor
::
QmlModelManagerInterface
*
modelManager
=
pluginManager
->
getObject
<
QmlEditor
::
QmlModelManagerInterface
>
();
Q_ASSERT
(
modelManager
);
connect
(
modelManager
,
SIGNAL
(
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)),
m_qmlTaskManager
,
SLOT
(
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
)));
}
Q_EXPORT_PLUGIN
(
QmlProjectPlugin
)
src/plugins/qmlprojectmanager/qmlprojectplugin.h
View file @
925c686d
...
...
@@ -38,6 +38,7 @@ namespace QmlProjectManager {
namespace
Internal
{
class
ProjectFilesFactory
;
class
QmlTaskManager
;
class
QmlProjectPlugin
:
public
ExtensionSystem
::
IPlugin
{
...
...
@@ -52,6 +53,7 @@ public:
private:
ProjectFilesFactory
*
m_projectFilesEditorFactory
;
QmlTaskManager
*
m_qmlTaskManager
;
};
}
// namespace Internal
...
...
src/plugins/qmlprojectmanager/qmltaskmanager.cpp
0 → 100644
View file @
925c686d
#include "qmltaskmanager.h"
#include "qmlprojectconstants.h"
#include <QDebug>
namespace
QmlProjectManager
{
namespace
Internal
{
QmlTaskManager
::
QmlTaskManager
(
QObject
*
parent
)
:
QObject
(
parent
),
m_taskWindow
(
0
)
{
}
void
QmlTaskManager
::
setTaskWindow
(
ProjectExplorer
::
TaskWindow
*
taskWindow
)
{
Q_ASSERT
(
taskWindow
);
m_taskWindow
=
taskWindow
;
m_taskWindow
->
addCategory
(
Constants
::
TASK_CATEGORY_QML
,
"Qml"
);
}
void
QmlTaskManager
::
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
)
{
m_taskWindow
->
clearTasks
(
Constants
::
TASK_CATEGORY_QML
);
foreach
(
const
QmlJS
::
DiagnosticMessage
&
msg
,
doc
->
diagnosticMessages
())
{
ProjectExplorer
::
TaskWindow
::
TaskType
type
=
msg
.
isError
()
?
ProjectExplorer
::
TaskWindow
::
Error
:
ProjectExplorer
::
TaskWindow
::
Warning
;
ProjectExplorer
::
TaskWindow
::
Task
task
(
type
,
msg
.
message
,
doc
->
fileName
(),
msg
.
loc
.
startLine
,
Constants
::
TASK_CATEGORY_QML
);
m_taskWindow
->
addTask
(
task
);
}
}
}
// Internal
}
// QmlEditor
src/plugins/qmlprojectmanager/qmltaskmanager.h
0 → 100644
View file @
925c686d
#ifndef QMLTASKMANAGER_H
#define QMLTASKMANAGER_H
#include <projectexplorer/taskwindow.h>
#include <qmleditor/qmldocument.h>
#include <QtCore/QObject>
namespace
QmlProjectManager
{
namespace
Internal
{
class
QmlTaskManager
:
public
QObject
{
Q_OBJECT
public:
QmlTaskManager
(
QObject
*
parent
=
0
);
void
setTaskWindow
(
ProjectExplorer
::
TaskWindow
*
taskWindow
);
public
slots
:
void
documentUpdated
(
QmlEditor
::
QmlDocument
::
Ptr
doc
);
private:
ProjectExplorer
::
TaskWindow
*
m_taskWindow
;
};
}
// Internal
}
// QmlProjectManager
#endif // QMLTASKMANAGER_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment