本文整理汇总了C++中CCachedDirectory::Invalidate方法的典型用法代码示例。如果您正苦于以下问题:C++ CCachedDirectory::Invalidate方法的具体用法?C++ CCachedDirectory::Invalidate怎么用?C++ CCachedDirectory::Invalidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCachedDirectory
的用法示例。
在下文中一共展示了CCachedDirectory::Invalidate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WorkerThread
//.........这里部分代码省略.........
continue;*/
// Here's a little problem:
// the lock file is also created for fetching the status
// and not just when committing.
// If we could find out why the lock file was changed
// we could decide to crawl the folder again or not.
// But for now, we have to crawl the parent folder
// no matter what.
//if (lowerpath.Find(_T("\\lock"))>0)
// continue;
}
else if (!workingPath.Exists())
{
CGitStatusCache::Instance().WaitToWrite();
CGitStatusCache::Instance().RemoveCacheForPath(workingPath);
CGitStatusCache::Instance().Done();
continue;
}
do
{
workingPath = workingPath.GetContainingDirectory();
} while(workingPath.IsAdminDir());
ATLTRACE(_T("Invalidating and refreshing folder: %s\n"), workingPath.GetWinPath());
{
AutoLocker print(critSec);
_stprintf_s(szCurrentCrawledPath[nCurrentCrawledpathIndex], MAX_CRAWLEDPATHSLEN, _T("Invalidating and refreshing folder: %s"), workingPath.GetWinPath());
nCurrentCrawledpathIndex++;
if (nCurrentCrawledpathIndex >= MAX_CRAWLEDPATHS)
nCurrentCrawledpathIndex = 0;
}
InvalidateRect(hWnd, NULL, FALSE);
CGitStatusCache::Instance().WaitToRead();
// Invalidate the cache of this folder, to make sure its status is fetched again.
CCachedDirectory * pCachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(workingPath);
if (pCachedDir)
{
git_wc_status_kind status = pCachedDir->GetCurrentFullStatus();
pCachedDir->Invalidate();
if (workingPath.Exists())
{
pCachedDir->RefreshStatus(bRecursive);
// if the previous status wasn't normal and now it is, then
// send a notification too.
// We do this here because GetCurrentFullStatus() doesn't send
// notifications for 'normal' status - if it would, we'd get tons
// of notifications when crawling a working copy not yet in the cache.
if ((status != git_wc_status_normal)&&(pCachedDir->GetCurrentFullStatus() != status))
{
CGitStatusCache::Instance().UpdateShell(workingPath);
ATLTRACE(_T("shell update in crawler for %s\n"), workingPath.GetWinPath());
}
}
else
{
CGitStatusCache::Instance().Done();
CGitStatusCache::Instance().WaitToWrite();
CGitStatusCache::Instance().RemoveCacheForPath(workingPath);
}
}
CGitStatusCache::Instance().Done();
//In case that svn_client_stat() modified a file and we got
//a notification about that in the directory watcher,
//remove that here again - this is to prevent an endless loop
示例2: WorkerThread
//.........这里部分代码省略.........
do
{
workingPath = workingPath.GetContainingDirectory();
} while(workingPath.IsAdminDir());
}
else if (!workingPath.Exists())
{
CAutoWriteLock writeLock(CGitStatusCache::Instance().GetGuard());
CGitStatusCache::Instance().RemoveCacheForPath(workingPath);
continue;
}
if (!CGitStatusCache::Instance().IsPathGood(workingPath))
{
AutoLocker lock(m_critSec);
// move the path, the root of the repository, to the end of the list
if (projectroot.IsEmpty())
m_pathsToUpdate.Push(workingPath);
else
m_pathsToUpdate.Push(CTGitPath(projectroot));
if (m_pathsToUpdate.size() < 3)
Sleep(50);
continue;
}
CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": Invalidating and refreshing folder: %s\n", workingPath.GetWinPath());
{
AutoLocker print(critSec);
_sntprintf_s(szCurrentCrawledPath[nCurrentCrawledpathIndex], MAX_CRAWLEDPATHSLEN, _TRUNCATE, L"Invalidating and refreshing folder: %s", workingPath.GetWinPath());
++nCurrentCrawledpathIndex;
if (nCurrentCrawledpathIndex >= MAX_CRAWLEDPATHS)
nCurrentCrawledpathIndex = 0;
}
InvalidateRect(hWndHidden, nullptr, FALSE);
{
CAutoReadLock readLock(CGitStatusCache::Instance().GetGuard());
// Invalidate the cache of this folder, to make sure its status is fetched again.
CCachedDirectory * pCachedDir = CGitStatusCache::Instance().GetDirectoryCacheEntry(workingPath);
if (pCachedDir)
{
git_wc_status_kind status = pCachedDir->GetCurrentFullStatus();
pCachedDir->Invalidate();
if (workingPath.Exists())
{
pCachedDir->RefreshStatus(bRecursive);
// if the previous status wasn't normal and now it is, then
// send a notification too.
// We do this here because GetCurrentFullStatus() doesn't send
// notifications for 'normal' status - if it would, we'd get tons
// of notifications when crawling a working copy not yet in the cache.
if ((status != git_wc_status_normal) && (pCachedDir->GetCurrentFullStatus() != status))
{
CGitStatusCache::Instance().UpdateShell(workingPath);
CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": shell update in crawler for %s\n", workingPath.GetWinPath());
}
}
else
{
CAutoWriteLock writeLock(CGitStatusCache::Instance().GetGuard());
CGitStatusCache::Instance().RemoveCacheForPath(workingPath);
}
}
}
//In case that svn_client_stat() modified a file and we got
//a notification about that in the directory watcher,
//remove that here again - this is to prevent an endless loop