Bug 562897 - Add required implementation to open files on Maemo 6. r=dougt
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user