From 2a9c9f2d707d37e9cac8712aeac049c35fd820e7 Mon Sep 17 00:00:00 2001 From: jkobus Date: Fri, 24 Oct 2014 14:11:12 +0200 Subject: Hide some diff editor controls when diff editor is bound to a file. Remove unnecessary anymore "ignoreWhitespace" argument from functions which read a patch file. Transfer the ownership of reloader into controller. Task-number: QTCREATORBUG-13250 Change-Id: I68183005b845d6ece9ea2be9888abc8597310426 Reviewed-by: Tobias Hunger --- src/plugins/diffeditor/diffeditorplugin.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/plugins/diffeditor/diffeditorplugin.cpp') diff --git a/src/plugins/diffeditor/diffeditorplugin.cpp b/src/plugins/diffeditor/diffeditorplugin.cpp index fc88e8fffd..3c48515d10 100644 --- a/src/plugins/diffeditor/diffeditorplugin.cpp +++ b/src/plugins/diffeditor/diffeditorplugin.cpp @@ -54,8 +54,7 @@ class SimpleDiffEditorReloader : public DiffEditorReloader { Q_OBJECT public: - SimpleDiffEditorReloader(QObject *parent, - const QString &leftFileName, + SimpleDiffEditorReloader(const QString &leftFileName, const QString &rightFileName); protected: @@ -66,11 +65,9 @@ private: QString m_rightFileName; }; -SimpleDiffEditorReloader::SimpleDiffEditorReloader(QObject *parent, - const QString &leftFileName, +SimpleDiffEditorReloader::SimpleDiffEditorReloader(const QString &leftFileName, const QString &rightFileName) - : DiffEditorReloader(parent), - m_leftFileName(leftFileName), + : m_leftFileName(leftFileName), m_rightFileName(rightFileName) { } @@ -206,7 +203,7 @@ void DiffEditorPlugin::diff() DiffEditorController *controller = document->controller(); if (!controller->reloader()) { SimpleDiffEditorReloader *reloader = - new SimpleDiffEditorReloader(controller, fileName1, fileName2); + new SimpleDiffEditorReloader(fileName1, fileName2); controller->setReloader(reloader); } @@ -475,7 +472,7 @@ void DiffEditor::Internal::DiffEditorPlugin::testMakePatch() QCOMPARE(result, patchText); bool ok; - QList resultList = DiffUtils::readPatch(result, false, &ok); + QList resultList = DiffUtils::readPatch(result, &ok); QVERIFY(ok); QCOMPARE(resultList.count(), 1); @@ -905,7 +902,7 @@ void DiffEditor::Internal::DiffEditorPlugin::testReadPatch() QFETCH(QList, fileDataList); bool ok; - QList result = DiffUtils::readPatch(sourcePatch, false, &ok); + QList result = DiffUtils::readPatch(sourcePatch, &ok); QVERIFY(ok); QCOMPARE(fileDataList.count(), result.count()); -- cgit v1.2.1