Beispiel #1
0
bool FCollectionManager::RenameCollection (FName CurrentCollectionName, ECollectionShareType::Type CurrentShareType, FName NewCollectionName, ECollectionShareType::Type NewShareType)
{
	if ( !ensure(CurrentShareType < ECollectionShareType::CST_All) || !ensure(NewShareType < ECollectionShareType::CST_All) )
	{
		// Bad share type
		LastError = LOCTEXT("Error_Internal", "There was an internal error.");
		return false;
	}

	// Get the object paths for the assets in the collection
	TArray<FName> ObjectPaths;
	if ( !GetAssetsInCollection(CurrentCollectionName, CurrentShareType, ObjectPaths) )
	{
		// Failed to get assets in the current collection
		return false;
	}

	// Create a new collection
	if ( !CreateCollection(NewCollectionName, NewShareType) )
	{
		// Failed to create collection
		return false;
	}

	if ( ObjectPaths.Num() > 0 )
	{
		// Add all the objects from the old collection to the new collection
		if ( !AddToCollection(NewCollectionName, NewShareType, ObjectPaths) )
		{
			// Failed to add paths to the new collection. Destroy the collection we created.
			DestroyCollection(NewCollectionName, NewShareType);
			return false;
		}
	}

	// Delete the old collection
	if ( !DestroyCollection(CurrentCollectionName, CurrentShareType) )
	{
		// Failed to destroy the old collection. Destroy the collection we created.
		DestroyCollection(NewCollectionName, NewShareType);
		return false;
	}

	// Success
	FCollectionNameType OriginalCollectionNameType( CurrentCollectionName, CurrentShareType );
	FCollectionNameType NewCollectionNameType( NewCollectionName, NewShareType );
	CollectionRenamedEvent.Broadcast( OriginalCollectionNameType, NewCollectionNameType );
	return true;
}
Beispiel #2
0
// default constructor
BlockCollection::BlockCollection(const Logger& logger) :
   m_logger(logger)
{
   m_logger.logTrace( "BlockCollection::BlockCollection()" );
	CreateCollection();
}
	void SelectAlbumDialog::on_AddButton__released ()
	{
		auto isu = qobject_cast<ISupportUploads*> (Acc_->GetQObject ());
		isu->CreateCollection (Ui_.View_->currentIndex ());
	}