From 8d567174a90c0ba090989c751b2c0016a482df50 Mon Sep 17 00:00:00 2001
From: hjk <qtc-committer@nokia.com>
Date: Tue, 28 Jun 2011 19:14:08 +0200
Subject: [PATCH] analyzer: more verbosity in the tool description

Change-Id: Ie259c78710c9e926f75595a7c22195efb7036532
Reviewed-on: http://codereview.qt.nokia.com/856
Reviewed-by: hjk <qthjk@ovi.com>
---
 src/plugins/analyzerbase/ianalyzertool.h    | 31 ++++++++++++---------
 src/plugins/qmlprofiler/qmlprofilertool.cpp | 20 ++++++++-----
 src/plugins/qmlprofiler/qmlprofilertool.h   |  3 +-
 src/plugins/valgrind/callgrindtool.cpp      |  8 +++++-
 src/plugins/valgrind/callgrindtool.h        |  1 +
 src/plugins/valgrind/memchecktool.cpp       | 14 ++++++++--
 src/plugins/valgrind/memchecktool.h         |  1 +
 7 files changed, 53 insertions(+), 25 deletions(-)

diff --git a/src/plugins/analyzerbase/ianalyzertool.h b/src/plugins/analyzerbase/ianalyzertool.h
index 1c9266feca3..f9c45662de6 100644
--- a/src/plugins/analyzerbase/ianalyzertool.h
+++ b/src/plugins/analyzerbase/ianalyzertool.h
@@ -62,19 +62,23 @@ class IAnalyzerEngine;
 class ANALYZER_EXPORT IAnalyzerTool : public QObject
 {
     Q_OBJECT
+
 public:
     explicit IAnalyzerTool(QObject *parent = 0);
 
-    /// @return unique ID for this tool
+    /// Returns a unique ID for this tool.
     virtual QString id() const = 0;
-    /// @return user readable display name for this tool
+    /// Returns a short user readable display name for this tool.
     virtual QString displayName() const = 0;
+    /// Returns a user readable description name for this tool.
+    virtual QString description() const = 0;
 
     /**
      * The mode in which this tool should preferably be run
      *
-     * memcheck, for example, requires debug symbols, hence DebugMode is preferred.
-     * otoh callgrind should look at optimized code, hence ReleaseMode.
+     * The memcheckt tool, for example, requires debug symbols, hence DebugMode
+     * is preferred. On the other hand, callgrind should look at optimized code,
+     * hence ReleaseMode.
      */
     enum ToolMode {
         DebugMode,
@@ -86,28 +90,29 @@ public:
     static QString modeString(ToolMode mode);
 
     /**
-     * The implementation should setup widgets for the output pane here and optionally add
-     * dock widgets in the analyzation mode if wanted.
+     * The implementation should setup widgets for the output pane here and
+     * optionally add dock widgets in the analyzation mode if wanted.
      */
     virtual void initialize() = 0;
-    /// gets called after all analyzation tools where initialized.
+    /// This gets called after all analyzation tools where initialized.
     virtual void extensionsInitialized() = 0;
 
     /**
-      * Called to add all dock widgets if tool becomes active first time.
+      * This is called to add all dock widgets if tool becomes active first time.
       * \sa AnalzyerManager::createDockWidget
       */
     virtual void initializeDockWidgets();
 
-    /// subclass to return a control widget which will be shown
-    /// in the output pane when this tool is selected
+    /// Returns a control widget which will be shown
+    /// in the output pane when this tool is selected.
     virtual QWidget *createControlWidget();
 
-    /// @return a new engine for the given start parameters. Called each time the tool is launched.
+    /// Returns a new engine for the given start parameters.
+    /// Called each time the tool is launched.
     virtual IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
-                                          ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
+        ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
 
-    /// @return true when this tool can be run remotely, e.g. on a meego or maemo device
+    /// Returns true when this tool can be run on a remote machine.
     virtual bool canRunRemotely() const = 0;
 };
 
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 3b582f3f399..65560485515 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -150,27 +150,33 @@ QString QmlProfilerTool::displayName() const
     return tr("QML Profiler");
 }
 
+QString QmlProfilerTool::description() const
+{
+    return tr("The QML Profiler can be used to find performance bottlenecks in "
+              "applications using QML.");
+}
+
 IAnalyzerTool::ToolMode QmlProfilerTool::mode() const
 {
     return AnyMode;
 }
 
 IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
-                                               ProjectExplorer::RunConfiguration *runConfiguration)
+    ProjectExplorer::RunConfiguration *runConfiguration)
 {
     QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
 
-    // Check minimum Qt Version. We cannot really be sure what the Qt version at runtime is,
-    // but guess that the active build configuraiton has been used.
-    QtSupport::QtVersionNumber minimumVersion(4,7,4);
+    // Check minimum Qt Version. We cannot really be sure what the Qt version
+    // at runtime is, but guess that the active build configuraiton has been used.
+    QtSupport::QtVersionNumber minimumVersion(4, 7, 4);
     if (Qt4ProjectManager::Qt4BuildConfiguration *qt4Config
             = qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(
                 runConfiguration->target()->activeBuildConfiguration())) {
         if (qt4Config->qtVersion()->isValid() && qt4Config->qtVersion()->qtVersion() < minimumVersion) {
             int result = QMessageBox::warning(QApplication::activeWindow(), tr("QML Profiler"),
-                                 "The QML profiler requires Qt 4.7.4 or newer.\n"
-                                 "The Qt version configured in your active build configuration is too old.\n"
-                                 "Do you want to continue?", QMessageBox::Yes, QMessageBox::No);
+                 "The QML profiler requires Qt 4.7.4 or newer.\n"
+                 "The Qt version configured in your active build configuration is too old.\n"
+                 "Do you want to continue?", QMessageBox::Yes, QMessageBox::No);
             if (result == QMessageBox::No)
                 return 0;
         }
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.h b/src/plugins/qmlprofiler/qmlprofilertool.h
index 759bb84290d..583070d55ac 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.h
+++ b/src/plugins/qmlprofiler/qmlprofilertool.h
@@ -50,6 +50,7 @@ public:
 
     QString id() const;
     QString displayName() const;
+    QString description() const;
     ToolMode mode() const;
 
     void initialize();
@@ -57,7 +58,7 @@ public:
     void initializeDockWidgets();
 
     Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
-                                            ProjectExplorer::RunConfiguration *runConfiguration = 0);
+        ProjectExplorer::RunConfiguration *runConfiguration = 0);
 
     QWidget *createControlWidget();
 
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index 6e52521124c..da9a37da70a 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -521,7 +521,13 @@ QString CallgrindTool::id() const
 
 QString CallgrindTool::displayName() const
 {
-    return tr("Profile");
+    return tr("Valgrind Function Profile");
+}
+
+QString CallgrindTool::description() const
+{
+    return tr("Valgrind Profile uses the \"callgrind\" tool to "
+              "record function calls when a program runs.");
 }
 
 IAnalyzerTool::ToolMode CallgrindTool::mode() const
diff --git a/src/plugins/valgrind/callgrindtool.h b/src/plugins/valgrind/callgrindtool.h
index 606d183df59..3e6d1eeb515 100644
--- a/src/plugins/valgrind/callgrindtool.h
+++ b/src/plugins/valgrind/callgrindtool.h
@@ -50,6 +50,7 @@ public:
 
     QString id() const;
     QString displayName() const;
+    QString description() const;
     ToolMode mode() const;
 
     void initialize();
diff --git a/src/plugins/valgrind/memchecktool.cpp b/src/plugins/valgrind/memchecktool.cpp
index b391ca16970..54a399b1e92 100644
--- a/src/plugins/valgrind/memchecktool.cpp
+++ b/src/plugins/valgrind/memchecktool.cpp
@@ -195,12 +195,14 @@ MemcheckTool::MemcheckTool(QObject *parent)
     setObjectName(QLatin1String("MemcheckTool"));
 
     m_filterProjectAction = new QAction(tr("External Errors"), this);
-    m_filterProjectAction->setToolTip(tr("Show issues originating outside currently opened projects."));
+    m_filterProjectAction->setToolTip(
+        tr("Show issues originating outside currently opened projects."));
     m_filterProjectAction->setCheckable(true);
 
     m_suppressionSeparator = new QAction(tr("Suppressions"), this);
     m_suppressionSeparator->setSeparator(true);
-    m_suppressionSeparator->setToolTip(tr("These suppression files were used in the last memory analyzer run."));
+    m_suppressionSeparator->setToolTip(
+        tr("These suppression files were used in the last memory analyzer run."));
 
     QAction *a = new QAction(tr("Definite Memory Leaks"), this);
     initKindFilterAction(a, QList<int>() << Leak_DefinitelyLost << Leak_IndirectlyLost);
@@ -297,7 +299,13 @@ QString MemcheckTool::id() const
 
 QString MemcheckTool::displayName() const
 {
-    return tr("Analyze Memory");
+    return tr("Valgrind Analyze Memory");
+}
+
+QString MemcheckTool::description() const
+{
+    return tr("Valgrind Analyze Memory uses the \"memcheck\" tool to find "
+        "memory leaks");
 }
 
 IAnalyzerTool::ToolMode MemcheckTool::mode() const
diff --git a/src/plugins/valgrind/memchecktool.h b/src/plugins/valgrind/memchecktool.h
index 820aeb5e512..fe75afb6b76 100644
--- a/src/plugins/valgrind/memchecktool.h
+++ b/src/plugins/valgrind/memchecktool.h
@@ -95,6 +95,7 @@ public:
 
     QString id() const;
     QString displayName() const;
+    QString description() const;
     ToolMode mode() const;
 
 private slots:
-- 
GitLab