projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was generated by cvs2svn to compensate for changes in r28944,
[wxWidgets.git]
/
src
/
os2
/
utils.cpp
diff --git
a/src/os2/utils.cpp
b/src/os2/utils.cpp
index 67e5fdad7841b10a2a14ad8d021340ffab6aa96b..80f9a04b3ca7b06ba8d9490608fdf19e3272fa85 100644
(file)
--- a/
src/os2/utils.cpp
+++ b/
src/os2/utils.cpp
@@
-45,7
+45,7
@@
#include <netbios.h>
#endif
#include <netbios.h>
#endif
-static const wxChar WX_SECTION[] = _T("wxWi
ndow
s");
+static const wxChar WX_SECTION[] = _T("wxWi
dget
s");
static const wxChar eHOSTNAME[] = _T("HostName");
static const wxChar eUSERID[] = _T("UserId");
static const wxChar eUSERNAME[] = _T("UserName");
static const wxChar eHOSTNAME[] = _T("HostName");
static const wxChar eUSERID[] = _T("UserId");
static const wxChar eUSERNAME[] = _T("UserName");
@@
-83,13
+83,13
@@
bool wxGetHostName(
if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL)
{
if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL)
{
-
ULONG n =
::PrfQueryProfileString( HINI_PROFILE
-
,(PSZ)WX_SECTION
-
,(PSZ)eHOSTNAME
-
,(PSZ)zDefaultHost
-
,(void*)zBuf
-
,(ULONG)nMaxSize - 1
-
);
+ ::PrfQueryProfileString( HINI_PROFILE
+ ,(PSZ)WX_SECTION
+ ,(PSZ)eHOSTNAME
+ ,(PSZ)zDefaultHost
+ ,(void*)zBuf
+ ,(ULONG)nMaxSize - 1
+ );
}
else
wxStrncpy(zBuf, zSysname, nMaxSize - 1);
}
else
wxStrncpy(zBuf, zSysname, nMaxSize - 1);
@@
-260,13
+260,20
@@
bool wxSetEnv(const wxString& variable, const wxChar *value)
#endif
}
#endif
}
-void wx
Us
leep(
+void wx
MilliS
leep(
unsigned long ulMilliseconds
)
{
::DosSleep(ulMilliseconds);
}
unsigned long ulMilliseconds
)
{
::DosSleep(ulMilliseconds);
}
+void wxMicroSleep(
+ unsigned long ulMicroseconds
+)
+{
+ ::DosSleep(ulMicroseconds/1000);
+}
+
void wxSleep(
int nSecs
)
void wxSleep(
int nSecs
)
@@
-303,7
+310,7
@@
void wxError(
, const wxString& rTitle
)
{
, const wxString& rTitle
)
{
- wxBuffer = new wxChar[256];
+ wx
Char *wx
Buffer = new wxChar[256];
wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg);
if (::WinMessageBox( HWND_DESKTOP
,NULL
wxSprintf(wxBuffer, "%s\nContinue?", WXSTRINGCAST rMsg);
if (::WinMessageBox( HWND_DESKTOP
,NULL
@@
-380,18
+387,24
@@
const wxChar* wxGetHomeDir(
wxString& rStrDir = *pStr;
// OS/2 has no idea about home,
wxString& rStrDir = *pStr;
// OS/2 has no idea about home,
- // so use the working directory instead?
+ // so use the working directory instead.
+ // However, we might have a valid HOME directory,
+ // as is used on many machines that have unix utilities
+ // on them, so we should use that, if available.
// 256 was taken from os2def.h
#ifndef MAX_PATH
# define MAX_PATH 256
#endif
// 256 was taken from os2def.h
#ifndef MAX_PATH
# define MAX_PATH 256
#endif
- char zDirName[256];
- ULONG ulDirLen;
+ const wxChar *szHome = wxGetenv("HOME");
+ if ( szHome == NULL ) {
+ // we're homeless, use current directory.
+ rStrDir = wxT(".");
+ }
+ else
+ rStrDir = szHome;
- ::DosQueryCurrentDir(0, zDirName, &ulDirLen);
- rStrDir = zDirName;
return rStrDir.c_str();
}
return rStrDir.c_str();
}
@@
-403,7
+416,7
@@
wxChar* wxGetUserHome (
wxChar* zHome;
wxString sUser1(rUser);
wxChar* zHome;
wxString sUser1(rUser);
- wxBuffer = new wxChar[256];
+
char *
wxBuffer = new wxChar[256];
#ifndef __EMX__
if (sUser1 != _T(""))
{
#ifndef __EMX__
if (sUser1 != _T(""))
{