Commit 615660c0 authored by hjk's avatar hjk
Browse files

Fixes: qtestlibplugin: some care for dead code

parent 6bf55b61
......@@ -33,8 +33,8 @@
#include "qtestlibplugin.h"
//#include <Qt4IProjectManagers>
//#include <texteditor/TextEditorInterfaces>
#include <coreplugin/icore.h>
#include <texteditor/itexteditor.h>
#include <QtCore/QDebug>
#include <QtCore/QDir>
......@@ -116,28 +116,27 @@ static QTestFunction::MessageType stringToMessageType(const QString &str)
}
// -----------------------------------
QTestLibPlugin::QTestLibPlugin() :
m_projectExplorer(0),
m_core(0),
m_outputPane(0)
QTestLibPlugin::QTestLibPlugin()
: m_projectExplorer(0), m_outputPane(0)
{
}
QTestLibPlugin::~QTestLibPlugin()
{
if (m_core && m_outputPane)
m_core->pluginManager()->removeObject(m_outputPane);
if (m_outputPane)
ExtensionSystem::PluginManager::instance()->removeObject(m_outputPane);
}
bool QTestLibPlugin::init(ExtensionSystem::PluginManagerInterface *app, QString *errorMessage)
bool QTestLibPlugin::init(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments);
Q_UNUSED(errorMessage);
m_projectExplorer = app->getObject<ProjectExplorer::ProjectExplorerPlugin>();
connect(m_projectExplorer->qObject(), SIGNAL(aboutToExecuteProject(ProjectExplorer::Project *)),
m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
connect(m_projectExplorer, SIGNAL(aboutToExecuteProject(ProjectExplorer::Project *)),
this, SLOT(projectRunHook(ProjectExplorer::Project *)));
m_outputPane = new QTestOutputPane(this);
app->addObject(m_outputPane);
ExtensionSystem::PluginManager::instance()->addObject(m_outputPane);
return true;
}
......@@ -169,10 +168,10 @@ void QTestLibPlugin::projectRunHook(ProjectExplorer::Project *proj)
//NBS proj->setCustomApplicationOutputHandler(this);
//NBS proj->setExtraApplicationRunArguments(QStringList() << QLatin1String("-xml") << QLatin1String("-o") << m_outputFile);
const QString proFile = proj->fileName();
const QFileInfo fi(proFile);
if (QFile::exists(fi.absolutePath()))
m_projectDirectory = fi.absolutePath();
// const QString proFile = proj->fileName();
// const QFileInfo fi(proFile);
// if (QFile::exists(fi.absolutePath()))
// m_projectDirectory = fi.absolutePath();
}
void QTestLibPlugin::clear()
......@@ -319,9 +318,11 @@ bool QTestFunction::indexHasIncidents(const QModelIndex &function, IncidentType
return false;
}
// -------------- QTestOutputPane
QTestOutputPane::QTestOutputPane(QTestLibPlugin *plugin) :
QObject(plugin),
QTestOutputPane::QTestOutputPane(QTestLibPlugin *plugin)
: QObject(plugin),
m_plugin(plugin),
m_widget(0),
m_model(new QStandardItemModel(this))
......@@ -485,8 +486,8 @@ void QTestOutputWidget::gotoLocation(QModelIndex index)
QTestLocation loc = tag.value<QTestLocation>();
m_coreInterface->editorManager()->openEditor(loc.file);
Core::EditorInterface *edtIface = m_coreInterface->editorManager()->currentEditor();
Core::ICore::instance()->editorManager()->openEditor(loc.file);
Core::EditorInterface *edtIface = Core::ICore::instance()->editorManager()->currentEditor();
if (!edtIface)
return;
TextEditor::ITextEditor *editor =
......
......@@ -35,18 +35,19 @@
#define QTESTLIBPLUGIN_H
#include <coreplugin/ioutputpane.h>
//#include <projectexplorer/ProjectExplorerInterfaces>
#include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <QtGui/QPixmap>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QStandardItem>
#include <QtGui/QWidget>
#include <QtGui/QSortFilterProxyModel>
QT_BEGIN_NAMESPACE
class QComboBox;
class QStandardItemModel;
class QTreeView;
class QTextEdit;
class QComboBox;
class QTreeView;
QT_END_NAMESPACE
namespace QTestLib {
......@@ -101,7 +102,7 @@ public:
class QTestOutputPane : public Core::IOutputPane
{
Q_OBJECT
//Q_INTERFACES(Core::IOutputPane)
public:
QTestOutputPane(QTestLibPlugin *plugin);
......@@ -116,8 +117,13 @@ public:
void show();
Q_SIGNALS:
//signals
// FIXME:
virtual int priorityInStatusBar() const { return 0;}
virtual void setFocus() {}
virtual bool hasFocus() { return false;}
virtual bool canFocus() { return false;}
signals:
void showPage();
private:
......@@ -165,19 +171,15 @@ private:
QTestOutputFilter *m_filterModel;
};
class QTestLibPlugin : public QObject,
public ExtensionSystem::PluginInterface,
public ProjectExplorer::IApplicationOutput
class QTestLibPlugin : public QObject
{
Q_OBJECT
Q_INTERFACES(ExtensionSystem::PluginInterface
ProjectExplorer::IApplicationOutput)
public:
QTestLibPlugin();
virtual ~QTestLibPlugin();
bool init(ExtensionSystem::PluginManagerInterface *app, QString *error_message);
bool init(const QStringList &args, QString *error_message);
void extensionsInitialized();
// IApplicationOutput
......
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