nsCString->nsString API changes. Merged from 1.0 branch.

Not part of the build.
This commit is contained in:
mhammond%skippinet.com.au 2002-05-22 05:41:04 +00:00
Родитель e6d903de2f
Коммит e517fa3bcd
2 изменённых файлов: 9 добавлений и 8 удалений

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

@ -31,6 +31,7 @@
#include "nsIModule.h"
#include "nsDirectoryServiceDefs.h"
#include "nsILocalFile.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsString.h"
#include "stdlib.h"
@ -81,17 +82,17 @@ void AddStandardPaths()
LogError("The Python XPCOM loader could not locate the 'bin' directory\n");
return;
}
nsCAutoString python(NS_LITERAL_CSTRING("python"));
aFile->Append(python);
nsCAutoString path_string;
aFile->GetPath(path_string);
aFile->Append(NS_LITERAL_STRING("python"));
nsAutoString pathBuf;
aFile->GetPath(pathBuf);
PyObject *obPath = PySys_GetObject("path");
if (!obPath) {
LogError("The Python XPCOM loader could not get the Python sys.path variable\n");
return;
}
LogDebug("The Python XPCOM loader is adding '%s' to sys.path\n", (const char *)path_string.get());
PyObject *newStr = PyString_FromString(path_string.get());
NS_LossyConvertUCS2toASCII pathCBuf(pathBuf);
LogDebug("The Python XPCOM loader is adding '%s' to sys.path\n", pathCBuf.get());
PyObject *newStr = PyString_FromString(pathCBuf.get());
PyList_Insert(obPath, 0, newStr);
Py_XDECREF(newStr);
}

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

@ -503,8 +503,8 @@ PRBool PyXPCOM_Globals_Ensure()
if (end > landmark) *end = '\0';
nsCOMPtr<nsILocalFile> ns_bin_dir;
nsCAutoString ns_landmark(landmark);
NS_NewLocalFile(ns_landmark, PR_FALSE, getter_AddRefs(ns_bin_dir));
NS_ConvertASCIItoUCS2 strLandmark(landmark);
NS_NewLocalFile(strLandmark, PR_FALSE, getter_AddRefs(ns_bin_dir));
nsresult rv = NS_InitXPCOM2(nsnull, ns_bin_dir, nsnull);
#else
// Elsewhere, Mozilla can find it itself (we hope!)