Commit b9a60137 authored by Christian Stenger's avatar Christian Stenger
Browse files

Clean up plugin



Change-Id: I695adb992f4d1f32f266f1628f2094e4bcc81485
Reviewed-by: default avatarAndre Poenitz <andre.poenitz@theqtcompany.com>
parent 4caba7a3
......@@ -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;
......
......@@ -45,10 +45,6 @@ public:
void extensionsInitialized();
ShutdownFlag aboutToShutdown();
private slots:
void triggerAction();
private:
bool checkLicense();
void initializeMenuEntries();
......
......@@ -31,7 +31,6 @@
#include <QSignalSpy>
#include <QTest>
#include <QTime>
#include <coreplugin/navigationwidget.h>
......
......@@ -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)) {
......
......@@ -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)
......
......@@ -801,7 +801,6 @@ QModelIndex TestTreeModel::rootIndexForType(TestTreeModel::Type type)
}
void TestTreeModel::modifyTestSubtree(QModelIndex &toBeModifiedIndex, const TestTreeItem &newItem)
{
if (!toBeModifiedIndex.isValid())
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment