// Created: 27.04.98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence: wxWindows license
+// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
// ----------------------------------------------------------------------------
// we put our data in HKLM\SOFTWARE_KEY\appname
-#define SOFTWARE_KEY wxString("Software\\")
+#define SOFTWARE_KEY wxString(wxT("Software\\"))
// ----------------------------------------------------------------------------
// global functions
m_keyLocal.ReserveMemoryForName(MEMORY_PREALLOC);
m_keyLocalRoot.SetName(wxRegKey::HKCU, SOFTWARE_KEY + str);
- m_keyLocal.SetName(m_keyLocalRoot, _T(""));
+ m_keyLocal.SetName(m_keyLocalRoot, wxEmptyString);
if ( bDoUseGlobal )
{
m_keyGlobal.ReserveMemoryForName(MEMORY_PREALLOC);
m_keyGlobalRoot.SetName(wxRegKey::HKLM, SOFTWARE_KEY + str);
- m_keyGlobal.SetName(m_keyGlobalRoot, _T(""));
+ m_keyGlobal.SetName(m_keyGlobalRoot, wxEmptyString);
}
// Create() will Open() if key already exists
// registry APIs want backslashes instead of slashes
wxString strRegPath;
- size_t len = m_strPath.length();
+ if ( !m_strPath.empty() )
+ {
+ size_t len = m_strPath.length();
- const wxChar *src = m_strPath.c_str();
- wxChar *dst = strRegPath.GetWriteBuf(len);
+ const wxChar *src = m_strPath.c_str();
+ wxChar *dst = strRegPath.GetWriteBuf(len);
- const wxChar *end = src + len;
- for ( ; src < end; src++, dst++ )
- {
- if ( *src == wxCONFIG_PATH_SEPARATOR )
- *dst = _T('\\');
- else
- *dst = *src;
- }
+ const wxChar *end = src + len;
+ for ( ; src < end; src++, dst++ )
+ {
+ if ( *src == wxCONFIG_PATH_SEPARATOR )
+ *dst = _T('\\');
+ else
+ *dst = *src;
+ }
- strRegPath.UngetWriteBuf(len);
+ strRegPath.UngetWriteBuf(len);
+ }
// this is not needed any longer as we don't create keys unnecessarily any
// more (now it is done on demand, i.e. only when they're going to contain
if ( m_keyLocal.IsEmpty() ) {
wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR);
- SetPath(".."); // changes m_keyLocal
+ SetPath(_T("..")); // changes m_keyLocal
return LocalKey().DeleteKey(strKey);
}
}