Tracker: Trash entry must be set, otherwise bad things happen.
Follow up to hrev59580. Preload Trash icon again. We need to Refresh cache in TrashWatcher::Run(), remove the rest. Fixes #20026. Change-Id: Ie39fff508c936819067eed198f5b801de2662ba8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10689 Reviewed-by: John Scipione <[email protected]> Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
757e60f86b
commit
76afa5f534
@@ -965,9 +965,6 @@ IconCache::Preload(AutoLock<SimpleIconCache>* nodeCacheLocker,
|
|||||||
entry = GetPrinterIcon(nodeCacheLocker, sharedCacheLocker,
|
entry = GetPrinterIcon(nodeCacheLocker, sharedCacheLocker,
|
||||||
&resultingOpenCache, model, source, mode, size, &lazyBitmap);
|
&resultingOpenCache, model, source, mode, size, &lazyBitmap);
|
||||||
ASSERT(entry != NULL);
|
ASSERT(entry != NULL);
|
||||||
} else if (model->IsTrash()) {
|
|
||||||
// do not preload Trash icon, TrashWatcher handles it.
|
|
||||||
source = kNode;
|
|
||||||
} else {
|
} else {
|
||||||
if (source == kUnknownSource) {
|
if (source == kUnknownSource) {
|
||||||
// look for node icons first
|
// look for node icons first
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ All rights reserved.
|
|||||||
#include "Attributes.h"
|
#include "Attributes.h"
|
||||||
#include "Bitmaps.h"
|
#include "Bitmaps.h"
|
||||||
#include "FSUtils.h"
|
#include "FSUtils.h"
|
||||||
|
#include "IconCache.h"
|
||||||
#include "Tracker.h"
|
#include "Tracker.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -71,8 +72,16 @@ BTrashWatcher::BTrashWatcher()
|
|||||||
thread_id
|
thread_id
|
||||||
BTrashWatcher::Run()
|
BTrashWatcher::Run()
|
||||||
{
|
{
|
||||||
fTrashFull = CheckTrashDirs();
|
// refresh Trash icon cache
|
||||||
UpdateTrashIcon();
|
BPath path;
|
||||||
|
if (find_directory(B_TRASH_DIRECTORY, &path) == B_OK) {
|
||||||
|
BDirectory trashDir(path.Path());
|
||||||
|
BEntry entry;
|
||||||
|
if (trashDir.GetEntry(&entry) == B_OK) {
|
||||||
|
Model trashModel(&entry);
|
||||||
|
IconCache::sIconCache->IconChanged(&trashModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return BLooper::Run();
|
return BLooper::Run();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user