forked from qt-creator/qt-creator
Add a DiffShowEditor showing an additional info
Task-number: QTCREATORBUG-9489 Change-Id: I3ae2e59ccaf397f4236505f21e027a42e2798784 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Petar Perisin <petar.perisin@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
@@ -29,10 +29,12 @@
|
||||
|
||||
#include "diffeditorplugin.h"
|
||||
#include "diffeditor.h"
|
||||
#include "diffeditorwidget.h"
|
||||
#include "diffeditorconstants.h"
|
||||
#include "diffeditorfactory.h"
|
||||
#include "diffeditorwidget.h"
|
||||
#include "diffshoweditor.h"
|
||||
#include "diffshoweditorfactory.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QFileDialog>
|
||||
#include <QTextCodec>
|
||||
#include <QtPlugin>
|
||||
@@ -44,40 +46,8 @@
|
||||
|
||||
namespace DiffEditor {
|
||||
|
||||
///////////////////////////////// DiffEditorFactory //////////////////////////////////
|
||||
|
||||
namespace Internal {
|
||||
|
||||
DiffEditorFactory::DiffEditorFactory(DiffEditorPlugin *owner)
|
||||
: m_mimeTypes(QLatin1String(Constants::DIFF_EDITOR_MIMETYPE)),
|
||||
m_owner(owner)
|
||||
{
|
||||
}
|
||||
|
||||
Core::Id DiffEditorFactory::id() const
|
||||
{
|
||||
return Constants::DIFF_EDITOR_ID;
|
||||
}
|
||||
|
||||
QString DiffEditorFactory::displayName() const
|
||||
{
|
||||
return qApp->translate("DiffEditorFactory", Constants::DIFF_EDITOR_DISPLAY_NAME);
|
||||
}
|
||||
|
||||
Core::IEditor *DiffEditorFactory::createEditor(QWidget *parent)
|
||||
{
|
||||
DiffEditorWidget *editorWidget = new DiffEditorWidget(parent);
|
||||
DiffEditor *editor = new DiffEditor(editorWidget);
|
||||
return editor;
|
||||
}
|
||||
|
||||
QStringList DiffEditorFactory::mimeTypes() const
|
||||
{
|
||||
return m_mimeTypes;
|
||||
}
|
||||
|
||||
///////////////////////////////// DiffEditorPlugin //////////////////////////////////
|
||||
|
||||
DiffEditorPlugin::DiffEditorPlugin()
|
||||
{
|
||||
}
|
||||
@@ -86,11 +56,6 @@ DiffEditorPlugin::~DiffEditorPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
void DiffEditorPlugin::initializeEditor(DiffEditorWidget *editor)
|
||||
{
|
||||
Q_UNUSED(editor)
|
||||
}
|
||||
|
||||
bool DiffEditorPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(arguments)
|
||||
@@ -110,6 +75,7 @@ bool DiffEditorPlugin::initialize(const QStringList &arguments, QString *errorMe
|
||||
toolsContainer->addAction(diffCommand, Constants::G_TOOLS_DIFF);
|
||||
|
||||
addAutoReleasedObject(new DiffEditorFactory(this));
|
||||
addAutoReleasedObject(new DiffShowEditorFactory(this));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user