Skip to content

Commit

Permalink
fix warnings in ScriptsListModel.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Felk committed Nov 22, 2020
1 parent 57cfc9b commit 51d5a26
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Source/Core/DolphinQt/Scripting/ScriptsListModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ int ScriptsListModel::columnCount(const QModelIndex& parent) const

QVariant ScriptsListModel::data(const QModelIndex& index, int role) const
{
if (!index.isValid())
return QVariant();

if (index.row() >= m_scripts.size())
if (!index.isValid() || (size_t)index.row() >= m_scripts.size())
return QVariant();

if (role == Qt::DisplayRole || role == Qt::EditRole)
{
if (index.column() == 0)
return QVariant();
else if (index.column() == 1)
return QVariant(QString::fromStdString(m_scripts[index.row()].filename));
}
return QVariant();
}

Expand Down

0 comments on commit 51d5a26

Please sign in to comment.