X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=blobdiff_plain;f=src%2FTortoiseShell%2FIconOverlay.cpp;h=c8b5a338d9cad6ee7c31e936b7a537c0220e63a0;hp=28a59a041bd2e3a9efc65628f52527e92579bfe9;hb=d5dc266514112a9fca0cf733bde2ae03bbc410df;hpb=0720fd3abc8e2ed4e95d1265d9e70c1b6a476de4 diff --git a/src/TortoiseShell/IconOverlay.cpp b/src/TortoiseShell/IconOverlay.cpp index 28a59a0..c8b5a33 100644 --- a/src/TortoiseShell/IconOverlay.cpp +++ b/src/TortoiseShell/IconOverlay.cpp @@ -22,7 +22,7 @@ #include "PreserveChdir.h" #include "UnicodeUtils.h" #include "GitStatus.h" -//#include "..\TSVNCache\CacheInterface.h" +#include "..\TGitCache\CacheInterface.h" // "The Shell calls IShellIconOverlayIdentifier::GetOverlayInfo to request the // location of the handler's icon overlay. The icon overlay handler returns @@ -137,18 +137,16 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) { case ShellCache::exe: { -#if 0 TSVNCacheResponse itemStatus; SecureZeroMemory(&itemStatus, sizeof(itemStatus)); if (m_remoteCacheLink.GetStatusFromRemoteCache(CTGitPath(pPath), &itemStatus, true)) { status = GitStatus::GetMoreImportant(itemStatus.m_status.text_status, itemStatus.m_status.prop_status); - if ((itemStatus.m_kind == git_node_file)&&(status == git_wc_status_normal)&&((itemStatus.m_needslock && itemStatus.m_owner[0]==0)||(itemStatus.m_readonly))) +/* if ((itemStatus.m_kind == git_node_file)&&(status == git_wc_status_normal)&&((itemStatus.m_needslock && itemStatus.m_owner[0]==0)||(itemStatus.m_readonly))) readonlyoverlay = true; if (itemStatus.m_owner[0]!=0) - lockedoverlay = true; + lockedoverlay = true;*/ } -#endif } break; case ShellCache::dll: @@ -207,6 +205,10 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) lockedoverlay = true; } + // index based version does not enumerate unversioned files, so default to unversioned + if (g_ShellCache.GetCacheType() == ShellCache::dll + && status == git_wc_status_none && g_ShellCache.HasSVNAdminDir(pPath, true)) + status = git_wc_status_unversioned; break; default: case ShellCache::none: @@ -244,11 +246,6 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) //if other handlers would return S_OK too (they're never called on my machine!) //So we return S_OK for ONLY ONE handler! - // TODO: not sure this should be here. if anywhere it should be in case 'dll' above - // because if overlay type 'none' is selected we don't want this to change status to unversioned (which may have overlay) - if(g_ShellCache.HasSVNAdminDir(pPath, true) && status == git_wc_status_none) - status = git_wc_status_unversioned; - switch (status) { // note: we can show other overlays if due to lack of enough free overlay @@ -326,7 +323,6 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) } case git_wc_status_replaced: case git_wc_status_modified: - case git_wc_status_merged: if (m_State == FileStateModified) { g_filepath.clear(); @@ -334,6 +330,14 @@ STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /*dwAttrib*/) } else return S_FALSE; + case git_wc_status_merged: + if (m_State == FileStateReadOnly) + { + g_filepath.clear(); + return S_OK; + } + else + return S_FALSE; case git_wc_status_added: if (g_addedovlloaded) {