Changeset ddce4294c9ef…
Parent 7b7599d33425…
by
Changes to 6 files · Browse files at ddce4294c9ef Showing diff from parent 7b7599d33425 Diff from another changeset...
|
@@ -0,0 +1,4 @@ + Windows Registry Editor Version 5.00
+
+[HKEY_CURRENT_USER\Software\TortoiseHg]
+"DebugShellExt"="1"
|
@@ -2,7 +2,8 @@ OBJECTS_DIRSTATE = TortoiseUtils.obj \
Direntry.obj \
Directory.obj \
- Winstat.obj
+ Winstat.obj \
+ ThgDebug.obj
OBJECTS_THGSGELL = $(OBJECTS_DIRSTATE) \
InitStatus.obj \
@@ -15,7 +16,8 @@ Dirstatecache.obj \
DirectoryStatus.obj \
Thgstatus.obj \
- QueryDirstate.obj
+ QueryDirstate.obj \
+ ThgDebug.obj
LIBS = User32.lib Ole32.lib Shlwapi.lib Shell32.lib Advapi32.lib
DEFFILE = ShellExt.def
|
@@ -151,6 +151,9 @@ can be captured by using for example the tool **DebugView** from Microsoft sysinternals (see
http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx).
+The debug output must be enabled in the registry. Double click the file
+"DebugShellExt.reg" and restart explorer.
+
Example output (copied via clipboard):
{{{
|
|
@@ -0,0 +1,24 @@ +
+// 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.
+
+#include "ThgDebug.h"
+#include "TortoiseUtils.h"
+
+#include <string>
+
+bool ThgDebug::regDebugShellExt()
+{
+ std::string val;
+ return GetRegistryConfig("DebugShellExt", val) != 0 && val == "1";
+}
+
+bool ThgDebug::enabled()
+{
+ static bool e = regDebugShellExt();
+ return e;
+}
|
|
@@ -0,0 +1,23 @@ +
+// 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.
+
+#ifndef THGDEBUG_H
+#define THGDEBUG_H
+
+class ThgDebug
+{
+public:
+ static bool enabled();
+
+private:
+ ThgDebug();
+
+ static bool regDebugShellExt();
+};
+
+#endif
|
@@ -15,6 +15,8 @@ #include <assert.h>
#include <string>
+#include "ThgDebug.h"
+
#define ASSERT assert
@@ -24,18 +26,18 @@ // TDEBUG_TRACE() prints debugging messages to Windows' debugger display.
// The messages can be viewed with Sysinternals DebugView, which may be
// downloaded from Microsoft TechNet.
- #define TDEBUG_TRACE(s) do { \
+ #define TDEBUG_TRACE(s) if (ThgDebug::enabled()) { \
std::stringstream _the_msg; \
_the_msg << "[THG] " << s; \
std::string _the_str = _the_msg.str(); \
OutputDebugStringA(_the_str.c_str()); \
- } while (0)
- #define TDEBUG_TRACEW(s) do { \
+ }
+ #define TDEBUG_TRACEW(s) if (ThgDebug::enabled()) { \
std::basic_stringstream<wchar_t> _the_msg; \
_the_msg << L"[THG] " << s; \
std::wstring _the_str = _the_msg.str(); \
OutputDebugStringW(_the_str.c_str()); \
- } while (0)
+ }
#define TDEBUG_ENTER TDEBUG_TRACE
#else
#define TDEBUG_TRACE(s)
|
Loading...