Change the implementation to use nsILocalFile as the first step to fix
non ASCII problem. We will change to use the unicode version of the method in the near future. The unicode version is put in the comment for now. After we validate the nsILocalFile version have no problem. We will switch to it's unicode version of method r=dougt git-svn-id: svn://10.0.0.236/trunk@66980 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4d7e55797e
commit
c936bf31e5
@ -70,6 +70,8 @@ function chooseProfileFolder( aRootFolder )
|
||||
fp.init(window, bundle.GetStringFromName("chooseFolder"), Components.interfaces.nsIFilePicker.modeGetFolder);
|
||||
fp.setFilters(Components.interfaces.nsIFilePicker.filterAll);
|
||||
fp.show();
|
||||
// later change to
|
||||
// aRootFolder = fp.file.unicodePath;
|
||||
aRootFolder = fp.file.path;
|
||||
}
|
||||
catch(e) {
|
||||
@ -96,19 +98,28 @@ function clearFolderDisplay()
|
||||
|
||||
function updateProfileName()
|
||||
{
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
const nsILocalFile_PROGID = "component://mozilla/file/local";
|
||||
|
||||
var profileName = document.getElementById( "ProfileName" );
|
||||
var folderDisplayElement = document.getElementById( "ProfileDir" );
|
||||
var rootFolder = folderDisplayElement.getAttribute( "rootFolder" );
|
||||
try {
|
||||
var fileSpec = Components.classes["component://netscape/filespec"].createInstance();
|
||||
if ( fileSpec )
|
||||
fileSpec = fileSpec.QueryInterface( Components.interfaces.nsIFileSpec );
|
||||
if ( fileSpec )
|
||||
fileSpec.nativePath = rootFolder;
|
||||
fileSpec.appendRelativeUnixPath( profileName.value );
|
||||
|
||||
var sfile = Components.classes[nsILocalFile_PROGID].createInstance(nsILocalFile);
|
||||
if ( sfile ) {
|
||||
// later change to
|
||||
// sfile.initWithUnicodePath(rootFolder);
|
||||
sfile.initWithPath(rootFolder);
|
||||
}
|
||||
// later change to
|
||||
// sfile.appendUnicode(profileName.value);
|
||||
sfile.append(profileName.value);
|
||||
|
||||
clearFolderDisplay();
|
||||
var value = document.createTextNode( fileSpec.nativePath );
|
||||
// later change to
|
||||
// var value = document.createTextNode( sfile.unicodePath );
|
||||
var value = document.createTextNode( sfile.path );
|
||||
folderDisplayElement.appendChild( value );
|
||||
}
|
||||
catch(e) {
|
||||
@ -127,6 +138,8 @@ function setDisplayToDefaultFolder()
|
||||
fileSpec = fileSpec.QueryInterface( Components.interfaces.nsIFileSpec );
|
||||
if ( fileSpec )
|
||||
profileDisplay.setAttribute("rootFolder", fileSpec.nativePath );
|
||||
|
||||
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user