forked from qt-creator/qt-creator
Merge ITextMark and BaseTextMark
Turns out we don't even need two-phase initialization, by transparently postponing registration until we get a non-empty file name, either at constuction, or at file name change times. Change-Id: I3e87e47c820066e6707e946fc474ab9c1993e61f Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
#include "stackhandler.h"
|
||||
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/textmark.h>
|
||||
|
||||
#include <cppeditor/cppeditorconstants.h>
|
||||
|
||||
@@ -61,7 +62,7 @@ public:
|
||||
public:
|
||||
QPointer<TextEditor::BaseTextEditor> editor;
|
||||
QPointer<DebuggerEngine> engine;
|
||||
TextEditor::ITextMark *locationMark;
|
||||
TextEditor::TextMark *locationMark;
|
||||
QString path;
|
||||
QString producer;
|
||||
};
|
||||
@@ -140,9 +141,9 @@ void SourceAgent::updateLocationMarker()
|
||||
d->locationMark = 0;
|
||||
if (d->engine->stackHandler()->currentFrame().file == d->path) {
|
||||
int lineNumber = d->engine->stackHandler()->currentFrame().line;
|
||||
d->locationMark = new TextEditor::ITextMark(lineNumber);
|
||||
d->locationMark = new TextEditor::TextMark(QString(), lineNumber);
|
||||
d->locationMark->setIcon(debuggerCore()->locationMarkIcon());
|
||||
d->locationMark->setPriority(TextEditor::ITextMark::HighPriority);
|
||||
d->locationMark->setPriority(TextEditor::TextMark::HighPriority);
|
||||
d->editor->baseTextDocument()->addMark(d->locationMark);
|
||||
QPlainTextEdit *plainTextEdit = d->editor->editorWidget();
|
||||
QTC_ASSERT(plainTextEdit, return);
|
||||
|
||||
Reference in New Issue
Block a user