diff --git a/layout/inspector/src/inFileSearch.cpp b/layout/inspector/src/inFileSearch.cpp index d723058ed60..df911785420 100644 --- a/layout/inspector/src/inFileSearch.cpp +++ b/layout/inspector/src/inFileSearch.cpp @@ -171,9 +171,9 @@ inFileSearch::GetStringResultAt(PRInt32 aIndex, nsAString& _retval) } if (file) { - nsXPIDLCString temp; - mLastResult->GetPath(getter_Copies(temp)); - _retval = NS_ConvertASCIItoUCS2(temp); + nsCAutoString temp; + mLastResult->GetPath(temp); + _retval = NS_ConvertUTF8toUCS2(temp); if (mReturnRelativePaths) MakePathRelative(_retval); } else { @@ -543,11 +543,10 @@ inFileSearch::GetNextDirectory(nsISimpleEnumerator* aEnum) PRBool inFileSearch::MatchFile(nsIFile* aFile) { - char* fileName; - aFile->GetLeafName(&fileName); + nsCAutoString fileName; + aFile->GetLeafName(fileName); - nsAutoString temp; - temp.AssignWithConversion(fileName); + NS_ConvertUTF8toUCS2 temp(fileName); PRUnichar* fileNameUnicode = ToNewUnicode(temp); @@ -558,6 +557,7 @@ inFileSearch::MatchFile(nsIFile* aFile) if (match) return PR_TRUE; } + // XXX are we leaking fileNameUnicode? return PR_FALSE; } @@ -610,10 +610,9 @@ inFileSearch::MakePathRelative(nsAString& aPath) { // get an nsAutoString version of the search path - char* temp; - mSearchPath->GetPath(&temp); - nsAutoString searchPath; - searchPath.AssignWithConversion(temp); + nsCAutoString temp; + mSearchPath->GetPath(temp); + NS_ConvertUTF8toUCS2 searchPath(temp); nsAutoString result; PRUint32 len = searchPath.Length(); diff --git a/suite/common/pref/pref-cache.js b/suite/common/pref/pref-cache.js index 751e8e3d243..4c922c65b5c 100644 --- a/suite/common/pref/pref-cache.js +++ b/suite/common/pref/pref-cache.js @@ -46,7 +46,7 @@ function Startup() // if both pref and dir svc fail leave this field blank else show path if (path) document.getElementById("browserCacheDiskCacheFolder").value = - path.unicodePath; + path.path; } @@ -75,7 +75,7 @@ function prefCacheSelectFolder() if (ret == nsIFilePicker.returnOK) { var localFile = fp.file.QueryInterface(nsILocalFile); - var viewable = fp.file.unicodePath; + var viewable = fp.file.path; var folderField = document.getElementById("browserCacheDiskCacheFolder"); folderField.value = viewable; pref.setComplexValue(kCacheParentDirPref, nsILocalFile, localFile)