Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[nemo][xulrunner] Use libcontentaction for uri scheme handling. JB#47892
- Loading branch information
Showing
3 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
From bbfe07e55e96b302c01842552d275853614ef9ad Mon Sep 17 00:00:00 2001 | ||
From: Raine Makelainen <raine.makelainen@jolla.com> | ||
Date: Fri, 31 Jan 2020 11:09:02 +0000 | ||
Subject: [PATCH 18/18] [nemo][xulrunner] Use libcontentaction for custom | ||
scheme uri handling. JB#47892 | ||
|
||
Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com> | ||
--- | ||
configure.in | 8 +++++--- | ||
uriloader/exthandler/nsContentHandlerApp.h | 5 +++-- | ||
uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | 8 ++++---- | ||
uriloader/exthandler/unix/nsOSHelperAppService.cpp | 2 +- | ||
xpcom/io/moz.build | 2 ++ | ||
xpcom/io/nsLocalFileUnix.cpp | 2 +- | ||
8 files changed, 16 insertions(+), 11 deletions(-) | ||
|
||
diff --git a/configure.in b/configure.in | ||
index c98b3171c25e..872b5b2cb347 100644 | ||
--- a/configure.in | ||
+++ b/configure.in | ||
@@ -4518,11 +4518,13 @@ then | ||
fi | ||
|
||
MOZ_ENABLE_CONTENTACTION= | ||
- PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=) | ||
+ PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction5, | ||
+ MOZ_ENABLE_CONTENTACTION=1, | ||
+ MOZ_ENABLE_CONTENTACTION=) | ||
if test "$MOZ_ENABLE_CONTENTACTION"; then | ||
MOZ_ENABLE_CONTENTACTION=1 | ||
- MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_CONTENTACTION_CFLAGS" | ||
- MOZ_QT_LIBS="$MOZ_QT_LIBS $_CONTENTACTION_LIBS" | ||
+ MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $LIBCONTENTACTION_CFLAGS" | ||
+ MOZ_QT_LIBS="$MOZ_QT_LIBS $LIBCONTENTACTION_LIBS" | ||
AC_DEFINE(MOZ_ENABLE_CONTENTACTION) | ||
AC_SUBST(MOZ_ENABLE_CONTENTACTION) | ||
fi | ||
diff --git a/uriloader/exthandler/nsContentHandlerApp.h b/uriloader/exthandler/nsContentHandlerApp.h | ||
index 8ace9a2cd4d0..983faacc4d96 100644 | ||
--- a/uriloader/exthandler/nsContentHandlerApp.h | ||
+++ b/uriloader/exthandler/nsContentHandlerApp.h | ||
@@ -7,7 +7,7 @@ | ||
#ifndef __nsContentHandlerAppImpl_h__ | ||
#define __nsContentHandlerAppImpl_h__ | ||
|
||
-#include <contentaction/contentaction.h> | ||
+#include <contentaction5/contentaction.h> | ||
#include "nsString.h" | ||
#include "nsIMIMEInfo.h" | ||
|
||
@@ -18,9 +18,10 @@ public: | ||
NS_DECL_NSIHANDLERAPP | ||
|
||
nsContentHandlerApp(nsString aName, nsCString aType, ContentAction::Action& aAction); | ||
+ | ||
+private: | ||
virtual ~nsContentHandlerApp() { } | ||
|
||
-protected: | ||
nsString mName; | ||
nsCString mType; | ||
nsString mDetailedDescription; | ||
diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | ||
index caac2ff26694..be1b9e99b88b 100644 | ||
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | ||
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp | ||
@@ -5,8 +5,8 @@ | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
#ifdef MOZ_WIDGET_QT | ||
-#if (MOZ_ENABLE_CONTENTACTION) | ||
-#include <contentaction/contentaction.h> | ||
+#if defined(MOZ_ENABLE_CONTENTACTION) | ||
+#include <contentaction5/contentaction.h> | ||
#include "nsContentHandlerApp.h" | ||
#endif | ||
#endif | ||
@@ -92,9 +92,9 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(nsIFile *aFile) | ||
aFile->GetNativePath(nativePath); | ||
|
||
#if defined(MOZ_ENABLE_CONTENTACTION) | ||
- QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(nativePath.get())); | ||
+ QUrl localFileUri = QUrl::fromLocalFile(QString::fromUtf8(nativePath.get())); | ||
ContentAction::Action action = | ||
- ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get())); | ||
+ ContentAction::Action::defaultActionForFile(localFileUri, QString(mSchemeOrType.get())); | ||
if (action.isValid()) { | ||
action.trigger(); | ||
return NS_OK; | ||
diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp | ||
index 84e1cf5b040b..3fda2378ee55 100644 | ||
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp | ||
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp | ||
@@ -8,7 +8,7 @@ | ||
#include <sys/stat.h> | ||
|
||
#if defined(MOZ_ENABLE_CONTENTACTION) | ||
-#include <contentaction/contentaction.h> | ||
+#include <contentaction5/contentaction.h> | ||
#include <QString> | ||
#endif | ||
|
||
diff --git a/xpcom/io/moz.build b/xpcom/io/moz.build | ||
index 45732e4cbf2f..c6cc71ee793e 100644 | ||
--- a/xpcom/io/moz.build | ||
+++ b/xpcom/io/moz.build | ||
@@ -135,3 +135,5 @@ if CONFIG['OS_ARCH'] == 'Linux' and 'lib64' in CONFIG['libdir']: | ||
DEFINES['HAVE_USR_LIB64_DIR'] = True | ||
|
||
LOCAL_INCLUDES += ['!..'] | ||
+ | ||
+CXXFLAGS += CONFIG['TK_CFLAGS'] | ||
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp | ||
index 74c5bf072b71..d88ede495b7a 100644 | ||
--- a/xpcom/io/nsLocalFileUnix.cpp | ||
+++ b/xpcom/io/nsLocalFileUnix.cpp | ||
@@ -71,7 +71,7 @@ static nsresult MacErrorMapper(OSErr inErr); | ||
#endif | ||
|
||
#ifdef MOZ_ENABLE_CONTENTACTION | ||
-#include <contentaction/contentaction.h> | ||
+#include <contentaction5/contentaction.h> | ||
#endif | ||
|
||
#include "nsNativeCharsetUtils.h" | ||
-- | ||
2.24.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters