From ac61c9a91885f373d021c15a6279cd81d64bbbf5 Mon Sep 17 00:00:00 2001 From: Kai Koehne <kai.koehne@nokia.com> Date: Fri, 25 Mar 2011 09:21:00 +0100 Subject: [PATCH] QmlProfiler: Namespace fixes Use own namespace (QmlProfiler) instead of Analyzer. --- src/plugins/qmlprofiler/qmlprofilerengine.cpp | 4 ++-- src/plugins/qmlprofiler/qmlprofilerengine.h | 11 +++++------ src/plugins/qmlprofiler/qmlprofilerplugin.cpp | 2 +- src/plugins/qmlprofiler/qmlprofilerplugin.h | 4 ++-- src/plugins/qmlprofiler/qmlprofilertool.cpp | 3 +-- src/plugins/qmlprofiler/qmlprofilertool.h | 16 ++++++++-------- src/plugins/qmlprofiler/timelineview.cpp | 2 ++ src/plugins/qmlprofiler/timelineview.h | 12 +++++++++--- src/plugins/qmlprofiler/tracewindow.cpp | 10 +++++++++- src/plugins/qmlprofiler/tracewindow.h | 11 +++++++++-- 10 files changed, 48 insertions(+), 27 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 657ac872b76..e7e01589180 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -27,7 +27,7 @@ #include <unistd.h> // sleep #endif -using namespace Analyzer::Internal; +using namespace QmlProfiler::Internal; class QmlProfilerEngine::QmlProfilerEnginePrivate { @@ -88,7 +88,7 @@ void QmlProfilerEngine::stop() void QmlProfilerEngine::spontaneousStop() { - AnalyzerManager::instance()->stopTool(); + Analyzer::AnalyzerManager::instance()->stopTool(); } void QmlProfilerEngine::viewUpdated() diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index cc3449cb050..7b51939eda0 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -1,13 +1,12 @@ #ifndef QMLPROFILERENGINE_H #define QMLPROFILERENGINE_H -#include "ianalyzerengine.h" +#include <analyzerbase/ianalyzerengine.h> -namespace Analyzer { +namespace QmlProfiler { namespace Internal { - -class QmlProfilerEngine : public IAnalyzerEngine +class QmlProfilerEngine : public Analyzer::IAnalyzerEngine { Q_OBJECT public: @@ -31,7 +30,7 @@ private: QmlProfilerEnginePrivate *d; }; -} -} +} // namespace Internal +} // namespace QmlProfiler #endif // QMLPROFILERENGINE_H diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp index 0e6b871c597..e94f1933aa5 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.cpp @@ -20,7 +20,7 @@ #include "qmlprofilertool.h" using namespace Analyzer; -using namespace Analyzer::Internal; +using namespace QmlProfiler::Internal; QmlProfilerPlugin *QmlProfilerPlugin::m_instance = 0; bool QmlProfilerPlugin::debugOutput = false; diff --git a/src/plugins/qmlprofiler/qmlprofilerplugin.h b/src/plugins/qmlprofiler/qmlprofilerplugin.h index 5707c87b18e..223010b178d 100644 --- a/src/plugins/qmlprofiler/qmlprofilerplugin.h +++ b/src/plugins/qmlprofiler/qmlprofilerplugin.h @@ -5,7 +5,7 @@ #include <extensionsystem/iplugin.h> -namespace Analyzer { +namespace QmlProfiler { namespace Internal { class QmlProfilerPlugin : public ExtensionSystem::IPlugin @@ -32,7 +32,7 @@ private: }; } // namespace Internal -} // namespace Analyzer +} // namespace QmlProfiler #endif // QMLPROFILERPLUGIN_H diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index 9e3d2553bb9..a403ec06916 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -28,9 +28,8 @@ #include <QtGui/QHBoxLayout> #include <QtGui/QLabel> - using namespace Analyzer; -using namespace Analyzer::Internal; +using namespace QmlProfiler::Internal; QString QmlProfilerTool::host = QLatin1String("localhost"); quint16 QmlProfilerTool::port = 33456; diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h index 19c3a7ce337..9384733719e 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.h +++ b/src/plugins/qmlprofiler/qmlprofilertool.h @@ -1,13 +1,13 @@ #ifndef QMLPROFILERTOOL_H #define QMLPROFILERTOOL_H -#include "ianalyzertool.h" -#include "ianalyzerengine.h" +#include <analyzerbase/ianalyzertool.h> +#include <analyzerbase/ianalyzerengine.h> -namespace Analyzer { +namespace QmlProfiler { namespace Internal { -class QmlProfilerTool : public IAnalyzerTool +class QmlProfilerTool : public Analyzer::IAnalyzerTool { Q_OBJECT public: @@ -20,9 +20,9 @@ public: void initialize(ExtensionSystem::IPlugin *plugin); - IAnalyzerEngine *createEngine(ProjectExplorer::RunConfiguration *runConfiguration); + Analyzer::IAnalyzerEngine *createEngine(ProjectExplorer::RunConfiguration *runConfiguration); - IAnalyzerOutputPaneAdapter *outputPaneAdapter(); + Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter(); QWidget *createToolBarWidget(); QWidget *createTimeLineWidget(); @@ -48,7 +48,7 @@ private: QmlProfilerToolPrivate *d; }; -} -} +} // namespace Internal +} // namespace QmlProfiler #endif // QMLPROFILERTOOL_H diff --git a/src/plugins/qmlprofiler/timelineview.cpp b/src/plugins/qmlprofiler/timelineview.cpp index 3c951237e27..bde435f58a4 100644 --- a/src/plugins/qmlprofiler/timelineview.cpp +++ b/src/plugins/qmlprofiler/timelineview.cpp @@ -3,6 +3,8 @@ #include <qdeclarativecontext.h> #include <qdeclarativeproperty.h> +using namespace QmlProfiler::Internal; + TimelineView::TimelineView(QDeclarativeItem *parent) : QDeclarativeItem(parent), m_delegate(0), m_startTime(0), m_endTime(0), m_startX(0), prevMin(0), prevMax(0), m_totalWidth(0) diff --git a/src/plugins/qmlprofiler/timelineview.h b/src/plugins/qmlprofiler/timelineview.h index 0235d34aec6..ab3aad1a536 100644 --- a/src/plugins/qmlprofiler/timelineview.h +++ b/src/plugins/qmlprofiler/timelineview.h @@ -1,8 +1,11 @@ #ifndef TIMELINEVIEW_H #define TIMELINEVIEW_H -#include <QDeclarativeItem> -#include <QScriptValue> +#include <QtDeclarative/QDeclarativeItem> +#include <QtScript/QScriptValue> + +namespace QmlProfiler { +namespace Internal { class TimelineView : public QDeclarativeItem { @@ -104,6 +107,9 @@ private: qreal m_totalWidth; }; -QML_DECLARE_TYPE(TimelineView) +} // namespace Internal +} // namespace QmlProfiler + +QML_DECLARE_TYPE(QmlProfiler::Internal::TimelineView) #endif // TIMELINEVIEW_H diff --git a/src/plugins/qmlprofiler/tracewindow.cpp b/src/plugins/qmlprofiler/tracewindow.cpp index aa245fd1f32..0423e73ddf7 100644 --- a/src/plugins/qmlprofiler/tracewindow.cpp +++ b/src/plugins/qmlprofiler/tracewindow.cpp @@ -52,6 +52,9 @@ #define GAP_TIME 150 +namespace QmlProfiler { +namespace Internal { + struct Location { Location() : line(-1) {} @@ -131,6 +134,11 @@ private: bool m_recording; }; +} // namespace Internal +} // namespace QmlProfiler + +using namespace QmlProfiler::Internal; + TracePlugin::TracePlugin(QDeclarativeDebugConnection *client) : QDeclarativeDebugClient(QLatin1String("CanvasFrameRate"), client), m_inProgressRanges(0), m_maximumTime(0), m_recording(false) { @@ -252,7 +260,7 @@ TraceWindow::TraceWindow(QWidget *parent) m_view = new QDeclarativeView(this); - if (Analyzer::Internal::QmlProfilerPlugin::debugOutput) { + if (QmlProfilerPlugin::debugOutput) { //new QmlJSDebugger::JSDebuggerAgent(m_view->engine()); //new QmlJSDebugger::QDeclarativeViewObserver(m_view, m_view); } diff --git a/src/plugins/qmlprofiler/tracewindow.h b/src/plugins/qmlprofiler/tracewindow.h index 03d3cc37547..ff1dd477cc7 100644 --- a/src/plugins/qmlprofiler/tracewindow.h +++ b/src/plugins/qmlprofiler/tracewindow.h @@ -29,11 +29,12 @@ #ifndef CANVASFRAMERATE_H #define CANVASFRAMERATE_H -#include <private/qdeclarativedebugclient_p.h> - #include <QtCore/qpointer.h> #include <QtGui/qwidget.h> +#include <QtDeclarative/private/qdeclarativedebugclient_p.h> + + QT_BEGIN_NAMESPACE class QTabWidget; class QSlider; @@ -44,6 +45,9 @@ class QPushButton; class QDeclarativeView; QT_END_NAMESPACE +namespace QmlProfiler { +namespace Internal { + class TracePlugin; class TraceWindow : public QWidget @@ -75,5 +79,8 @@ private: QDeclarativeView *m_view; }; +} // namespace Internal +} // namespace QmlProfiler + #endif // CANVASFRAMERATE_H -- GitLab