Bug 562897 - Add required implementation to open files on Maemo 6. r=dougt

This commit is contained in:
Wolfgang Rosenauer
2010-07-30 12:46:20 -07:00
parent f2e5fcdda2
commit c281782958
9 changed files with 297 additions and 4 deletions

View File

@@ -72,6 +72,12 @@
#include <sys/quota.h>
#endif
#if (MOZ_PLATFORM_MAEMO == 6)
#include <QUrl>
#include <QString>
#include <contentaction/contentaction.h>
#endif
#include "nsDirectoryServiceDefs.h"
#include "nsCRT.h"
#include "nsCOMPtr.h"
@@ -1891,6 +1897,17 @@ nsLocalFile::Launch()
return NS_ERROR_FAILURE;
#endif
#elif (MOZ_PLATFORM_MAEMO == 6)
QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));
ContentAction::Action action =
ContentAction::Action::defaultActionForFile(uri);
if (action.isValid()) {
action.trigger();
return NS_OK;
}
return NS_ERROR_FAILURE;
#elif defined(ANDROID)
// Try to get a mimetype, if this fails just use the file uri alone
nsresult rv;