Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext/IconOverlay.cpp: remove commented out code in CShellExt::GetOverlayInfo

Changeset d293d7db789e

Parent b4e54d5d46a7

by Adrian Buehlmann

Changes to one file · Browse files at d293d7db789e Showing diff from parent b4e54d5d46a7 Diff from another changeset...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 #include "stdafx.h"  #include "ShellExt.h"  #include "TortoiseUtils.h"  #include "StringUtils.h"  #include "PipeUtils.h"  #include "QueryDirstate.h"    #include <shlwapi.h>      STDMETHODIMP CShellExt::GetOverlayInfo(LPWSTR pwszIconFile, int cchMax,   int *pIndex, DWORD *pdwFlags)  {   *pIndex = 0;   *pdwFlags = ISIOI_ICONFILE;     // get installation path   std::string dir = GetTHgProgRoot();   if (dir.empty())   {   TDEBUG_TRACE("GetOverlayInfo: THG root is empty");   wcsncpy(pwszIconFile, L"", cchMax);   return S_OK;   }     // find icon per overlay type   std::wstring dirWide = MultibyteToWide(dir);   wcsncpy(pwszIconFile, dirWide.c_str(), cchMax);   cchMax -= static_cast<int>(dirWide.size()) + 1; -/* - switch (myTortoiseClass) - { - case TORTOISE_OLE_ADDED: - wcsncat(pwszIconFile, L"\\icons\\status\\added.ico", cchMax); - break; - case TORTOISE_OLE_MODIFIED: - wcsncat(pwszIconFile, L"\\icons\\status\\changed.ico", cchMax); - break; - case TORTOISE_OLE_UNCHANGED: - wcsncat(pwszIconFile, L"\\icons\\status\\unchanged.ico", cchMax); - break; - default: - break; - } -*/ +   std::string path = WideToMultibyte(pwszIconFile);   TDEBUG_TRACE("GetOverlayInfo: icon path = " << path);     return S_OK;  }    STDMETHODIMP CShellExt::GetPriority(int *pPriority)  {   *pPriority = 1;   return S_OK;  }      STDMETHODIMP CShellExt::IsMemberOf(LPCWSTR pwszPath, DWORD /* dwAttrib */)  {   std::string cval;   if (GetRegistryConfig("EnableOverlays", cval) != 0 && cval == "0")   return S_FALSE;     std::string path = WideToMultibyte(pwszPath);     if (GetRegistryConfig("LocalDisksOnly", cval) != 0 && cval != "0"   && PathIsNetworkPath(path.c_str()))   return S_FALSE;     char filterStatus = 0;   if (myTortoiseClass == TORTOISE_OLE_ADDED)   filterStatus = 'A';     char status = 0;   if (!HgQueryDirstate(path, filterStatus, status))   return S_FALSE;     if (myTortoiseClass == TORTOISE_OLE_ADDED && status == 'A')   return S_OK;   else if (myTortoiseClass == TORTOISE_OLE_MODIFIED && status == 'M')   return S_OK;   else if (myTortoiseClass == TORTOISE_OLE_UNCHANGED && status == 'C')   return S_OK;     return S_FALSE;  }