Commit c81ddf8f authored by Bill King's avatar Bill King
Browse files

Fix insufficient null checking.

parent 7ccfd479
......@@ -880,19 +880,21 @@ void EditorManager::closeDuplicate(Core::IEditor *editor)
emit editorAboutToClose(editor);
EditorView *view = m_d->m_splitter->findView(editor)->view();
removeEditor(editor);
view->removeEditor(editor);
if(m_d->m_splitter->findView(editor)) {
EditorView *view = m_d->m_splitter->findView(editor)->view();
removeEditor(editor);
view->removeEditor(editor);
IEditor *newCurrent = view->currentEditor();
if (!newCurrent)
newCurrent = pickUnusedEditor();
if (newCurrent) {
activateEditor(view, newCurrent, NoActivate);
} else {
QModelIndex idx = m_d->m_editorModel->firstRestoredEditor();
if (idx.isValid())
activateEditor(idx, view, NoActivate);
IEditor *newCurrent = view->currentEditor();
if (!newCurrent)
newCurrent = pickUnusedEditor();
if (newCurrent) {
activateEditor(view, newCurrent, NoActivate);
} else {
QModelIndex idx = m_d->m_editorModel->firstRestoredEditor();
if (idx.isValid())
activateEditor(idx, view, NoActivate);
}
}
emit editorsClosed(QList<IEditor*>() << editor);
......
......@@ -223,16 +223,17 @@ QList<BuildConfigWidget *> BuildSettingsWidget::subWidgets() const
void BuildSettingsWidget::updateAddButtonMenu()
{
m_addButtonMenu->clear();
if (m_target &&
m_target->activeBuildConfiguration()) {
m_addButtonMenu->addAction(tr("&Clone Selected"),
this, SLOT(cloneConfiguration()));
}
IBuildConfigurationFactory *factory = m_target->buildConfigurationFactory();
if (factory) {
foreach (const QString &id, factory->availableCreationIds(m_target)) {
QAction *action = m_addButtonMenu->addAction(factory->displayNameForId(id), this, SLOT(createConfiguration()));
action->setData(id);
if (m_target) {
if (m_target->activeBuildConfiguration()) {
m_addButtonMenu->addAction(tr("&Clone Selected"),
this, SLOT(cloneConfiguration()));
}
IBuildConfigurationFactory *factory = m_target->buildConfigurationFactory();
if (factory) {
foreach (const QString &id, factory->availableCreationIds(m_target)) {
QAction *action = m_addButtonMenu->addAction(factory->displayNameForId(id), this, SLOT(createConfiguration()));
action->setData(id);
}
}
}
}
......
......@@ -1118,9 +1118,10 @@ void MyGroupBox::paintEvent(QPaintEvent * event)
QGroupBox::paintEvent(event);
if (m_animated) {
QPainter p(this);
p.setOpacity(m_alpha);
if (!m_pixmap.isNull() && !m_firstExpand)
if (!m_pixmap.isNull() && !m_firstExpand) {
p.setOpacity(m_alpha);
p.drawPixmap(5, 5, m_pixmap.width(), m_pixmap.height(), m_pixmap);
}
}
}
......
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