forked from qt-creator/qt-creator
Git: Fix preserving selection from previous submit editor
Change-Id: Ideab3cb6c9250ab45f4a896e21ffd6007d810158 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
4c800b1b5a
commit
7eebf9abba
@@ -53,11 +53,13 @@ public:
|
|||||||
|
|
||||||
void updateSelections(SubmitFileModel *source)
|
void updateSelections(SubmitFileModel *source)
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(source, return);
|
||||||
|
GitSubmitFileModel *gitSource = static_cast<GitSubmitFileModel *>(source);
|
||||||
int j = 0;
|
int j = 0;
|
||||||
for (int i = 0; i < rowCount() && j < source->rowCount(); ++i) {
|
for (int i = 0; i < rowCount() && j < source->rowCount(); ++i) {
|
||||||
CommitData::StateFilePair stateFile = stateFilePair(i);
|
CommitData::StateFilePair stateFile = stateFilePair(i);
|
||||||
for (; j < source->rowCount(); ++j) {
|
for (; j < source->rowCount(); ++j) {
|
||||||
CommitData::StateFilePair sourceStateFile = stateFilePair(j);
|
CommitData::StateFilePair sourceStateFile = gitSource->stateFilePair(j);
|
||||||
if (stateFile == sourceStateFile) {
|
if (stateFile == sourceStateFile) {
|
||||||
setChecked(i, source->checked(j));
|
setChecked(i, source->checked(j));
|
||||||
break;
|
break;
|
||||||
@@ -69,7 +71,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CommitData::StateFilePair stateFilePair(int row)
|
CommitData::StateFilePair stateFilePair(int row) const
|
||||||
{
|
{
|
||||||
return CommitData::StateFilePair(static_cast<FileStates>(extraData(row).toInt()), file(row));
|
return CommitData::StateFilePair(static_cast<FileStates>(extraData(row).toInt()), file(row));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user