void checkNewsSources( void ) { int i; extern feedEntryType feed; /* For each of the active groups within the feed, call checkGroup to see * if any new messages are available that meet the user's search criteria. */ for (i = 0 ; i < MAX_GROUPS ; i++) { if ( feed.groups[i].active ) { checkGroup( i ); } } return; }
TaskGroup* AbstractGroupingStrategy::createGroup(ItemList items) { GroupPtr oldGroup; if (!items.isEmpty() && items.first()->isGrouped()) { oldGroup = items.first()->parentGroup(); } else { oldGroup = rootGroup(); } TaskGroup *newGroup = new TaskGroup(d->groupManager); ItemList oldGroupMembers = oldGroup->members(); int index = oldGroupMembers.count(); d->createdGroups.append(newGroup); //kDebug() << "added group" << d->createdGroups.count(); // NOTE: Queued is vital to make sure groups only get removed after their children, for // correct QAbstractItemModel (TasksModel) transaction semantics. connect(newGroup, SIGNAL(itemRemoved(AbstractGroupableItem*)), this, SLOT(checkGroup()), Qt::QueuedConnection); foreach (AbstractGroupableItem * item, items) { int idx = oldGroupMembers.indexOf(item); if (idx >= 0 && idx < index) { index = idx; } newGroup->add(item); }