Properly pass comparator to priority queue

There was a bug before where our Nonblocking.Mailbox's priority queue
wasn't actually being created correctly.  This fixes that.  Sounds like
this might affect lots of things, especially the order in which the
background fetcher syncs folders.
This commit is contained in:
Charles Lindsay 2013-06-05 17:40:58 -07:00
parent b3a672f6cf
commit 2005e4553c

View file

@ -12,12 +12,12 @@ public class Geary.Nonblocking.Mailbox<G> : BaseObject {
private Gee.Queue<G> queue;
private Nonblocking.Spinlock spinlock = new Nonblocking.Spinlock();
public Mailbox(CompareFunc<G>? comparator = null) {
public Mailbox(owned CompareDataFunc<G>? comparator = null) {
// can't use ternary here, Vala bug
if (comparator == null)
queue = new Gee.LinkedList<G>();
else
queue = new Gee.PriorityQueue<G>();
queue = new Gee.PriorityQueue<G>((owned) comparator);
}
public bool send(G msg) {