summaryrefslogtreecommitdiffstats
path: root/src/registrytool.cpp
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
committerMartin Owens <doctormo@gmail.com>2014-03-27 01:33:44 +0000
commit5a4fb2325f60d292b47330f540b26a3279341c90 (patch)
treed2aa7967be25450b83e625025366c618101ae49f /src/registrytool.cpp
parentThe Polar Arrange Tab of the Arrange Dialog now hides the parametric (diff)
parentRemove Snap menu item and improve grid menu item text (diff)
downloadinkscape-5a4fb2325f60d292b47330f540b26a3279341c90.tar.gz
inkscape-5a4fb2325f60d292b47330f540b26a3279341c90.zip
Commit a merge to trunk, with probabal errors
(bzr r11073.1.36)
Diffstat (limited to 'src/registrytool.cpp')
-rw-r--r--src/registrytool.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/registrytool.cpp b/src/registrytool.cpp
index d2cec0080..51c1063ef 100644
--- a/src/registrytool.cpp
+++ b/src/registrytool.cpp
@@ -21,12 +21,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "registrytool.h"
+
#include <windows.h>
#include <string>
#include <cstdio>
-#include "registrytool.h"
-
+#include <glibmm/ustring.h>
typedef struct
{
@@ -70,6 +71,7 @@ bool RegistryTool::setStringValue(const Glib::ustring &keyNameArg,
//Get or create the key
gunichar2 *keyw = g_utf8_to_utf16(keyName.data(), -1, 0,0,0);
gunichar2 *valuenamew = g_utf8_to_utf16(valueName.data(), -1, 0,0,0);
+ gunichar2 *valuew = g_utf8_to_utf16(value.data(), -1, 0,0,0);
HKEY key;
if (RegCreateKeyExW(rootKey, (WCHAR*) keyw,
@@ -82,7 +84,7 @@ bool RegistryTool::setStringValue(const Glib::ustring &keyNameArg,
// Set the value
if (RegSetValueExW(key, (WCHAR*) valuenamew,
- 0, REG_SZ, (LPBYTE) value.data(), (DWORD) (value.size() + 1)))
+ 0, REG_SZ, (LPBYTE) valuew, (DWORD) (2*value.size() + 2)))
{
fprintf(stderr, "RegistryTool: Could not set the value '%s'\n", value.c_str());
goto failkey;
@@ -140,7 +142,7 @@ bool RegistryTool::setPathInfo()
// fullPath.c_str(), path.c_str(), exeName.c_str());
Glib::ustring keyName =
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\";
+ "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\";
keyName.append(exeName);
Glib::ustring valueName = "";