|
|
|
@ -45,7 +45,7 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
|
|
|
|
|
#include "prefapi.h"
|
|
|
|
|
#include "prefread.h"
|
|
|
|
|
#include "prefapi_private_data.h"
|
|
|
|
|
@@ -907,16 +908,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
|
|
|
|
|
@@ -896,16 +897,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
|
|
|
|
|
|
|
|
|
|
static nsresult pref_LoadPrefsInDirList(const char *listId)
|
|
|
|
|
{
|
|
|
|
@ -80,7 +80,7 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
|
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
|
|
bool hasMore;
|
|
|
|
|
@@ -932,17 +951,17 @@ static nsresult pref_LoadPrefsInDirList(
|
|
|
|
|
@@ -921,17 +940,17 @@ static nsresult pref_LoadPrefsInDirList(
|
|
|
|
|
|
|
|
|
|
nsCAutoString leaf;
|
|
|
|
|
path->GetNativeLeafName(leaf);
|
|
|
|
@ -89,7 +89,7 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
|
|
|
|
|
if (Substring(leaf, leaf.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi")))
|
|
|
|
|
ReadExtensionPrefs(path);
|
|
|
|
|
else
|
|
|
|
|
- pref_LoadPrefsInDir(path, nsnull, 0);
|
|
|
|
|
- pref_LoadPrefsInDir(path, nullptr, 0);
|
|
|
|
|
+ pref_LoadPrefsInDir(path, specialFiles, NS_ARRAY_LENGTH(specialFiles));
|
|
|
|
|
}
|
|
|
|
|
return NS_OK;
|
|
|
|
@ -99,7 +99,7 @@ diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferenc
|
|
|
|
|
{
|
|
|
|
|
nsZipItemPtr<char> manifest(jarReader, name, true);
|
|
|
|
|
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
|
|
|
|
|
@@ -1036,28 +1055,40 @@ static nsresult pref_InitInitialObjects(
|
|
|
|
|
@@ -1025,28 +1044,40 @@ static nsresult pref_InitInitialObjects(
|
|
|
|
|
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
|
|
|
|
|
static const char* specialFiles[] = {
|
|
|
|
|
#if defined(XP_MACOSX)
|
|
|
|
@ -198,12 +198,12 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
|
|
|
|
|
+ nsKDEUtils::command( command );
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // begin non-KDE block
|
|
|
|
|
PRInt32 alertInterval = 2000;
|
|
|
|
|
int32_t alertInterval = 2000;
|
|
|
|
|
if (pref)
|
|
|
|
|
pref->GetIntPref(PREF_BDM_SHOWALERTINTERVAL, &alertInterval);
|
|
|
|
|
|
|
|
|
|
PRInt64 alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
|
|
|
|
|
PRInt64 goat = PR_Now() - mStartTime;
|
|
|
|
|
int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
|
|
|
|
|
int64_t goat = PR_Now() - mStartTime;
|
|
|
|
|
showTaskbarAlert = goat > alertIntervalUSec;
|
|
|
|
|
|
|
|
|
|
@@ -2266,19 +2279,20 @@ nsDownload::SetState(DownloadState aStat
|
|
|
|
@ -2068,8 +2068,7 @@ new file mode 100644
|
|
|
|
|
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
|
|
|
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
|
|
|
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
|
|
|
|
|
@@ -12,16 +12,18 @@
|
|
|
|
|
#include "nsArrayUtils.h"
|
|
|
|
|
@@ -13,16 +13,19 @@
|
|
|
|
|
#include "prnetdb.h"
|
|
|
|
|
#include "prenv.h"
|
|
|
|
|
#include "nsPrintfCString.h"
|
|
|
|
@ -2077,24 +2076,26 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
|
|
|
|
|
#include "nsISupportsPrimitives.h"
|
|
|
|
|
#include "nsIGSettingsService.h"
|
|
|
|
|
#include "nsInterfaceHashtable.h"
|
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
|
+#include "nsVoidArray.h"
|
|
|
|
|
+#include "nsKDEUtils.h"
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
class nsUnixSystemProxySettings : public nsISystemProxySettings {
|
|
|
|
|
class nsUnixSystemProxySettings MOZ_FINAL : public nsISystemProxySettings {
|
|
|
|
|
public:
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
NS_DECL_NSISYSTEMPROXYSETTINGS
|
|
|
|
|
|
|
|
|
|
nsUnixSystemProxySettings() {}
|
|
|
|
|
nsresult Init();
|
|
|
|
|
@@ -33,16 +35,17 @@ private:
|
|
|
|
|
@@ -34,16 +37,17 @@ private:
|
|
|
|
|
nsCOMPtr<nsIGSettingsService> mGSettings;
|
|
|
|
|
nsCOMPtr<nsIGSettingsCollection> mProxySettings;
|
|
|
|
|
nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
|
|
|
|
|
bool IsProxyMode(const char* aMode);
|
|
|
|
|
nsresult SetProxyResultFromGConf(const char* aKeyBase, const char* aType, nsACString& aResult);
|
|
|
|
|
nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
|
|
|
|
|
nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
|
|
|
|
|
nsresult GetProxyFromGConf(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult);
|
|
|
|
|
nsresult GetProxyFromGSettings(const nsACString& aScheme, const nsACString& aHost, int32_t aPort, nsACString& aResult);
|
|
|
|
|
nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult);
|
|
|
|
|
+ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
|
|
|
|
|
};
|
|
|
|
@ -2105,12 +2106,12 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
|
|
|
|
|
nsUnixSystemProxySettings::Init()
|
|
|
|
|
{
|
|
|
|
|
// If this is a GNOME session, load gconf and try to use its preferences.
|
|
|
|
|
@@ -495,16 +498,19 @@ nsUnixSystemProxySettings::GetProxyForUR
|
|
|
|
|
@@ -496,16 +500,19 @@ nsUnixSystemProxySettings::GetProxyForUR
|
|
|
|
|
nsCAutoString host;
|
|
|
|
|
rv = aURI->GetHost(host);
|
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
|
|
PRInt32 port;
|
|
|
|
|
int32_t port;
|
|
|
|
|
rv = aURI->GetPort(&port);
|
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
|
@ -2125,7 +2126,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
|
|
|
|
|
if (mGConf)
|
|
|
|
|
return GetProxyFromGConf(scheme, host, port, aResult);
|
|
|
|
|
|
|
|
|
|
@@ -530,8 +536,34 @@ static const mozilla::Module::ContractID
|
|
|
|
|
@@ -531,8 +538,34 @@ static const mozilla::Module::ContractID
|
|
|
|
|
|
|
|
|
|
static const mozilla::Module kUnixProxyModule = {
|
|
|
|
|
mozilla::Module::kVersion,
|
|
|
|
@ -2187,43 +2188,11 @@ diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/toolkit/xre/nsKDEUtils.cpp
|
|
|
|
|
@@ -0,0 +1,373 @@
|
|
|
|
|
@@ -0,0 +1,341 @@
|
|
|
|
|
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
|
+/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is Unix Native App Support.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * Mozilla Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 2007
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
|
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#include "nsKDEUtils.h"
|
|
|
|
|
+#include "nsIWidget.h"
|
|
|
|
@ -2565,44 +2534,11 @@ diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/toolkit/xre/nsKDEUtils.h
|
|
|
|
|
@@ -0,0 +1,81 @@
|
|
|
|
|
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is Mozilla Communicator client code.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * Netscape Communications Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
|
+ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
@@ -0,0 +1,48 @@
|
|
|
|
|
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#ifndef nsKDEUtils_h__
|
|
|
|
|
+#define nsKDEUtils_h__
|
|
|
|
@ -2675,44 +2611,11 @@ diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandl
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
|
|
|
|
|
@@ -0,0 +1,87 @@
|
|
|
|
|
@@ -0,0 +1,54 @@
|
|
|
|
|
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
|
+/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is the GNOME helper app implementation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * IBM Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ * Brian Ryner <bryner@brianryner.com> (Original Author)
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
|
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#include "nsCommonRegistry.h"
|
|
|
|
|
+
|
|
|
|
@ -2767,43 +2670,10 @@ diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/uriloader/exthandler/unix/nsCommonRegistry.h
|
|
|
|
|
@@ -0,0 +1,56 @@
|
|
|
|
|
+/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is the GNOME helper app implementation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * IBM Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ * Brian Ryner <bryner@brianryner.com> (Original Author)
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
|
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
@@ -0,0 +1,23 @@
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#include "nsIURI.h"
|
|
|
|
|
+#include "nsCOMPtr.h"
|
|
|
|
@ -2828,44 +2698,11 @@ diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
|
|
|
|
|
@@ -0,0 +1,119 @@
|
|
|
|
|
@@ -0,0 +1,86 @@
|
|
|
|
|
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
|
+/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is the GNOME helper app implementation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * IBM Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ * Brian Ryner <bryner@brianryner.com> (Original Author)
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
|
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#include "nsKDERegistry.h"
|
|
|
|
|
+#include "prlink.h"
|
|
|
|
@ -2936,7 +2773,7 @@ new file mode 100644
|
|
|
|
|
+ {
|
|
|
|
|
+ nsCString mimetype = output[ 0 ];
|
|
|
|
|
+ nsRefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix( mimetype );
|
|
|
|
|
+ NS_ENSURE_TRUE(mimeInfo, nsnull);
|
|
|
|
|
+ NS_ENSURE_TRUE(mimeInfo, nullptr);
|
|
|
|
|
+ nsCString description = output[ 1 ];
|
|
|
|
|
+ mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description));
|
|
|
|
|
+ nsCString handlerAppName = output[ 2 ];
|
|
|
|
@ -2946,49 +2783,16 @@ new file mode 100644
|
|
|
|
|
+ NS_ADDREF((retval = mimeInfo));
|
|
|
|
|
+ return retval;
|
|
|
|
|
+ }
|
|
|
|
|
+ return nsnull;
|
|
|
|
|
+ return nullptr;
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h
|
|
|
|
|
new file mode 100644
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/uriloader/exthandler/unix/nsKDERegistry.h
|
|
|
|
|
@@ -0,0 +1,62 @@
|
|
|
|
|
+/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
|
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
|
+ *
|
|
|
|
|
+ * The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
|
+ * 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
|
+ * the License. You may obtain a copy of the License at
|
|
|
|
|
+ * http://www.mozilla.org/MPL/
|
|
|
|
|
+ *
|
|
|
|
|
+ * Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
|
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
|
+ * for the specific language governing rights and limitations under the
|
|
|
|
|
+ * License.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Original Code is the GNOME helper app implementation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The Initial Developer of the Original Code is
|
|
|
|
|
+ * IBM Corporation.
|
|
|
|
|
+ * Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
|
+ * the Initial Developer. All Rights Reserved.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Contributor(s):
|
|
|
|
|
+ * Brian Ryner <bryner@brianryner.com> (Original Author)
|
|
|
|
|
+ *
|
|
|
|
|
+ * Alternatively, the contents of this file may be used under the terms of
|
|
|
|
|
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
|
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
|
+ * in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
|
+ * of those above. If you wish to allow use of your version of this file only
|
|
|
|
|
+ * under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
|
+ * use your version of this file under the terms of the MPL, indicate your
|
|
|
|
|
+ * decision by deleting the provisions above and replace them with the notice
|
|
|
|
|
+ * and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
|
+ * the provisions above, a recipient may use your version of this file under
|
|
|
|
|
+ * the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
|
+ *
|
|
|
|
|
+ * ***** END LICENSE BLOCK ***** */
|
|
|
|
|
@@ -0,0 +1,29 @@
|
|
|
|
|
+/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
+
|
|
|
|
|
+#include "nsIURI.h"
|
|
|
|
|
+#include "nsCOMPtr.h"
|
|
|
|
@ -3049,11 +2853,11 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
|
|
|
|
|
|
|
|
|
|
#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
|
|
|
|
|
if (NS_FAILED(rv)){
|
|
|
|
|
HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nsnull);
|
|
|
|
|
HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nullptr);
|
|
|
|
|
if (action) {
|
|
|
|
|
nsCAutoString spec;
|
|
|
|
|
aURI->GetAsciiSpec(spec);
|
|
|
|
|
if (hildon_uri_open(spec.get(), action, nsnull))
|
|
|
|
|
if (hildon_uri_open(spec.get(), action, nullptr))
|
|
|
|
|
@@ -61,22 +64,22 @@ nsMIMEInfoUnix::LoadUriInternal(nsIURI *
|
|
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
@ -3207,7 +3011,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
|
|
|
|
|
majorType,
|
|
|
|
|
@@ -1391,17 +1391,17 @@ nsOSHelperAppService::GetFromType(const
|
|
|
|
|
#ifdef MOZ_WIDGET_GTK2
|
|
|
|
|
nsMIMEInfoBase *gnomeInfo = nsnull;
|
|
|
|
|
nsMIMEInfoBase *gnomeInfo = nullptr;
|
|
|
|
|
if (handler.IsEmpty()) {
|
|
|
|
|
// No useful data yet. Check the GNOME registry. Unfortunately, newer
|
|
|
|
|
// GNOME versions no longer have type-to-extension mappings, so we might
|
|
|
|
@ -3227,7 +3031,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
|
|
|
|
|
diff --git a/widget/gtk2/Makefile.in b/widget/gtk2/Makefile.in
|
|
|
|
|
--- a/widget/gtk2/Makefile.in
|
|
|
|
|
+++ b/widget/gtk2/Makefile.in
|
|
|
|
|
@@ -105,11 +105,14 @@ DEFINES += -DCAIRO_GFX -DMOZ_APP_NAME='
|
|
|
|
|
@@ -104,11 +104,14 @@ DEFINES += -DCAIRO_GFX -DMOZ_APP_NAME='
|
|
|
|
|
|
|
|
|
|
INCLUDES += \
|
|
|
|
|
-I$(srcdir)/../xpwidgets \
|
|
|
|
@ -3281,7 +3085,7 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
|
|
|
|
|
using namespace mozilla;
|
|
|
|
|
|
|
|
|
|
#define MAX_PREVIEW_SIZE 180
|
|
|
|
|
@@ -252,17 +254,19 @@ nsFilePicker::AppendFilters(PRInt32 aFil
|
|
|
|
|
@@ -264,17 +266,19 @@ nsFilePicker::AppendFilters(int32_t aFil
|
|
|
|
|
return nsBaseFilePicker::AppendFilters(aFilterMask);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3302,34 +3106,34 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
|
|
|
|
|
|
|
|
|
|
mFilters.AppendElement(filter);
|
|
|
|
|
mFilterNames.AppendElement(name);
|
|
|
|
|
@@ -357,16 +361,19 @@ nsFilePicker::GetFiles(nsISimpleEnumerat
|
|
|
|
|
@@ -369,16 +373,19 @@ nsFilePicker::GetFiles(nsISimpleEnumerat
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
|
nsFilePicker::Show(PRInt16 *aReturn)
|
|
|
|
|
nsFilePicker::Show(int16_t *aReturn)
|
|
|
|
|
{
|
|
|
|
|
NS_ENSURE_ARG_POINTER(aReturn);
|
|
|
|
|
|
|
|
|
|
+ if( nsKDEUtils::kdeSupport())
|
|
|
|
|
+ return kdeFileDialog(aReturn);
|
|
|
|
|
+
|
|
|
|
|
nsXPIDLCString title;
|
|
|
|
|
title.Adopt(ToNewUTF8String(mTitle));
|
|
|
|
|
nsresult rv = Open(nullptr);
|
|
|
|
|
if (NS_FAILED(rv))
|
|
|
|
|
return rv;
|
|
|
|
|
|
|
|
|
|
GtkWindow *parent_widget = get_gtk_window_for_nsiwidget(mParentWidget);
|
|
|
|
|
|
|
|
|
|
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
|
|
|
|
|
const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
|
|
|
|
|
? GTK_STOCK_SAVE : GTK_STOCK_OPEN;
|
|
|
|
|
@@ -505,8 +512,234 @@ nsFilePicker::Show(PRInt16 *aReturn)
|
|
|
|
|
*aReturn = nsIFilePicker::returnCancel;
|
|
|
|
|
break;
|
|
|
|
|
while (mRunning) {
|
|
|
|
|
g_main_context_iteration(nullptr, TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gtk_widget_destroy(file_chooser);
|
|
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
|
@@ -587,8 +594,235 @@ nsFilePicker::Done(GtkWidget* file_choos
|
|
|
|
|
if (mCallback) {
|
|
|
|
|
mCallback->Done(result);
|
|
|
|
|
mCallback = nullptr;
|
|
|
|
|
} else {
|
|
|
|
|
mResult = result;
|
|
|
|
|
}
|
|
|
|
|
NS_RELEASE_THIS();
|
|
|
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+nsCString nsFilePicker::kdeMakeFilter( int index )
|
|
|
|
@ -3557,10 +3361,11 @@ diff --git a/widget/gtk2/nsFilePicker.cpp b/widget/gtk2/nsFilePicker.cpp
|
|
|
|
|
+ }
|
|
|
|
|
+ return NS_OK;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
diff --git a/widget/gtk2/nsFilePicker.h b/widget/gtk2/nsFilePicker.h
|
|
|
|
|
--- a/widget/gtk2/nsFilePicker.h
|
|
|
|
|
+++ b/widget/gtk2/nsFilePicker.h
|
|
|
|
|
@@ -57,11 +57,17 @@ protected:
|
|
|
|
|
@@ -67,11 +67,17 @@ protected:
|
|
|
|
|
nsString mDefault;
|
|
|
|
|
nsString mDefaultExtension;
|
|
|
|
|
|
|
|
|
@ -3835,7 +3640,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
@@ -1823,16 +1831,23 @@ nsLocalFile::Launch()
|
|
|
|
|
|
|
|
|
|
if (nsnull == connection)
|
|
|
|
|
if (nullptr == connection)
|
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
|
|
|
|
|
|
if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS)
|
|
|
|
|