if (position != newPosition) updatePosition(guide, newPosition);
// If guide is standard and reading lists changed
if (guide instanceof StandardGuide)
{
StandardGuide sguide = (StandardGuide)guide;
ReadingList[] aReadingLists = sguide.getReadingLists();
List<ReadingList> oldLists = Arrays.asList(aReadingLists);
List<ReadingList> newLists = Arrays.asList(dialog.getReadingLists());
boolean addedReadingList = false;
// Add missing
for (ReadingList list : newLists)
{
if (!oldLists.contains(list))
{
sguide.add(list);
addedReadingList = true;
}
}
// Remove deleted
for (ReadingList list : oldLists)
{
if (!newLists.contains(list)) sguide.remove(list, true);
}
if (addedReadingList) GlobalController.SINGLETON.getPoller().update(sguide);
}
}