summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorDavid Schulz <david.schulz@qt.io>2019-10-17 14:46:26 +0200
committerhjk <hjk@qt.io>2019-10-18 12:01:06 +0000
commit383ea95889d7f841ebe5047572861febf65f0450 (patch)
tree46ebc11dbf77a9e450b6c17e9e459d41f75d0975 /src/plugins
parentb9b2d5ef5d3366b67aef797a4c07d508ddb034b0 (diff)
downloadqt-creator-383ea95889d7f841ebe5047572861febf65f0450.tar.gz
Debugger: Avoid recreation of breakpoint markers
Change-Id: Ie3b160a7b7137257b2028d03878700675142102f Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/debugger/breakhandler.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index 22fd4a4008..63b03189be 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -2260,13 +2260,18 @@ void GlobalBreakpointItem::removeBreakpointFromModel()
void GlobalBreakpointItem::updateLineNumber(int lineNumber)
{
+ if (m_params.lineNumber == lineNumber)
+ return;
m_params.lineNumber = lineNumber;
update();
}
void GlobalBreakpointItem::updateFileName(const FilePath &fileName)
{
- m_params.fileName = fileName.toString();
+ const QString &file = fileName.toString();
+ if (m_params.fileName == file)
+ return;
+ m_params.fileName = file;
update();
}
@@ -2305,11 +2310,14 @@ void GlobalBreakpointItem::updateMarker()
const FilePath file = FilePath::fromString(m_params.fileName);
const int line = m_params.lineNumber;
- if (m_marker && (file != m_marker->fileName() || line != m_marker->lineNumber()))
- destroyMarker();
-
- if (!m_marker && !file.isEmpty() && line > 0)
+ if (m_marker) {
+ if (file != m_marker->fileName())
+ m_marker->updateFileName(file);
+ if (line != m_marker->lineNumber())
+ m_marker->move(line);
+ } else if (!file.isEmpty() && line > 0) {
m_marker = new GlobalBreakpointMarker(this, file, line);
+ }
if (m_marker)
m_marker->setToolTip(toolTip());