Don't store the index of the file item in the VersionControlObserver::ItemState, get the index of the file item on demand instead.

Fixes some "old"-index problems, esp. when you copy/move around files while the version control thread is still running.

FIXED-IN: 4.13
REVIEW: 115410
This commit is contained in:
Emmanuel Pescosta 2014-01-31 20:56:57 +01:00
parent 2946cc30fc
commit 4d9193b85b
2 changed files with 1 additions and 3 deletions

View file

@ -206,7 +206,7 @@ void VersionControlObserver::slotThreadFinished()
foreach (const ItemState& item, items) {
QHash<QByteArray, QVariant> values;
values.insert("version", QVariant(item.version));
m_model->setData(item.index, values);
m_model->setData(m_model->index(item.item), values);
}
}
@ -265,7 +265,6 @@ int VersionControlObserver::createItemStatesList(QMap<QString, QVector<ItemState
if (expansionLevel == currentExpansionLevel) {
ItemState itemState;
itemState.index = index;
itemState.item = m_model->fileItem(index);
itemState.version = KVersionControlPlugin2::UnversionedVersion;

View file

@ -102,7 +102,6 @@ private slots:
private:
struct ItemState
{
int index;
KFileItem item;
KVersionControlPlugin2::ItemVersion version;
};