Commit 91f11d4b authored by hjk's avatar hjk

Debugger: Add an macro expander for debugger engine type

Change-Id: Ib16f3b410ea83f6a4687b03677c51fbec26165d7
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 0f29d404
......@@ -32,8 +32,9 @@
#include "debuggeritemmanager.h"
#include "debuggerkitconfigwidget.h"
#include "projectexplorer/toolchain.h"
#include "projectexplorer/projectexplorerconstants.h"
#include <projectexplorer/toolchain.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/kitinformationmacroexpander.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
......@@ -299,6 +300,20 @@ KitConfigWidget *DebuggerKitInformation::createConfigWidget(Kit *k) const
return new Internal::DebuggerKitConfigWidget(k, this);
}
AbstractMacroExpander *DebuggerKitInformation::createMacroExpander(const Kit *k) const
{
return new MacroExpander([k, this](const QString &name, QString *ret) -> bool {
const DebuggerItem *item = DebuggerKitInformation::debugger(k);
if (name == QLatin1String("Debugger:engineType")) {
*ret = item ? item->engineTypeName() : tr("none");
return true;
}
return false;
});
}
KitInformation::ItemList DebuggerKitInformation::toUserOutput(const Kit *k) const
{
return ItemList() << qMakePair(tr("Debugger"), displayString(k));
......
......@@ -62,6 +62,7 @@ public:
static bool isValidDebugger(const ProjectExplorer::Kit *k);
ProjectExplorer::KitConfigWidget *createConfigWidget(ProjectExplorer::Kit *k) const;
Utils::AbstractMacroExpander *createMacroExpander(const ProjectExplorer::Kit *k) const;
ItemList toUserOutput(const ProjectExplorer::Kit *k) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment