CMakePM: Show the target callstack in top order

In Projects view you can right click on a CMake target and select
"Open...", in the context menu you will have a stack of functions that
were used in the creation of the target.

If you are using a custom CMake API you would want the highlevel
function on top, and not on bottom.

Task-number: QTCREATORBUG-31362
Change-Id: I42e436d99f6c5f7a8d1cd67da84a6087bc18e8cd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Cristian Adam
2024-08-07 12:26:58 +02:00
parent 9fe6b26038
commit 5f3a343352

View File

@@ -913,13 +913,13 @@ static void setupLocationInfoForTargets(const QFuture<void> &cancelFuture,
QSet<std::pair<FilePath, int>> locations;
auto dedup = [&locations](const Backtrace &bt) {
QVector<FolderNode::LocationInfo> result;
for (const FolderNode::LocationInfo &i : bt) {
Utils::reverseForeach(bt, [&](const FolderNode::LocationInfo &i) {
int count = locations.count();
locations.insert({i.path, i.line});
if (count != locations.count()) {
result.append(i);
}
}
});
return result;
};