forked from qt-creator/qt-creator
debugger: allow the user to hide the std:: and Qt's namespace
This commit is contained in:
@@ -330,6 +330,7 @@ QString WatchData::shadowedName(const QString &name, int seen)
|
||||
return QCoreApplication::translate("Debugger::Internal::WatchData", "%1 <shadowed %2>").arg(name).arg(seen);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// WatchModel
|
||||
@@ -385,6 +386,11 @@ void WatchModel::reinitialize()
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
void WatchModel::emitAllChanged()
|
||||
{
|
||||
emit layoutChanged();
|
||||
}
|
||||
|
||||
void WatchModel::beginCycle()
|
||||
{
|
||||
emit enableUpdates(false);
|
||||
@@ -486,7 +492,7 @@ static inline QRegExp stdStringRegExp(const QString &charType)
|
||||
return re;
|
||||
}
|
||||
|
||||
QString niceType(const QString typeIn)
|
||||
static QString niceTypeHelper(const QString typeIn)
|
||||
{
|
||||
static QMap<QString, QString> cache;
|
||||
const QMap<QString, QString>::const_iterator it = cache.constFind(typeIn);
|
||||
@@ -588,6 +594,16 @@ QString niceType(const QString typeIn)
|
||||
return type;
|
||||
}
|
||||
|
||||
QString WatchModel::niceType(const QString &typeIn) const
|
||||
{
|
||||
QString type = niceTypeHelper(typeIn);
|
||||
if (theDebuggerBoolSetting(ShowStdNamespace))
|
||||
type = type.remove("std::");
|
||||
if (theDebuggerBoolSetting(ShowQtNamespace))
|
||||
type = type.remove(m_handler->m_manager->currentEngine()->qtNamespace());
|
||||
return type;
|
||||
}
|
||||
|
||||
static QString formattedValue(const WatchData &data,
|
||||
int individualFormat, int typeFormat)
|
||||
{
|
||||
@@ -1092,6 +1108,10 @@ WatchHandler::WatchHandler(DebuggerManager *manager)
|
||||
SIGNAL(triggered()), this, SLOT(watchExpression()));
|
||||
connect(theDebuggerAction(RemoveWatchExpression),
|
||||
SIGNAL(triggered()), this, SLOT(removeWatchExpression()));
|
||||
connect(theDebuggerAction(ShowStdNamespace),
|
||||
SIGNAL(triggered()), this, SLOT(emitAllChanged()));
|
||||
connect(theDebuggerAction(ShowQtNamespace),
|
||||
SIGNAL(triggered()), this, SLOT(emitAllChanged()));
|
||||
}
|
||||
|
||||
void WatchHandler::beginCycle()
|
||||
@@ -1125,6 +1145,13 @@ void WatchHandler::cleanup()
|
||||
#endif
|
||||
}
|
||||
|
||||
void WatchHandler::emitAllChanged()
|
||||
{
|
||||
m_locals->emitAllChanged();
|
||||
m_watchers->emitAllChanged();
|
||||
m_tooltips->emitAllChanged();
|
||||
}
|
||||
|
||||
void WatchHandler::insertData(const WatchData &data)
|
||||
{
|
||||
MODEL_DEBUG("INSERTDATA: " << data.toString());
|
||||
|
||||
Reference in New Issue
Block a user