Vcs: Move editor construction over to new scheme

Change-Id: I491b9f37bfe15ebc800fedd5c683bfaf24e63889
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
hjk
2014-08-21 01:24:38 +02:00
parent 461a54bd2d
commit 2481e71d18
25 changed files with 145 additions and 148 deletions

View File

@@ -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