r=bienvenu. Fix for bug 31363 and other progess problems. Deleting from a local folder

doesn't cause meteors to go on forever.
This commit is contained in:
putterman%netscape.com 2000-03-14 05:27:34 +00:00
Родитель d1f750751c
Коммит c0e03d0ee0
1 изменённых файлов: 43 добавлений и 14 удалений

Просмотреть файл

@ -265,9 +265,22 @@ nsMsgStatusFeedback::StartMeteors()
if (mQueuedMeteorStarts>0) { if (mQueuedMeteorStarts>0) {
mQueuedMeteorStarts--; mQueuedMeteorStarts--;
NS_ASSERTION(mQueuedMeteorStarts == 0, "destroying unfired/uncanceled start timer"); NS_ASSERTION(mQueuedMeteorStarts == 0, "destroying unfired/uncanceled start timer");
if(mStartTimer)
mStartTimer->Cancel();
} }
// if mStartTimer already exists, then this will cancel the old timer. //If there is an outstanding stop timer still then we might as well cancel it since we are
//just going to start it. This will prevent there being a start and stop timer outstanding in
//which case the start could go before the stop and cause the meteors to never start.
if(mQueuedMeteorStops > 0) {
mQueuedMeteorStops--;
if(mStopTimer)
mStopTimer->Cancel();
}
//only run the start timer if the meteors aren't spinning.
if(!m_meteorsSpinning)
{
rv = NS_NewTimer(getter_AddRefs(mStartTimer)); rv = NS_NewTimer(getter_AddRefs(mStartTimer));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
@ -276,6 +289,7 @@ nsMsgStatusFeedback::StartMeteors()
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
mQueuedMeteorStarts++; mQueuedMeteorStarts++;
}
return NS_OK; return NS_OK;
} }
@ -289,9 +303,23 @@ nsMsgStatusFeedback::StopMeteors()
if (mQueuedMeteorStops>0) { if (mQueuedMeteorStops>0) {
mQueuedMeteorStops--; mQueuedMeteorStops--;
NS_ASSERTION(mQueuedMeteorStops == 0, "destroying unfired/uncanceled stop"); NS_ASSERTION(mQueuedMeteorStops == 0, "destroying unfired/uncanceled stop");
if(mStopTimer)
mStopTimer->Cancel();
} }
// if mStopTimer already exists, then this will cancel the old timer. //If there is an outstanding start timer still then we might as well cancel it since we are
//just going to stop it. This will prevent there being a start and stop timer outstanding in
//which case the stop could go before the start and cause the meteors to never stop.
if(mQueuedMeteorStarts > 0) {
mQueuedMeteorStarts--;
if(mStartTimer)
mStartTimer->Cancel();
}
//only run the stop timer if the meteors are actually spinning.
if(m_meteorsSpinning)
{
rv = NS_NewTimer(getter_AddRefs(mStopTimer)); rv = NS_NewTimer(getter_AddRefs(mStopTimer));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
@ -300,6 +328,7 @@ nsMsgStatusFeedback::StopMeteors()
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
mQueuedMeteorStops++; mQueuedMeteorStops++;
}
return NS_OK; return NS_OK;
} }