Commit a88a635e authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Let's start from scratch with a new debugger for QmlJS.

parent 92e4fd9f
...@@ -43,10 +43,10 @@ contains(QT_CONFIG, declarative) { ...@@ -43,10 +43,10 @@ contains(QT_CONFIG, declarative) {
include(../private_headers.pri) include(../private_headers.pri)
exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) { exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
SUBDIRS += plugin_qmldesigner \ SUBDIRS += plugin_qmldesigner \
plugin_qmlinspector plugin_qmljsinspector
} else { } else {
warning() warning()
warning("QmlDesigner and QmlInspector plugins have been disabled") warning("QmlDesigner and QmlJSInspector plugins have been disabled")
warning("The plugins depend on on private headers from QtDeclarative module.") warning("The plugins depend on on private headers from QtDeclarative module.")
warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.") warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.")
warning() warning()
...@@ -200,12 +200,10 @@ plugin_qmldesigner.depends = plugin_coreplugin ...@@ -200,12 +200,10 @@ plugin_qmldesigner.depends = plugin_coreplugin
plugin_qmldesigner.depends += plugin_texteditor plugin_qmldesigner.depends += plugin_texteditor
plugin_qmldesigner.depends += plugin_qmljseditor plugin_qmldesigner.depends += plugin_qmljseditor
plugin_qmlinspector.subdir = qmlinspector plugin_qmljsinspector.subdir = qmljsinspector
plugin_qmlinspector.depends += plugin_projectexplorer plugin_qmljsinspector.depends += plugin_projectexplorer
plugin_qmlinspector.depends += plugin_cppeditor plugin_qmljsinspector.depends += plugin_qmlprojectmanager
plugin_qmlinspector.depends += plugin_qmlprojectmanager plugin_qmljsinspector.depends += plugin_debugger
plugin_qmlinspector.depends += plugin_debugger
plugin_qmlinspector.depends += plugin_cpptools
plugin_mercurial.subdir = mercurial plugin_mercurial.subdir = mercurial
plugin_mercurial.depends = plugin_vcsbase plugin_mercurial.depends = plugin_vcsbase
......
<plugin name="QmlInspector" version="2.1.80" compatVersion="2.1.80"> <plugin name="QmlJSInspector" version="2.1.80" compatVersion="2.1.80">
<vendor>Nokia Corporation</vendor> <vendor>Nokia Corporation</vendor>
<copyright>(C) 2010 Nokia Corporation</copyright> <copyright>(C) 2010 Nokia Corporation</copyright>
<license> <license>
......
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#include "qmljsdebuggerclient.h"
using namespace QmlJSInspector::Internal;
DebuggerClient::DebuggerClient(QDeclarativeDebugConnection *client, Debugger::Internal::QmlEngine *engine)
: QDeclarativeDebugClient(QLatin1String("Debugger"), client)
, connection(client), engine(engine)
{
connect(engine, SIGNAL(sendMessage(QByteArray)), this, SLOT(slotSendMessage(QByteArray)));
setEnabled(true);
}
DebuggerClient::~DebuggerClient()
{
}
void DebuggerClient::messageReceived(const QByteArray &data)
{
engine->messageReceived(data);
}
void DebuggerClient::slotSendMessage(const QByteArray &message)
{
QDeclarativeDebugClient::sendMessage(message);
}
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/
#ifndef QMLJSDEBUGGERCLIENT_H
#define QMLJSDEBUGGERCLIENT_H
#include <debugger/qml/qmlengine.h>
#include <debugger/stackframe.h>
#include <debugger/stackhandler.h>
#include <debugger/debuggerrunner.h>
#include <private/qdeclarativedebugclient_p.h> // QML private API
namespace QmlJSInspector {
namespace Internal {
class DebuggerClient : public QDeclarativeDebugClient
{
Q_OBJECT
public:
DebuggerClient(QDeclarativeDebugConnection *client, Debugger::Internal::QmlEngine *engine);
virtual ~DebuggerClient();
public: // attributes
QDeclarativeDebugConnection *connection;
Debugger::Internal::QmlEngine *engine;
private Q_SLOTS:
void slotSendMessage(const QByteArray &message);
protected:
virtual void messageReceived(const QByteArray &data);
};
} // Internal
} // QmlJSInspector
#endif // QMLJSDEBUGGERCLIENT_H
TEMPLATE = lib TEMPLATE = lib
TARGET = QmlInspector TARGET = QmlJSInspector
INCLUDEPATH += . INCLUDEPATH += .
DEPENDPATH += . DEPENDPATH += .
QT += declarative
include(../../private_headers.pri) include(../../private_headers.pri)
DEFINES += QMLINSPECTOR_LIBRARY DEFINES += QMLJSINSPECTOR_LIBRARY
HEADERS += qmlinspectorplugin.h \ HEADERS += \
qmlinspectorconstants.h \ qmljsdebuggerclient.h \
qmlinspector_global.h \ qmljsinspector_global.h \
inspectorcontext.h \ qmljsinspectorconstants.h \
qmljsinspectorcontext.h \
qmljsinspectorplugin.h
SOURCES += qmlinspectorplugin.cpp \ SOURCES += \
inspectorcontext.cpp qmljsdebuggerclient.cpp \
qmljsinspectorcontext.cpp \
qmljsinspectorplugin.cpp
OTHER_FILES += QmlInspector.pluginspec OTHER_FILES += QmlJSInspector.pluginspec
RESOURCES += qmlinspector.qrc RESOURCES += qmljsinspector.qrc
include(../../qtcreatorplugin.pri) include(../../qtcreatorplugin.pri)
include(../../plugins/projectexplorer/projectexplorer.pri) include(../../plugins/projectexplorer/projectexplorer.pri)
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if defined(QMLINSPECTOR_LIBRARY) #if defined(QMLJSINSPECTOR_LIBRARY)
# define QMLINSPECTOR_EXPORT Q_DECL_EXPORT # define QMLINSPECTOR_EXPORT Q_DECL_EXPORT
#else #else
# define QMLINSPECTOR_EXPORT Q_DECL_IMPORT # define QMLINSPECTOR_EXPORT Q_DECL_IMPORT
......
...@@ -26,10 +26,10 @@ ...@@ -26,10 +26,10 @@
** contact the sales department at http://qt.nokia.com/contact. ** contact the sales department at http://qt.nokia.com/contact.
** **
**************************************************************************/ **************************************************************************/
#ifndef QMLINSPECTORCONSTANTS_H #ifndef QMLJSINSPECTORCONSTANTS_H
#define QMLINSPECTORCONSTANTS_H #define QMLJSINSPECTORCONSTANTS_H
namespace QmlInspector { namespace QmlJSInspector {
namespace Constants { namespace Constants {
const char * const RUN = "QmlInspector.Run"; const char * const RUN = "QmlInspector.Run";
const char * const STOP = "QmlInspector.Stop"; const char * const STOP = "QmlInspector.Stop";
......
...@@ -27,15 +27,15 @@ ...@@ -27,15 +27,15 @@
** **
**************************************************************************/ **************************************************************************/
#include "inspectorcontext.h" #include "qmljsinspectorcontext.h"
#include "qmlinspectorconstants.h" #include "qmljsinspectorconstants.h"
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtCore/QDebug> #include <QtCore/QDebug>
using namespace QmlInspector::Internal; using namespace QmlJSInspector::Internal;
using namespace QmlInspector::Constants; using namespace QmlJSInspector::Constants;
InspectorContext::InspectorContext(QWidget *widget) InspectorContext::InspectorContext(QWidget *widget)
: IContext(widget), : IContext(widget),
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
** **
**************************************************************************/ **************************************************************************/
#ifndef INSPECTORCONTEXT_H #ifndef QMLJSINSPECTORCONTEXT_H
#define INSPECTORCONTEXT_H #define QMLJSINSPECTORCONTEXT_H
#include <coreplugin/icontext.h> #include <coreplugin/icontext.h>
#include <QList> #include <QList>
...@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE ...@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
class QWidget; class QWidget;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace QmlInspector { namespace QmlJSInspector {
namespace Internal { namespace Internal {
class ObjectPropertiesView; class ObjectPropertiesView;
...@@ -72,4 +72,5 @@ private: ...@@ -72,4 +72,5 @@ private:
} // Internal } // Internal
} // QmlInspector } // QmlInspector
#endif // DESIGNMODECONTEXT_H #endif
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
** **
**************************************************************************/ **************************************************************************/
#include "qmlinspectorconstants.h" #include "qmljsinspectorconstants.h"
#include "qmlinspectorplugin.h" #include "qmljsinspectorplugin.h"
#include <debugger/debuggeruiswitcher.h> #include <debugger/debuggeruiswitcher.h>
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
using namespace QmlInspector::Internal; using namespace QmlJSInspector::Internal;
using namespace QmlInspector::Constants; using namespace QmlJSInspector::Constants;
namespace { namespace {
QToolButton *createToolButton(QAction *action) QToolButton *createToolButton(QAction *action)
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
** contact the sales department at http://qt.nokia.com/contact. ** contact the sales department at http://qt.nokia.com/contact.
** **
**************************************************************************/ **************************************************************************/
#ifndef QMLINSPECTORPLUGIN_H #ifndef QMLJSINSPECTORPLUGIN_H
#define QMLINSPECTORPLUGIN_H #define QMLJSINSPECTORPLUGIN_H
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
...@@ -45,7 +45,7 @@ namespace ProjectExplorer { ...@@ -45,7 +45,7 @@ namespace ProjectExplorer {
class Project; class Project;
} }
namespace QmlInspector { namespace QmlJSInspector {
namespace Internal { namespace Internal {
class QmlInspectorPlugin : public ExtensionSystem::IPlugin class QmlInspectorPlugin : public ExtensionSystem::IPlugin
...@@ -69,6 +69,6 @@ private slots: ...@@ -69,6 +69,6 @@ private slots:
}; };
} // end of namespace Internal } // end of namespace Internal
} // end of namespace QmlInspector } // end of QmlJSInspector
#endif // QMLINSPECTORPLUGIN_H #endif // QMLINSPECTORPLUGIN_H
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#include <debugger/debuggerconstants.h> #include <debugger/debuggerconstants.h>
#include <debugger/debuggeruiswitcher.h> #include <debugger/debuggeruiswitcher.h>
#include <qmlinspector/qmlinspectorconstants.h> #include <qmljsinspector/qmljsinspectorconstants.h>
#include <QDir> #include <QDir>
#include <QLabel> #include <QLabel>
...@@ -86,7 +86,7 @@ void QmlRunControl::start() ...@@ -86,7 +86,7 @@ void QmlRunControl::start()
// FIXME this line should be refactored out in order to remove the dependency between // FIXME this line should be refactored out in order to remove the dependency between
// debugger and qmlprojectmanager, because debugger also relies on cpptools. // debugger and qmlprojectmanager, because debugger also relies on cpptools.
Debugger::DebuggerUISwitcher::instance()->setActiveLanguage(QmlInspector::Constants::LANG_QML); Debugger::DebuggerUISwitcher::instance()->setActiveLanguage(QmlJSInspector::Constants::LANG_QML);
emit started(); emit started();
emit appendMessage(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable), emit appendMessage(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
......
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