* Finally nailed down and fixed #355: apparently, if the pose info attribute
couldn't be read from a file, Tracker would try 10 times with a 10 ms timeout - but only if the creation time equals the modification time! That was obviously supposed to be a check if the file was recent... Now that computers are faster (even when running Haiku), it may actually take less than one second to copy a file, so most files on the Haiku image satisfied this thoughtful and future-proof check. (And no, even the original BFS does not automatically increase the modified time on close.) * Now, mmlr came up with a better check: we just check the file's creation time against the current time to see if it's a recent file. That should work a bit more reliable :-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23376 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -755,12 +755,13 @@ BPoseView::SavePoseLocations(BRect *frameIfDesktop)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
model->WriteAttrKillForegin(kAttrPoseInfo, kAttrPoseInfoForeign,
|
model->WriteAttrKillForegin(kAttrPoseInfo, kAttrPoseInfoForeign,
|
||||||
B_RAW_TYPE, 0, &poseInfo, sizeof(poseInfo));
|
B_RAW_TYPE, 0, &poseInfo, sizeof(poseInfo)));
|
||||||
|
|
||||||
if (desktop)
|
if (desktop) {
|
||||||
model->WriteAttrKillForegin(kAttrExtendedPoseInfo,
|
model->WriteAttrKillForegin(kAttrExtendedPoseInfo,
|
||||||
kAttrExtendedPoseInfoForegin,
|
kAttrExtendedPoseInfoForegin,
|
||||||
B_RAW_TYPE, 0, extendedPoseInfo, extendedPoseInfoSize);
|
B_RAW_TYPE, 0, extendedPoseInfo, extendedPoseInfoSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] (char *)extendedPoseInfo;
|
delete [] (char *)extendedPoseInfo;
|
||||||
@@ -2541,6 +2542,8 @@ BPoseView::ReadPoseInfo(Model *model, PoseInfo *poseInfo)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ASSERT(model->IsNodeOpen());
|
ASSERT(model->IsNodeOpen());
|
||||||
|
time_t now = time(NULL);
|
||||||
|
|
||||||
for (int32 count = 10; count >= 0; count--) {
|
for (int32 count = 10; count >= 0; count--) {
|
||||||
if (!model->Node())
|
if (!model->Node())
|
||||||
break;
|
break;
|
||||||
@@ -2558,9 +2561,9 @@ BPoseView::ReadPoseInfo(Model *model, PoseInfo *poseInfo)
|
|||||||
// pose info to properly place the icon
|
// pose info to properly place the icon
|
||||||
if (ViewMode() == kListMode)
|
if (ViewMode() == kListMode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const StatStruct *stat = model->StatBuf();
|
const StatStruct *stat = model->StatBuf();
|
||||||
if (stat->st_crtime != stat->st_mtime)
|
if (stat->st_crtime < now - 5)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// PRINT(("retrying to read pose info for %s, %d\n", model->Name(), count));
|
// PRINT(("retrying to read pose info for %s, %d\n", model->Name(), count));
|
||||||
|
|||||||
Reference in New Issue
Block a user