当前位置: 首页>>代码示例>>C++>>正文


C++ CDownload::GetDisplayName方法代码示例

本文整理汇总了C++中CDownload::GetDisplayName方法的典型用法代码示例。如果您正苦于以下问题:C++ CDownload::GetDisplayName方法的具体用法?C++ CDownload::GetDisplayName怎么用?C++ CDownload::GetDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDownload的用法示例。


在下文中一共展示了CDownload::GetDisplayName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Add

CDownload* CDownloads::Add(CQueryHit* pHit, BOOL bAddToHead)
{
	CSingleLock pLock( &Transfers.m_pSection, TRUE );
	
	CDownload* pDownload = NULL;
	
	if ( pDownload == NULL && pHit->m_bSHA1 )
		pDownload = FindBySHA1( &pHit->m_pSHA1 );
	if ( pDownload == NULL && pHit->m_bTiger )
		pDownload = FindByTiger( &pHit->m_pTiger );
	if ( pDownload == NULL && pHit->m_bED2K )
		pDownload = FindByED2K( &pHit->m_pED2K );
	
	if ( pDownload != NULL )
	{
		theApp.Message( MSG_DOWNLOAD, IDS_DOWNLOAD_ALREADY, (LPCTSTR)pHit->m_sName );
		
		pDownload->AddSourceHit( pHit );
		pDownload->Resume();
	}
	else
	{
		pDownload = new CDownload();
		pDownload->AddSourceHit( pHit, TRUE );

		if ( bAddToHead ) m_pList.AddHead( pDownload );
		else m_pList.AddTail( pDownload );
		
		theApp.Message( MSG_DOWNLOAD, IDS_DOWNLOAD_ADDED,
			(LPCTSTR)pDownload->GetDisplayName(), pDownload->GetSourceCount() );

		if( pDownload->m_bSHA1 ) pDownload->m_bSHA1Trusted = TRUE;
		else if( pDownload->m_bED2K ) pDownload->m_bED2KTrusted = TRUE;
	}

	pHit->m_bDownload = TRUE;
	
	DownloadGroups.Link( pDownload );
	Transfers.StartThread();

	if ( ( (pDownload->GetSourceCount() == 0 ) || ( pDownload->m_bED2K && ! pDownload->m_bSHA1 ) ) 
	 &&( (GetTryingCount() < Settings.Downloads.MaxFiles ) || ( bAddToHead ) ) )
	{
		pDownload->SetStartTimer();
	}
	
	
	return pDownload;
}
开发者ID:ericfillipe1,项目名称:shareaza-code,代码行数:49,代码来源:Downloads.cpp

示例2: PageDownloads


//.........这里部分代码省略.........
				if ( ! pDownload->IsTasking() )
					pDownload->Remove();
				continue;
			}
			else if ( strAction == L"clear" )
			{
				if ( pDownload->IsCompleted() && ! pDownload->IsPreviewVisible() )
				{
					pDownload->Remove();
					continue;
				}
			}
			else if ( strAction == L"more_sources" )
			{
				// roo_koo_too improvement
				pDownload->FindMoreSources();
			}
		}

		if ( CDownloadsCtrl::IsFiltered( pDownload ) ) continue;

		CDownloadGroup* pGroup = NULL;

		for ( POSITION posGroup = DownloadGroups.GetIterator(); posGroup != NULL; )
		{
			pGroup = DownloadGroups.GetNext( posGroup );
			if ( pGroup->m_bRemoteSelected && pGroup->Contains( pDownload ) ) break;
			pGroup = NULL;
		}

		if ( pGroup == NULL ) continue;

		Add( L"download_id", strDownloadID );
		Add( L"download_filename", pDownload->GetDisplayName() );
		Add( L"download_size", ( pDownload->m_nSize == SIZE_UNKNOWN ) ?
			LoadString( IDS_STATUS_UNKNOWN ) : Settings.SmartVolume( pDownload->m_nSize ) );
		int nProgress = int( pDownload->GetProgress() );
		str.Format( L"%i", nProgress );
		Add( L"download_percent", str );
		str.Format( L"%i", 100 - nProgress );
		Add( L"download_percent_inverse", str );
		Add( L"download_speed", Settings.SmartSpeed( pDownload->GetMeasuredSpeed() ) );
		if ( CDownloadsCtrl::IsExpandable( pDownload ) )
		{
			if ( pDownload->m_bExpanded )
				Add( L"download_is_expanded", L"true" );
			else
				Add( L"download_is_collapsed", L"true" );
		}
		if ( pDownload->IsCompleted() )
			Add( L"download_is_complete", L"true" );
		else if ( pDownload->IsPaused() )
			Add( L"download_is_paused", L"true" );

		Add( L"download_status", pDownload->GetDownloadStatus() );
		Add( L"download_sources", pDownload->GetDownloadSources() );
		Output( L"downloadsDownload" );

		if ( pDownload->m_bExpanded && CDownloadsCtrl::IsExpandable( pDownload ) )
		{
			for ( POSITION posSource = pDownload->GetIterator(); posSource; )
			{
				CDownloadSource* pSource = pDownload->GetNext( posSource );

				ASSERT( pSource->m_pDownload == pDownload );
开发者ID:GetEnvy,项目名称:Envy,代码行数:66,代码来源:Remote.cpp

示例3: Update

void CHomeDownloadsBox::Update()
{
	if ( m_pDocument == NULL ) return;

	CSingleLock pLock( &Transfers.m_pSection );
	if ( ! pLock.Lock( 50 ) ) return;

	BOOL bChanged = FALSE;
	CString str;

	for ( INT_PTR nItem = m_pList.GetSize() - 1 ; nItem >= 0 ; nItem-- )
	{
		Item* pItem = m_pList.GetAt( nItem );

		if ( ! Downloads.CheckActive( pItem->m_pDownload, 6 ) )
		{
			delete pItem;
			m_pList.RemoveAt( nItem );
			bChanged = TRUE;
			m_pHover = NULL;
			KillTimer( 2 );
		}
	}

	int nCount = 0;
	int nInsert = 0;

	for ( POSITION pos = Downloads.GetReverseIterator() ; pos && nCount < 6 ; )
	{
		CDownload* pDownload = Downloads.GetPrevious( pos );
		if ( pDownload->IsPaused() ) continue;
		if ( pDownload->IsCompleted() ) continue;

		Item* pItem = NULL;

		for ( int nItem = 0 ; nItem < m_pList.GetSize() ; nItem++ )
		{
			pItem = m_pList.GetAt( nItem );
			if ( pItem->m_pDownload == pDownload ) break;
			pItem = NULL;
		}

		if ( pItem == NULL )
		{
			pItem				= new Item();
			pItem->m_pDownload	= pDownload;
			pItem->m_sText		= pDownload->GetDisplayName();
			pItem->m_nIcon16	= ShellIcons.Get( pItem->m_sText, 16 );
			m_pList.InsertAt( nInsert++, pItem );
			bChanged = TRUE;
			m_pHover = NULL;
			KillTimer( 2 );
		}

		QWORD nComplete	= pDownload->GetVolumeComplete();
		BOOL bPaused	= pDownload->GetFirstTransfer() == NULL;

		if ( pItem->m_nComplete != nComplete ||
			 pItem->m_bPaused != bPaused ||
			 pItem->m_nSize != pDownload->m_nSize )
		{
			pItem->m_nSize		= pDownload->m_nSize;
			pItem->m_nComplete	= nComplete;
			pItem->m_bPaused	= bPaused;
			bChanged = TRUE;
		}

		nCount++;
	}

	nCount = static_cast< int >( m_pList.GetSize() * 18 );
	if ( nCount ) nCount += 6;

	m_pDocument->ShowGroup( 1, m_pList.GetSize() == 0 );

	int nActive = (int)CGraphItem::GetValue( GRC_DOWNLOADS_FILES );

	if ( nActive > 1 )
	{
		if ( m_pdDownloadsMany )
		{
			str.Format( m_sDownloadsMany, nActive );
			m_pdDownloadsMany->SetText( str );
			m_pdDownloadsMany->Show( TRUE );
		}
		if ( m_pdDownloadsOne )  m_pdDownloadsOne->Show( FALSE );
		if ( m_pdDownloadsNone ) m_pdDownloadsNone->Show( FALSE );
	}
	else if ( nActive == 1 )
	{
		if ( m_pdDownloadsMany ) m_pdDownloadsMany->Show( FALSE );
		if ( m_pdDownloadsOne )  m_pdDownloadsOne->Show( TRUE );
		if ( m_pdDownloadsNone ) m_pdDownloadsNone->Show( FALSE );
	}
	else
	{
		if ( m_pdDownloadsMany ) m_pdDownloadsMany->Show( FALSE );
		if ( m_pdDownloadsOne )  m_pdDownloadsOne->Show( FALSE );
		if ( m_pdDownloadsNone ) m_pdDownloadsNone->Show( TRUE );
	}
//.........这里部分代码省略.........
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:101,代码来源:CtrlHomePanel.cpp


注:本文中的CDownload::GetDisplayName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。