Commit 6ef5aaad authored by hjk's avatar hjk

Debugger: Set model object names at construction time

Change-Id: Ib1d273ef2c2bb97a2343da6d361fde7c01012040
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent ca171628
......@@ -416,34 +416,22 @@ SourceFilesHandler *DebuggerEngine::sourceFilesHandler() const
QAbstractItemModel *DebuggerEngine::modulesModel() const
{
QAbstractItemModel *model = modulesHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("ModulesModel"));
return model;
return modulesHandler()->model();
}
QAbstractItemModel *DebuggerEngine::registerModel() const
{
QAbstractItemModel *model = registerHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("RegisterModel"));
return model;
return registerHandler()->model();
}
QAbstractItemModel *DebuggerEngine::stackModel() const
{
QAbstractItemModel *model = stackHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("StackModel"));
return model;
return stackHandler()->model();
}
QAbstractItemModel *DebuggerEngine::threadsModel() const
{
QAbstractItemModel *model = threadsHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("ThreadsModel"));
return model;
return threadsHandler()->model();
}
QAbstractItemModel *DebuggerEngine::watchModel() const
......@@ -453,10 +441,7 @@ QAbstractItemModel *DebuggerEngine::watchModel() const
QAbstractItemModel *DebuggerEngine::sourceFilesModel() const
{
QAbstractItemModel *model = sourceFilesHandler()->model();
if (model->objectName().isEmpty()) // Make debugging easier.
model->setObjectName(objectName() + QLatin1String("SourceFilesModel"));
return model;
return sourceFilesHandler()->model();
}
void DebuggerEngine::fetchMemory(MemoryAgent *, QObject *,
......
......@@ -262,7 +262,9 @@ ModulesHandler::ModulesHandler(DebuggerEngine *engine)
{
m_engine = engine;
m_model = new ModulesModel(this);
m_model->setObjectName(QLatin1String("ModulesModel"));
m_proxyModel = new QSortFilterProxyModel(this);
m_proxyModel->setObjectName(QLatin1String("ModulesProxyModel"));
m_proxyModel->setSourceModel(m_model);
}
......
......@@ -314,6 +314,7 @@ Register::Register(const QByteArray &name_)
RegisterHandler::RegisterHandler()
{
setObjectName(QLatin1String("RegisterModel"));
m_base = 16;
calculateWidth();
#if USE_REGISTER_MODEL_TEST
......
......@@ -39,7 +39,9 @@ namespace Internal {
SourceFilesHandler::SourceFilesHandler()
{
setObjectName(QLatin1String("SourceFilesModel"));
QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this);
proxy->setObjectName(QLatin1String("SourceFilesProxyModel"));
proxy->setSourceModel(this);
m_proxyModel = proxy;
}
......
......@@ -57,6 +57,7 @@ StackHandler::StackHandler()
: m_positionIcon(QIcon(QLatin1String(":/debugger/images/location_16.png"))),
m_emptyIcon(QIcon(QLatin1String(":/debugger/images/debugger_empty_14.png")))
{
setObjectName(QLatin1String("StackModel"));
m_resetLocationScheduled = false;
m_contentsValid = false;
m_currentIndex = -1;
......
......@@ -135,6 +135,7 @@ ThreadsHandler::ThreadsHandler()
m_emptyIcon(QLatin1String(":/debugger/images/debugger_empty_14.png"))
{
m_resetLocationScheduled = false;
setObjectName(QLatin1String("ThreadsModel"));
// m_proxyModel = new QSortFilterProxyModel(this);
// m_proxyModel->setSourceModel(this);
}
......
......@@ -274,6 +274,7 @@ private:
WatchModel::WatchModel(WatchHandler *handler)
: m_handler(handler)
{
setObjectName(QLatin1String("WatchModel"));
m_root = createItem(QByteArray(), tr("Root"), 0);
// Note: Needs to stay
m_localsRoot = createItem("local", tr("Locals"), m_root);
......
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