Skip to content

Commit

Permalink
[nemo][gecko] Handle temporary directory similarly as in MacOSX. JB#4…
Browse files Browse the repository at this point in the history
…9155
  • Loading branch information
rainemak committed Mar 11, 2020
1 parent db4c73e commit d8eab9a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions rpm/0020-Handle-temporary-directory-similarly-as-in-MacOSX.patch
@@ -0,0 +1,42 @@
From 2ec4c9eb195e400b4245b5ec38d77f5e20df2598 Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Tue, 10 Mar 2020 15:06:39 +0200
Subject: [PATCH 20/20] Handle temporary directory similarly as in MacOSX

Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com>
---
uriloader/exthandler/nsExternalHelperAppService.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
index 39f066aff0f3..f5a2445a0627 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -284,7 +284,7 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
bool aSkipChecks = false)
{
nsCOMPtr<nsIFile> dir;
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX) || defined(XP_UNIX)
// On OS X, we first try to get the users download location, if it's set.
switch (Preferences::GetInt(NS_PREF_DOWNLOAD_FOLDERLIST, -1)) {
case NS_FOLDER_VALUE_DESKTOP:
@@ -321,8 +321,14 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
}

if (!dir) {
+#if defined(XP_MACOSX)
+ const char* specialDirName = NS_OSX_DEFAULT_DOWNLOAD_DIR;
+#else
+ const char* specialDirName = NS_UNIX_DEFAULT_DOWNLOAD_DIR;
+#endif
+
// If not, we default to the OS X default download location.
- nsresult rv = NS_GetSpecialDirectory(NS_OSX_DEFAULT_DOWNLOAD_DIR,
+ nsresult rv = NS_GetSpecialDirectory(specialDirName,
getter_AddRefs(dir));
NS_ENSURE_SUCCESS(rv, rv);
}
--
2.24.1

2 changes: 2 additions & 0 deletions rpm/xulrunner-qt5.spec
Expand Up @@ -62,6 +62,7 @@ Patch16: 0016-Cleanup-build-configuration.-Fixes-JB-44612.patch
Patch17: 0017-Make-gc-stats-work-with-gcc8.patch
Patch18: 0018-Use-libcontentaction-for-custom-schem.patch
Patch19: 0019-Allow-compositor-specializations-to-override-the-com.patch
Patch20: 0020-Handle-temporary-directory-similarly-as-in-MacOSX.patch

BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Network)
Expand Down Expand Up @@ -170,6 +171,7 @@ Tests and misc files for xulrunner.
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1

mkdir -p "%BUILD_DIR"
cp -rf "%BASE_CONFIG" "%BUILD_DIR"/mozconfig
Expand Down

0 comments on commit d8eab9a

Please sign in to comment.