diff --git a/share/qtcreator/qmljsdebugger/include/qdeclarativedesigndebugserver.h b/share/qtcreator/qmljsdebugger/include/qdeclarativeobserverservice.h similarity index 94% rename from share/qtcreator/qmljsdebugger/include/qdeclarativedesigndebugserver.h rename to share/qtcreator/qmljsdebugger/include/qdeclarativeobserverservice.h index d69fa3c2dee..70b09dbc332 100644 --- a/share/qtcreator/qmljsdebugger/include/qdeclarativedesigndebugserver.h +++ b/share/qtcreator/qmljsdebugger/include/qdeclarativeobserverservice.h @@ -56,12 +56,12 @@ class QDeclarativeContext; class QDeclarativeWatcher; class QDataStream; -class QMLJSDEBUGGER_EXPORT QDeclarativeDesignDebugServer : public QDeclarativeDebugService +class QMLJSDEBUGGER_EXPORT QDeclarativeObserverService : public QDeclarativeDebugService { Q_OBJECT public: - QDeclarativeDesignDebugServer(); - static QDeclarativeDesignDebugServer *instance(); + QDeclarativeObserverService(); + static QDeclarativeObserverService *instance(); void setDesignModeBehavior(bool inDesignMode); void setCurrentObjects(QList items); diff --git a/share/qtcreator/qmljsdebugger/qdeclarativedesigndebugserver.cpp b/share/qtcreator/qmljsdebugger/qdeclarativeobserverservice.cpp similarity index 83% rename from share/qtcreator/qmljsdebugger/qdeclarativedesigndebugserver.cpp rename to share/qtcreator/qmljsdebugger/qdeclarativeobserverservice.cpp index c6bf9d4d369..0398dd05cbd 100644 --- a/share/qtcreator/qmljsdebugger/qdeclarativedesigndebugserver.cpp +++ b/share/qtcreator/qmljsdebugger/qdeclarativeobserverservice.cpp @@ -39,31 +39,31 @@ ** ****************************************************************************/ -#include "qdeclarativedesigndebugserver.h" +#include "qdeclarativeobserverservice.h" #include #include #include -Q_GLOBAL_STATIC(QDeclarativeDesignDebugServer, qmlDesignDebugServer) +Q_GLOBAL_STATIC(QDeclarativeObserverService, serviceInstance) -QDeclarativeDesignDebugServer::QDeclarativeDesignDebugServer() - : QDeclarativeDebugService(QLatin1String("QDeclarativeDesignMode")) +QDeclarativeObserverService::QDeclarativeObserverService() + : QDeclarativeDebugService(QLatin1String("QDeclarativeObserverMode")) { } -QDeclarativeDesignDebugServer *QDeclarativeDesignDebugServer::instance() +QDeclarativeObserverService *QDeclarativeObserverService::instance() { - return qmlDesignDebugServer(); + return serviceInstance(); } -void QDeclarativeDesignDebugServer::enabledChanged(bool enabled) +void QDeclarativeObserverService::enabledChanged(bool enabled) { emit debuggingClientChanged(enabled); } -void QDeclarativeDesignDebugServer::messageReceived(const QByteArray &message) +void QDeclarativeObserverService::messageReceived(const QByteArray &message) { QDataStream ds(message); @@ -145,7 +145,7 @@ void QDeclarativeDesignDebugServer::messageReceived(const QByteArray &message) } } -void QDeclarativeDesignDebugServer::setDesignModeBehavior(bool inDesignMode) +void QDeclarativeObserverService::setDesignModeBehavior(bool inDesignMode) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -156,7 +156,7 @@ void QDeclarativeDesignDebugServer::setDesignModeBehavior(bool inDesignMode) sendMessage(message); } -void QDeclarativeDesignDebugServer::setCurrentObjects(QList objects) +void QDeclarativeObserverService::setCurrentObjects(QList objects) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -172,7 +172,7 @@ void QDeclarativeDesignDebugServer::setCurrentObjects(QList objects) sendMessage(message); } -void QDeclarativeDesignDebugServer::setCurrentTool(QmlViewer::Constants::DesignTool toolId) +void QDeclarativeObserverService::setCurrentTool(QmlViewer::Constants::DesignTool toolId) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -183,7 +183,7 @@ void QDeclarativeDesignDebugServer::setCurrentTool(QmlViewer::Constants::DesignT sendMessage(message); } -void QDeclarativeDesignDebugServer::setAnimationSpeed(qreal slowdownFactor) +void QDeclarativeObserverService::setAnimationSpeed(qreal slowdownFactor) { QByteArray message; @@ -195,7 +195,7 @@ void QDeclarativeDesignDebugServer::setAnimationSpeed(qreal slowdownFactor) sendMessage(message); } -void QDeclarativeDesignDebugServer::reloaded() +void QDeclarativeObserverService::reloaded() { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -205,7 +205,7 @@ void QDeclarativeDesignDebugServer::reloaded() sendMessage(message); } -void QDeclarativeDesignDebugServer::selectedColorChanged(const QColor &color) +void QDeclarativeObserverService::selectedColorChanged(const QColor &color) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -216,7 +216,7 @@ void QDeclarativeDesignDebugServer::selectedColorChanged(const QColor &color) sendMessage(message); } -void QDeclarativeDesignDebugServer::contextPathUpdated(const QStringList &contextPath) +void QDeclarativeObserverService::contextPathUpdated(const QStringList &contextPath) { QByteArray message; QDataStream ds(&message, QIODevice::WriteOnly); @@ -227,7 +227,7 @@ void QDeclarativeDesignDebugServer::contextPathUpdated(const QStringList &contex sendMessage(message); } -QString QDeclarativeDesignDebugServer::idStringForObject(QObject *obj) const +QString QDeclarativeObserverService::idStringForObject(QObject *obj) const { int id = idForObject(obj); QString idString = m_stringIdForObjectId.value(id, QString()); diff --git a/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver.cpp b/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver.cpp index d94de934b7a..48985c9d4f4 100644 --- a/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver.cpp +++ b/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver.cpp @@ -29,7 +29,7 @@ #include "qdeclarativeviewobserver.h" #include "qdeclarativeviewobserver_p.h" -#include "qdeclarativedesigndebugserver.h" +#include "qdeclarativeobserverservice.h" #include "selectiontool.h" #include "zoomtool.h" #include "colorpickertool.h" @@ -85,35 +85,35 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje data->view->setMouseTracking(true); data->view->viewport()->installEventFilter(this); - data->debugServer = QDeclarativeDesignDebugServer::instance(); - connect(data->debugServer, SIGNAL(designModeBehaviorChanged(bool)), SLOT(setDesignModeBehavior(bool))); - connect(data->debugServer, SIGNAL(reloadRequested()), SLOT(_q_reloadView())); - connect(data->debugServer, + data->debugService = QDeclarativeObserverService::instance(); + connect(data->debugService, SIGNAL(designModeBehaviorChanged(bool)), SLOT(setDesignModeBehavior(bool))); + connect(data->debugService, SIGNAL(reloadRequested()), SLOT(_q_reloadView())); + connect(data->debugService, SIGNAL(currentObjectsChanged(QList)), SLOT(_q_onCurrentObjectsChanged(QList))); - connect(data->debugServer, SIGNAL(animationSpeedChangeRequested(qreal)), SLOT(changeAnimationSpeed(qreal))); - connect(data->debugServer, SIGNAL(colorPickerToolRequested()), SLOT(_q_changeToColorPickerTool())); - connect(data->debugServer, SIGNAL(selectMarqueeToolRequested()), SLOT(_q_changeToMarqueeSelectTool())); - connect(data->debugServer, SIGNAL(selectToolRequested()), SLOT(_q_changeToSingleSelectTool())); - connect(data->debugServer, SIGNAL(zoomToolRequested()), SLOT(_q_changeToZoomTool())); - connect(data->debugServer, + connect(data->debugService, SIGNAL(animationSpeedChangeRequested(qreal)), SLOT(changeAnimationSpeed(qreal))); + connect(data->debugService, SIGNAL(colorPickerToolRequested()), SLOT(_q_changeToColorPickerTool())); + connect(data->debugService, SIGNAL(selectMarqueeToolRequested()), SLOT(_q_changeToMarqueeSelectTool())); + connect(data->debugService, SIGNAL(selectToolRequested()), SLOT(_q_changeToSingleSelectTool())); + connect(data->debugService, SIGNAL(zoomToolRequested()), SLOT(_q_changeToZoomTool())); + connect(data->debugService, SIGNAL(objectCreationRequested(QString,QObject*,QStringList,QString)), SLOT(_q_createQmlObject(QString,QObject*,QStringList,QString))); - connect(data->debugServer, + connect(data->debugService, SIGNAL(objectReparentRequested(QObject *, QObject *)), SLOT(_q_reparentQmlObject(QObject *, QObject *))); - connect(data->debugServer, SIGNAL(contextPathIndexChanged(int)), SLOT(_q_changeContextPathIndex(int))); - connect(data->debugServer, SIGNAL(clearComponentCacheRequested()), SLOT(_q_clearComponentCache())); + connect(data->debugService, SIGNAL(contextPathIndexChanged(int)), SLOT(_q_changeContextPathIndex(int))); + connect(data->debugService, SIGNAL(clearComponentCacheRequested()), SLOT(_q_clearComponentCache())); connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)), SLOT(_q_onStatusChanged(QDeclarativeView::Status))); connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), SIGNAL(selectedColorChanged(QColor))); connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)), - data->debugServer, SLOT(selectedColorChanged(QColor))); + data->debugService, SLOT(selectedColorChanged(QColor))); connect(data->subcomponentEditorTool, SIGNAL(cleared()), SIGNAL(inspectorContextCleared())); connect(data->subcomponentEditorTool, SIGNAL(contextPushed(QString)), SIGNAL(inspectorContextPushed(QString))); connect(data->subcomponentEditorTool, SIGNAL(contextPopped()), SIGNAL(inspectorContextPopped())); - connect(data->subcomponentEditorTool, SIGNAL(contextPathChanged(QStringList)), data->debugServer, SLOT(contextPathUpdated(QStringList))); + connect(data->subcomponentEditorTool, SIGNAL(contextPathChanged(QStringList)), data->debugService, SLOT(contextPathUpdated(QStringList))); data->createToolbar(); @@ -132,7 +132,7 @@ void QDeclarativeViewObserver::setInspectorContext(int contextIndex) if (data->subcomponentEditorTool->contextIndex() != contextIndex) { QGraphicsObject *object = data->subcomponentEditorTool->setContext(contextIndex); if (object) - data->debugServer->setCurrentObjects(QList() << object); + data->debugService->setCurrentObjects(QList() << object); } } @@ -251,7 +251,7 @@ bool QDeclarativeViewObserver::mouseReleaseEvent(QMouseEvent *event) data->cursorPos = event->pos(); data->currentTool->mouseReleaseEvent(event); - data->debugServer->setCurrentObjects(AbstractFormEditorTool::toObjectList(selectedItems())); + data->debugService->setCurrentObjects(AbstractFormEditorTool::toObjectList(selectedItems())); return true; } @@ -381,7 +381,7 @@ bool QDeclarativeViewObserver::mouseDoubleClickEvent(QMouseEvent *event) if ((event->buttons() & Qt::LeftButton) && itemToEnter) { QGraphicsObject *objectToEnter = itemToEnter->toGraphicsObject(); if (objectToEnter) - data->debugServer->setCurrentObjects(QList() << objectToEnter); + data->debugService->setCurrentObjects(QList() << objectToEnter); } return true; @@ -410,7 +410,7 @@ void QDeclarativeViewObserver::setDesignModeBehavior(bool value) emit designModeBehaviorChanged(value); data->toolbar->setDesignModeBehavior(value); - data->debugServer->setDesignModeBehavior(value); + data->debugService->setDesignModeBehavior(value); data->designModeBehavior = value; if (data->subcomponentEditorTool) { @@ -460,7 +460,7 @@ void QDeclarativeViewObserverPrivate::setSelectedItemsForTools(QList items) { setSelectedItemsForTools(items); - debugServer->setCurrentObjects(AbstractFormEditorTool::toObjectList(items)); + debugService->setCurrentObjects(AbstractFormEditorTool::toObjectList(items)); } QList QDeclarativeViewObserverPrivate::selectedItems() @@ -555,7 +555,7 @@ void QDeclarativeViewObserverPrivate::_q_changeToSingleSelectTool() changeToSelectTool(); emit q->selectToolActivated(); - debugServer->setCurrentTool(Constants::SelectionToolMode); + debugService->setCurrentTool(Constants::SelectionToolMode); } void QDeclarativeViewObserverPrivate::changeToSelectTool() @@ -576,7 +576,7 @@ void QDeclarativeViewObserverPrivate::_q_changeToMarqueeSelectTool() selectionTool->setRubberbandSelectionMode(true); emit q->marqueeSelectToolActivated(); - debugServer->setCurrentTool(Constants::MarqueeSelectionToolMode); + debugService->setCurrentTool(Constants::MarqueeSelectionToolMode); } void QDeclarativeViewObserverPrivate::_q_changeToZoomTool() @@ -587,7 +587,7 @@ void QDeclarativeViewObserverPrivate::_q_changeToZoomTool() currentTool->clear(); emit q->zoomToolActivated(); - debugServer->setCurrentTool(Constants::ZoomMode); + debugService->setCurrentTool(Constants::ZoomMode); } void QDeclarativeViewObserverPrivate::_q_changeToColorPickerTool() @@ -601,7 +601,7 @@ void QDeclarativeViewObserverPrivate::_q_changeToColorPickerTool() currentTool->clear(); emit q->colorPickerActivated(); - debugServer->setCurrentTool(Constants::ColorPickerMode); + debugService->setCurrentTool(Constants::ColorPickerMode); } void QDeclarativeViewObserverPrivate::_q_changeContextPathIndex(int index) @@ -634,7 +634,7 @@ void QDeclarativeViewObserver::continueExecution(qreal slowdownFactor) data->executionPaused = false; emit executionStarted(data->slowdownFactor); - data->debugServer->setAnimationSpeed(data->slowdownFactor); + data->debugService->setAnimationSpeed(data->slowdownFactor); } void QDeclarativeViewObserver::pauseExecution() @@ -645,7 +645,7 @@ void QDeclarativeViewObserver::pauseExecution() data->executionPaused = true; emit executionPaused(); - data->debugServer->setAnimationSpeed(0); + data->debugService->setAnimationSpeed(0); } void QDeclarativeViewObserverPrivate::_q_applyChangesFromClient() @@ -705,7 +705,7 @@ void QDeclarativeViewObserverPrivate::_q_onStatusChanged(QDeclarativeView::Statu emit q->executionStarted(1.0f); } - debugServer->reloaded(); + debugService->reloaded(); } } @@ -729,7 +729,7 @@ void QDeclarativeViewObserverPrivate::_q_onCurrentObjectsChanged(QList QString QDeclarativeViewObserver::idStringForObject(QObject *obj) { - return QDeclarativeDesignDebugServer::instance()->idStringForObject(obj); + return QDeclarativeObserverService::instance()->idStringForObject(obj); } // adjusts bounding boxes on edges of screen to be visible diff --git a/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver_p.h b/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver_p.h index 85e28b94c21..eb3c593c3b7 100644 --- a/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver_p.h +++ b/share/qtcreator/qmljsdebugger/qdeclarativeviewobserver_p.h @@ -35,7 +35,7 @@ #include #include "qdeclarativeviewobserver.h" -#include "qdeclarativedesigndebugserver.h" +#include "qdeclarativeobserverservice.h" QT_FORWARD_DECLARE_CLASS(JSDebuggerAgent) @@ -67,7 +67,7 @@ public: QDeclarativeView *view; QDeclarativeViewObserver *q; - QDeclarativeDesignDebugServer *debugServer; + QDeclarativeObserverService *debugService; QPointF cursorPos; QList > currentSelection; diff --git a/share/qtcreator/qmljsdebugger/qmljsdebugger-lib.pri b/share/qtcreator/qmljsdebugger/qmljsdebugger-lib.pri index 288b3f35427..2c47e3ad91c 100644 --- a/share/qtcreator/qmljsdebugger/qmljsdebugger-lib.pri +++ b/share/qtcreator/qmljsdebugger/qmljsdebugger-lib.pri @@ -18,7 +18,7 @@ include($$PWD/editor/editor.pri) HEADERS += \ include/jsdebuggeragent.h \ include/qdeclarativeviewobserver.h \ - include/qdeclarativedesigndebugserver.h \ + include/qdeclarativeobserverservice.h \ include/qmlviewerconstants.h \ include/qmljsdebugger_global.h \ qdeclarativeviewobserver_p.h @@ -26,6 +26,6 @@ HEADERS += \ SOURCES += \ jsdebuggeragent.cpp \ qdeclarativeviewobserver.cpp \ - qdeclarativedesigndebugserver.cpp + qdeclarativeobserverservice.cpp OTHER_FILES += qmljsdebugger.pri diff --git a/src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp b/src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp index ee02d3afc5f..38d4c979d1e 100644 --- a/src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp +++ b/src/plugins/qmljsinspector/qmljsdesigndebugclient.cpp @@ -50,7 +50,7 @@ namespace Internal { QmlJSDesignDebugClient::QmlJSDesignDebugClient(QDeclarativeDebugConnection *client, QObject * /*parent*/) - : QDeclarativeDebugClient(QLatin1String("QDeclarativeDesignMode"), client) , + : QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) , m_connection(client) { setEnabled(true); diff --git a/src/tools/qml/qmlobserver/qmlruntime.cpp b/src/tools/qml/qmlobserver/qmlruntime.cpp index fbbeda6efeb..2894da2e355 100644 --- a/src/tools/qml/qmlobserver/qmlruntime.cpp +++ b/src/tools/qml/qmlobserver/qmlruntime.cpp @@ -55,7 +55,7 @@ #endif #include -#include +#include #include #include "qmlruntime.h" @@ -794,10 +794,10 @@ void QDeclarativeViewer::createMenu() designModeBehaviorAction->setShortcut(QKeySequence("Ctrl+D")); designModeBehaviorAction->setCheckable(true); designModeBehaviorAction->setChecked(observer->designModeBehavior()); - designModeBehaviorAction->setEnabled(QDeclarativeDesignDebugServer::hasDebuggingClient()); + designModeBehaviorAction->setEnabled(QDeclarativeObserverService::hasDebuggingClient()); connect(designModeBehaviorAction, SIGNAL(triggered(bool)), this, SLOT(setDesignModeBehavior(bool))); connect(observer, SIGNAL(designModeBehaviorChanged(bool)), designModeBehaviorAction, SLOT(setChecked(bool))); - connect(QDeclarativeDesignDebugServer::instance(), SIGNAL(debuggingClientChanged(bool)), designModeBehaviorAction, SLOT(setEnabled(bool))); + connect(QDeclarativeObserverService::instance(), SIGNAL(debuggingClientChanged(bool)), designModeBehaviorAction, SLOT(setEnabled(bool))); QAction *proxyAction = new QAction(tr("HTTP &Proxy..."), this); connect(proxyAction, SIGNAL(triggered()), this, SLOT(showProxySettings()));