зеркало из https://github.com/mozilla/pjs.git
nsCString->nsString API changes. Merged from 1.0 branch.
Not part of the build.
This commit is contained in:
Родитель
e6d903de2f
Коммит
e517fa3bcd
|
@ -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!)
|
||||
|
|
Загрузка…
Ссылка в новой задаче