diff options
author | hjk <[email protected]> | 2025-01-09 11:58:40 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2025-01-10 13:05:29 +0000 |
commit | 2d9d6aa315976dc8937381e453f57263950d8841 (patch) | |
tree | 7ccb860763e95ad24272b158ead690afb79e9c3b /src/plugins/debugger/dap | |
parent | 0986822d44c80ee1fc8fef0289a05ccc2d4d3668 (diff) |
Utils: Rename FilePath::toString() into toUrlishString()
toString() is almost always the wrong conversion, but unfortunately
too easy to find and often even working at least for local setup.
This here raises the bar as the non-availability of the "obvious"
toString() hopefully helps people to think about the semantics of
the needed conversion and choose the right toXXX() function.
The chosen new name is intentional ugly to reduce the likelihood
that this (still almost always wrong) function is used out of
convenience.
Change-Id: I57f1618dd95ef2629d7d978688d130275e096c0f
Reviewed-by: Eike Ziller <[email protected]>
Diffstat (limited to 'src/plugins/debugger/dap')
-rw-r--r-- | src/plugins/debugger/dap/dapengine.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/debugger/dap/dapengine.cpp b/src/plugins/debugger/dap/dapengine.cpp index 5d40d3e72de..fd4119e361c 100644 --- a/src/plugins/debugger/dap/dapengine.cpp +++ b/src/plugins/debugger/dap/dapengine.cpp @@ -814,7 +814,7 @@ void DapEngine::handleBreakpointResponse(const QJsonObject &response) const Breakpoints bps = breakHandler()->breakpoints(); for (const Breakpoint &bp : bps) { BreakpointParameters parameters = bp->requestedParameters(); - QString mapKey = parameters.fileName.toString() + ":" + QString mapKey = parameters.fileName.toUrlishString() + ":" + QString::number(parameters.textPosition.line); if (map.find(mapKey) != map.end()) { if (bp->state() == BreakpointRemoveProceeding) { @@ -854,14 +854,14 @@ void DapEngine::handleBreakpointResponse(const QJsonObject &response) if (!bp->isEnabled()) continue; - QString path = bp->requestedParameters().fileName.toString(); + QString path = bp->requestedParameters().fileName.toUrlishString(); int line = bp->requestedParameters().textPosition.line; QJsonObject jsonBreakpoint; QString key; for (auto it = map.cbegin(); it != map.cend(); ++it) { const QJsonObject breakpoint = *it; - if (path == bp->requestedParameters().fileName.toString() + if (path == bp->requestedParameters().fileName.toUrlishString() && abs(breakpoint.value("line").toInt() - line) < abs(jsonBreakpoint.value("line").toInt() - line)) { jsonBreakpoint = breakpoint; |