Changeset 3c5afd3c0bbf…
Parent 81461256fd3e…
by
Changes to 8 files · Browse files at 3c5afd3c0bbf Showing diff from parent 81461256fd3e Diff from another changeset...
@@ -8,6 +8,7 @@ #include "SysInfo.h"
#include "ShellExt.h"
#include "CShellExtCMenu.h"
+#include "RegistryConfig.h"
#include <map>
|
@@ -3,6 +3,7 @@ #include "TortoiseUtils.h"
#include "StringUtils.h"
#include "QueryDirstate.h"
+#include "RegistryConfig.h"
#include "CShellExtOverlay.h"
#include <shlwapi.h>
|
@@ -3,6 +3,7 @@ Direntry.obj \
Directory.obj \
Winstat.obj \
+ RegistryConfig.obj \
ThgDebug.obj
OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \
@@ -21,13 +22,8 @@ Thgstatus.obj \
QueryDirstate.obj
-# TODO: Break link dependencies: Thgstatus needs ThgDebug if compiled with
-# /DTHG_DEBUG, which in turn depends on TortoiseUtils and then even
-# IconBitmapUtils and SysInfo
-OBJECTS_TERMINATE = TortoiseUtils.obj \
- SysInfo.obj \
- IconBitmapUtils.obj \
- Thgstatus.obj \
+OBJECTS_TERMINATE = Thgstatus.obj \
+ RegistryConfig.obj \
ThgDebug.obj
LIBS = shlwapi.lib gdiplus.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
|
|
@@ -0,0 +1,30 @@ + #include "stdafx.h"
+#include "RegistryConfig.h"
+
+int GetRegistryConfig(const std::string& name, std::string& res)
+{
+ const char* const subkey = "Software\\TortoiseHg";
+
+ HKEY hkey = 0;
+ LONG rv = RegOpenKeyExA(
+ HKEY_CURRENT_USER, subkey, 0, KEY_READ, &hkey);
+
+ if (rv != ERROR_SUCCESS || hkey == 0)
+ return 0;
+
+ BYTE Data[MAX_PATH] = "";
+ DWORD cbData = MAX_PATH * sizeof(BYTE);
+
+ rv = RegQueryValueExA(
+ hkey, name.c_str(), 0, 0, Data, &cbData);
+
+ int ret = 0;
+ if (rv == ERROR_SUCCESS)
+ {
+ res = reinterpret_cast<const char*>(&Data);
+ ret = 1;
+ }
+
+ RegCloseKey(hkey);
+ return ret;
+}
|
|
@@ -0,0 +1,8 @@ + #ifndef REGISTRY_CONFIG_H_
+#define REGISTRY_CONFIG_H_
+
+#include <string>
+
+int GetRegistryConfig(const std::string& name, std::string& res);
+
+#endif
|
@@ -7,9 +7,7 @@ // (at your option) any later version.
#include "ThgDebug.h"
-#include "TortoiseUtils.h"
-
-#include <string>
+#include "RegistryConfig.h"
bool ThgDebug::regDebugShellExt()
{
|
@@ -62,35 +62,6 @@ }
-int GetRegistryConfig(const std::string& name, std::string& res)
-{
- const char* const subkey = "Software\\TortoiseHg";
-
- HKEY hkey = 0;
- LONG rv = RegOpenKeyExA(
- HKEY_CURRENT_USER, subkey, 0, KEY_READ, &hkey);
-
- if (rv != ERROR_SUCCESS || hkey == 0)
- return 0;
-
- BYTE Data[MAX_PATH] = "";
- DWORD cbData = MAX_PATH * sizeof(BYTE);
-
- rv = RegQueryValueExA(
- hkey, name.c_str(), 0, 0, Data, &cbData);
-
- int ret = 0;
- if (rv == ERROR_SUCCESS)
- {
- res = reinterpret_cast<const char*>(&Data);
- ret = 1;
- }
-
- RegCloseKey(hkey);
- return ret;
-}
-
-
// Start an external command
// Note: if the command is a batch file and the [full] path to the
// batch contains spaces, the path must be double-quoted.
|
@@ -22,7 +22,6 @@ HBITMAP GetTortoiseIconBitmap(const std::string& iconname);
std::string GetHgRepoRoot(const std::string& path);
bool IsHgRepo(const std::string& path);
-int GetRegistryConfig(const std::string& name, std::string& res);
FILE* fopenReadRenameAllowed(const char* path);
int GetRegSZValue(HKEY hkey, const char* name, std::string& res);
int GetRegSZValueW(HKEY hkey, const wchar_t* name, std::wstring& res);
|
Loading...