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