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

merge with crew

Changeset a7d8c476ee18

Parents 72a091dde1e2

Parents 887f8ef3312a

by Adrian Buehlmann

Changes to 5 files · Browse files at a7d8c476ee18 Showing diff from parent 72a091dde1e2 887f8ef3312a Diff from another changeset...

 
113
114
115
116
 
117
118
119
 
123
124
125
126
127
 
 
128
129
130
 
136
137
138
139
 
140
141
142
 
161
162
163
164
 
165
166
167
 
186
187
188
189
 
190
191
192
 
225
226
227
228
 
229
230
231
 
460
461
462
463
 
464
465
466
 
113
114
115
 
116
117
118
119
 
123
124
125
 
 
126
127
128
129
130
 
136
137
138
 
139
140
141
142
 
161
162
163
 
164
165
166
167
 
186
187
188
 
189
190
191
192
 
225
226
227
 
228
229
230
231
 
460
461
462
 
463
464
465
466
@@ -113,7 +113,7 @@
 MenuDescriptionMap MenuDescMap;  MenuIdCmdMap MenuIdMap;   -void AddMenuList(int idCmd, std::string name) +void AddMenuList(int idCmd, std::string const& name)  {   TDEBUG_TRACE("AddMenuList: idCmd = " << idCmd << " name = " << name);   MenuIdMap[idCmd] = MenuDescMap[name]; @@ -123,8 +123,8 @@
 {   if (MenuDescMap.empty())   { - int sz = sizeof(menuDescList) / sizeof(MenuDescription); - for (int i=0; i < sz; i++) + std::size_t sz = sizeof(menuDescList) / sizeof(MenuDescription); + for (std::size_t i=0; i < sz; i++)   {   MenuDescription md = menuDescList[i];   TDEBUG_TRACE("InitMenuMaps: adding " << md.name); @@ -136,7 +136,7 @@
 }    void InsertMenuItemWithIcon(HMENU hMenu, int indexMenu, int idCmd, - std::string menuText, std::string iconName) + std::string const& menuText, std::string const& iconName)  {   MENUITEMINFO mi;   mi.cbSize = sizeof(mi); @@ -161,7 +161,7 @@
 }    void InsertSubMenuItemWithIcon(HMENU hMenu, HMENU hSubMenu, int indexMenu, int idCmd, - std::string menuText, std::string iconName) + std::string const& menuText, std::string const& iconName)  {   MENUITEMINFO mi;   mi.cbSize = sizeof(mi); @@ -186,7 +186,7 @@
  InsertMenuItem(hMenu, indexMenu, TRUE, &mi);  }   -void InsertMenuItemByName(HMENU hMenu, std::string name, int indexMenu, +void InsertMenuItemByName(HMENU hMenu, std::string const& name, int indexMenu,   int idCmd, int idCmdFirst)  {   TDEBUG_TRACE("InsertMenuItemByName: name = " << name); @@ -225,7 +225,7 @@
  if (!bAppendItems)   return NOERROR;   - const int sz = sizeof(menuDescList) / sizeof(MenuDescription); + const std::size_t sz = sizeof(menuDescList) / sizeof(MenuDescription);   bool promoted[ sz ];   memset(&promoted, 0, sizeof(promoted));   @@ -460,7 +460,7 @@
  HANDLE tempfileHandle = CreateFileA(tempfile.c_str(), GENERIC_WRITE,   FILE_SHARE_READ, &sa, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);   - for (int i=0; i<myFiles.size(); i++) + for (std::vector<std::string>::size_type i=0; i<myFiles.size(); i++)   {   DWORD dwWritten;   TDEBUG_TRACE("DoHgtk: temp file adding " << myFiles[i]);
 
43
44
45
46
 
47
48
49
 
50
51
52
 
43
44
45
 
46
47
 
 
48
49
50
51
@@ -43,10 +43,9 @@
 };     -bool hasHgDir(std::string path) +bool hasHgDir(std::string const& path)  { - path += "\\.hg"; - return PathIsDirectory(path.c_str()); + return PathIsDirectory((path + "\\.hg").c_str()) != 0;  }    
 
279
280
281
282
 
283
284
285
 
279
280
281
 
282
283
284
285
@@ -279,7 +279,7 @@
  {   UINT uNumFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);   TDEBUG_TRACE(" hDrop uNumFiles = " << uNumFiles); - for (int i = 0; i < uNumFiles; ++i) { + for (UINT i = 0; i < uNumFiles; ++i) {   if (DragQueryFile(hDrop, i, name, MAX_PATH) > 0)   {   TDEBUG_TRACE(" DragQueryFile [" << i << "] = " << name);
 
109
110
111
112
 
113
114
115
 
109
110
111
 
112
113
114
115
@@ -109,7 +109,7 @@
     // Cuts the first token off a delimited list -std::string CutFirstToken(std::string& sList, const std::string sDelimiter) +std::string CutFirstToken(std::string& sList, const std::string& sDelimiter)  {   std::string::size_type p = sList.find(sDelimiter);   std::string sResult;
 
69
70
71
72
73
74
 
 
 
 
75
76
77
 
82
83
84
85
86
87
 
 
 
 
88
89
90
 
159
160
161
162
 
163
164
165
166
167
168
169
 
170
171
172
 
195
196
197
198
199
 
200
201
202
 
69
70
71
 
 
 
72
73
74
75
76
77
78
 
83
84
85
 
 
 
86
87
88
89
90
91
92
 
161
162
163
 
164
165
166
167
168
169
170
 
171
172
173
174
 
197
198
199
 
 
200
201
202
203
@@ -69,9 +69,10 @@
  TCHAR lpszValue[MAX_PATH] = "";   LONG lpcbLonger = MAX_PATH * sizeof(TCHAR);   - RegQueryValue(key, regname, lpszValue, &lpcbLonger); - std::string result(reinterpret_cast<char*>(lpszValue)); - return result; + if (RegQueryValue(key, regname, lpszValue, &lpcbLonger) != ERROR_SUCCESS) + return ""; + + return lpszValue;  }     @@ -82,9 +83,10 @@
  TCHAR lpszValue[MAX_PATH] = "";   LONG lpcbLonger = MAX_PATH * sizeof(TCHAR);   - RegQueryValue(key, regname, lpszValue, &lpcbLonger); - std::string result(reinterpret_cast<char*>(lpszValue)); - return result; + if (RegQueryValue(key, regname, lpszValue, &lpcbLonger) != ERROR_SUCCESS) + return ""; + + return lpszValue;  }     @@ -159,14 +161,14 @@
  }   else if (GetTempFileName(tempDir, prefix, 0, tempFile) != 0)   { - return std::string(tempFile); + return tempFile;   }   else   {   TDEBUG_TRACE("GetTemporaryFile: Failed to get temporary file");   }   - return std::string(); + return "";  }     @@ -195,8 +197,7 @@
  if (filename.empty())   return filename;   std::string::size_type pos = filename.find_last_of("\\"); - std::string myfilename = filename.substr(pos+1); - return myfilename; + return filename.substr(pos+1);  }    HICON GetTortoiseIcon(const std::string& iconname)