void CMyTreeView::DirectoryAlteredRemoveFile(const TCHAR *szFullFileName)
{
	TCHAR szParent[MAX_PATH];
	HTREEITEM hItem;
	HTREEITEM hDeskItem;
	HTREEITEM hDeskParent;

	StringCchCopy(szParent,SIZEOF_ARRAY(szParent),szFullFileName);
	PathRemoveFileSpec(szParent);

	/* If the item is on the desktop, we need to remove the item 
	   from the desktop tree branch as well. */
	hDeskParent = LocateItemOnDesktopTree(szParent);  
	hDeskItem	= LocateItemOnDesktopTree(szFullFileName); 

	if(hDeskItem != NULL)
	{
		RemoveItem(hDeskItem);
	}

	hItem = LocateDeletedItem(szFullFileName);
	if(hItem != NULL)
	{
		RemoveItem(szFullFileName);
	}

	/* The parent item should be updated (if it is in the tree), regardless of whether the
	   actual item was found. For example, the number of children may need to be set to 0
	   to remove the "+" sign from the tree. The update should be done after the removal. */
	UpdateParent(hDeskParent);
	UpdateParent(szParent);

	if(hDeskItem == NULL && hItem == NULL)
	{
		/* The file does not currently exist within the treeview.
		   It should appear in the tracking list however. */
		for(auto itr = m_AlteredTrackingList.begin();itr != m_AlteredTrackingList.end();itr++)
		{
			if(lstrcmp(szFullFileName,itr->szFileName) == 0)
			{
				/* Found the deleted item. Remove it from the tracking list. */
				/* TODO: May need to do this multiple times.
				e.g.
				Created
				Renamed
				Removed

				Both the created and renamed notifications need to
				be removed from the queue. */
				m_AlteredTrackingList.erase(itr);
				break;
			}
		}
	}
}
Exemplo n.º 2
0
// Note: This should just call the parent callback which will free the DNSSECVerifier.
mDNSlocal void VerifyNSECCallback(mDNS *const m, DNSSECVerifier *dv, DNSSECStatus status)
{
    if (!dv->parent)
    {
        LogMsg("VerifyNSECCCallback: ERROR!! no parent DV\n");
        FreeDNSSECVerifier(m, dv);
        return;
    }
    if (dv->ac)
    {
        // Before we free the "dv", we need to update the
        // parent with our AuthChain information
        UpdateParent(dv);
    }
    // "status" indicates whether we are able to successfully verify
    // the NSEC/NSEC3 signatures. For NSEC3, the OptOut flag may be set
    // for which we need to deliver insecure result.
    if ((dv->parent->flags & NSEC3_OPT_OUT) && (status == DNSSEC_Secure))
    {
        dv->parent->DVCallback(m, dv->parent, DNSSEC_Insecure);
    }
    else
    {
        dv->parent->DVCallback(m, dv->parent, status);
    }
    // The callback we called in the previous line should recursively
    // free all the DNSSECVerifiers starting from dv->parent and above.
    // So, set that to NULL and free the "dv" itself here.
    dv->parent = mDNSNULL;
    FreeDNSSECVerifier(m, dv);
}
Exemplo n.º 3
0
void wxInfoBar::ShowMessage(const wxString& msg, int flags)
{
    if ( !UseNative() )
    {
        wxInfoBarGeneric::ShowMessage(msg, flags);
        return;
    }

    // if we don't have any buttons, create a standard close one to give the
    // user at least some way to close the bar
    if ( m_impl->m_buttons.empty() && !m_impl->m_close )
    {
        m_impl->m_close = GTKAddButton(wxID_CLOSE);
    }

    GtkMessageType type;
    if ( wxGTKImpl::ConvertMessageTypeFromWX(flags, &type) )
        gtk_info_bar_set_message_type(GTK_INFO_BAR(m_widget), type);
    gtk_label_set_text(GTK_LABEL(m_impl->m_label), wxGTK_CONV(msg));

    if ( !IsShown() )
        Show();

    UpdateParent();
}
Exemplo n.º 4
0
void CTxMemPool::UpdateChildrenForRemoval(txiter it)
{
    const setEntries &setMemPoolChildren = GetMemPoolChildren(it);
    for (txiter updateIt : setMemPoolChildren) {
        UpdateParent(updateIt, it, false);
    }
}
void CMyTreeView::UpdateParent(const TCHAR *szParent)
{
	HTREEITEM hParent;

	hParent = LocateExistingItem(szParent);

	UpdateParent(hParent);
}
Exemplo n.º 6
0
bool CTxMemPool::addUnchecked(const uint256& hash, const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate)
{
    NotifyEntryAdded(entry.GetSharedTx());
    // Add to memory pool without checking anything.
    // Used by AcceptToMemoryPool(), which DOES do
    // all the appropriate checks.
    LOCK(cs);
    indexed_transaction_set::iterator newit = mapTx.insert(entry).first;
    mapLinks.insert(make_pair(newit, TxLinks()));

    // Update transaction for any feeDelta created by PrioritiseTransaction
    // TODO: refactor so that the fee delta is calculated before inserting
    // into mapTx.
    std::map<uint256, CAmount>::const_iterator pos = mapDeltas.find(hash);
    if (pos != mapDeltas.end()) {
        const CAmount &delta = pos->second;
        if (delta) {
            mapTx.modify(newit, update_fee_delta(delta));
        }
    }

    // Update cachedInnerUsage to include contained transaction's usage.
    // (When we update the entry for in-mempool parents, memory usage will be
    // further updated.)
    cachedInnerUsage += entry.DynamicMemoryUsage();

    const CTransaction& tx = newit->GetTx();
    std::set<uint256> setParentTransactions;
    for (unsigned int i = 0; i < tx.vin.size(); i++) {
        mapNextTx.insert(std::make_pair(&tx.vin[i].prevout, &tx));
        setParentTransactions.insert(tx.vin[i].prevout.hash);
    }
    // Don't bother worrying about child transactions of this one.
    // Normal case of a new transaction arriving is that there can't be any
    // children, because such children would be orphans.
    // An exception to that is if a transaction enters that used to be in a block.
    // In that case, our disconnect block logic will call UpdateTransactionsFromBlock
    // to clean up the mess we're leaving here.

    // Update ancestors with information about this tx
    for (const uint256 &phash : setParentTransactions) {
        txiter pit = mapTx.find(phash);
        if (pit != mapTx.end()) {
            UpdateParent(newit, pit, true);
        }
    }
    UpdateAncestorsOf(true, newit, setAncestors);
    UpdateEntryForAncestors(newit, setAncestors);

    nTransactionsUpdated++;
    totalTxSize += entry.GetTxSize();
    if (minerPolicyEstimator) {minerPolicyEstimator->processTransaction(entry, validFeeEstimate);}

    vTxHashes.emplace_back(tx.GetWitnessHash(), newit);
    newit->vTxHashesIdx = vTxHashes.size() - 1;

    return true;
}
Exemplo n.º 7
0
// on left mouse button up
void CSplitterFrame::OnLButtonUp(UINT nFlags, CPoint point)
{
    if(GetCapture()==this) {
        ReleaseCapture();
        ChangeParent(pDockedParent);
        UpdateParent();
        // SetOrientation(uiOrientation);
    }
    CWnd::OnLButtonUp(nFlags, point);
}
Exemplo n.º 8
0
mDNSexport void NameErrorNSECCallback(mDNS *const m, DNSSECVerifier *dv, DNSSECStatus status)
{
    RRVerifier *rv;
    DNSSECVerifier *pdv;
    CacheRecord *ncr;

    LogDNSSEC("NameErrorNSECCallback: called");
    if (!dv->parent)
    {
        LogMsg("NameErrorNSECCCallback: no parent DV");
        FreeDNSSECVerifier(m, dv);
        return;
    }

    if (dv->ac)
    {
        // Before we free the "dv", we need to update the
        // parent with our AuthChain information
        UpdateParent(dv);
    }

    pdv = dv->parent;
    // We don't care about the "dv" that was allocated in VerifyNSEC
    // as it just verifies one of the nsecs. Get the original verifier and
    // verify the other NSEC like we did the first time.
    dv->parent = mDNSNULL;
    FreeDNSSECVerifier(m, dv);

    if (status != DNSSEC_Secure)
    {
        goto error;
    }

    ncr = NSECParentForQuestion(m, &pdv->q);
    if (!ncr)
    {
        LogMsg("NameErrorNSECCallback: Can't find NSEC Parent for %##s (%s)", pdv->q.qname.c, DNSTypeName(pdv->q.qtype));
        goto error;
    }
    rv = pdv->pendingNSEC;
    pdv->pendingNSEC = rv->next;
    // We might have more than one pendingNSEC in the case of NSEC3. If this is the last one,
    // we don't need to come back here; let the regular NSECCallback call the original callback.
    rv->next = mDNSNULL;
    LogDNSSEC("NameErrorNSECCallback: Verifying %##s (%s)", rv->name.c, DNSTypeName(rv->rrtype));
    if (!pdv->pendingNSEC)
        VerifyNSEC(m, mDNSNULL, rv, pdv, ncr, mDNSNULL);
    else
        VerifyNSEC(m, mDNSNULL, rv, pdv, ncr, NameErrorNSECCallback);

    return;

error:
    pdv->DVCallback(m, pdv, status);
}
Exemplo n.º 9
0
void CScriptParticlesCustom::shedule_Update(u32 _dt)
{
	CParticlesObject::shedule_Update(_dt);
	if (m_animator){
		float dt				= float(_dt)/1000.f; 
		Fvector prev_pos		= m_animator->XFORM().c;
		m_animator->Update		(dt);
		Fvector vel;
		vel.sub					(m_animator->XFORM().c,prev_pos).div(dt);
		UpdateParent			(m_animator->XFORM(),vel);
	}
}
Exemplo n.º 10
0
void wxInfoBar::Dismiss()
{
    if ( !UseNative() )
    {
        wxInfoBarGeneric::Dismiss();
        return;
    }

    Hide();

    UpdateParent();
}
Exemplo n.º 11
0
//-----------------------------------------------------------------------------
// Purpose: Turns this object into a duplicate of the given object.
// Input  : pFrom - The object to replicate.
// Output : Returns a pointer to this object.
//-----------------------------------------------------------------------------
CMapClass *CMapClass::CopyFrom(CMapClass *pFrom, bool bUpdateDependencies)
{
	// Copy CMapPoint stuff. dvs: should be in CMapPoint implementation!
	m_Origin = pFrom->m_Origin;
	    
	//
	// Copy CMapClass stuff.
	//
	int nVisGroupCount = pFrom->GetVisGroupCount();
	for (int nVisGroup = 0; nVisGroup < nVisGroupCount; nVisGroup++)
	{
		CVisGroup *pVisGroup = pFrom->GetVisGroup(nVisGroup);
		if (!pVisGroup->IsAutoVisGroup())
		{
			AddVisGroup(pVisGroup);
		}
	}

	//m_bVisible = pFrom->m_bVisible;
	//m_bVisGroupShown = pFrom->m_bVisGroupShown;
	m_bTemporary = pFrom->m_bTemporary;
	m_bVisible2D = pFrom->m_bVisible2D;
	m_nRenderFrame = pFrom->m_nRenderFrame;
	m_CullBox = pFrom->m_CullBox;
	m_Render2DBox = pFrom->m_Render2DBox;

	r = pFrom->r;
	g = pFrom->g;
	b = pFrom->b;

	m_Dependents.RemoveAll();
	m_Dependents.AddVectorToTail(pFrom->m_Dependents);

	// dvs: should I copy m_pEditorKeys?

	//
	// Don't link to the parent if we're not updating dependencies, just copy the pointer.
	//
	if (bUpdateDependencies)
	{
		UpdateParent( pFrom->GetParent() );
	}
	else
	{
		m_pParent = pFrom->GetParent();
	}

	return(this);
}
Exemplo n.º 12
0
//-----------------------------------------------------------------------------
// Purpose: Turns this object into a duplicate of the given object.
// Input  : pFrom - The object to replicate.
// Output : Returns a pointer to this object.
//-----------------------------------------------------------------------------
CMapClass *CMapClass::CopyFrom(CMapClass *pFrom, bool bUpdateDependencies)
{
	//
	// Copy CMapPoint stuff. dvs: should be in CMapPoint implementation!
	//
	m_Origin = pFrom->m_Origin;

	//
	// Copy CMapAtom stuff. dvs: should be in CMapAtom implementation!
	//
	//m_eSelectionState = pFrom->m_eSelectionState; dvs: don't copy selection state - causes bad behavior when hollowing, for example
	m_pParent = pFrom->m_pParent;

	//
	// Copy CMapClass stuff.
	//
	m_pVisGroup = pFrom->m_pVisGroup;
	m_bShouldSerialize = pFrom->m_bShouldSerialize;
	//m_bVisible = pFrom->m_bVisible;
	m_bTemporary = pFrom->m_bTemporary;
	m_bVisible2D = pFrom->m_bVisible2D;
	m_nRenderFrame = pFrom->m_nRenderFrame;
	m_CullBox = pFrom->m_CullBox;
	m_Render2DBox = pFrom->m_Render2DBox;

	r = pFrom->r;
	g = pFrom->g;
	b = pFrom->b;

	m_Dependents.RemoveAll();
	m_Dependents.AddTail(&pFrom->m_Dependents);

	// dvs: should I copy m_pEditorKeys?

	//
	// Don't link to the parent if we're not updating dependencies, just copy the pointer.
	//
	if (bUpdateDependencies)
	{
		UpdateParent(pFrom->Parent);
	}
	else
	{
		Parent = pFrom->Parent;
	}

	return(this);
}
Exemplo n.º 13
0
// vHashesToUpdate is the set of transaction hashes from a disconnected block
// which has been re-added to the mempool.
// for each entry, look for descendants that are outside vHashesToUpdate, and
// add fee/size information for such descendants to the parent.
// for each such descendant, also update the ancestor state to include the parent.
void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashesToUpdate)
{
    LOCK(cs);
    // For each entry in vHashesToUpdate, store the set of in-mempool, but not
    // in-vHashesToUpdate transactions, so that we don't have to recalculate
    // descendants when we come across a previously seen entry.
    cacheMap mapMemPoolDescendantsToUpdate;

    // Use a set for lookups into vHashesToUpdate (these entries are already
    // accounted for in the state of their ancestors)
    std::set<uint256> setAlreadyIncluded(vHashesToUpdate.begin(), vHashesToUpdate.end());

    // Iterate in reverse, so that whenever we are looking at a transaction
    // we are sure that all in-mempool descendants have already been processed.
    // This maximizes the benefit of the descendant cache and guarantees that
    // setMemPoolChildren will be updated, an assumption made in
    // UpdateForDescendants.
    for (const uint256 &hash : reverse_iterate(vHashesToUpdate)) {
        // we cache the in-mempool children to avoid duplicate updates
        setEntries setChildren;
        // calculate children from mapNextTx
        txiter it = mapTx.find(hash);
        if (it == mapTx.end()) {
            continue;
        }
        auto iter = mapNextTx.lower_bound(COutPoint(hash, 0));
        // First calculate the children, and update setMemPoolChildren to
        // include them, and update their setMemPoolParents to include this tx.
        for (; iter != mapNextTx.end() && iter->first->hash == hash; ++iter) {
            const uint256 &childHash = iter->second->GetHash();
            txiter childIter = mapTx.find(childHash);
            assert(childIter != mapTx.end());
            // We can skip updating entries we've encountered before or that
            // are in the block (which are already accounted for).
            if (setChildren.insert(childIter).second && !setAlreadyIncluded.count(childHash)) {
                UpdateChild(it, childIter, true);
                UpdateParent(childIter, it, true);
            }
        }
        UpdateForDescendants(it, mapMemPoolDescendantsToUpdate, setAlreadyIncluded);
    }
}
Exemplo n.º 14
0
void wxInfoBarGeneric::DoShow()
{
    // re-layout the parent first so that the window expands into an already
    // unoccupied by the other controls area: for this we need to change our
    // internal visibility flag to force Layout() to take us into account (an
    // alternative solution to this hack would be to temporarily set
    // wxRESERVE_SPACE_EVEN_IF_HIDDEN flag but it's not really batter)

    // just change the internal flag indicating that the window is visible,
    // without really showing it
    wxWindowBase::Show();

    // adjust the parent layout to account for us
    UpdateParent();

    // reset the flag back before really showing the window or it wouldn't be
    // shown at all because it would believe itself already visible
    wxWindowBase::Show(false);


    // finally do really show the window.
    ShowWithEffect(GetShowEffect(), GetEffectDuration());
}
Exemplo n.º 15
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : pParent - 
//-----------------------------------------------------------------------------
// dvs: HACK to distinguish from CMapAtom::SetParent. Need to merge the two!
//		So far the only reason this is ever called is to prune an object from
//		the world tree, such as when Copying to the clipboard. Maybe there needs
//		to be a Prune/Graft interface instead?
void CMapClass::SetObjParent(CMapClass *pParent)
{
	UpdateParent(pParent);
}
Exemplo n.º 16
0
void wxInfoBarGeneric::DoHide()
{
    HideWithEffect(GetHideEffect(), GetEffectDuration());

    UpdateParent();
}
Exemplo n.º 17
0
void VTimeOfDayComponent::OnHandleCallback(IVisCallbackDataObject_cl *pData)
{
  if (GetOwner()!=NULL)
    UpdateParent();
}