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,17 +265,31 @@ 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
rv = NS_NewTimer(getter_AddRefs(mStartTimer)); //just going to start it. This will prevent there being a start and stop timer outstanding in
if (NS_FAILED(rv)) return rv; //which case the start could go before the stop and cause the meteors to never start.
if(mQueuedMeteorStops > 0) {
mQueuedMeteorStops--;
if(mStopTimer)
mStopTimer->Cancel();
}
rv = mStartTimer->Init(notifyStartMeteors, (void *)this, //only run the start timer if the meteors aren't spinning.
MSGFEEDBACK_TIMER_INTERVAL); if(!m_meteorsSpinning)
if (NS_FAILED(rv)) return rv; {
rv = NS_NewTimer(getter_AddRefs(mStartTimer));
if (NS_FAILED(rv)) return rv;
mQueuedMeteorStarts++; rv = mStartTimer->Init(notifyStartMeteors, (void *)this,
MSGFEEDBACK_TIMER_INTERVAL);
if (NS_FAILED(rv)) return rv;
mQueuedMeteorStarts++;
}
return NS_OK; return NS_OK;
} }
@ -289,17 +303,32 @@ 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
rv = NS_NewTimer(getter_AddRefs(mStopTimer)); //just going to stop it. This will prevent there being a start and stop timer outstanding in
if (NS_FAILED(rv)) return rv; //which case the stop could go before the start and cause the meteors to never stop.
if(mQueuedMeteorStarts > 0) {
mQueuedMeteorStarts--;
if(mStartTimer)
mStartTimer->Cancel();
}
rv = mStopTimer->Init(notifyStopMeteors, (void *)this,
MSGFEEDBACK_TIMER_INTERVAL);
if (NS_FAILED(rv)) return rv;
mQueuedMeteorStops++; //only run the stop timer if the meteors are actually spinning.
if(m_meteorsSpinning)
{
rv = NS_NewTimer(getter_AddRefs(mStopTimer));
if (NS_FAILED(rv)) return rv;
rv = mStopTimer->Init(notifyStopMeteors, (void *)this,
MSGFEEDBACK_TIMER_INTERVAL);
if (NS_FAILED(rv)) return rv;
mQueuedMeteorStops++;
}
return NS_OK; return NS_OK;
} }