Changeset View
Changeset View
Standalone View
Standalone View
lib/thumbnailview/thumbnailview.cpp
Show First 20 Lines • Show All 870 Lines • ▼ Show 20 Line(s) | |||||
871 | 871 | | |||
872 | void ThumbnailView::updateThumbnail(const QUrl& url) | 872 | void ThumbnailView::updateThumbnail(const QUrl& url) | ||
873 | { | 873 | { | ||
874 | const ThumbnailForUrl::Iterator it = d->mThumbnailForUrl.find(url); | 874 | const ThumbnailForUrl::Iterator it = d->mThumbnailForUrl.find(url); | ||
875 | if (it == d->mThumbnailForUrl.end()) { | 875 | if (it == d->mThumbnailForUrl.end()) { | ||
876 | return; | 876 | return; | ||
877 | } | 877 | } | ||
878 | 878 | | |||
879 | if (d->mDocumentInfoProvider && d->mDocumentInfoProvider->isModified(url)) { | 879 | if (d->mDocumentInfoProvider) { | ||
muhlenpfordt: After undoing the last edit `isModified()` is false but the document changed and the thumbnail… | |||||
880 | d->updateThumbnailForModifiedDocument(it->mIndex); | 880 | d->updateThumbnailForModifiedDocument(it->mIndex); | ||
881 | } else { | 881 | } else { | ||
882 | const KFileItem item = fileItemForIndex(it->mIndex); | 882 | const KFileItem item = fileItemForIndex(it->mIndex); | ||
883 | d->appendItemsToThumbnailProvider(KFileItemList({ item })); | 883 | d->appendItemsToThumbnailProvider(KFileItemList({ item })); | ||
884 | } | 884 | } | ||
It's probably better to keep the else branch as-is, but in case you know (without spending too much time researching), I'd be interested in how we could enter the else, i.e. in which situations mDocumentInfoProvider is null. rkflx: It's probably better to keep the `else` branch as-is, but in case you know (without spending… | |||||
I think this should not happen and found no way to provoke this. But I'm not 100% sure it is really impossible. muhlenpfordt: I think this should not happen and found no way to provoke this. But I'm not 100% sure it is… | |||||
rkflx: Ok, let's just keep it then. | |||||
885 | } | 885 | } | ||
886 | 886 | | |||
887 | void ThumbnailView::updateThumbnailBusyState(const QUrl& url, bool busy) | 887 | void ThumbnailView::updateThumbnailBusyState(const QUrl& url, bool busy) | ||
888 | { | 888 | { | ||
889 | const ThumbnailForUrl::Iterator it = d->mThumbnailForUrl.find(url); | 889 | const ThumbnailForUrl::Iterator it = d->mThumbnailForUrl.find(url); | ||
890 | if (it == d->mThumbnailForUrl.end()) { | 890 | if (it == d->mThumbnailForUrl.end()) { | ||
891 | return; | 891 | return; | ||
892 | } | 892 | } | ||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |
After undoing the last edit isModified() is false but the document changed and the thumbnail needs an update.