OSDN Git Service

QmlJSDebugClient: Move QmlProfilerTraceClient into library
authorKai Koehne <kai.koehne@nokia.com>
Fri, 5 Aug 2011 09:12:27 +0000 (11:12 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Fri, 5 Aug 2011 10:17:30 +0000 (12:17 +0200)
Change-Id: I1c0821778a3350ec55741b45680fca2cb1fed3aa
Reviewed-on: http://codereview.qt.nokia.com/2680
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
src/libs/qmljsdebugclient/qmljsdebugclient-lib.pri
src/libs/qmljsdebugclient/qmlprofilereventtypes.h [moved from src/plugins/qmlprofiler/qmlprofilereventtypes.h with 96% similarity]
src/libs/qmljsdebugclient/qmlprofilertraceclient.cpp [moved from src/plugins/qmlprofiler/qmlprofilertraceclient.cpp with 99% similarity]
src/libs/qmljsdebugclient/qmlprofilertraceclient.h [moved from src/plugins/qmlprofiler/qmlprofilertraceclient.h with 91% similarity]
src/plugins/qmlprofiler/qmlprofiler.pro
src/plugins/qmlprofiler/qmlprofilereventview.cpp
src/plugins/qmlprofiler/qmlprofilereventview.h
src/plugins/qmlprofiler/tracewindow.cpp
src/plugins/qmlprofiler/tracewindow.h

index c06b426..1eceea4 100644 (file)
@@ -10,12 +10,15 @@ HEADERS += \
     $$PWD/qdeclarativeenginedebug.h \
     $$PWD/qpacketprotocol.h \
     $$PWD/qdeclarativedebugclient.h \
-    $$PWD/qmljsdebugclient_global.h
+    $$PWD/qmljsdebugclient_global.h \
+    $$PWD/qmlprofilertraceclient.h \
+    $$PWD/qmlprofilereventtypes.h
 
 SOURCES += \
     $$PWD/qdeclarativeenginedebug.cpp \
     $$PWD/qpacketprotocol.cpp \
-    $$PWD/qdeclarativedebugclient.cpp
+    $$PWD/qdeclarativedebugclient.cpp \
+    $$PWD/qmlprofilertraceclient.cpp
 
 OTHER_FILES += \
     $$PWD/qmljsdebugclient.pri \
@@ -33,8 +33,7 @@
 #ifndef QMLPROFILEREVENTTYPES_H
 #define QMLPROFILEREVENTTYPES_H
 
-namespace QmlProfiler {
-namespace Internal {
+namespace QmlJsDebugClient {
 
 enum QmlEventType {
     Painting,
@@ -46,7 +45,6 @@ enum QmlEventType {
     MaximumQmlEventType
 };
 
-}
-}
+} // namespace QmlJsDebugClient
 
 #endif //QMLPROFILEREVENTTYPES_H
@@ -32,7 +32,6 @@
 
 #include "qmlprofilertraceclient.h"
 
-using namespace QmlProfiler::Internal;
 using namespace QmlJsDebugClient;
 
 static const int GAP_TIME = 150;
 #ifndef QMLPROFILERTRACECLIENT_H
 #define QMLPROFILERTRACECLIENT_H
 
-#include <qmljsdebugclient/qdeclarativedebugclient.h>
+#include "qdeclarativedebugclient.h"
+#include "qmlprofilereventtypes.h"
+#include "qmljsdebugclient_global.h"
+
 #include <QtCore/QStack>
 #include <QtCore/QStringList>
 
-#include "qmlprofilereventtypes.h"
-
-namespace QmlProfiler {
-namespace Internal {
+namespace QmlJsDebugClient {
 
-struct Location
+struct QMLJSDEBUGCLIENT_EXPORT Location
 {
     Location() : line(-1) {}
     Location(const QString &file, int lineNumber) : fileName(file), line(lineNumber) {}
@@ -50,7 +50,7 @@ struct Location
     int line;
 };
 
-class QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient
+class QMLJSDEBUGCLIENT_EXPORT QmlProfilerTraceClient : public QmlJsDebugClient::QDeclarativeDebugClient
 {
     Q_OBJECT
     Q_PROPERTY(bool recording READ isRecording WRITE setRecording NOTIFY recordingChanged)
@@ -116,7 +116,6 @@ private:
     int m_nestingInType[MaximumQmlEventType];
 };
 
-} // namespace Internal
-} // namespace QmlProfiler
+} // namespace QmlJsDebugClient
 
 #endif // QMLPROFILERTRACECLIENT_H
index 0b3ad3f..107acdc 100644 (file)
@@ -26,7 +26,6 @@ SOURCES += \
     localqmlprofilerrunner.cpp \
     codaqmlprofilerrunner.cpp \
     remotelinuxqmlprofilerrunner.cpp \
-    qmlprofilertraceclient.cpp \
     qmlprofilereventview.cpp \
     qmlprofilerruncontrolfactory.cpp
 
@@ -43,9 +42,7 @@ HEADERS += \
     localqmlprofilerrunner.h \
     codaqmlprofilerrunner.h \
     remotelinuxqmlprofilerrunner.h \
-    qmlprofilertraceclient.h \
     qmlprofilereventview.h \
-    qmlprofilereventtypes.h \
     qmlprofilerruncontrolfactory.h
 
 RESOURCES += \
index 62c9907..aa97693 100644 (file)
@@ -38,6 +38,8 @@
 #include <QtGui/QHeaderView>
 #include <QtGui/QStandardItemModel>
 
+using namespace QmlJsDebugClient;
+
 namespace QmlProfiler {
 namespace Internal {
 
index 857c505..a04b6d3 100644 (file)
@@ -34,7 +34,7 @@
 #define QMLPROFILEREVENTVIEW_H
 
 #include <QTreeView>
-#include "qmlprofilereventtypes.h"
+#include <qmljsdebugclient/qmlprofilereventtypes.h>
 
 namespace QmlProfiler {
 namespace Internal {
@@ -42,7 +42,7 @@ namespace Internal {
 struct QmlEventData
 {
     QmlEventData() : displayname(0) , filename(0) , location(0) , details(0),
-        line(0), eventType(MaximumQmlEventType), level(-1), parentList(0), childrenList(0) {}
+        line(0), eventType(QmlJsDebugClient::MaximumQmlEventType), level(-1), parentList(0), childrenList(0) {}
     ~QmlEventData() {
         delete displayname;
         delete filename;
@@ -55,7 +55,7 @@ struct QmlEventData
     QString *location;
     QString *details;
     int line;
-    QmlEventType eventType;
+    QmlJsDebugClient::QmlEventType eventType;
     qint64 level;
     QList< QmlEventData *> *parentList;
     QList< QmlEventData *> *childrenList;
index 380a54d..f3ab972 100644 (file)
@@ -33,9 +33,9 @@
 #include "tracewindow.h"
 
 #include "qmlprofilerplugin.h"
-#include "qmlprofilertraceclient.h"
 
 #include <qmljsdebugclient/qdeclarativedebugclient.h>
+#include <qmljsdebugclient/qmlprofilertraceclient.h>
 #include <utils/styledbar.h>
 
 #include <QtDeclarative/QDeclarativeView>
@@ -44,6 +44,8 @@
 #include <QtGui/QToolButton>
 #include <QtGui/QGraphicsObject>
 
+using namespace QmlJsDebugClient;
+
 namespace QmlProfiler {
 namespace Internal {
 
@@ -112,7 +114,7 @@ TraceWindow::~TraceWindow()
     delete m_plugin.data();
 }
 
-void TraceWindow::reset(QmlJsDebugClient::QDeclarativeDebugConnection *conn)
+void TraceWindow::reset(QDeclarativeDebugConnection *conn)
 {
     if (m_plugin)
         disconnect(m_plugin.data(), SIGNAL(complete()), this, SIGNAL(viewUpdated()));
index ffd414d..5629f97 100644 (file)
@@ -33,7 +33,7 @@
 #ifndef TRACEWINDOW_H
 #define TRACEWINDOW_H
 
-#include "qmlprofilertraceclient.h"
+#include <qmljsdebugclient/qmlprofilertraceclient.h>
 
 #include <QtCore/QPointer>
 #include <QtGui/QWidget>
@@ -79,7 +79,7 @@ signals:
     void enableToolbar(bool);
 
 private:
-    QWeakPointer<QmlProfilerTraceClient> m_plugin;
+    QWeakPointer<QmlJsDebugClient::QmlProfilerTraceClient> m_plugin;
     QSize m_sizeHint;
 
     QDeclarativeView *m_view;