Exemplo n.º 1
0
ALERROR CMultiverseModel::SetCollection (const TArray<CMultiverseCatalogEntry *> &NewCollection)

//	SetCollection
//
//	Sets the collection from a list of entries.
//	NOTE: We take ownership of the catalog entries.

	{
	CSmartLock Lock(m_cs);
	int i;

	//	Replace our collection.

	DeleteCollection();
	for (i = 0; i < NewCollection.GetCount(); i++)
		{
		m_Collection.Insert(NewCollection[i]);

		//	Get the resources in this entry and add them to our list

		AddResources(*NewCollection[i]);
		}

	//	Done

	m_fCollectionLoaded = true;
	m_fLoadingCollection = false;

	return NOERROR;
	}
Exemplo n.º 2
0
void CMultiverseModel::OnUserSignedIn (const CString &sUsername)

//	OnUserSignedIn
//
//	The given user has signed in. The given username is the human-readable
//	username (not the username key).

	{
	CSmartLock Lock(m_cs);

	ASSERT(!sUsername.IsBlank());

	if (!strEquals(sUsername, m_sUsername) || !m_fUserSignedIn)
		{
		m_sUsername = sUsername;

		//	Clear out the collection so that we are forced to reload it.

		DeleteCollection();

		//	We're signed in

		m_fUserSignedIn = true;
		}
	}
Exemplo n.º 3
0
void CMultiverseModel::SetDisabled (void)

//	SetDisabled
//
//	Disables access to the Multiverse. This happens if we don't have the proper
//	cloud service (or if the user has disabled cloud connections).

	{
	CSmartLock Lock(m_cs);

	m_fDisabled = true;
	m_sUsername = NULL_STR;
	m_fUserSignedIn = false;
	DeleteCollection();
	}
Exemplo n.º 4
0
void CMultiverseModel::SetUsername (const CString &sUsername)

//	SetUsername
//
//	Sets a cached username.

	{
	CSmartLock Lock(m_cs);

	//	Not valid if we're already signed in (use OnUserSignedIn instead)

	if (m_fUserSignedIn)
		return;

	if (!strEquals(m_sUsername, sUsername))
		{
		m_sUsername = sUsername;

		//	Clear out the collection since we've got a different user.

		DeleteCollection();
		}
	}
Exemplo n.º 5
0
BlockCollection::~BlockCollection()
{
   m_logger.logTrace( "BlockCollection::~BlockCollection()" );
	// remove all blocks from the list (the collection)
	DeleteCollection();
}
Exemplo n.º 6
0
ClassAdCollection::~ClassAdCollection() {
  DeleteCollection(0);
}