Changeset View
Changeset View
Standalone View
Standalone View
src/core/kcoredirlister_p.h
Show First 20 Lines • Show All 299 Lines • ▼ Show 20 Line(s) | 248 | private: | |||
---|---|---|---|---|---|
300 | * @param item the modified item to be inserted | 300 | * @param item the modified item to be inserted | ||
301 | */ | 301 | */ | ||
302 | void reinsert(const KFileItem &item, const QUrl &oldUrl) | 302 | void reinsert(const KFileItem &item, const QUrl &oldUrl) | ||
303 | { | 303 | { | ||
304 | const QUrl parentDir = oldUrl.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash); | 304 | const QUrl parentDir = oldUrl.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash); | ||
305 | DirItem *dirItem = dirItemForUrl(parentDir); | 305 | DirItem *dirItem = dirItemForUrl(parentDir); | ||
306 | if (dirItem) { | 306 | if (dirItem) { | ||
307 | auto it = std::lower_bound(dirItem->lstItems.begin(), dirItem->lstItems.end(), oldUrl); | 307 | auto it = std::lower_bound(dirItem->lstItems.begin(), dirItem->lstItems.end(), oldUrl); | ||
308 | Q_ASSERT(it != dirItem->lstItems.end()); | 308 | if (it != dirItem->lstItems.end() && (*it).url() == oldUrl ) { | ||
309 | dirItem->lstItems.erase(it); | 309 | dirItem->lstItems.erase(it); | ||
310 | } | ||||
310 | dirItem->insert(item); | 311 | dirItem->insert(item); | ||
311 | } | 312 | } | ||
312 | } | 313 | } | ||
313 | 314 | | |||
314 | /** | 315 | /** | ||
315 | * When KDirWatch tells us that something changed in "dir", we need to | 316 | * When KDirWatch tells us that something changed in "dir", we need to | ||
316 | * also notify the dirlisters that are listing a symlink to "dir" (#213799) | 317 | * also notify the dirlisters that are listing a symlink to "dir" (#213799) | ||
317 | */ | 318 | */ | ||
▲ Show 20 Lines • Show All 237 Lines • Show Last 20 Lines |