forked from qt-creator/qt-creator
Debugger: Mark bad debuggger entries with an error icon
Change-Id: If3f7ab4ea015be6f580f748f9d0ee19c608a0239 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
@@ -202,6 +202,18 @@ QStringList DebuggerItem::abiNames() const
|
||||
return list;
|
||||
}
|
||||
|
||||
bool DebuggerItem::isGood() const
|
||||
{
|
||||
return m_engineType != NoEngineType;
|
||||
}
|
||||
|
||||
QString DebuggerItem::validityMessage() const
|
||||
{
|
||||
if (m_engineType == NoEngineType)
|
||||
return DebuggerOptionsPage::tr("Could not determine debugger type");
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool DebuggerItem::operator==(const DebuggerItem &other) const
|
||||
{
|
||||
return m_id == other.m_id
|
||||
|
||||
@@ -98,6 +98,9 @@ public:
|
||||
|
||||
QStringList abiNames() const;
|
||||
|
||||
bool isGood() const;
|
||||
QString validityMessage() const;
|
||||
|
||||
bool operator==(const DebuggerItem &other) const;
|
||||
bool operator!=(const DebuggerItem &other) const { return !operator==(other); }
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
#include "debuggeritemmanager.h"
|
||||
#include "debuggeritem.h"
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <utils/detailswidget.h>
|
||||
@@ -68,6 +70,8 @@ public:
|
||||
|
||||
QVariant data(int column, int role) const
|
||||
{
|
||||
static QIcon errorIcon(QString::fromLatin1(Core::Constants::ICON_ERROR));
|
||||
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
switch (column) {
|
||||
@@ -81,6 +85,13 @@ public:
|
||||
font.setBold(m_changed);
|
||||
return font;
|
||||
}
|
||||
case Qt::DecorationRole: {
|
||||
if (column == 0 && !m_item.isGood())
|
||||
return errorIcon;
|
||||
}
|
||||
case Qt::ToolTipRole: {
|
||||
return m_item.validityMessage();
|
||||
}
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user