Only write the icons if we did in fact have to freshly create the Trash directory. Should fix #5827 completely.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36522 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -2362,7 +2362,13 @@ FSGetTrashDir(BDirectory *trashDir, dev_t dev)
|
||||
return result;
|
||||
|
||||
BPath path;
|
||||
result = find_directory(B_TRASH_DIRECTORY, &path, true, &volume);
|
||||
bool created = false;
|
||||
result = find_directory(B_TRASH_DIRECTORY, &path, false, &volume);
|
||||
if (result != B_OK) {
|
||||
result = find_directory(B_TRASH_DIRECTORY, &path, true,
|
||||
&volume);
|
||||
created = true;
|
||||
}
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
@@ -2370,6 +2376,8 @@ FSGetTrashDir(BDirectory *trashDir, dev_t dev)
|
||||
if (result != B_OK)
|
||||
return result;
|
||||
|
||||
if (created)
|
||||
{
|
||||
// make trash invisible
|
||||
StatStruct sbuf;
|
||||
trashDir->GetStat(&sbuf);
|
||||
@@ -2393,8 +2401,7 @@ FSGetTrashDir(BDirectory *trashDir, dev_t dev)
|
||||
trashDir->WriteAttr(kAttrMiniIcon, 'MICN', 0,
|
||||
data, size);
|
||||
}
|
||||
// TODO: figure out why writing the vector icon seems broken.
|
||||
#if 0
|
||||
#ifdef __HAIKU__
|
||||
data = GetTrackerResources()->
|
||||
LoadResource(B_VECTOR_ICON_TYPE, R_TrashIcon, &size);
|
||||
if (data != NULL) {
|
||||
@@ -2402,6 +2409,7 @@ FSGetTrashDir(BDirectory *trashDir, dev_t dev)
|
||||
data, size);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user