// if mSourcePath is a local file, then let's use the pretty path name instead of an ugly
// url...
var pathString = this.mSourcePath;
try
{
var fileURL = url.QueryInterface(Components.interfaces.nsIFileURL);
if (fileURL)
{
var fileObject = fileURL.file;
if (fileObject)
{
var parentObject = fileObject.parent;
if (parentObject)
{
pathString = parentObject.path;
}
}
}
} catch(ex) {}
// Set the location text, which is separate from the intro text so it can be cropped
var location = this.dialogElement( "source" );
location.value = pathString;
// Show the type of file.
var type = this.dialogElement("type");
var mimeInfo = this.mLauncher.MIMEInfo;
// 1. Try to use the pretty description of the type, if one is available.
var typeString = mimeInfo.Description;
if (typeString == "") {
// 2. If there is none, use the extension to identify the file, e.g. "ZIP file" var primaryExtension = ""; try { primaryExtension = mimeInfo.primaryExtension; } catch (ex) { }