Bug 391980 - "New Download manager automatically associates all types of files including folders with one file type" [p=ventnor.bugzilla@yahoo.com.au (Michael Ventnor) r=bsmedberg a=blocking-firefox3+]

This commit is contained in:
2007-11-26 15:55:34 -08:00
parent 20cb064ab1
commit c4ee665159
3 changed files with 52 additions and 1 deletions

View File

@@ -83,6 +83,10 @@
#include "nsITimelineService.h"
#include "nsIProgrammingLanguage.h"
#ifdef MOZ_WIDGET_GTK2
#include "nsIGnomeVFSService.h"
#endif
#include "nsNativeCharsetUtils.h"
#include "nsTraceRefcntImpl.h"
@@ -1663,13 +1667,44 @@ nsLocalFile::Launch()
NS_IMETHODIMP
nsLocalFile::Reveal()
{
#ifdef MOZ_WIDGET_GTK2
nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
if (!vfs)
return NS_ERROR_FAILURE;
PRBool isDirectory;
if (NS_FAILED(IsDirectory(&isDirectory)))
return NS_ERROR_FAILURE;
if (isDirectory) {
return vfs->ShowURIForInput(mPath);
} else {
nsCOMPtr<nsIFile> parentDir;
nsCAutoString dirPath;
if (NS_FAILED(GetParent(getter_AddRefs(parentDir))))
return NS_ERROR_FAILURE;
if (NS_FAILED(parentDir->GetNativePath(dirPath)))
return NS_ERROR_FAILURE;
return vfs->ShowURIForInput(dirPath);
}
#else
return NS_ERROR_FAILURE;
#endif
}
NS_IMETHODIMP
nsLocalFile::Launch()
{
#ifdef MOZ_WIDGET_GTK2
nsCOMPtr<nsIGnomeVFSService> vfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
if (!vfs)
return NS_ERROR_FAILURE;
return vfs->ShowURIForInput(mPath);
#else
return NS_ERROR_FAILURE;
#endif
}
#endif