本文整理汇总了C++中CDownload::ClearSources方法的典型用法代码示例。如果您正苦于以下问题:C++ CDownload::ClearSources方法的具体用法?C++ CDownload::ClearSources怎么用?C++ CDownload::ClearSources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDownload
的用法示例。
在下文中一共展示了CDownload::ClearSources方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
void CDownloads::Load()
{
CSingleLock pLock( &Transfers.m_pSection, TRUE );
WIN32_FIND_DATA pFind;
CString strPath;
HANDLE hSearch;
PurgeDeletes();
PurgePreviews();
DownloadGroups.CreateDefault();
LoadFromCompoundFiles();
strPath = Settings.Downloads.IncompletePath + _T("\\*.sd");
hSearch = FindFirstFile( strPath, &pFind );
if ( hSearch != INVALID_HANDLE_VALUE )
{
do
{
CDownload* pDownload = new CDownload();
strPath.Format( _T("%s\\%s"), (LPCTSTR)Settings.Downloads.IncompletePath, pFind.cFileName );
if ( pDownload->Load( strPath ) )
{
m_pList.AddTail( pDownload );
}
else
{
theApp.Message( MSG_ERROR, _T("Error loading %s"), strPath );
pDownload->ClearSources();
delete pDownload;
}
}
while ( FindNextFile( hSearch, &pFind ) );
FindClose( hSearch );
}
Save( FALSE );
DownloadGroups.Load();
Transfers.StartThread();
}
示例2: OnApply
//.........这里部分代码省略.........
if ( pDownload->m_oSHA1.isValid() != oSHA1.isValid()
|| validAndUnequal( pDownload->m_oSHA1, oSHA1 ) )
{
pLock.Unlock();
strMessage.Format( LoadString( IDS_DOWNLOAD_EDIT_CHANGE_HASH ), _T("SHA1"), _T("SHA1") );
if ( MsgBox( strMessage, MB_ICONQUESTION|MB_YESNO ) != IDYES ) return FALSE;
pLock.Lock();
pDownload = pSheet->GetDownload();
if ( ! pDownload ) return CPropertyPageAdv::OnApply();
pDownload->m_oSHA1 = oSHA1;
if ( oSHA1 ) pDownload->m_bSHA1Trusted = true;
pDownload->CloseTransfers();
pDownload->ClearVerification();
bCriticalChange = true;
}
if ( pDownload->m_oTiger.isValid() != oTiger.isValid()
|| validAndUnequal( pDownload->m_oTiger, oTiger ) )
{
pLock.Unlock();
strMessage.Format( LoadString( IDS_DOWNLOAD_EDIT_CHANGE_HASH ), _T("Tiger-Root"), _T("Tiger-Root") );
if ( MsgBox( strMessage, MB_ICONQUESTION|MB_YESNO ) != IDYES ) return FALSE;
pLock.Lock();
pDownload = pSheet->GetDownload();
if ( ! pDownload ) return CPropertyPageAdv::OnApply();
pDownload->m_oTiger = oTiger;
if ( oTiger ) pDownload->m_bTigerTrusted = true;
pDownload->CloseTransfers();
pDownload->ClearVerification();
bCriticalChange = true;
}
if ( pDownload->m_oED2K.isValid() != oED2K.isValid()
|| validAndUnequal( pDownload->m_oED2K, oED2K ) )
{
pLock.Unlock();
strMessage.Format( LoadString( IDS_DOWNLOAD_EDIT_CHANGE_HASH ), _T("ED2K"), _T("ED2K") );
if ( MsgBox( strMessage, MB_ICONQUESTION|MB_YESNO ) != IDYES ) return FALSE;
pLock.Lock();
pDownload = pSheet->GetDownload();
if ( ! pDownload ) return CPropertyPageAdv::OnApply();
pDownload->m_oED2K = oED2K;
if ( oED2K ) pDownload->m_bED2KTrusted = true;
pDownload->CloseTransfers();
pDownload->ClearVerification();
bCriticalChange = true;
}
if ( pDownload->m_oMD5.isValid() != oMD5.isValid()
|| validAndUnequal( pDownload->m_oMD5, oMD5 ) )
{
pLock.Unlock();
strMessage.Format( LoadString( IDS_DOWNLOAD_EDIT_CHANGE_HASH ), _T("MD5"), _T("MD5") );
if ( MsgBox( strMessage, MB_ICONQUESTION|MB_YESNO ) != IDYES ) return FALSE;
pLock.Lock();
pDownload = pSheet->GetDownload();
if ( ! pDownload ) return CPropertyPageAdv::OnApply();
pDownload->m_oMD5 = oMD5;
if ( oMD5 ) pDownload->m_bMD5Trusted = true;
pDownload->CloseTransfers();
pDownload->ClearVerification();
bCriticalChange = true;
}
if ( pDownload->m_oBTH.isValid() != oBTH.isValid()
|| validAndUnequal( pDownload->m_oBTH, oBTH ) )
{
pLock.Unlock();
strMessage.Format( LoadString( IDS_DOWNLOAD_EDIT_CHANGE_HASH ), _T("BitTorrent"), _T("BitTorrent") );
if ( MsgBox( strMessage, MB_ICONQUESTION|MB_YESNO ) != IDYES ) return FALSE;
pLock.Lock();
pDownload = pSheet->GetDownload();
if ( ! pDownload ) return CPropertyPageAdv::OnApply();
pDownload->m_oBTH = oBTH;
if ( oBTH ) pDownload->m_bBTHTrusted = true;
pDownload->CloseTransfers();
pDownload->ClearVerification();
bCriticalChange = true;
}
pDownload->m_bSHA1Trusted = m_bSHA1Trusted != FALSE;
pDownload->m_bTigerTrusted = m_bTigerTrusted != FALSE;
pDownload->m_bED2KTrusted = m_bED2KTrusted != FALSE;
pDownload->m_bMD5Trusted = m_bMD5Trusted != FALSE;
pDownload->m_bBTHTrusted = m_bBTHTrusted != FALSE;
if ( bCriticalChange )
{
pDownload->CloseTransfers();
pDownload->ClearSources();
pDownload->ClearFailedSources();
pDownload->ClearVerification();
bNeedUpdate = true;
}
if ( bNeedUpdate )
pDownload->SetModified();
return CPropertyPageAdv::OnApply();
}