Skip to content

Commit

Permalink
Fix Coverity Scan issues CID 57634 and CID 57625
Browse files Browse the repository at this point in the history
  • Loading branch information
trollixx committed Apr 13, 2015
1 parent eefaffe commit 1ebe5ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/registry/listmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
return QVariant();
}
case DocsetNameRole:
if (!index.parent().isValid())
return m_docsetRegistry->docset(index.row())->name();
if (index.parent().isValid())
return QVariant();
return m_docsetRegistry->docset(index.row())->name();
case UpdateAvailableRole:
if (!index.parent().isValid())
return m_docsetRegistry->docset(index.row())->hasUpdate;
if (index.parent().isValid())
return QVariant();
return m_docsetRegistry->docset(index.row())->hasUpdate;
default:
return QVariant();
}
Expand Down
3 changes: 2 additions & 1 deletion src/ui/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ void SettingsDialog::downloadCompleted()
dir.rename(docsetDirName, tmpName);
QtConcurrent::run([=] {
QDir d(dir);
d.cd(tmpName);
if (!d.cd(tmpName))
return;
d.removeRecursively();
});
}
Expand Down

0 comments on commit 1ebe5ed

Please sign in to comment.