core/queue: Resort the queue when unsetting Q_ADD_FRONT

This flag is used for bulk inserts to cut down on the number of gui
operations during startup.  Let's just make it standard that unsetting
the flag causes the queue to resort itself.

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2016-04-28 07:29:19 -04:00 committed by Anna Schumaker
parent 9a98a009e9
commit c845530812
1 changed files with 4 additions and 0 deletions

View File

@ -182,7 +182,11 @@ void queue_set_flag(struct queue *queue, enum queue_flags flag)
void queue_unset_flag(struct queue *queue, enum queue_flags flag)
{
if (!queue_has_flag(queue, flag))
return;
queue->q_flags &= ~flag;
if (flag == Q_ADD_FRONT)
queue_resort(queue);
__queue_save(queue, Q_SAVE_FLAGS);
}