Commit a59fdc80 authored by hjk's avatar hjk Committed by Eike Ziller
Browse files

TextEditor: Fix crash due to setting up fall back editor twice



Change-Id: Id1287a1b1b33924c490b664d81c661b1481a3e4f
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 350bd8f9
......@@ -35,11 +35,11 @@
namespace DiffEditor {
SelectableTextEditorWidget::SelectableTextEditorWidget(QWidget *parent)
SelectableTextEditorWidget::SelectableTextEditorWidget(Core::Id id, QWidget *parent)
: BaseTextEditorWidget(parent)
{
setFrameStyle(QFrame::NoFrame);
setupFallBackEditor("DiffEditor.UnifiedDiffEditor");
setupFallBackEditor(id);
}
SelectableTextEditorWidget::~SelectableTextEditorWidget()
......
......@@ -52,7 +52,7 @@ class DIFFEDITOR_EXPORT SelectableTextEditorWidget
{
Q_OBJECT
public:
SelectableTextEditorWidget(QWidget *parent = 0);
SelectableTextEditorWidget(Core::Id id, QWidget *parent = 0);
~SelectableTextEditorWidget();
void setSelections(const QMap<int, QList<DiffSelection> > &selections) {
m_selections = selections;
......
......@@ -281,12 +281,10 @@ void MultiHighlighter::highlightBlock(const QString &text)
////////////////////////
SideDiffEditorWidget::SideDiffEditorWidget(QWidget *parent)
: SelectableTextEditorWidget(parent),
: SelectableTextEditorWidget("DiffEditor.SideDiffEditor", parent),
m_lineNumberDigits(1),
m_inPaintEvent(false)
{
setupFallBackEditor("DiffEditor.SideDiffEditor");
DisplaySettings settings = displaySettings();
settings.m_textWrapping = false;
settings.m_displayLineNumbers = true;
......
......@@ -72,7 +72,7 @@ using namespace TextEditor;
namespace DiffEditor {
UnifiedDiffEditorWidget::UnifiedDiffEditorWidget(QWidget *parent)
: SelectableTextEditorWidget(parent)
: SelectableTextEditorWidget("DiffEditor.UnifiedDiffEditor", parent)
, m_guiController(0)
, m_controller(0)
, m_ignoreCurrentIndexChange(false)
......@@ -81,8 +81,6 @@ UnifiedDiffEditorWidget::UnifiedDiffEditorWidget(QWidget *parent)
, m_leftLineNumberDigits(1)
, m_rightLineNumberDigits(1)
{
setupFallBackEditor(Id());
DisplaySettings settings = displaySettings();
settings.m_textWrapping = false;
settings.m_displayLineNumbers = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment