Simplify url lookup in the ProjectChangesModel

Authored by apol.

Description

Simplify url lookup in the ProjectChangesModel

Details

Committed
apolJan 14 2016, 3:18 PM
Parents
R33:b3de7de042f8: Prevent reloading the project changes twice
Branches
Unknown
Tags
Unknown
kfunk added a subscriber: kfunk.Jan 14 2016, 3:49 PM
kfunk added inline comments.
/vcs/models/vcsfilechangesmodel.cpp
162

Why the check for column?

This means index(0, 1).data(UrlRole) will return just the display string. Probably not what you want?

apol added inline comments.Jan 14 2016, 4:20 PM
/vcs/models/vcsfilechangesmodel.cpp
162

No, it will return the URL, note we're also checking the role.

kfunk added inline comments.Jan 14 2016, 5:32 PM
/vcs/models/vcsfilechangesmodel.cpp
162

I'm just confused why this check is needed, it shouldn't be needed.

This whole QStandardItemModel::data overload could be trashed; since you already do the work in VcsStatusInfoItem::data, no?

apol added inline comments.Jan 14 2016, 5:46 PM
/vcs/models/vcsfilechangesmodel.cpp
162

No, because in some places we request the URL of the first column.

Code can be adapted, but I rather have a predictable UrlRole for the whole row.