Commit 2481e71d authored by hjk's avatar hjk

Vcs: Move editor construction over to new scheme

Change-Id: I491b9f37bfe15ebc800fedd5c683bfaf24e63889
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 461a54bd
......@@ -41,8 +41,7 @@
using namespace Bazaar::Internal;
using namespace Bazaar;
BazaarEditor::BazaarEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent)
: VcsBase::VcsBaseEditorWidget(type, parent),
BazaarEditor::BazaarEditor() :
m_changesetId(QLatin1String(Constants::CHANGESET_ID)),
m_exactChangesetId(QLatin1String(Constants::CHANGESET_ID_EXACT))
{
......
......@@ -41,7 +41,7 @@ class BazaarEditor : public VcsBase::VcsBaseEditorWidget
Q_OBJECT
public:
explicit BazaarEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent);
BazaarEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -166,8 +166,6 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
Q_UNUSED(arguments);
Q_UNUSED(errorMessage);
typedef VcsEditorFactory<BazaarEditor> BazaarEditorFactory;
m_client = new BazaarClient(&m_bazaarSettings);
initializeVcs(new BazaarControl(m_client));
......@@ -179,8 +177,9 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag
static const char *describeSlot = SLOT(view(QString,QString));
const int editorCount = sizeof(editorParameters) / sizeof(VcsBaseEditorParameters);
const auto widgetCreator = []() { return new BazaarEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new BazaarEditorFactory(editorParameters + i, m_client, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, m_client, describeSlot));
addAutoReleasedObject(new VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters));
......@@ -657,7 +656,8 @@ void BazaarPlugin::testDiffFileResolving_data()
void BazaarPlugin::testDiffFileResolving()
{
BazaarEditor editor(editorParameters + 2, 0);
BazaarEditor editor;
editor.setParameters(editorParameters + 2);
editor.testDiffFileResolving();
}
......@@ -681,7 +681,8 @@ void BazaarPlugin::testLogResolving()
" (gz) Set approved revision and vote \"Approve\" when using lp-propose\n"
" --approve (Jonathan Lange)\n"
);
BazaarEditor editor(editorParameters, 0);
BazaarEditor editor;
editor.setParameters(editorParameters);
editor.testLogResolving(data, "6572", "6571");
}
#endif
......
......@@ -44,9 +44,7 @@
using namespace ClearCase;
using namespace ClearCase::Internal;
ClearCaseEditor::ClearCaseEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent) :
VcsBase::VcsBaseEditorWidget(type, parent),
ClearCaseEditor::ClearCaseEditor() :
m_versionNumberPattern(QLatin1String("[\\\\/]main[\\\\/][^ \t\n\"]*"))
{
QTC_ASSERT(m_versionNumberPattern.isValid(), return);
......
......@@ -43,8 +43,7 @@ class ClearCaseEditor : public VcsBase::VcsBaseEditorWidget
Q_OBJECT
public:
explicit ClearCaseEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent);
ClearCaseEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -437,7 +437,6 @@ static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = {
bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *errorMessage)
{
typedef VcsBase::VcsSubmitEditorFactory<ClearCaseSubmitEditor> ClearCaseSubmitEditorFactory;
typedef VcsBase::VcsEditorFactory<ClearCaseEditor> ClearCaseEditorFactory;
using namespace Constants;
using namespace Core::Constants;
......@@ -466,8 +465,9 @@ bool ClearCasePlugin::initialize(const QStringList & /*arguments */, QString *er
// any editor responds to describe (when clicking a version)
static const char *describeSlot = SLOT(describe(QString,QString));
const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters);
const auto widgetCreator = []() { return new ClearCaseEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new ClearCaseEditorFactory(editorParameters + i, this, describeSlot));
addAutoReleasedObject(new VcsBase::VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlot));
const QString description = QLatin1String("ClearCase");
const QString prefix = QLatin1String("cc");
......@@ -2229,7 +2229,8 @@ void ClearCasePlugin::testDiffFileResolving_data()
void ClearCasePlugin::testDiffFileResolving()
{
ClearCaseEditor editor(editorParameters + 2, 0);
ClearCaseEditor editor;
editor.setParameters(editorParameters + 2);
editor.testDiffFileResolving();
}
......@@ -2239,7 +2240,8 @@ void ClearCasePlugin::testLogResolving()
"13-Sep.17:41 user1 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9\" (baseline1, baseline2, ...)\n"
"22-Aug.14:13 user2 create version \"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8\" (baseline3, baseline4, ...)\n"
);
ClearCaseEditor editor(editorParameters, 0);
ClearCaseEditor editor;
editor.setParameters(editorParameters);
editor.testLogResolving(data,
"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/9",
"src/plugins/clearcase/clearcaseeditor.h@@/main/branch1/branch2/8");
......
......@@ -47,9 +47,7 @@ namespace Internal {
#define CVS_REVISION_PATTERN "[\\d\\.]+"
#define CVS_REVISION_AT_START_PATTERN "^(" CVS_REVISION_PATTERN ") "
CvsEditor::CvsEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent) :
VcsBase::VcsBaseEditorWidget(type, parent),
CvsEditor::CvsEditor() :
m_revisionAnnotationPattern(QLatin1String(CVS_REVISION_AT_START_PATTERN ".*$")),
m_revisionLogPattern(QLatin1String("^revision *(" CVS_REVISION_PATTERN ")$"))
{
......
......@@ -42,8 +42,7 @@ class CvsEditor : public VcsBase::VcsBaseEditorWidget
Q_OBJECT
public:
explicit CvsEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent);
CvsEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -231,7 +231,6 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
{
Q_UNUSED(arguments);
typedef VcsSubmitEditorFactory<CvsSubmitEditor> CVSSubmitEditorFactory;
typedef VcsEditorFactory<CvsEditor> CVSEditorFactory;
using namespace Constants;
using namespace Core::Constants;
......@@ -254,8 +253,9 @@ bool CvsPlugin::initialize(const QStringList &arguments, QString *errorMessage)
static const char *describeSlotC = SLOT(slotDescribe(QString,QString));
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new CvsEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new CVSEditorFactory(editorParameters + i, this, describeSlotC));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlotC));
auto checkoutWizardFactory = new BaseCheckoutWizardFactory;
checkoutWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS));
......@@ -1318,7 +1318,8 @@ void CvsPlugin::testDiffFileResolving_data()
void CvsPlugin::testDiffFileResolving()
{
CvsEditor editor(editorParameters + 3, 0);
CvsEditor editor;
editor.setParameters(editorParameters + 3);
editor.testDiffFileResolving();
}
......@@ -1345,7 +1346,8 @@ void CvsPlugin::testLogResolving()
"added latest commentary\n"
"----------------------------\n"
);
CvsEditor editor(editorParameters + 1, 0);
CvsEditor editor;
editor.setParameters(editorParameters + 1);
editor.testLogResolving(data, "1.3", "1.2");
}
#endif
......
......@@ -58,8 +58,7 @@
namespace Git {
namespace Internal {
GitEditorWidget::GitEditorWidget(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) :
VcsBase::VcsBaseEditorWidget(type, parent),
GitEditorWidget::GitEditorWidget() :
m_changeNumberPattern(QLatin1String(CHANGE_PATTERN))
{
QTC_ASSERT(m_changeNumberPattern.isValid(), return);
......
......@@ -46,8 +46,7 @@ class GitEditorWidget : public VcsBase::VcsBaseEditorWidget
Q_OBJECT
public:
GitEditorWidget(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent);
GitEditorWidget();
public slots:
void setPlainTextFiltered(const QString &text);
......
......@@ -280,7 +280,6 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
m_gitClient = new GitClient(&m_settings);
typedef VcsEditorFactory<GitEditorWidget> GitEditorFactory;
typedef VcsSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory;
initializeVcs(new GitVersionControl(m_gitClient));
......@@ -293,8 +292,9 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage)
static const char *describeSlot = SLOT(show(QString,QString));
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new GitEditorWidget; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new GitEditorFactory(editorParameters + i, m_gitClient, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, m_gitClient, describeSlot));
addAutoReleasedObject(new GitSubmitEditorFactory(&submitParameters));
......@@ -1523,7 +1523,8 @@ void GitPlugin::testDiffFileResolving_data()
void GitPlugin::testDiffFileResolving()
{
GitEditorWidget editor(editorParameters + 3, 0);
GitEditorWidget editor;
editor.setParameters(editorParameters + 3);
editor.testDiffFileResolving();
}
......@@ -1549,7 +1550,8 @@ void GitPlugin::testLogResolving()
" \n"
" Signed-off-by: Junio C Hamano <gitster@pobox.com>\n"
);
GitEditorWidget editor(editorParameters + 1, 0);
GitEditorWidget editor;
editor.setParameters(editorParameters + 1);
editor.testLogResolving(data,
"50a6b54c - Merge branch 'for-junio' of git://bogomips.org/git-svn",
"3587b513 - Update draft release notes to 1.8.2");
......
......@@ -46,8 +46,7 @@
using namespace Mercurial::Internal;
using namespace Mercurial;
MercurialEditor::MercurialEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent)
: VcsBase::VcsBaseEditorWidget(type, parent),
MercurialEditor::MercurialEditor() :
exactIdentifier12(QLatin1String(Constants::CHANGEIDEXACT12)),
exactIdentifier40(QLatin1String(Constants::CHANGEIDEXACT40)),
changesetIdentifier12(QLatin1String(Constants::CHANGESETID12)),
......
......@@ -41,7 +41,7 @@ class MercurialEditor : public VcsBase::VcsBaseEditorWidget
{
Q_OBJECT
public:
explicit MercurialEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent);
MercurialEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -139,8 +139,6 @@ MercurialPlugin::~MercurialPlugin()
bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString * /*errorMessage */)
{
typedef VcsEditorFactory<MercurialEditor> MercurialEditorFactory;
m_client = new MercurialClient(&mercurialSettings);
initializeVcs(new MercurialControl(m_client));
......@@ -153,8 +151,9 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
static const char *describeSlot = SLOT(view(QString,QString));
const int editorCount = sizeof(editorParameters)/sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new MercurialEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new MercurialEditorFactory(editorParameters + i, m_client, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, m_client, describeSlot));
addAutoReleasedObject(new VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters));
......@@ -726,7 +725,8 @@ void MercurialPlugin::testDiffFileResolving_data()
void MercurialPlugin::testDiffFileResolving()
{
MercurialEditor editor(editorParameters + 2, 0);
MercurialEditor editor;
editor.setParameters(editorParameters + 2);
editor.testDiffFileResolving();
}
......@@ -747,7 +747,8 @@ void MercurialPlugin::testLogResolving()
"date: Sat Jan 19 04:08:16 2013 +0100\n"
"summary: test-rebase: add another test for rebase with multiple roots\n"
);
MercurialEditor editor(editorParameters, 0);
MercurialEditor editor;
editor.setParameters(editorParameters);
editor.testLogResolving(data, "18473:692cbda1eb50", "18472:37100f30590f");
}
#endif
......
......@@ -56,9 +56,7 @@ namespace Perforce {
namespace Internal {
// ------------ PerforceEditor
PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent) :
VcsBase::VcsBaseEditorWidget(type, parent),
PerforceEditor::PerforceEditor() :
m_changeNumberPattern(QLatin1String("^\\d+$"))
{
QTC_CHECK(m_changeNumberPattern.isValid());
......@@ -70,8 +68,6 @@ PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
setDiffFilePattern(QRegExp(QLatin1String("^(?:={4}|\\+{3}) (.+)(?:\\t|#\\d)")));
setLogEntryPattern(QRegExp(QLatin1String("^... #\\d change (\\d+) ")));
setAnnotateRevisionTextFormat(tr("Annotate change list \"%1\""));
if (Perforce::Constants::debug)
qDebug() << "PerforceEditor::PerforceEditor" << type->type << type->id;
}
QSet<QString> PerforceEditor::annotationChanges() const
......
......@@ -37,15 +37,12 @@
namespace Perforce {
namespace Internal {
class PerforcePlugin;
class PerforceEditor : public VcsBase::VcsBaseEditorWidget
{
Q_OBJECT
public:
explicit PerforceEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent);
PerforceEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -227,7 +227,6 @@ static const VcsBaseSubmitEditorParameters submitParameters = {
bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *errorMessage)
{
typedef VcsEditorFactory<PerforceEditor> PerforceEditorFactory;
typedef VcsSubmitEditorFactory<PerforceSubmitEditor> PerforceSubmitEditorFactory;
initializeVcs(new PerforceVersionControl(this));
......@@ -245,8 +244,9 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er
static const char *describeSlot = SLOT(describe(QString,QString));
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new PerforceEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new PerforceEditorFactory(editorParameters + i, this, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlot));
const QString prefix = QLatin1String("p4");
m_commandLocator = new CommandLocator("Perforce", prefix, prefix);
......@@ -1557,13 +1557,14 @@ void PerforcePlugin::testLogResolving()
"\n"
" Comment\n"
);
PerforceEditor editor(editorParameters, 0);
PerforceEditor editor;
editor.setParameters(editorParameters);
editor.testLogResolving(data, "12345", "12344");
}
#endif
}
}
} // namespace Internal
} // namespace Perforce
Q_EXPORT_PLUGIN(Perforce::Internal::PerforcePlugin)
......
......@@ -44,9 +44,7 @@
using namespace Subversion;
using namespace Subversion::Internal;
SubversionEditor::SubversionEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent) :
VcsBase::VcsBaseEditorWidget(type, parent),
SubversionEditor::SubversionEditor() :
m_changeNumberPattern(QLatin1String("^\\d+$")),
m_revisionNumberPattern(QLatin1String("^r\\d+$"))
{
......
......@@ -42,8 +42,7 @@ class SubversionEditor : public VcsBase::VcsBaseEditorWidget
Q_OBJECT
public:
explicit SubversionEditor(const VcsBase::VcsBaseEditorParameters *type,
QWidget *parent);
SubversionEditor();
private:
QSet<QString> annotationChanges() const;
......
......@@ -248,7 +248,6 @@ const VcsBaseSubmitEditorParameters submitParameters = {
bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *errorMessage)
{
typedef VcsSubmitEditorFactory<SubversionSubmitEditor> SubversionSubmitEditorFactory;
typedef VcsEditorFactory<SubversionEditor> SubversionEditorFactory;
using namespace Constants;
using namespace Core::Constants;
......@@ -270,8 +269,9 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e
static const char *describeSlot = SLOT(describe(QString,QString));
const int editorCount = sizeof(editorParameters) / sizeof(editorParameters[0]);
const auto widgetCreator = []() { return new SubversionEditor; };
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new SubversionEditorFactory(editorParameters + i, this, describeSlot));
addAutoReleasedObject(new VcsEditorFactory(editorParameters + i, widgetCreator, this, describeSlot));
auto checkoutWizardFactory = new BaseCheckoutWizardFactory;
checkoutWizardFactory->setId(QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION));
......@@ -1282,7 +1282,8 @@ void SubversionPlugin::testDiffFileResolving_data()
void SubversionPlugin::testDiffFileResolving()
{
SubversionEditor editor(editorParameters + 2, 0);
SubversionEditor editor;
editor.setParameters(editorParameters + 2);
editor.testDiffFileResolving();
}
......@@ -1304,7 +1305,8 @@ void SubversionPlugin::testLogResolving()
" expectations, remove XFail.\n"
"\n"
);
SubversionEditor editor(editorParameters, 0);
SubversionEditor editor;
editor.setParameters(editorParameters);
editor.testLogResolving(data, "r1439551", "r1439540");
}
#endif
......
......@@ -37,6 +37,8 @@
#include <QCoreApplication>
#include <QStringList>
using namespace TextEditor;
/*!
\class VcsBase::BaseVCSEditorFactory
......@@ -52,44 +54,57 @@ namespace Internal {
class BaseVcsEditorFactoryPrivate
{
public:
const VcsBaseEditorParameters *m_type;
const VcsBaseEditorParameters *m_parameters;
QObject *m_describeReceiver;
const char *m_describeSlot;
BaseTextEditor::WidgetCreator m_widgetCreator;
};
} // namespace Internal
BaseVcsEditorFactory::BaseVcsEditorFactory(const VcsBaseEditorParameters *t,
QObject *describeReceiver, const char *describeSlot)
VcsEditorFactory::VcsEditorFactory(const VcsBaseEditorParameters *parameters,
const BaseTextEditor::WidgetCreator &creator,
QObject *describeReceiver, const char *describeSlot)
: d(new Internal::BaseVcsEditorFactoryPrivate)
{
d->m_type = t;
d->m_parameters = parameters;
d->m_describeReceiver = describeReceiver;
d->m_describeSlot = describeSlot;
setId(t->id);
setDisplayName(QCoreApplication::translate("VCS", t->displayName));
if (QLatin1String(t->mimeType) != QLatin1String(DiffEditor::Constants::DIFF_EDITOR_MIMETYPE))
addMimeType(t->mimeType);
new TextEditor::TextEditorActionHandler(this, t->context);
d->m_widgetCreator = creator;
setId(parameters->id);
setDisplayName(QCoreApplication::translate("VCS", parameters->displayName));
if (QLatin1String(parameters->mimeType) != QLatin1String(DiffEditor::Constants::DIFF_EDITOR_MIMETYPE))
addMimeType(parameters->mimeType);
new TextEditor::TextEditorActionHandler(this, parameters->context);
}
BaseVcsEditorFactory::~BaseVcsEditorFactory()
VcsEditorFactory::~VcsEditorFactory()
{
delete d;
}
Core::IEditor *BaseVcsEditorFactory::createEditor()
Core::IEditor *VcsEditorFactory::createEditor()
{
VcsBaseEditorWidget *vcsEditor = createVcsBaseEditor(d->m_type);
TextEditor::BaseTextEditor *editor = new VcsBaseEditor(d->m_parameters);
VcsBaseEditorWidget *widget = qobject_cast<VcsBaseEditorWidget *>(d->m_widgetCreator());
widget->setParameters(d->m_parameters);
// Pass on signals.
connect(widget, SIGNAL(describeRequested(QString,QString)),
editor, SIGNAL(describeRequested(QString,QString)));
connect(widget, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)),
editor, SIGNAL(annotateRevisionRequested(QString,QString,QString,int)));
editor->setEditorWidget(widget);
vcsEditor->init();
widget->init();
if (d->m_describeReceiver)
connect(vcsEditor, SIGNAL(describeRequested(QString,QString)), d->m_describeReceiver, d->m_describeSlot);
connect(widget, SIGNAL(describeRequested(QString,QString)), d->m_describeReceiver, d->m_describeSlot);
if (!mimeTypes().isEmpty())
vcsEditor->textDocument()->setMimeType(mimeTypes().front());
widget->textDocument()->setMimeType(mimeTypes().front());
return vcsEditor->editor();
return editor;
}
} // namespace VcsBase
......@@ -34,48 +34,28 @@
#include "vcsbaseeditor.h"
#include <coreplugin/editormanager/ieditorfactory.h>
#include <texteditor/basetexteditor.h>
namespace VcsBase {
namespace Internal { class BaseVcsEditorFactoryPrivate; }
class VCSBASE_EXPORT BaseVcsEditorFactory : public Core::IEditorFactory
class VCSBASE_EXPORT VcsEditorFactory : public Core::IEditorFactory
{
Q_OBJECT
public:
explicit BaseVcsEditorFactory(const VcsBaseEditorParameters *type,
QObject *describeReceiver,
const char *describeSlot);
~BaseVcsEditorFactory();
VcsEditorFactory(const VcsBaseEditorParameters *type,
const TextEditor::BaseTextEditor::WidgetCreator &creator,
QObject *describeReceiver,
const char *describeSlot);
~VcsEditorFactory();
Core::IEditor *createEditor();
private:
// Implement to create and initialize (call init()) a VcsBaseEditor subclass.
virtual VcsBaseEditorWidget *createVcsBaseEditor(const VcsBaseEditorParameters *type) = 0;
Internal::BaseVcsEditorFactoryPrivate *const d;
};
// Utility template to create an editor.
template <class Editor>
class VcsEditorFactory : public BaseVcsEditorFactory
{
public:
explicit VcsEditorFactory(const VcsBaseEditorParameters *type,
QObject *describeReceiver = 0,
const char *describeSlot = 0)
: BaseVcsEditorFactory(type, describeReceiver, describeSlot)
{
}
private:
VcsBaseEditorWidget *createVcsBaseEditor(const VcsBaseEditorParameters *type)
{
return new Editor(type, 0);
}
};
} // namespace VcsBase
#endif // BASEVCSEDITORFACTORY_H
......
......@@ -150,18 +150,6 @@ namespace VcsBase {
manager passes the editor around.
*/
class VcsBaseEditor : public TextEditor::BaseTextEditor
{
Q_OBJECT
public:
explicit VcsBaseEditor(const VcsBaseEditorParameters *type);
signals:
void describeRequested(const QString &source, const QString &change);
void annotateRevisionRequested(const QString &workingDirectory, const QString &file,
const QString &change, int line);
};
VcsBaseEditor::VcsBaseEditor(const VcsBaseEditorParameters *type)
{
setContext(Core::Context(type->context, TextEditor::Constants::C_TEXTEDITOR));
......@@ -547,13 +535,14 @@ void EmailTextCursorHandler::slotOpenUrl()
class VcsBaseEditorWidgetPrivate
{
public:
VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget* editorWidget, const VcsBaseEditorParameters *type);
VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget *editorWidget);
AbstractTextCursorHandler *findTextCursorHandler(const QTextCursor &cursor);
// creates a browse combo in the toolbar for quick access to entries.
// Can be used for diff and log. Combo created on first call.
QComboBox *entriesComboBox();
TextEditor::BaseTextEditorWidget *q;
const VcsBaseEditorParameters *m_parameters;
QString m_workingDirectory;
......@@ -566,7 +555,6 @@ public:
QString m_annotatePreviousRevisionTextFormat;
QString m_copyRevisionTextFormat;
bool m_fileLogAnnotateEnabled;
TextEditor::BaseTextEditor *m_editor;
VcsBaseEditorParameterWidget *m_configurationWidget;
bool m_mouseDragging;
QList<AbstractTextCursorHandler *> m_textCursorHandlers;
......@@ -576,14 +564,13 @@ private:
QComboBox *m_entriesComboBox;
};
VcsBaseEditorWidgetPrivate::VcsBaseEditorWidgetPrivate(VcsBaseEditorWidget *editorWidget,
const VcsBaseEditorParameters *type) :