示例#1
0
	DNode* DNode::removeChild( DNode* n )
	{
		if (n != NULL)
		{
			ChildSet::iterator	i = mChildren.find(n);
			if (i != mChildren.end())
			{
				cancelUpdate(n);
				mChildren.erase(i);
				n->setParent(NULL);
			}
		}
		return n;
	}
示例#2
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(Node* child)
    {
        if (child)
        {
            ChildNodeMap::iterator i = mChildren.find(child->getName());
            // ensure it's our child
            if (i != mChildren.end() && i->second == child)
            {
                // cancel any pending update
                cancelUpdate(child);

                mChildren.erase(i);
                child->setParent(NULL);
            }
        }
        return child;
    }
示例#3
0
	DNode* DNode::removeChild( uint32 index )
	{
		DNode* ret;
		assert(index < getChildCount());
		ChildSet::iterator	i = mChildren.begin();
		for (uint32 j = 0; j < index; ++j)
		{
			i++;
		}
		if (i != mChildren.end())
		{
			ret = *i;
			cancelUpdate(ret);
			(ret)->mParent = NULL;
			signalDetached(this, ret);
			mChildren.erase(i);
			return ret;
		}
		return NULL;
	}
示例#4
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(const String& name)
    {
        ChildNodeMap::iterator i = mChildren.find(name);

        if (i == mChildren.end())
        {
            OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Child node named " + name +
                " does not exist.", "Node::removeChild");
        }

        Node* ret = i->second;
        // Cancel any pending update
        cancelUpdate(ret);

        mChildren.erase(i);
        ret->setParent(NULL);

        return ret;


    }
示例#5
0
	DNode* DNode::removeChild( const DString& name )
	{
		DNode* ret;
		ChildSet::iterator	i, iend = mChildren.end();
		for (i = mChildren.begin();i != iend; ++i)
		{
			if ((*i)->mName == name)
			{
				break;
			}
		}
		if (i != mChildren.end())
		{
			ret = *i;
			cancelUpdate(ret);
			(ret)->mParent = NULL;
			signalDetached(this, ret);
			mChildren.erase(i);
			return ret;
		}
		return NULL;
	}
示例#6
0
    //-----------------------------------------------------------------------
    Node* Node::removeChild(unsigned short index)
    {
        Node* ret;
        if (index < mChildren.size())
        {
            ChildNodeMap::iterator i = mChildren.begin();
            while (index--) ++i;
            ret = i->second;
            // cancel any pending update
            cancelUpdate(ret);

            mChildren.erase(i);
            ret->setParent(NULL);
            return ret;
        }
        else
        {
            OGRE_EXCEPT(
                Exception::ERR_INVALIDPARAMS,
                "Child index out of bounds.",
                "Node::getChild" );
        }
        return 0;
    }
示例#7
0
void QDeclarativeLandmarkCategoryModel::startUpdate()
{
#ifdef QDECLARATIVE_LANDMARK_DEBUG
    qDebug("QDeclarativeLandmarkCategoryModel::startUpdate()");
#endif
    if (!m_manager) {
        m_updatePending = false;
        return;
    }
    // Clear any previous updates and request new
    cancelUpdate();
    if (m_landmark) {
        QLandmarkCategoryFetchByIdRequest* req = new QLandmarkCategoryFetchByIdRequest(m_manager, this);
        req->setCategoryIds(m_landmark->categoryIds());
        m_fetchRequest = req;
    } else {
        m_fetchRequest = new QLandmarkCategoryFetchRequest(m_manager, this);
        setFetchRange();
        setFetchOrder();
    }
    QObject::connect(m_fetchRequest, SIGNAL(stateChanged(QLandmarkAbstractRequest::State)), this, SLOT(fetchRequestStateChanged(QLandmarkAbstractRequest::State)));
    m_fetchRequest->start();
    m_updatePending = false; // Allow requesting updates again
}
示例#8
0
void
UpdateProgressDialog::onCancel()
{
  emit cancelUpdate();
  hide();
}