Commit 0c3743bb authored by hjk's avatar hjk Committed by hjk
Browse files

debugger: use saved "resize columns to contents" settings

Change-Id: I88d50205d6ba626e0b4bf66879271fafab81e8cb
Reviewed-by: con
Task-number: QTCREATORBUG-5320
Reviewed-on: http://codereview.qt.nokia.com/1379

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent 0461150b
......@@ -527,6 +527,10 @@ void BreakWindow::setModel(QAbstractItemModel *model)
resizeColumnToContents(0); // Number
resizeColumnToContents(3); // Line
resizeColumnToContents(6); // Ignore count
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustBreakpointsColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
connect(model, SIGNAL(layoutChanged()), this, SLOT(expandAll()));
}
......
......@@ -2584,7 +2584,9 @@ void DebuggerPluginPrivate::extensionsInitialized()
ICore *core = ICore::instance();
QTC_ASSERT(core, return);
m_coreSettings = core->settings();
m_debuggerSettings = new DebuggerSettings(m_coreSettings);
m_debuggerSettings->readSettings();
connect(core, SIGNAL(coreAboutToClose()), this, SLOT(coreShutdown()));
......@@ -2776,8 +2778,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_commonOptionsPage = new CommonOptionsPage(m_globalDebuggerOptions);
m_plugin->addAutoReleasedObject(m_commonOptionsPage);
m_debuggerSettings->readSettings();
// Do not fail to load the whole plugin if something goes wrong here.
QString errorMessage;
if (!parseArguments(m_arguments, &m_cmdLineEnabledEngines, &errorMessage)) {
......
......@@ -215,7 +215,10 @@ void ModulesWindow::setAlwaysResizeColumnsToContents(bool on)
void ModulesWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
setAlwaysResizeColumnsToContents(true);
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustModulesColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
}
} // namespace Internal
......
......@@ -296,6 +296,10 @@ void RegisterWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
setAlwaysResizeColumnsToContents(true);
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustRegistersColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
}
void RegisterWindow::reloadRegisters()
......
......@@ -135,6 +135,16 @@ void SnapshotWindow::removeSnapshot(int i)
m_snapshotHandler->at(i)->quitDebugger();
}
void SnapshotWindow::setModel(QAbstractItemModel *model)
{
QTreeView::setModel(model);
setAlwaysResizeColumnsToContents(true);
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustSnapshotsColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
}
void SnapshotWindow::resizeColumnsToContents()
{
for (int i = model()->columnCount(); --i >= 0; )
......
......@@ -59,6 +59,7 @@ private:
void removeSnapshot(int i);
void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
void setModel(QAbstractItemModel *model);
SnapshotHandler *m_snapshotHandler;
};
......
......@@ -105,6 +105,10 @@ void StackWindow::setModel(QAbstractItemModel *model)
//resizeColumnsToContents();
resizeColumnToContents(0);
resizeColumnToContents(3);
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustStackColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
}
void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
......
......@@ -82,6 +82,10 @@ void ThreadsWindow::setModel(QAbstractItemModel *model)
resizeColumnToContents(0); // Id
resizeColumnToContents(4); // Line
resizeColumnToContents(6); // Name
if (header()) {
bool adjust = debuggerCore()->boolSetting(AlwaysAdjustThreadsColumnWidths);
setAlwaysResizeColumnsToContents(adjust);
}
}
void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
......
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