Commit a07533a9 authored by Kurt Hindenburg's avatar Kurt Hindenburg
Browse files

Fix a few llvm scanner issues - pointer is null and dead assignment

llvm's scan-build likes to check object is not null before calling
method and removed one dead assignment.
(cherry picked from commit 1be837a6)
parent b820dbf7
......@@ -730,11 +730,12 @@ void EditProfileDialog::colorSchemeSelected()
if (!selected.isEmpty()) {
QAbstractItemModel* model = _ui->colorSchemeList->model();
const ColorScheme* colors = model->data(selected.first(), Qt::UserRole + 1).value<const ColorScheme*>();
if (colors) {
updateTempProfileProperty(Profile::ColorScheme, colors->name());
previewColorScheme(selected.first());
updateTempProfileProperty(Profile::ColorScheme, colors->name());
previewColorScheme(selected.first());
updateTransparencyWarning();
updateTransparencyWarning();
}
}
updateColorSchemeButtons();
......@@ -839,7 +840,9 @@ void EditProfileDialog::keyBindingSelected()
QAbstractItemModel* model = _ui->keyBindingList->model();
const KeyboardTranslator* translator = model->data(selected.first(), Qt::UserRole + 1)
.value<const KeyboardTranslator*>();
updateTempProfileProperty(Profile::KeyBindings, translator->name());
if (translator) {
updateTempProfileProperty(Profile::KeyBindings, translator->name());
}
}
updateKeyBindingsButtons();
......@@ -1251,8 +1254,9 @@ void ColorSchemeViewDelegate::paint(QPainter* painter, const QStyleOptionViewIte
const QModelIndex& index) const
{
const ColorScheme* scheme = index.data(Qt::UserRole + 1).value<const ColorScheme*>();
Q_ASSERT(scheme);
if (!scheme)
return;
bool transparencyAvailable = KWindowSystem::compositingActive();
......
......@@ -1896,7 +1896,6 @@ void SearchHistoryTask::executeOnScreenWindow(SessionPtr session , ScreenWindowP
// line number search below assumes that the buffer ends with a new-line
string.append('\n');
pos = -1;
if (forwards)
pos = string.indexOf(_regExp);
else
......
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