Fixes: qtestlibplugin: some care for dead code

This commit is contained in:
hjk
2009-01-28 13:40:59 +01:00
parent 6bf55b6184
commit 615660c021
2 changed files with 37 additions and 34 deletions

View File

@@ -33,8 +33,8 @@
#include "qtestlibplugin.h" #include "qtestlibplugin.h"
//#include <Qt4IProjectManagers> #include <coreplugin/icore.h>
//#include <texteditor/TextEditorInterfaces> #include <texteditor/itexteditor.h>
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QDir> #include <QtCore/QDir>
@@ -116,28 +116,27 @@ static QTestFunction::MessageType stringToMessageType(const QString &str)
} }
// ----------------------------------- // -----------------------------------
QTestLibPlugin::QTestLibPlugin() : QTestLibPlugin::QTestLibPlugin()
m_projectExplorer(0), : m_projectExplorer(0), m_outputPane(0)
m_core(0),
m_outputPane(0)
{ {
} }
QTestLibPlugin::~QTestLibPlugin() QTestLibPlugin::~QTestLibPlugin()
{ {
if (m_core && m_outputPane) if (m_outputPane)
m_core->pluginManager()->removeObject(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); Q_UNUSED(errorMessage);
m_projectExplorer = app->getObject<ProjectExplorer::ProjectExplorerPlugin>(); m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
connect(m_projectExplorer->qObject(), SIGNAL(aboutToExecuteProject(ProjectExplorer::Project *)), connect(m_projectExplorer, SIGNAL(aboutToExecuteProject(ProjectExplorer::Project *)),
this, SLOT(projectRunHook(ProjectExplorer::Project *))); this, SLOT(projectRunHook(ProjectExplorer::Project *)));
m_outputPane = new QTestOutputPane(this); m_outputPane = new QTestOutputPane(this);
app->addObject(m_outputPane); ExtensionSystem::PluginManager::instance()->addObject(m_outputPane);
return true; return true;
} }
@@ -169,10 +168,10 @@ void QTestLibPlugin::projectRunHook(ProjectExplorer::Project *proj)
//NBS proj->setCustomApplicationOutputHandler(this); //NBS proj->setCustomApplicationOutputHandler(this);
//NBS proj->setExtraApplicationRunArguments(QStringList() << QLatin1String("-xml") << QLatin1String("-o") << m_outputFile); //NBS proj->setExtraApplicationRunArguments(QStringList() << QLatin1String("-xml") << QLatin1String("-o") << m_outputFile);
const QString proFile = proj->fileName(); // const QString proFile = proj->fileName();
const QFileInfo fi(proFile); // const QFileInfo fi(proFile);
if (QFile::exists(fi.absolutePath())) // if (QFile::exists(fi.absolutePath()))
m_projectDirectory = fi.absolutePath(); // m_projectDirectory = fi.absolutePath();
} }
void QTestLibPlugin::clear() void QTestLibPlugin::clear()
@@ -319,9 +318,11 @@ bool QTestFunction::indexHasIncidents(const QModelIndex &function, IncidentType
return false; return false;
} }
// -------------- QTestOutputPane // -------------- QTestOutputPane
QTestOutputPane::QTestOutputPane(QTestLibPlugin *plugin) :
QObject(plugin), QTestOutputPane::QTestOutputPane(QTestLibPlugin *plugin)
: QObject(plugin),
m_plugin(plugin), m_plugin(plugin),
m_widget(0), m_widget(0),
m_model(new QStandardItemModel(this)) m_model(new QStandardItemModel(this))
@@ -485,8 +486,8 @@ void QTestOutputWidget::gotoLocation(QModelIndex index)
QTestLocation loc = tag.value<QTestLocation>(); QTestLocation loc = tag.value<QTestLocation>();
m_coreInterface->editorManager()->openEditor(loc.file); Core::ICore::instance()->editorManager()->openEditor(loc.file);
Core::EditorInterface *edtIface = m_coreInterface->editorManager()->currentEditor(); Core::EditorInterface *edtIface = Core::ICore::instance()->editorManager()->currentEditor();
if (!edtIface) if (!edtIface)
return; return;
TextEditor::ITextEditor *editor = TextEditor::ITextEditor *editor =

View File

@@ -35,18 +35,19 @@
#define QTESTLIBPLUGIN_H #define QTESTLIBPLUGIN_H
#include <coreplugin/ioutputpane.h> #include <coreplugin/ioutputpane.h>
//#include <projectexplorer/ProjectExplorerInterfaces> #include <extensionsystem/pluginmanager.h>
#include <projectexplorer/projectexplorer.h>
#include <QtGui/QPixmap> #include <QtGui/QPixmap>
#include <QtGui/QSortFilterProxyModel>
#include <QtGui/QStandardItem> #include <QtGui/QStandardItem>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QSortFilterProxyModel>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QStandardItemModel;
class QTreeView;
class QTextEdit;
class QComboBox; class QComboBox;
class QStandardItemModel;
class QTextEdit;
class QTreeView;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace QTestLib { namespace QTestLib {
@@ -101,7 +102,7 @@ public:
class QTestOutputPane : public Core::IOutputPane class QTestOutputPane : public Core::IOutputPane
{ {
Q_OBJECT Q_OBJECT
//Q_INTERFACES(Core::IOutputPane)
public: public:
QTestOutputPane(QTestLibPlugin *plugin); QTestOutputPane(QTestLibPlugin *plugin);
@@ -116,8 +117,13 @@ public:
void show(); void show();
Q_SIGNALS: // FIXME:
//signals virtual int priorityInStatusBar() const { return 0;}
virtual void setFocus() {}
virtual bool hasFocus() { return false;}
virtual bool canFocus() { return false;}
signals:
void showPage(); void showPage();
private: private:
@@ -165,19 +171,15 @@ private:
QTestOutputFilter *m_filterModel; QTestOutputFilter *m_filterModel;
}; };
class QTestLibPlugin : public QObject, class QTestLibPlugin : public QObject
public ExtensionSystem::PluginInterface,
public ProjectExplorer::IApplicationOutput
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(ExtensionSystem::PluginInterface
ProjectExplorer::IApplicationOutput)
public: public:
QTestLibPlugin(); QTestLibPlugin();
virtual ~QTestLibPlugin(); virtual ~QTestLibPlugin();
bool init(ExtensionSystem::PluginManagerInterface *app, QString *error_message); bool init(const QStringList &args, QString *error_message);
void extensionsInitialized(); void extensionsInitialized();
// IApplicationOutput // IApplicationOutput