mozilla-kde.patch
changeset 850 a2bdff616a0e
parent 837 a1f740acf68e
child 868 284da266ec46
child 888 b94dace970c6
equal deleted inserted replaced
845:a704b2a17e39 850:a2bdff616a0e
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  2b183c17f6e4693372442af1a8ee0be364f8cba0
     2 # Parent  214f99f3ce4f1f8ae9b3d18da44e5d66b3105663
     3 Description: Add KDE integration to Firefox (toolkit parts)
     3 Description: Add KDE integration to Firefox (toolkit parts)
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     5 Author: Lubos Lunak <lunak@suse.com>
     5 Author: Lubos Lunak <lunak@suse.com>
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
  1834 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
  1834 +                    .getService(Components.interfaces.nsIScriptSecurityManager);
  1835 +        if (this.type == "child" && window.opener &&
  1835 +        if (this.type == "child" && window.opener &&
  1836 +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
  1836 +            secMan.isSystemPrincipal(window.opener.document.nodePrincipal)) {
  1837 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1837 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1838 +                               .getService(Components.interfaces.nsIPrefBranch);
  1838 +                               .getService(Components.interfaces.nsIPrefBranch);
  1839 +          var instantApply = psvc.getBoolPref("browser.preferences.instantApply");
  1839 +          var pdocEl = window.opener.document.documentElement;
  1840 +          if (instantApply) {
  1840 +          if (pdocEl.instantApply) {
  1841 +            var panes = this.preferencePanes;
  1841 +            var panes = this.preferencePanes;
  1842 +            for (var i = 0; i < panes.length; ++i)
  1842 +            for (var i = 0; i < panes.length; ++i)
  1843 +              panes[i].writePreferences(true);
  1843 +              panes[i].writePreferences(true);
  1844 +          }
  1844 +          }
  1845 +          else {
  1845 +          else {
  2134  #include "mozilla/Attributes.h"
  2134  #include "mozilla/Attributes.h"
  2135  #include "nsIURI.h"
  2135  #include "nsIURI.h"
  2136 +#include "nsVoidArray.h"
  2136 +#include "nsVoidArray.h"
  2137 +#include "nsKDEUtils.h"
  2137 +#include "nsKDEUtils.h"
  2138  
  2138  
  2139  class nsUnixSystemProxySettings MOZ_FINAL : public nsISystemProxySettings {
  2139  class nsUnixSystemProxySettings final : public nsISystemProxySettings {
  2140  public:
  2140  public:
  2141    NS_DECL_ISUPPORTS
  2141    NS_DECL_ISUPPORTS
  2142    NS_DECL_NSISYSTEMPROXYSETTINGS
  2142    NS_DECL_NSISYSTEMPROXYSETTINGS
  2143  
  2143  
  2144    nsUnixSystemProxySettings()
  2144    nsUnixSystemProxySettings()
  2217 +}
  2217 +}
  2218 +
  2218 +
  2219 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2219 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2220 --- a/toolkit/xre/moz.build
  2220 --- a/toolkit/xre/moz.build
  2221 +++ b/toolkit/xre/moz.build
  2221 +++ b/toolkit/xre/moz.build
  2222 @@ -43,17 +43,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
  2222 @@ -45,17 +45,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt
  2223      GENERATED_SOURCES += [
  2223      GENERATED_SOURCES += [
  2224          'moc_nsNativeAppSupportQt.cpp',
  2224          'moc_nsNativeAppSupportQt.cpp',
  2225      ]
  2225      ]
  2226      SOURCES += [
  2226      SOURCES += [
  2227          'nsNativeAppSupportQt.cpp',
  2227          'nsNativeAppSupportQt.cpp',
  2664  FINAL_LIBRARY = 'xul'
  2664  FINAL_LIBRARY = 'xul'
  2665  
  2665  
  2666  LOCAL_INCLUDES += [
  2666  LOCAL_INCLUDES += [
  2667      '/dom/base',
  2667      '/dom/base',
  2668      '/dom/ipc',
  2668      '/dom/ipc',
  2669      '/netwerk/base/src',
  2669      '/netwerk/base',
  2670      '/netwerk/protocol/http',
  2670      '/netwerk/protocol/http',
  2671 +    '/toolkit/xre'
  2671 +    '/toolkit/xre',
  2672  ]
  2672  ]
  2673  
  2673  
  2674  if CONFIG['MOZ_ENABLE_DBUS']:
  2674  if CONFIG['MOZ_ENABLE_DBUS']:
  2675      CXXFLAGS += CONFIG['TK_CFLAGS']
  2675      CXXFLAGS += CONFIG['TK_CFLAGS']
  2676      CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
  2676      CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
  2902 +
  2902 +
  2903 +#endif //nsKDERegistry_h__
  2903 +#endif //nsKDERegistry_h__
  2904 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2904 diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2905 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2905 --- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2906 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2906 +++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
  2907 @@ -7,33 +7,36 @@
  2907 @@ -7,32 +7,35 @@
  2908  #ifdef MOZ_WIDGET_QT
  2908  #ifdef MOZ_WIDGET_QT
  2909  #if (MOZ_ENABLE_CONTENTACTION)
  2909  #if (MOZ_ENABLE_CONTENTACTION)
  2910  #include <contentaction/contentaction.h>
  2910  #include <contentaction/contentaction.h>
  2911  #include "nsContentHandlerApp.h"
  2911  #include "nsContentHandlerApp.h"
  2912  #endif
  2912  #endif
  2916 -#include "nsGNOMERegistry.h"
  2916 -#include "nsGNOMERegistry.h"
  2917 +#include "nsCommonRegistry.h"
  2917 +#include "nsCommonRegistry.h"
  2918  #include "nsIGIOService.h"
  2918  #include "nsIGIOService.h"
  2919  #include "nsNetCID.h"
  2919  #include "nsNetCID.h"
  2920  #include "nsIIOService.h"
  2920  #include "nsIIOService.h"
  2921  #include "nsIGnomeVFSService.h"
       
  2922  #include "nsAutoPtr.h"
  2921  #include "nsAutoPtr.h"
  2923  #ifdef MOZ_ENABLE_DBUS
  2922  #ifdef MOZ_ENABLE_DBUS
  2924  #include "nsDBusHandlerApp.h"
  2923  #include "nsDBusHandlerApp.h"
  2925  #endif
  2924  #endif
  2926  #ifdef MOZ_WIDGET_QT
  2925  #ifdef MOZ_WIDGET_QT
  2941      rv = nsMIMEInfoQt::LoadUriInternal(aURI);
  2940      rv = nsMIMEInfoQt::LoadUriInternal(aURI);
  2942    }
  2941    }
  2943  #endif
  2942  #endif
  2944  
  2943  
  2945    return rv;
  2944    return rv;
  2946 @@ -46,24 +49,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
  2945 @@ -45,24 +48,24 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
  2947    // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
  2946    // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
  2948    // give the GNOME answer.
  2947    // give the GNOME answer.
  2949    if (mDefaultApplication)
  2948    if (mDefaultApplication)
  2950      return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
  2949      return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
  2951  
  2950  
  2952    *_retval = false;
  2951    *_retval = false;
  2953  
  2952  
  2954    if (mClass ==  eProtocolInfo) {
  2953    if (mClass == eProtocolInfo) {
  2955 -    *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
  2954 -    *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
  2956 +    *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
  2955 +    *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
  2957    } else {
  2956    } else {
  2958 -    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
  2957 -    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromType(mSchemeOrType);
  2959 +    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
  2958 +    nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromType(mSchemeOrType);
  2969        *_retval = true;
  2968        *_retval = true;
  2970    }
  2969    }
  2971  
  2970  
  2972    if (*_retval)
  2971    if (*_retval)
  2973      return NS_OK;
  2972      return NS_OK;
  2974 @@ -98,16 +101,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
  2973 @@ -97,16 +100,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
  2975      ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
  2974      ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
  2976    if (action.isValid()) {
  2975    if (action.isValid()) {
  2977      action.trigger();
  2976      action.trigger();
  2978      return NS_OK;
  2977      return NS_OK;
  2979    }
  2978    }
  2996 +
  2995 +
  2997 +    return LaunchWithIProcess(mDefaultApplication, nativePath);
  2996 +    return LaunchWithIProcess(mDefaultApplication, nativePath);
  2998 +  }
  2997 +  }
  2999 +
  2998 +
  3000    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  2999    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3001    nsAutoCString uriSpec;
  3000    if (!giovfs) {
  3002    if (giovfs) {
  3001      return NS_ERROR_FAILURE;
  3003      // nsGIOMimeApp->Launch wants a URI string instead of local file
       
  3004      nsresult rv;
       
  3005      nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
       
  3006      NS_ENSURE_SUCCESS(rv, rv);
       
  3007      nsCOMPtr<nsIURI> uri;
       
  3008 @@ -125,17 +145,17 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
       
  3009      /* Fallback to GnomeVFS */
       
  3010      nsCOMPtr<nsIGnomeVFSMimeApp> app;
       
  3011      if (NS_SUCCEEDED(gnomevfs->GetAppForMimeType(mSchemeOrType, getter_AddRefs(app))) && app)
       
  3012        return app->Launch(nativePath);
       
  3013    }
  3002    }
  3014  
  3003  
  3015    // If we haven't got an app we try to get a valid one by searching for the
  3004    // nsGIOMimeApp->Launch wants a URI string instead of local file
  3016    // extension mapped type
  3005    nsresult rv;
  3017 -  nsRefPtr<nsMIMEInfoBase> mimeInfo = nsGNOMERegistry::GetFromExtension(nativePath);
  3006    nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
  3018 +  nsRefPtr<nsMIMEInfoBase> mimeInfo = nsCommonRegistry::GetFromExtension(nativePath);
       
  3019    if (mimeInfo) {
       
  3020      nsAutoCString type;
       
  3021      mimeInfo->GetType(type);
       
  3022      if (giovfs) {
       
  3023        nsCOMPtr<nsIGIOMimeApp> app;
       
  3024        if (NS_SUCCEEDED(giovfs->GetAppForMimeType(type, getter_AddRefs(app))) && app)
       
  3025          return app->Launch(uriSpec);
       
  3026      } else if (gnomevfs) {
       
  3027 diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3007 diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3028 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3008 --- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3029 +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3009 +++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
  3030 @@ -10,17 +10,17 @@
  3010 @@ -10,17 +10,17 @@
  3031  #if defined(MOZ_ENABLE_CONTENTACTION)
  3011  #if defined(MOZ_ENABLE_CONTENTACTION)
  3052    if (action.isValid())
  3032    if (action.isValid())
  3053      *aHandlerExists = true;
  3033      *aHandlerExists = true;
  3054  #endif
  3034  #endif
  3055  
  3035  
  3056  #ifdef MOZ_WIDGET_GTK
  3036  #ifdef MOZ_WIDGET_GTK
  3057    // Check the GConf registry for a protocol handler
  3037    // Check the GNOME registry for a protocol handler
  3058 -  *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
  3038 -  *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
  3059 +  *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
  3039 +  *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
  3060  #endif
  3040  #endif
  3061  
  3041  
  3062    return NS_OK;
  3042    return NS_OK;
  3092      }
  3072      }
  3093  #endif
  3073  #endif
  3094  
  3074  
  3095      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  3075      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  3096                                    majorType,
  3076                                    majorType,
  3097 @@ -1372,17 +1372,17 @@ nsOSHelperAppService::GetFromType(const 
  3077 @@ -1373,17 +1373,17 @@ nsOSHelperAppService::GetFromType(const 
       
  3078    nsAutoString extensions, mime_types_description;
       
  3079    LookUpExtensionsAndDescription(majorType,
       
  3080                                   minorType,
       
  3081                                   extensions,
       
  3082                                   mime_types_description);
       
  3083  
  3098  #ifdef MOZ_WIDGET_GTK
  3084  #ifdef MOZ_WIDGET_GTK
  3099    nsRefPtr<nsMIMEInfoBase> gnomeInfo;
       
  3100    if (handler.IsEmpty()) {
  3085    if (handler.IsEmpty()) {
  3101      // No useful data yet.  Check the GNOME registry.  Unfortunately, newer
  3086 -    nsRefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
  3102      // GNOME versions no longer have type-to-extension mappings, so we might
  3087 +    nsRefPtr<nsMIMEInfoBase> gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
  3103      // get back a MIMEInfo without any extensions set.  In that case we'll have
  3088      if (gnomeInfo) {
  3104      // to look in our mime.types files for the extensions.
  3089        LOG(("Got MIMEInfo from GNOME registry without extensions; setting them "
  3105      LOG(("Looking in GNOME registry\n"));
  3090             "to %s\n", NS_LossyConvertUTF16toASCII(extensions).get()));
  3106 -    gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
  3091  
  3107 +    gnomeInfo = nsCommonRegistry::GetFromType(aMIMEType);
  3092        NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
  3108      if (gnomeInfo && gnomeInfo->HasExtensions()) {
  3093        gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
  3109        LOG(("Got MIMEInfo from GNOME registry, and it has extensions set\n"));
       
  3110        return gnomeInfo.forget();
  3094        return gnomeInfo.forget();
  3111      }
  3095      }
  3112    }
       
  3113  #endif
       
  3114  
       
  3115    // Now look up our extensions
       
  3116 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3096 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3117 --- a/widget/gtk/moz.build
  3097 --- a/widget/gtk/moz.build
  3118 +++ b/widget/gtk/moz.build
  3098 +++ b/widget/gtk/moz.build
  3119 @@ -79,16 +79,17 @@ else:
  3099 @@ -79,16 +79,17 @@ else:
  3120  include('/ipc/chromium/chromium-config.mozbuild')
  3100  include('/ipc/chromium/chromium-config.mozbuild')
  3463 +    }
  3443 +    }
  3464 +
  3444 +
  3465 diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
  3445 diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
  3466 --- a/widget/gtk/nsFilePicker.h
  3446 --- a/widget/gtk/nsFilePicker.h
  3467 +++ b/widget/gtk/nsFilePicker.h
  3447 +++ b/widget/gtk/nsFilePicker.h
  3468 @@ -66,11 +66,17 @@ protected:
  3448 @@ -68,11 +68,17 @@ protected:
  3469    nsString  mDefault;
  3449    nsString  mDefault;
  3470    nsString  mDefaultExtension;
  3450    nsString  mDefaultExtension;
  3471  
  3451  
  3472    nsTArray<nsCString> mFilters;
  3452    nsTArray<nsCString> mFilters;
  3473    nsTArray<nsCString> mFilterNames;
  3453    nsTArray<nsCString> mFilterNames;
  3502  #define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
  3482  #define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
  3503  #else
  3483  #else
  3504  #define XPTONLY_MANIFEST nullptr
  3484  #define XPTONLY_MANIFEST nullptr
  3505  #define XPTONLY_XPT nullptr
  3485  #define XPTONLY_XPT nullptr
  3506  #endif
  3486  #endif
  3507 @@ -488,16 +489,17 @@ ParseManifest(NSLocationType aType, File
  3487 @@ -489,16 +490,17 @@ ParseManifest(NSLocationType aType, File
  3508    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
  3488    NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
  3509    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
  3489    NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
  3510    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3490    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3511    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3491    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3512    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3492    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3513    NS_NAMED_LITERAL_STRING(kOs, "os");
  3493    NS_NAMED_LITERAL_STRING(kOs, "os");
  3514    NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
  3494    NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
  3520  #endif
  3500  #endif
  3521  
  3501  
  3522    NS_NAMED_LITERAL_STRING(kMain, "main");
  3502    NS_NAMED_LITERAL_STRING(kMain, "main");
  3523    NS_NAMED_LITERAL_STRING(kContent, "content");
  3503    NS_NAMED_LITERAL_STRING(kContent, "content");
  3524  
  3504  
  3525 @@ -548,44 +550,49 @@ ParseManifest(NSLocationType aType, File
  3505 @@ -549,44 +551,49 @@ ParseManifest(NSLocationType aType, File
  3526          CopyUTF8toUTF16(s, abi);
  3506          CopyUTF8toUTF16(s, abi);
  3527          abi.Insert(char16_t('_'), 0);
  3507          abi.Insert(char16_t('_'), 0);
  3528          abi.Insert(osTarget, 0);
  3508          abi.Insert(osTarget, 0);
  3529        }
  3509        }
  3530      }
  3510      }
  3571    } else {
  3551    } else {
  3572      process = kMain;
  3552      process = kMain;
  3573    }
  3553    }
  3574  
  3554  
  3575 @@ -681,25 +688,27 @@ ParseManifest(NSLocationType aType, File
  3555 @@ -681,25 +688,27 @@ ParseManifest(NSLocationType aType, File
       
  3556      TriState stOsVersion = eUnspecified;
  3576      TriState stOs = eUnspecified;
  3557      TriState stOs = eUnspecified;
  3577      TriState stABI = eUnspecified;
  3558      TriState stABI = eUnspecified;
  3578      TriState stProcess = eUnspecified;
  3559      TriState stProcess = eUnspecified;
  3579  #if defined(MOZ_WIDGET_ANDROID)
  3560  #if defined(MOZ_WIDGET_ANDROID)
  3580      TriState stTablet = eUnspecified;
  3561      TriState stTablet = eUnspecified;
  3581  #endif
  3562  #endif
  3582      bool platform = false;
  3563      int flags = 0;
  3583      bool contentAccessible = false;
       
  3584 +    TriState stDesktop = eUnspecified;
  3564 +    TriState stDesktop = eUnspecified;
  3585  
  3565  
  3586      while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
  3566      while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
  3587             ok) {
  3567             ok) {
  3588        ToLowerCase(token);
  3568        ToLowerCase(token);
  3598            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3578            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3599          continue;
  3579          continue;
  3600        }
  3580        }
  3601  
  3581  
  3602  #if defined(MOZ_WIDGET_ANDROID)
  3582  #if defined(MOZ_WIDGET_ANDROID)
  3603 @@ -731,16 +740,17 @@ ParseManifest(NSLocationType aType, File
  3583 @@ -749,16 +758,17 @@ ParseManifest(NSLocationType aType, File
  3604      }
  3584      }
  3605  
  3585  
  3606      if (!ok ||
  3586      if (!ok ||
  3607          stApp == eBad ||
  3587          stApp == eBad ||
  3608          stAppVersion == eBad ||
  3588          stAppVersion == eBad ||
  3636  if CONFIG['MOZ_WIDGET_GTK']:
  3616  if CONFIG['MOZ_WIDGET_GTK']:
  3637      CXXFLAGS += CONFIG['TK_CFLAGS']
  3617      CXXFLAGS += CONFIG['TK_CFLAGS']
  3638 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3618 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3639 --- a/xpcom/io/nsLocalFileUnix.cpp
  3619 --- a/xpcom/io/nsLocalFileUnix.cpp
  3640 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3620 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3641 @@ -45,16 +45,17 @@
  3621 @@ -44,16 +44,17 @@
       
  3622  #include "prproces.h"
  3642  #include "nsIDirectoryEnumerator.h"
  3623  #include "nsIDirectoryEnumerator.h"
  3643  #include "nsISimpleEnumerator.h"
  3624  #include "nsISimpleEnumerator.h"
  3644  #include "private/pprio.h"
  3625  #include "private/pprio.h"
  3645  #include "prlink.h"
  3626  #include "prlink.h"
  3646  
  3627  
  3647  #ifdef MOZ_WIDGET_GTK
  3628  #ifdef MOZ_WIDGET_GTK
  3648  #include "nsIGIOService.h"
  3629  #include "nsIGIOService.h"
  3649  #include "nsIGnomeVFSService.h"
       
  3650 +#include "nsKDEUtils.h"
  3630 +#include "nsKDEUtils.h"
  3651  #endif
  3631  #endif
  3652  
  3632  
  3653  #ifdef MOZ_WIDGET_COCOA
  3633  #ifdef MOZ_WIDGET_COCOA
  3654  #include <Carbon/Carbon.h>
  3634  #include <Carbon/Carbon.h>
  3655  #include "CocoaFileUtils.h"
  3635  #include "CocoaFileUtils.h"
  3656  #include "prmem.h"
  3636  #include "prmem.h"
  3657  #include "plbase64.h"
  3637  #include "plbase64.h"
  3658  
  3638  
  3659 @@ -1965,55 +1966,57 @@ nsLocalFile::SetPersistentDescriptor(con
  3639 @@ -1964,42 +1965,52 @@ nsLocalFile::SetPersistentDescriptor(con
  3660    return InitWithNativePath(aPersistentDescriptor);
  3640    return InitWithNativePath(aPersistentDescriptor);
  3661  #endif
  3641  #endif
  3662  }
  3642  }
  3663  
  3643  
  3664  NS_IMETHODIMP
  3644  NS_IMETHODIMP
  3665  nsLocalFile::Reveal()
  3645  nsLocalFile::Reveal()
  3666  {
  3646  {
  3667  #ifdef MOZ_WIDGET_GTK
  3647  #ifdef MOZ_WIDGET_GTK
  3668 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3648 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3669 -  nsCOMPtr<nsIGnomeVFSService> gnomevfs =
  3649 -  if (!giovfs) {
  3670 -    do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
       
  3671 -  if (!giovfs && !gnomevfs) {
       
  3672 -    return NS_ERROR_FAILURE;
  3650 -    return NS_ERROR_FAILURE;
  3673 -  }
  3651 -  }
  3674 -
       
  3675 +
       
  3676 +  nsAutoCString url;
  3652 +  nsAutoCString url;
       
  3653  
  3677    bool isDirectory;
  3654    bool isDirectory;
  3678    if (NS_FAILED(IsDirectory(&isDirectory))) {
  3655    if (NS_FAILED(IsDirectory(&isDirectory))) {
  3679      return NS_ERROR_FAILURE;
  3656      return NS_ERROR_FAILURE;
  3680    }
  3657    }
  3681  
  3658  
  3682 +  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3659 +  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3683    if (isDirectory) {
  3660    if (isDirectory) {
  3684 -    if (giovfs) {
  3661 -    return giovfs->ShowURIForInput(mPath);
  3685 -      return giovfs->ShowURIForInput(mPath);
       
  3686 -    } else
       
  3687 -      /* Fallback to GnomeVFS */
       
  3688 -    {
       
  3689 -      return gnomevfs->ShowURIForInput(mPath);
       
  3690 -    }
       
  3691 +    url = mPath;
  3662 +    url = mPath;
  3692    } else if (giovfs &&
  3663    } else if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
  3693               NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
       
  3694      return NS_OK;
  3664      return NS_OK;
  3695    } else {
  3665    } else {
  3696      nsCOMPtr<nsIFile> parentDir;
  3666      nsCOMPtr<nsIFile> parentDir;
  3697      nsAutoCString dirPath;
  3667      nsAutoCString dirPath;
  3698      if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
  3668      if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
  3700      }
  3670      }
  3701      if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
  3671      if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
  3702        return NS_ERROR_FAILURE;
  3672        return NS_ERROR_FAILURE;
  3703      }
  3673      }
  3704  
  3674  
  3705 -    if (giovfs) {
  3675 -    return giovfs->ShowURIForInput(dirPath);
  3706 -      return giovfs->ShowURIForInput(dirPath);
       
  3707 -    } else {
       
  3708 -      return gnomevfs->ShowURIForInput(dirPath);
       
  3709 -    }
       
  3710 +    url = dirPath;
  3676 +    url = dirPath;
  3711    }
  3677    }
  3712 +
  3678 +
  3713 +  if(nsKDEUtils::kdeSupport()) {
  3679 +  if(nsKDEUtils::kdeSupport()) {
  3714 +    nsTArray<nsCString> command;
  3680 +    nsTArray<nsCString> command;
  3715 +    command.AppendElement( NS_LITERAL_CSTRING("REVEAL") );
  3681 +    command.AppendElement( NS_LITERAL_CSTRING("REVEAL") );
  3716 +    command.AppendElement( mPath );
  3682 +    command.AppendElement( mPath );
  3717 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3683 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3718 +  }
  3684 +  }
  3719 +
  3685 +
  3720 +  nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3686 +  if (!giovfs)
  3721 +  if (!giovfs && !gnomevfs)
       
  3722 +    return NS_ERROR_FAILURE;
  3687 +    return NS_ERROR_FAILURE;
  3723 +
  3688 +
  3724 +  if (giovfs)
  3689 +  return giovfs->ShowURIForInput(url);
  3725 +    return giovfs->ShowURIForInput(url);
       
  3726 +  else
       
  3727 +    return gnomevfs->ShowURIForInput(url);
       
  3728  #elif defined(MOZ_WIDGET_COCOA)
  3690  #elif defined(MOZ_WIDGET_COCOA)
  3729    CFURLRef url;
  3691    CFURLRef url;
  3730    if (NS_SUCCEEDED(GetCFURL(&url))) {
  3692    if (NS_SUCCEEDED(GetCFURL(&url))) {
  3731      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3693      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3732      ::CFRelease(url);
  3694      ::CFRelease(url);
  3733      return rv;
  3695      return rv;
  3734    }
  3696    }
  3735    return NS_ERROR_FAILURE;
  3697    return NS_ERROR_FAILURE;
  3736 @@ -2021,16 +2024,22 @@ nsLocalFile::Reveal()
  3698 @@ -2007,16 +2018,22 @@ nsLocalFile::Reveal()
  3737    return NS_ERROR_FAILURE;
  3699    return NS_ERROR_FAILURE;
  3738  #endif
  3700  #endif
  3739  }
  3701  }
  3740  
  3702  
  3741  NS_IMETHODIMP
  3703  NS_IMETHODIMP
  3747 +    command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3709 +    command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3748 +    command.AppendElement( mPath );
  3710 +    command.AppendElement( mPath );
  3749 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3711 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3750 +  }
  3712 +  }
  3751    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3713    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3752    nsCOMPtr<nsIGnomeVFSService> gnomevfs =
  3714    if (!giovfs) {
  3753      do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3715      return NS_ERROR_FAILURE;
  3754    if (giovfs) {
  3716    }
  3755      return giovfs->ShowURIForInput(mPath);
  3717  
  3756    } else if (gnomevfs) {
  3718    return giovfs->ShowURIForInput(mPath);
  3757      /* GnomeVFS fallback */
  3719  #elif defined(MOZ_ENABLE_CONTENTACTION)
  3758      return gnomevfs->ShowURIForInput(mPath);
  3720    QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));