diff options
author | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-02-16 13:17:53 +0100 |
---|---|---|
committer | Christian Stenger <christian.stenger@theqtcompany.com> | 2015-02-17 10:44:35 +0200 |
commit | b9a60137ad79ec49ffd671e509af4086a4482440 (patch) | |
tree | 6a2f71a9772d94b1c41cee7e6234882353b12fd7 | |
parent | 4caba7a3dda9a22a505d96799233dc35de29dba3 (diff) | |
download | qt-creator-b9a60137ad79ec49ffd671e509af4086a4482440.tar.gz |
Clean up plugin
Change-Id: I695adb992f4d1f32f266f1628f2094e4bcc81485
Reviewed-by: Andre Poenitz <andre.poenitz@theqtcompany.com>
-rw-r--r-- | autotest.pro (renamed from autotest-qtcreator-plugin.pro) | 0 | ||||
-rw-r--r-- | plugins/autotest/autotestplugin.cpp | 29 | ||||
-rw-r--r-- | plugins/autotest/autotestplugin.h | 4 | ||||
-rw-r--r-- | plugins/autotest/autotestunittests.cpp | 1 | ||||
-rw-r--r-- | plugins/autotest/testcodeparser.cpp | 2 | ||||
-rw-r--r-- | plugins/autotest/testrunner.cpp | 6 | ||||
-rw-r--r-- | plugins/autotest/testtreemodel.cpp | 1 |
7 files changed, 8 insertions, 35 deletions
diff --git a/autotest-qtcreator-plugin.pro b/autotest.pro index 77543b34a5..77543b34a5 100644 --- a/autotest-qtcreator-plugin.pro +++ b/autotest.pro diff --git a/plugins/autotest/autotestplugin.cpp b/plugins/autotest/autotestplugin.cpp index 0d6f7be04f..82e20e82c3 100644 --- a/plugins/autotest/autotestplugin.cpp +++ b/plugins/autotest/autotestplugin.cpp @@ -18,6 +18,7 @@ #include "autotestplugin.h" #include "autotestconstants.h" +#include "testcodeparser.h" #include "testrunner.h" #include "testsettings.h" #include "testsettingspage.h" @@ -67,7 +68,6 @@ AutotestPlugin::AutotestPlugin() AutotestPlugin::~AutotestPlugin() { - // Unregister objects from the plugin manager's object pool // Delete members TestTreeModel *model = TestTreeModel::instance(); delete model; @@ -100,11 +100,12 @@ bool AutotestPlugin::checkLicense() void AutotestPlugin::initializeMenuEntries() { - QAction *action = new QAction(tr("Autotest action"), this); + QAction *action = new QAction(tr("Re&scan Tests"), this); Core::Command *command = Core::ActionManager::registerAction(action, Constants::ACTION_ID, Core::Context(Core::Constants::C_GLOBAL)); - command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+Meta+A"))); - connect(action, SIGNAL(triggered()), this, SLOT(triggerAction())); + command->setDefaultKeySequence(QKeySequence(tr("Alt+Shift+T,Alt+S"))); + connect(action, &QAction::triggered, + TestTreeModel::instance()->parser(), &TestCodeParser::updateTestTree); Core::ActionContainer *menu = Core::ActionManager::createMenu(Constants::MENU_ID); menu->menu()->setTitle(tr("Tests")); @@ -114,13 +115,6 @@ void AutotestPlugin::initializeMenuEntries() bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorString) { - // Register objects in the plugin manager's object pool - // Load settings - // Add actions to menus - // Connect to other plugins' signals - // In the initialize function, a plugin can be sure that the plugins it - // depends on have initialized their members. - Q_UNUSED(arguments) Q_UNUSED(errorString) @@ -139,26 +133,13 @@ bool AutotestPlugin::initialize(const QStringList &arguments, QString *errorStri void AutotestPlugin::extensionsInitialized() { - // Retrieve objects from the plugin manager's object pool - // In the extensionsInitialized function, a plugin can be sure that all - // plugins that depend on it are completely initialized. } ExtensionSystem::IPlugin::ShutdownFlag AutotestPlugin::aboutToShutdown() { - // Save settings - // Disconnect from signals that are not needed during shutdown - // Hide UI (if you add UI that is not in the main window directly) return SynchronousShutdown; } -void AutotestPlugin::triggerAction() -{ - QMessageBox::information(Core::ICore::mainWindow(), - tr("Action triggered"), - tr("This is an action from Autotest.")); -} - QList<QObject *> AutotestPlugin::createTestObjects() const { QList<QObject *> tests; diff --git a/plugins/autotest/autotestplugin.h b/plugins/autotest/autotestplugin.h index af5fcc91db..aab664bc2d 100644 --- a/plugins/autotest/autotestplugin.h +++ b/plugins/autotest/autotestplugin.h @@ -45,10 +45,6 @@ public: void extensionsInitialized(); ShutdownFlag aboutToShutdown(); - -private slots: - void triggerAction(); - private: bool checkLicense(); void initializeMenuEntries(); diff --git a/plugins/autotest/autotestunittests.cpp b/plugins/autotest/autotestunittests.cpp index 50556d7e00..1010bbc191 100644 --- a/plugins/autotest/autotestunittests.cpp +++ b/plugins/autotest/autotestunittests.cpp @@ -31,7 +31,6 @@ #include <QSignalSpy> #include <QTest> -#include <QTime> #include <coreplugin/navigationwidget.h> diff --git a/plugins/autotest/testcodeparser.cpp b/plugins/autotest/testcodeparser.cpp index 0a9b8b6893..09c0db0292 100644 --- a/plugins/autotest/testcodeparser.cpp +++ b/plugins/autotest/testcodeparser.cpp @@ -485,7 +485,6 @@ void TestCodeParser::onCppDocumentUpdated(const CPlusPlus::Document::Ptr &docume if (m_cppDocMap.contains(fileName)) { if (m_cppDocMap[fileName].revision() == document->revision() && m_cppDocMap[fileName].editorRevision() == document->editorRevision()) { - qDebug("Skipped due revision equality"); // added to verify if this ever happens.. return; } } else if (!project->files(ProjectExplorer::Project::AllFiles).contains(fileName)) { @@ -510,7 +509,6 @@ void TestCodeParser::onQmlDocumentUpdated(const QmlJS::Document::Ptr &document) const QString fileName = document->fileName(); if (m_quickDocMap.contains(fileName)) { if ((int)m_quickDocMap[fileName].editorRevision() == document->editorRevision()) { - qDebug("Skipped due revision equality (QML)"); // added to verify this ever happens.... return; } } else if (!project->files(ProjectExplorer::Project::AllFiles).contains(fileName)) { diff --git a/plugins/autotest/testrunner.cpp b/plugins/autotest/testrunner.cpp index af1b5e1703..185803fb02 100644 --- a/plugins/autotest/testrunner.cpp +++ b/plugins/autotest/testrunner.cpp @@ -23,8 +23,6 @@ #include "testsettings.h" #include "testxmloutputreader.h" -#include <QDebug> // REMOVE - #include <coreplugin/progressmanager/futureprogress.h> #include <coreplugin/progressmanager/progressmanager.h> @@ -106,7 +104,9 @@ void TestRunner::setSelectedTests(const QList<TestConfiguration *> &selected) m_selectedTests = selected; } -void performTestRun(QFutureInterface<void> &futureInterface, const QList<TestConfiguration *> selectedTests, const int timeout, const QString metricsOption, TestRunner* testRunner) +void performTestRun(QFutureInterface<void> &futureInterface, + const QList<TestConfiguration *> selectedTests, const int timeout, + const QString metricsOption, TestRunner* testRunner) { int testCaseCount = 0; foreach (const TestConfiguration *config, selectedTests) diff --git a/plugins/autotest/testtreemodel.cpp b/plugins/autotest/testtreemodel.cpp index 8b9de455ad..66abadd96a 100644 --- a/plugins/autotest/testtreemodel.cpp +++ b/plugins/autotest/testtreemodel.cpp @@ -801,7 +801,6 @@ QModelIndex TestTreeModel::rootIndexForType(TestTreeModel::Type type) } void TestTreeModel::modifyTestSubtree(QModelIndex &toBeModifiedIndex, const TestTreeItem &newItem) - { if (!toBeModifiedIndex.isValid()) return; |