From 24548a4d446c23a28eda9344eae78c29431be1e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= <thorbjorn.lindeijer@nokia.com>
Date: Thu, 16 Sep 2010 17:26:45 +0200
Subject: [PATCH] Fixed cursor width inconsistency

While it was set to 2 for most editors, some editors, like the .pro file
editor, set another document on the BaseTextEditor, which then did not
get its cursor width set.

Also removed a duplicated line.

Reviewed-by: dt
---
 src/plugins/texteditor/basetexteditor.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 4f333373182..af6bdb01706 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -195,11 +195,9 @@ BaseTextEditor::BaseTextEditor(QWidget *parent)
     d->m_searchResultOverlay = new TextEditorOverlay(this);
     d->m_refactorOverlay = new RefactorOverlay(this);
 
-    d->setupDocumentSignals(d->m_document);
     d->setupDocumentSignals(d->m_document);
 
     d->m_lastScrollPos = -1;
-    setCursorWidth(2);
 
     // from RESEARCH
 
@@ -1987,8 +1985,9 @@ void BaseTextEditorPrivate::setupDocumentSignals(BaseTextDocument *document)
         doc->setDocumentLayout(documentLayout);
     }
 
-
     q->setDocument(doc);
+    q->setCursorWidth(2); // Applies to the document layout
+
     QObject::connect(documentLayout, SIGNAL(updateBlock(QTextBlock)), q, SLOT(slotUpdateBlockNotify(QTextBlock)));
     QObject::connect(q, SIGNAL(requestBlockUpdate(QTextBlock)), documentLayout, SIGNAL(updateBlock(QTextBlock)));
     QObject::connect(doc, SIGNAL(modificationChanged(bool)), q, SIGNAL(changed()));
-- 
GitLab