The usage of BStatusWindow::HasStatus() was really bogus. First of all
HasStatus() and UpdateStatus() were not run in the same lock, so the job view could be gone anyway. And secondly, both methods iterate over all status items to find the one with the correct thread. Doh, if we don't have enough work to do, lets make some! Of course this was not critical in any case... git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34104 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -199,9 +199,8 @@ void
|
|||||||
TrackerCopyLoopControl::UpdateStatus(const char *name, entry_ref, int32 count,
|
TrackerCopyLoopControl::UpdateStatus(const char *name, entry_ref, int32 count,
|
||||||
bool optional)
|
bool optional)
|
||||||
{
|
{
|
||||||
if (gStatusWindow && gStatusWindow->HasStatus(fThread))
|
if (gStatusWindow)
|
||||||
gStatusWindow->UpdateStatus(fThread, const_cast<char *>(name),
|
gStatusWindow->UpdateStatus(fThread, name, count, optional);
|
||||||
count, optional);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -817,7 +816,7 @@ MoveTask(BObjectList<entry_ref> *srcList, BEntry *destEntry, BList *pointList, u
|
|||||||
|
|
||||||
// update the status because item got skipped and the status
|
// update the status because item got skipped and the status
|
||||||
// will not get updated by the move call
|
// will not get updated by the move call
|
||||||
if (gStatusWindow && gStatusWindow->HasStatus(thread))
|
if (gStatusWindow)
|
||||||
gStatusWindow->UpdateStatus(thread, srcRef->name, 1);
|
gStatusWindow->UpdateStatus(thread, srcRef->name, 1);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -1478,7 +1477,7 @@ MoveItem(BEntry *entry, BDirectory *destDir, BPoint *loc, uint32 moveMode,
|
|||||||
// size is irrelevant when simply moving to a new folder
|
// size is irrelevant when simply moving to a new folder
|
||||||
|
|
||||||
thread_id thread = find_thread(NULL);
|
thread_id thread = find_thread(NULL);
|
||||||
if (gStatusWindow && gStatusWindow->HasStatus(thread))
|
if (gStatusWindow)
|
||||||
gStatusWindow->UpdateStatus(thread, ref.name, 1);
|
gStatusWindow->UpdateStatus(thread, ref.name, 1);
|
||||||
if (entry->IsDirectory())
|
if (entry->IsDirectory())
|
||||||
return RecursiveMove(entry, destDir);
|
return RecursiveMove(entry, destDir);
|
||||||
|
|||||||
@@ -301,23 +301,6 @@ BStatusWindow::RemoveStatusItem(thread_id thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BStatusWindow::HasStatus(thread_id thread)
|
|
||||||
{
|
|
||||||
AutoLock<BWindow> lock(this);
|
|
||||||
|
|
||||||
int32 numItems = fViewList.CountItems();
|
|
||||||
for (int32 index = 0; index < numItems; index++) {
|
|
||||||
BStatusView* view = fViewList.ItemAt(index);
|
|
||||||
if (view->Thread() == thread)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BStatusWindow::CheckCanceledOrPaused(thread_id thread)
|
BStatusWindow::CheckCanceledOrPaused(thread_id thread)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ public:
|
|||||||
// will only be updated if 0.2 seconds
|
// will only be updated if 0.2 seconds
|
||||||
// elapsed since the last update
|
// elapsed since the last update
|
||||||
void RemoveStatusItem(thread_id);
|
void RemoveStatusItem(thread_id);
|
||||||
bool HasStatus(thread_id);
|
|
||||||
|
|
||||||
bool CheckCanceledOrPaused(thread_id);
|
bool CheckCanceledOrPaused(thread_id);
|
||||||
|
|
||||||
@@ -171,7 +170,7 @@ BStatusView::Thread() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern BStatusWindow *gStatusWindow;
|
extern BStatusWindow* gStatusWindow;
|
||||||
|
|
||||||
|
|
||||||
} // namespace BPrivate
|
} // namespace BPrivate
|
||||||
|
|||||||
Reference in New Issue
Block a user