change this to a wstring. not part of the build.

This commit is contained in:
sspitzer%netscape.com 2000-02-29 01:38:45 +00:00
Родитель 31d6c6f122
Коммит 7d3cd92679
4 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -27,7 +27,7 @@
interface nsIUserInfo : nsISupports
{
/* the system may know our user's fullname*/
readonly attribute string fullname;
readonly attribute wstring fullname;
};
%{C++

Просмотреть файл

@ -24,11 +24,10 @@
#include "nsUserInfo.h"
#include "nsCRT.h"
#ifdef XP_UNIX
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#endif /* XP_UNIX */
#include "nsString.h"
nsUserInfo::nsUserInfo()
{
@ -42,7 +41,7 @@ nsUserInfo::~nsUserInfo()
NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo);
NS_IMETHODIMP
nsUserInfo::GetFullname(char **aFullname)
nsUserInfo::GetFullname(PRUnichar **aFullname)
{
struct passwd *pw = nsnull;
@ -54,6 +53,9 @@ nsUserInfo::GetFullname(char **aFullname)
printf("name = %s\n", pw->pw_gecos);
#endif
*aFullname = nsCRT::strdup(pw->pw_gecos);
nsAutoString fullname(pw->pw_gecos);
*aFullname = fullname.ToNewUnicode();
return NS_OK;
}

Просмотреть файл

@ -27,7 +27,7 @@
interface nsIUserInfo : nsISupports
{
/* the system may know our user's fullname*/
readonly attribute string fullname;
readonly attribute wstring fullname;
};
%{C++

Просмотреть файл

@ -24,11 +24,10 @@
#include "nsUserInfo.h"
#include "nsCRT.h"
#ifdef XP_UNIX
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#endif /* XP_UNIX */
#include "nsString.h"
nsUserInfo::nsUserInfo()
{
@ -42,7 +41,7 @@ nsUserInfo::~nsUserInfo()
NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo);
NS_IMETHODIMP
nsUserInfo::GetFullname(char **aFullname)
nsUserInfo::GetFullname(PRUnichar **aFullname)
{
struct passwd *pw = nsnull;
@ -54,6 +53,9 @@ nsUserInfo::GetFullname(char **aFullname)
printf("name = %s\n", pw->pw_gecos);
#endif
*aFullname = nsCRT::strdup(pw->pw_gecos);
nsAutoString fullname(pw->pw_gecos);
*aFullname = fullname.ToNewUnicode();
return NS_OK;
}