mozilla-kde.patch
changeset 738 f118b88b7d7f
parent 718 6cb1ac7cd223
child 745 3e65dc8b9b4f
child 748 72ba5129e5fd
--- a/mozilla-kde.patch	Sat May 03 10:14:44 2014 +0200
+++ b/mozilla-kde.patch	Wed May 28 22:17:03 2014 +0200
@@ -44,7 +44,7 @@
  #include "prefread.h"
  #include "prefapi_private_data.h"
  
-@@ -1119,16 +1120,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
+@@ -1134,16 +1135,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
  
  static nsresult pref_LoadPrefsInDirList(const char *listId)
  {
@@ -79,7 +79,7 @@
      return NS_OK;
  
    bool hasMore;
-@@ -1144,17 +1163,17 @@ static nsresult pref_LoadPrefsInDirList(
+@@ -1159,17 +1178,17 @@ static nsresult pref_LoadPrefsInDirList(
  
      nsAutoCString leaf;
      path->GetNativeLeafName(leaf);
@@ -98,7 +98,7 @@
  {
    nsZipItemPtr<char> manifest(jarReader, name, true);
    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
-@@ -1248,26 +1267,38 @@ static nsresult pref_InitInitialObjects(
+@@ -1263,26 +1282,38 @@ 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)
@@ -196,7 +196,7 @@
 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
 --- a/toolkit/components/downloads/nsDownloadManager.cpp
 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
-@@ -42,16 +42,20 @@
+@@ -43,16 +43,20 @@
  #ifdef XP_WIN
  #include <shlobj.h>
  #include "nsWindowsHelpers.h"
@@ -217,7 +217,7 @@
  #include "AndroidBridge.h"
  using namespace mozilla::widget::android;
  #endif
-@@ -2695,16 +2699,25 @@ nsDownload::SetState(DownloadState aStat
+@@ -2722,16 +2726,25 @@ nsDownload::SetState(DownloadState aStat
        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
  
        // Master pref to control this function.
@@ -243,7 +243,7 @@
          int64_t goat = PR_Now() - mStartTime;
          showTaskbarAlert = goat > alertIntervalUSec;
  
-@@ -2732,19 +2745,20 @@ nsDownload::SetState(DownloadState aStat
+@@ -2759,19 +2772,20 @@ nsDownload::SetState(DownloadState aStat
                // because if it is, they'll click open the download manager and
                // the items they downloaded will have been removed.
                alerts->ShowAlertNotification(
@@ -268,7 +268,7 @@
 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
 --- a/toolkit/content/jar.mn
 +++ b/toolkit/content/jar.mn
-@@ -56,29 +56,33 @@ toolkit.jar:
+@@ -58,29 +58,33 @@ toolkit.jar:
     content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
     content/global/bindings/browser.xml         (widgets/browser.xml)
@@ -290,7 +290,7 @@
     content/global/bindings/menulist.xml        (widgets/menulist.xml)
     content/global/bindings/notification.xml    (widgets/notification.xml)
     content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
-    content/global/bindings/popup.xml           (widgets/popup.xml)
+ *  content/global/bindings/popup.xml           (widgets/popup.xml)
  *+ content/global/bindings/preferences.xml     (widgets/preferences.xml)
 +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
 +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
@@ -760,7 +760,7 @@
 new file mode 100644
 --- /dev/null
 +++ b/toolkit/content/widgets/preferences-kde.xml
-@@ -0,0 +1,1334 @@
+@@ -0,0 +1,1333 @@
 +<?xml version="1.0"?>
 +
 +<!DOCTYPE bindings [
@@ -1335,9 +1335,8 @@
 +          <children includes="prefpane"/>
 +        </xul:deck>
 +      </xul:hbox>
-+      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons"
++      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" pack="end">
 +#ifdef XP_UNIX_GNOME
-+                >
 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
 +        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
@@ -1346,16 +1345,14 @@
 +        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
 +#elif XP_UNIX
-+                pack="end">
-+	<xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
-+	<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
-+	<xul:spacer anonid="spacer" flex="1"/>
-+	<xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
-+	<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
-+	<xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
-+	<xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
++        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
++        <xul:spacer anonid="spacer" flex="1"/>
++        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
++        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
++        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
++        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
++        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
 +#else
-+                pack="end">
 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
 +        <xul:spacer anonid="spacer" flex="1"/>
 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
@@ -1384,6 +1381,8 @@
 +#ifdef XP_MACOSX
 +            // no buttons on Mac except Help
 +            cancelButton.hidden = true;
++            // Move Help button to the end
++            document.getAnonymousElementByAttribute(this, "anonid", "spacer").hidden = true;         
 +            // Also, don't fire onDialogAccept on enter
 +            acceptButton.disabled = true;
 +#else
@@ -2129,7 +2128,7 @@
 +  nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
  };
  
- NS_IMPL_ISUPPORTS1(nsUnixSystemProxySettings, nsISystemProxySettings)
+ NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
  
  NS_IMETHODIMP
  nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly)
@@ -2900,32 +2899,35 @@
      if (QDesktopServices::openUrl(QUrl(spec.get()))) {
        rv = NS_OK;
      }
-@@ -48,22 +51,22 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
- {
-   // if mDefaultApplication is set, it means the application has been set from
+@@ -50,24 +53,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
    // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
    // give the GNOME answer.
    if (mDefaultApplication)
      return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
  
    *_retval = false;
--  nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
-+  nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
-   if (!mimeInfo) {
-     nsAutoCString ext;
-     nsresult rv = GetPrimaryExtension(ext);
-     if (NS_SUCCEEDED(rv)) {
--      mimeInfo = nsGNOMERegistry::GetFromExtension(ext);
-+      mimeInfo = nsCommonRegistry::GetFromExtension(ext);
+ 
+   if (mClass ==  eProtocolInfo) {
+-    *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
++    *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
+   } else {
+-    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
++    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
+     if (!mimeInfo) {
+       nsAutoCString ext;
+       nsresult rv = GetPrimaryExtension(ext);
+       if (NS_SUCCEEDED(rv)) {
+-        mimeInfo = nsGNOMERegistry::GetFromExtension(ext);
++        mimeInfo = nsCommonRegistry::GetFromExtension(ext);
+       }
      }
+     if (mimeInfo)
+       *_retval = true;
    }
-   if (mimeInfo)
-     *_retval = true;
  
    if (*_retval)
      return NS_OK;
- 
-@@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
+@@ -102,16 +105,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
      ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
    if (action.isValid()) {
      action.trigger();
@@ -2959,7 +2961,7 @@
      nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
      NS_ENSURE_SUCCESS(rv, rv);
      nsCOMPtr<nsIURI> uri;
-@@ -124,17 +144,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
+@@ -129,17 +149,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
      /* Fallback to GnomeVFS */
      nsCOMPtr<nsIGnomeVFSMimeApp> app;
      if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app)
@@ -3000,7 +3002,7 @@
  #include "nsXPIDLString.h"
  #include "nsIURL.h"
  #include "nsIFileStreams.h"
-@@ -1157,26 +1157,26 @@ nsresult nsOSHelperAppService::OSProtoco
+@@ -1146,26 +1146,26 @@ nsresult nsOSHelperAppService::OSProtoco
      ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':');
  
    if (action.isValid())
@@ -3029,12 +3031,12 @@
  
  nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
  {
-@@ -1263,17 +1263,17 @@ nsOSHelperAppService::GetFromExtension(c
+@@ -1252,17 +1252,17 @@ nsOSHelperAppService::GetFromExtension(c
                                           mime_types_description,
                                           true);
  
    if (NS_FAILED(rv) || majorType.IsEmpty()) {
-     
+ 
  #ifdef MOZ_WIDGET_GTK
      LOG(("Looking in GNOME registry\n"));
      nsRefPtr<nsMIMEInfoBase> gnomeInfo =
@@ -3048,14 +3050,14 @@
  
      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
                                    majorType,
-@@ -1386,17 +1386,17 @@ nsOSHelperAppService::GetFromType(const 
+@@ -1372,17 +1372,17 @@ nsOSHelperAppService::GetFromType(const 
  #ifdef MOZ_WIDGET_GTK
    nsRefPtr<nsMIMEInfoBase> gnomeInfo;
    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
      // get back a MIMEInfo without any extensions set.  In that case we'll have
-     // to look in our mime.types files for the extensions.    
+     // to look in our mime.types files for the extensions.
      LOG(("Looking in GNOME registry\n"));
 -    gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
 +    gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
@@ -3143,7 +3145,7 @@
  
    mFilters.AppendElement(filter);
    mFilterNames.AppendElement(name);
-@@ -350,16 +354,32 @@ nsFilePicker::Show(int16_t *aReturn)
+@@ -351,16 +355,32 @@ nsFilePicker::Show(int16_t *aReturn)
  
  NS_IMETHODIMP
  nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
@@ -3176,7 +3178,7 @@
  
    GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
    const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
-@@ -538,8 +558,235 @@ nsFilePicker::Done(GtkWidget* file_choos
+@@ -539,8 +559,235 @@ nsFilePicker::Done(GtkWidget* file_choos
    if (mCallback) {
      mCallback->Done(result);
      mCallback = nullptr;
@@ -3600,7 +3602,7 @@
  #include "prmem.h"
  #include "plbase64.h"
  
-@@ -1813,46 +1814,52 @@ nsLocalFile::SetPersistentDescriptor(con
+@@ -1816,46 +1817,52 @@ nsLocalFile::SetPersistentDescriptor(con
      return InitWithNativePath(aPersistentDescriptor);
  #endif
  }
@@ -3667,7 +3669,7 @@
        return rv;
      }
      return NS_ERROR_FAILURE;
-@@ -1860,16 +1867,23 @@ nsLocalFile::Reveal()
+@@ -1863,16 +1870,23 @@ nsLocalFile::Reveal()
      return NS_ERROR_FAILURE;
  #endif
  }