Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

fogcreek shellext: removed unneeded CInitStatus class

Changeset a3b01d1f74eb

Parent 34d5e3a3faa1

by David Golub

Changes to 6 files · Browse files at a3b01d1f74eb Showing diff from parent 34d5e3a3faa1 Diff from another changeset...

Change 1 of 1 Show Entire File win32/​shellext/​InitStatus.cpp Stacked
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,60 +0,0 @@
- -// Copyright (C) 2009 Adrian Buehlmann -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -#include "stdafx.h" - -#include "InitStatus.h" -#include "Thgstatus.h" - - -CInitStatus& CInitStatus::Inst() -{ - static CInitStatus s; - return s; -} - - -void CInitStatus::Add(CString& s, const char* missing) -{ - if (!s.IsEmpty()) - s += ", "; - s += missing; -} - - -CString CInitStatus::Check() -{ - const CInitStatus& self = Inst(); - CString missing; - - if (self.unchanged_ == 0) - Add(missing, "unchanged"); - if (self.added_ == 0) - Add(missing, "added"); - if (self.modified_ == 0) - Add(missing, "modified"); - if (self.notinrepo_ == 0) - Add(missing, "notinrepo"); - - if (missing.IsEmpty()) - return ""; - - CString reason = "uninitialized handlers: " + missing; - CTHgStatus::Error(reason); - CString res = "InitStatus: error: " + reason; - ATLTRACE("***** %s\n", (LPCTSTR)res); - return res; -}
Change 1 of 1 Show Entire File win32/​shellext/​InitStatus.h Stacked
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
@@ -1,33 +0,0 @@
- -// Copyright (C) 2009 Adrian Buehlmann -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. - -class CInitStatus -{ -public: - int unchanged_; - int added_; - int modified_; - int notinrepo_; - - static CInitStatus& Inst(); - static CString Check(); - -private: - CInitStatus() : - unchanged_(0), added_(0), modified_(0), notinrepo_(0) {} - - static void Add(CString& s, const char* missing); -};
 
20
21
22
23
24
25
26
 
20
21
22
 
23
24
25
@@ -20,7 +20,6 @@
   #include "TortoiseUtils.h"  #include "StringUtils.h" -#include "InitStatus.h"  #include "TortoiseHgCmenu.h"  #include "TortoiseHgDropHandler.h"  #include "TortoiseHgOverlay.h"
 
210
211
212
213
214
215
216
 
232
233
234
235
236
237
238
 
210
211
212
 
213
214
215
 
231
232
233
 
234
235
236
@@ -210,7 +210,6 @@
  <ClCompile Include="Dirstate.cpp" />   <ClCompile Include="DirstateCache.cpp" />   <ClCompile Include="IconBitmapUtils.cpp" /> - <ClCompile Include="InitStatus.cpp" />   <ClCompile Include="QueryDirstate.cpp" />   <ClCompile Include="RegistryConfig.cpp" />   <ClCompile Include="StringUtils.cpp" /> @@ -232,7 +231,6 @@
  <ClInclude Include="Dirstate.h" />   <ClInclude Include="DirstateCache.h" />   <ClInclude Include="IconBitmapUtils.h" /> - <ClInclude Include="InitStatus.h" />   <ClInclude Include="QueryDirstate.h" />   <ClInclude Include="RegistryConfig.h" />   <ClInclude Include="resource.h" />
 
33
34
35
36
37
38
39
40
41
 
95
96
97
98
99
100
101
102
103
 
33
34
35
 
 
 
36
37
38
 
92
93
94
 
 
 
95
96
97
@@ -33,9 +33,6 @@
  <ClCompile Include="IconBitmapUtils.cpp">   <Filter>Source Files</Filter>   </ClCompile> - <ClCompile Include="InitStatus.cpp"> - <Filter>Source Files</Filter> - </ClCompile>   <ClCompile Include="QueryDirstate.cpp">   <Filter>Source Files</Filter>   </ClCompile> @@ -95,9 +92,6 @@
  <ClInclude Include="IconBitmapUtils.h">   <Filter>Header Files</Filter>   </ClInclude> - <ClInclude Include="InitStatus.h"> - <Filter>Header Files</Filter> - </ClInclude>   <ClInclude Include="QueryDirstate.h">   <Filter>Header Files</Filter>   </ClInclude>
 
20
21
22
23
24
25
26
 
547
548
549
550
551
552
553
554
 
804
805
806
807
808
809
810
 
840
841
842
843
844
845
846
 
20
21
22
 
23
24
25
 
546
547
548
 
 
549
550
551
 
801
802
803
 
804
805
806
 
836
837
838
 
839
840
841
@@ -20,7 +20,6 @@
 #include "StringUtils.h"  #include "THgStatus.h"  #include "Winstat.h" -#include "InitStatus.h"  #include "SysInfo.h"  #include "RegistryConfig.h"  #include "TortoiseIconBitmap.h" @@ -547,8 +546,6 @@
    ::InsertMenu(hMenu, indexMenu++, MF_SEPARATOR | MF_BYPOSITION, 0, NULL);   - CInitStatus::Check(); -   TweakMenuForVista(hMenu);     return ResultFromShort(idCmd - idCmdFirst); @@ -804,7 +801,6 @@
  CString strPath = strDir + "\\TortoiseHgOverlayServer.exe";   LaunchCommand(Quote(strPath), strDir);   } - CInitStatus::Check();   return;   }   @@ -840,7 +836,6 @@
  }     LaunchCommand(strHgCmd, strCwd); - CInitStatus::Check();  }    void CTortoiseHgCmenuBase::PrintDebugHeader(LPCITEMIDLIST pIDFolder, LPDATAOBJECT pDataObj)