aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/outputformatter.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-05-11 15:31:00 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-05-18 12:34:52 +0000
commitd9dd1f8d527b47fba0cc683f9ea34055e2a7283d (patch)
treed32d4ec3ae25b098210e6e49e526514d60daace4 /src/libs/utils/outputformatter.cpp
parent6bc59a0b95e87652d8c6d1001bed75e7606a891f (diff)
GCC parser: Create fewer and better issues
Consider the following compiler warning: In file included from qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ ardupilotmega/ardupilotmega.h:946, from qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ ardupilotmega/mavlink.h:32, from qgroundcontrol/src/comm/QGCMAVLink.h:24, from qgroundcontrol/src/comm/LinkInterface.h:21, from qgroundcontrol/src/comm/LinkManager.h:21, from qgroundcontrol/src/QGCApplication.h:27, from qgroundcontrol/src/QtLocationPlugin/ QGCMapUrlEngine.cpp:19: qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ardupilotmega/./ mavlink_msg_vision_position_delta.h: In function ‘uint16_t mavlink_msg_vision_position_delta_encode(uint8_t, uint8_t, mavlink_message_t*, const mavlink_vision_position_delta_t*)’: qgroundcontrol/libs/mavlink/include/mavlink/v2.0/ardupilotmega/./ mavlink_msg_vision_position_delta.h:138:178: warning: taking address of packed member of ‘__mavlink_vision_position_delta_t’ may result in an unaligned pointer value [-Waddress-of-packed-member] 138 | return mavlink_msg_vision_position_delta_pack(system_id, component_id, msg, vision_position_delta->time_usec, vision_position_delta->time_delta_usec, vision_position_delta- >angle_delta, vision_position_delta->position_delta, vision_position_delta->confidence); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ Before this patch, this output resulted in nine entries in the issues pane, which defeats the purpose: The user is supposed to get a quick overview of the build problems, but instead we basically just copied over the contents of the compile window, which is of little help and also slows things down by overloading the task model. We now try harder to identify output lines that belong to the same issue and create just one task for them. File paths are now linkified in the detailed issue view, so that users can still navigate quickly to all involved files. Task-number: QTCREATORBUG-22914 Change-Id: I1aed2ffac7d363c02073ef318cb863754379cf6d Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/libs/utils/outputformatter.cpp')
-rw-r--r--src/libs/utils/outputformatter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/utils/outputformatter.cpp b/src/libs/utils/outputformatter.cpp
index eb7f1cebb6..7d8ac409ed 100644
--- a/src/libs/utils/outputformatter.cpp
+++ b/src/libs/utils/outputformatter.cpp
@@ -374,6 +374,7 @@ const QList<FormattedText> OutputFormatter::linkifiedText(
int nextLinkSpecIndex = 0;
for (const FormattedText &t : text) {
+ const int totalPreviousTextLength = totalTextLengthSoFar;
// There is no more linkification work to be done. Just copy the text as-is.
if (nextLinkSpecIndex >= linkSpecs.size()) {
@@ -391,7 +392,7 @@ const QList<FormattedText> OutputFormatter::linkifiedText(
}
const OutputLineParser::LinkSpec &linkSpec = linkSpecs.at(nextLinkSpecIndex);
- const int localLinkStartPos = linkSpec.startPos - totalTextLengthSoFar;
+ const int localLinkStartPos = linkSpec.startPos - totalPreviousTextLength;
++nextLinkSpecIndex;
// We ignore links that would cross format boundaries.