Bug 23941 speed up install on Mac, r=cathleen, a=jar;
Bug 12817 no Autoreg (in optimized builds) unless xpinstall detects flag indicating install has happened or build number changed, r=dp, a=jar; Bug 23859 add wstring API to nsIRegistry for profile manager/i18n, r=gayatrib, a=jar; git-svn-id: svn://10.0.0.236/trunk@61370 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -85,14 +85,16 @@ interface nsIRegistry : nsISupports
|
||||
[scriptable, uuid(D1B54831-AC07-11d2-805E-00600811A9C3)]
|
||||
interface nsIRegistryNode : nsISupports
|
||||
{
|
||||
readonly attribute string name;
|
||||
readonly attribute string nameUTF8;
|
||||
readonly attribute wstring name;
|
||||
readonly attribute nsRegistryKey key;
|
||||
};
|
||||
|
||||
[scriptable,uuid(5316C380-B2F8-11d2-A374-0080C6F80E4B)]
|
||||
interface nsIRegistryValue : nsISupports
|
||||
{
|
||||
readonly attribute string name;
|
||||
readonly attribute wstring name;
|
||||
readonly attribute string nameUTF8;
|
||||
readonly attribute unsigned long type;
|
||||
readonly attribute PRUint32 length;
|
||||
};
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
#define PR_Unlock(x) (void)0
|
||||
#endif
|
||||
|
||||
PRUnichar widestrFormat[] = { PRUnichar('%'),PRUnichar('s'),PRUnichar(0)};
|
||||
|
||||
/*-------------------------------- nsRegistry ----------------------------------
|
||||
| This class implements the nsIRegistry interface using the functions |
|
||||
| provided by libreg (as declared in mozilla/modules/libreg/include/NSReg.h). |
|
||||
@@ -614,8 +616,7 @@ NS_IMETHODIMP nsRegistry::GetString(nsRegistryKey baseKey, const PRUnichar *valn
|
||||
rv = GetStringUTF8( baseKey, utf8name, &tmpstr );
|
||||
if (NS_SUCCEEDED(rv))
|
||||
{
|
||||
nsString tmpfmt("%s");
|
||||
*_retval = nsTextFormatter::smprintf( tmpfmt.GetUnicode(), tmpstr );
|
||||
*_retval = nsTextFormatter::smprintf( widestrFormat, tmpstr );
|
||||
nsCRT::free(tmpstr);
|
||||
if ( *_retval == nsnull )
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
@@ -1396,7 +1397,19 @@ nsRegistryNode::~nsRegistryNode()
|
||||
| If we haven't fetched it yet, get the name of the corresponding subkey now, |
|
||||
| using NR_RegEnumSubkeys. |
|
||||
------------------------------------------------------------------------------*/
|
||||
NS_IMETHODIMP nsRegistryNode::GetName( char **result ) {
|
||||
NS_IMETHODIMP nsRegistryNode::GetName( PRUnichar **result ) {
|
||||
if (result == nsnull) return NS_ERROR_NULL_POINTER;
|
||||
// Make sure there is a place to put the result.
|
||||
*result = nsTextFormatter::smprintf( widestrFormat, mName );
|
||||
if ( !*result ) return NS_ERROR_OUT_OF_MEMORY;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*-------------------------- nsRegistryNode::GetNameUTF8 -----------------------
|
||||
| If we haven't fetched it yet, get the name of the corresponding subkey now, |
|
||||
| using NR_RegEnumSubkeys. |
|
||||
------------------------------------------------------------------------------*/
|
||||
NS_IMETHODIMP nsRegistryNode::GetNameUTF8( char **result ) {
|
||||
if (result == nsnull) return NS_ERROR_NULL_POINTER;
|
||||
// Make sure there is a place to put the result.
|
||||
*result = nsCRT::strdup( mName );
|
||||
@@ -1441,7 +1454,31 @@ nsRegistryValue::~nsRegistryValue()
|
||||
/*------------------------- nsRegistryValue::GetName ---------------------------
|
||||
| See nsRegistryNode::GetName; we use NR_RegEnumEntries in this case. |
|
||||
------------------------------------------------------------------------------*/
|
||||
NS_IMETHODIMP nsRegistryValue::GetName( char **result ) {
|
||||
NS_IMETHODIMP nsRegistryValue::GetName( PRUnichar **result ) {
|
||||
nsresult rv = NS_OK;
|
||||
// Make sure we have a place to put the result.
|
||||
if( result ) {
|
||||
// Ensure we've got the info we need.
|
||||
rv = getInfo();
|
||||
if( rv == NS_OK || rv == NS_ERROR_REG_NO_MORE ) {
|
||||
// worked, return actual result.
|
||||
*result = nsTextFormatter::smprintf( widestrFormat, mName );
|
||||
if ( *result ) {
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rv = NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
/*------------------------- nsRegistryValue::GetNameUTF8 -----------------------
|
||||
| See nsRegistryNode::GetName; we use NR_RegEnumEntries in this case. |
|
||||
------------------------------------------------------------------------------*/
|
||||
NS_IMETHODIMP nsRegistryValue::GetNameUTF8( char **result ) {
|
||||
nsresult rv = NS_OK;
|
||||
// Make sure we have a place to put the result.
|
||||
if( result ) {
|
||||
|
||||
Reference in New Issue
Block a user