Beispiel #1
0
ICCItem *ICCItem::Stream (CCodeChain *pCC, IWriteStream *pStream)

//	Stream
//
//	Stream the item

	{
	ALERROR error;
	DWORD dwFlags = 0;

	//	Convert the flags into a single DWORD
	//	We do not save PartOfList because streamed elements are
	//	never part of a list until they are loaded back

	if (m_bQuoted)
		dwFlags |= ITEM_FLAG_QUOTED;
	if (m_bError)
		dwFlags |= ITEM_FLAG_ERROR;
	if (m_bNoRefCount)
		dwFlags |= ITEM_FLAG_NO_REF_COUNT;

	//	Save the flags

	if (error = pStream->Write((char *)&dwFlags, sizeof(dwFlags), NULL))
		return pCC->CreateSystemError(error);

	//	Save the sub-class specific stuff

	return StreamItem(pCC, pStream);
	}
Beispiel #2
0
void StreamSearchPage::addToFavourites()
{
    QModelIndexList selected = view->selectedIndexes();

    QList<const StreamsModel::Item *> items;

    for (const QModelIndex &i: selected) {
        QModelIndex mapped=proxy.mapToSource(i);
        const StreamsModel::Item *item=static_cast<const StreamsModel::Item *>(mapped.internalPointer());
        if (!item->isCategory() && item->parent && !item->parent->isFavourites()) {
            items.append(item);
        }
    }
    QList<StreamItem> itemsToAdd;
    for (const StreamsModel::Item *item: items) {
        itemsToAdd.append(StreamItem(item->url, item->modifiedName()));
    }
    emit addToFavourites(itemsToAdd);
}