diff --git a/vcs/models/tests/test_models.cpp b/vcs/models/tests/test_models.cpp --- a/vcs/models/tests/test_models.cpp +++ b/vcs/models/tests/test_models.cpp @@ -46,7 +46,9 @@ url, 1, Qt::MatchExactly).value(0); }; const auto statusInfo = [](const QModelIndex& idx) { - return idx.data(VcsFileChangesModel::VcsStatusInfoRole).value(); + auto data = idx.data(VcsFileChangesModel::VcsStatusInfoRole); + Q_ASSERT(data.canConvert()); + return data.value(); }; VcsFileChangesModel *model = new VcsFileChangesModel(this); diff --git a/vcs/models/vcsfilechangesmodel.cpp b/vcs/models/vcsfilechangesmodel.cpp --- a/vcs/models/vcsfilechangesmodel.cpp +++ b/vcs/models/vcsfilechangesmodel.cpp @@ -182,7 +182,7 @@ QVariant VcsFileChangesModel::data(const QModelIndex &index, int role) const { - if (role == UrlRole && index.column()==0) { + if (role >= VcsStatusInfoRole && index.column()==0) { return QStandardItemModel::data(index.sibling(index.row(), 1), role); } return QStandardItemModel::data(index, role);