mozilla-kde.patch
changeset 779 354c672efefa
parent 766 e0b23b7851e9
child 807 f54c68340963
equal deleted inserted replaced
778:9483ff78d5a0 779:354c672efefa
     2 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     2 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     3 Author: Lubos Lunak <lunak@suse.com>
     3 Author: Lubos Lunak <lunak@suse.com>
     4 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     4 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     5      https://bugzilla.novell.com/show_bug.cgi?id=170055
     5      https://bugzilla.novell.com/show_bug.cgi?id=170055
     6 
     6 
     7 diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in
     7 diff --git a/modules/libpref/Makefile.in b/modules/libpref/Makefile.in
     8 --- a/modules/libpref/src/Makefile.in
     8 --- a/modules/libpref/Makefile.in
     9 +++ b/modules/libpref/src/Makefile.in
     9 +++ b/modules/libpref/Makefile.in
    10 @@ -21,13 +21,15 @@ endif
    10 @@ -21,13 +21,15 @@ endif
    11  ifdef MOZ_SERVICES_HEALTHREPORT
    11  ifdef MOZ_SERVICES_HEALTHREPORT
    12  ifneq (android,$(MOZ_WIDGET_TOOLKIT))
    12  ifneq (android,$(MOZ_WIDGET_TOOLKIT))
    13  grepref_files += $(topsrcdir)/services/healthreport/healthreport-prefs.js
    13  grepref_files += $(topsrcdir)/services/healthreport/healthreport-prefs.js
    14  else
    14  else
    21  greprefs.js: $(grepref_files)
    21  greprefs.js: $(grepref_files)
    22  	$(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ -o $@)
    22  	$(call py_action,preprocessor,$(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ -o $@)
    23  
    23  
    24  libs:: greprefs.js
    24  libs:: greprefs.js
    25  	$(INSTALL) $^ $(DIST)/bin/
    25  	$(INSTALL) $^ $(DIST)/bin/
    26 diff --git a/modules/libpref/src/Preferences.cpp b/modules/libpref/src/Preferences.cpp
    26 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
    27 --- a/modules/libpref/src/Preferences.cpp
    27 --- a/modules/libpref/Preferences.cpp
    28 +++ b/modules/libpref/src/Preferences.cpp
    28 +++ b/modules/libpref/Preferences.cpp
    29 @@ -27,16 +27,17 @@
    29 @@ -27,16 +27,17 @@
    30  #include "nsIZipReader.h"
    30  #include "nsIZipReader.h"
    31  #include "nsPrefBranch.h"
    31  #include "nsPrefBranch.h"
    32  #include "nsXPIDLString.h"
    32  #include "nsXPIDLString.h"
    33  #include "nsCRT.h"
    33  #include "nsCRT.h"
   177          '''
   177          '''
   178          Initialize a manifest entry with the given base path and flags.
   178          Initialize a manifest entry with the given base path and flags.
   179          '''
   179          '''
   180          self.base = base
   180          self.base = base
   181          self.flags = Flags(*flags)
   181          self.flags = Flags(*flags)
   182 diff --git a/toolkit/components/downloads/Makefile.in b/toolkit/components/downloads/Makefile.in
   182 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
   183 --- a/toolkit/components/downloads/Makefile.in
   183 --- a/toolkit/components/downloads/moz.build
   184 +++ b/toolkit/components/downloads/Makefile.in
   184 +++ b/toolkit/components/downloads/moz.build
   185 @@ -1,9 +1,9 @@
   185 @@ -52,14 +52,15 @@ if not CONFIG['MOZ_SUITE']:
   186  #
   186      ]
   187  # This Source Code Form is subject to the terms of the Mozilla Public
   187  
   188  # License, v. 2.0. If a copy of the MPL was not distributed with this
   188  FAIL_ON_WARNINGS = True
   189  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
   189  
   190  
   190  FINAL_LIBRARY = 'xul'
   191  include $(topsrcdir)/config/rules.mk
   191  
   192  
   192  LOCAL_INCLUDES += [
   193  CXXFLAGS += $(TK_CFLAGS)
   193      '../protobuf',
   194 -
   194 -    '/ipc/chromium/src'
   195 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
   195 +    '/ipc/chromium/src',
       
   196 +    '/toolkit/xre'
       
   197  ]
       
   198  
       
   199  DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
       
   200  
       
   201  CXXFLAGS += CONFIG['TK_CFLAGS']
   196 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   202 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
   197 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   203 --- a/toolkit/components/downloads/nsDownloadManager.cpp
   198 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   204 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
   199 @@ -43,16 +43,20 @@
   205 @@ -43,16 +43,20 @@
   200  #ifdef XP_WIN
   206  #ifdef XP_WIN
   215  
   221  
   216  #ifdef MOZ_WIDGET_ANDROID
   222  #ifdef MOZ_WIDGET_ANDROID
   217  #include "AndroidBridge.h"
   223  #include "AndroidBridge.h"
   218  using namespace mozilla::widget::android;
   224  using namespace mozilla::widget::android;
   219  #endif
   225  #endif
   220 @@ -2729,16 +2733,25 @@ nsDownload::SetState(DownloadState aStat
   226 @@ -2711,16 +2715,25 @@ nsDownload::SetState(DownloadState aStat
   221        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   227        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   222  
   228  
   223        // Master pref to control this function.
   229        // Master pref to control this function.
   224        bool showTaskbarAlert = true;
   230        bool showTaskbarAlert = true;
   225        if (pref)
   231        if (pref)
   241  
   247  
   242          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   248          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   243          int64_t goat = PR_Now() - mStartTime;
   249          int64_t goat = PR_Now() - mStartTime;
   244          showTaskbarAlert = goat > alertIntervalUSec;
   250          showTaskbarAlert = goat > alertIntervalUSec;
   245  
   251  
   246 @@ -2766,19 +2779,20 @@ nsDownload::SetState(DownloadState aStat
   252 @@ -2751,16 +2764,17 @@ nsDownload::SetState(DownloadState aStat
   247                // because if it is, they'll click open the download manager and
       
   248                // the items they downloaded will have been removed.
       
   249                alerts->ShowAlertNotification(
       
   250                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   253                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   251                    message, !removeWhenDone,
   254                    message, !removeWhenDone,
   252                    mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
   255                    mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
   253                    mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
   256                    mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
   254                    EmptyString(), nullptr);
   257                    EmptyString(), EmptyString(), nullptr);
   255 -            }
   258              }
   256 +          }
       
   257          }
   259          }
   258        }
   260        }
   259 +      }
   261 +      }
   260  
   262  
   261  #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK)
   263  #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK)
   266        if (fileURL &&
   268        if (fileURL &&
   267            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
   269            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
   268 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   270 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   269 --- a/toolkit/content/jar.mn
   271 --- a/toolkit/content/jar.mn
   270 +++ b/toolkit/content/jar.mn
   272 +++ b/toolkit/content/jar.mn
   271 @@ -54,29 +54,33 @@ toolkit.jar:
   273 @@ -55,29 +55,33 @@ toolkit.jar:
   272     content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
   274     content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
   273  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
   275  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
   274     content/global/bindings/browser.xml         (widgets/browser.xml)
   276     content/global/bindings/browser.xml         (widgets/browser.xml)
   275     content/global/bindings/button.xml          (widgets/button.xml)
   277     content/global/bindings/button.xml          (widgets/button.xml)
   276     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
   278     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
  2129  public:
  2131  public:
  2130    NS_DECL_ISUPPORTS
  2132    NS_DECL_ISUPPORTS
  2131    NS_DECL_NSISYSTEMPROXYSETTINGS
  2133    NS_DECL_NSISYSTEMPROXYSETTINGS
  2132  
  2134  
  2133    nsUnixSystemProxySettings()
  2135    nsUnixSystemProxySettings()
  2134      : mSchemeProxySettings(5)
  2136      : mSchemeProxySettings(4)
  2135 @@ -38,16 +40,17 @@ private:
  2137 @@ -38,16 +40,17 @@ private:
  2136    nsCOMPtr<nsIGSettingsService> mGSettings;
  2138    nsCOMPtr<nsIGSettingsService> mGSettings;
  2137    nsCOMPtr<nsIGSettingsCollection> mProxySettings;
  2139    nsCOMPtr<nsIGSettingsCollection> mProxySettings;
  2138    nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
  2140    nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection> mSchemeProxySettings;
  2139    bool IsProxyMode(const char* aMode);
  2141    bool IsProxyMode(const char* aMode);
  2623 +        FILE* commandFile;
  2625 +        FILE* commandFile;
  2624 +        FILE* replyFile;
  2626 +        FILE* replyFile;
  2625 +    };
  2627 +    };
  2626 +
  2628 +
  2627 +#endif // nsKDEUtils
  2629 +#endif // nsKDEUtils
  2628 diff --git a/uriloader/exthandler/Makefile.in b/uriloader/exthandler/Makefile.in
       
  2629 --- a/uriloader/exthandler/Makefile.in
       
  2630 +++ b/uriloader/exthandler/Makefile.in
       
  2631 @@ -6,9 +6,10 @@
       
  2632  ifdef MOZ_ENABLE_DBUS
       
  2633  OS_INCLUDES   += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS)
       
  2634  endif
       
  2635  
       
  2636  include $(topsrcdir)/config/rules.mk
       
  2637  
       
  2638  ifneq (,$(filter qt gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
       
  2639  CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
       
  2640 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
       
  2641  endif
       
  2642 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
  2630 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
  2643 --- a/uriloader/exthandler/moz.build
  2631 --- a/uriloader/exthandler/moz.build
  2644 +++ b/uriloader/exthandler/moz.build
  2632 +++ b/uriloader/exthandler/moz.build
  2645 @@ -75,17 +75,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
  2633 @@ -75,17 +75,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
  2646  else:
  2634  else:
  2660      UNIFIED_SOURCES += [
  2648      UNIFIED_SOURCES += [
  2661          'android/nsAndroidHandlerApp.cpp',
  2649          'android/nsAndroidHandlerApp.cpp',
  2662          'android/nsExternalSharingAppService.cpp',
  2650          'android/nsExternalSharingAppService.cpp',
  2663          'android/nsExternalURLHandlerService.cpp',
  2651          'android/nsExternalURLHandlerService.cpp',
  2664          'android/nsMIMEInfoAndroid.cpp',
  2652          'android/nsMIMEInfoAndroid.cpp',
       
  2653 @@ -129,16 +131,17 @@ include('/ipc/chromium/chromium-config.m
       
  2654  FINAL_LIBRARY = 'xul'
       
  2655  
       
  2656  LOCAL_INCLUDES += [
       
  2657      '/content/base/src',
       
  2658      '/dom/base',
       
  2659      '/dom/ipc',
       
  2660      '/netwerk/base/src',
       
  2661      '/netwerk/protocol/http',
       
  2662 +    '/toolkit/xre'
       
  2663  ]
       
  2664  
       
  2665  if CONFIG['MOZ_ENABLE_DBUS']:
       
  2666      CXXFLAGS += CONFIG['TK_CFLAGS']
       
  2667      CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
       
  2668  
       
  2669  if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
       
  2670      CXXFLAGS += CONFIG['TK_CFLAGS']
  2665 diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
  2671 diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
  2666 new file mode 100644
  2672 new file mode 100644
  2667 --- /dev/null
  2673 --- /dev/null
  2668 +++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
  2674 +++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
  2669 @@ -0,0 +1,54 @@
  2675 @@ -0,0 +1,54 @@
  3093      }
  3099      }
  3094    }
  3100    }
  3095  #endif
  3101  #endif
  3096  
  3102  
  3097    // Now look up our extensions
  3103    // Now look up our extensions
  3098 diff --git a/widget/gtk/Makefile.in b/widget/gtk/Makefile.in
  3104 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3099 --- a/widget/gtk/Makefile.in
  3105 --- a/widget/gtk/moz.build
  3100 +++ b/widget/gtk/Makefile.in
  3106 +++ b/widget/gtk/moz.build
  3101 @@ -3,14 +3,16 @@
  3107 @@ -88,16 +88,17 @@ include('/ipc/chromium/chromium-config.m
  3102  # License, v. 2.0. If a copy of the MPL was not distributed with this
  3108  FINAL_LIBRARY = 'xul'
  3103  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  3109  
  3104  
  3110  LOCAL_INCLUDES += [
  3105  include $(topsrcdir)/config/rules.mk
  3111      '../shared',
  3106  
  3112      '../xpwidgets',
  3107  CFLAGS          += $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
  3113      '/layout/generic',
  3108  CXXFLAGS        += $(MOZ_CAIRO_CFLAGS) $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
  3114      '/layout/xul',
  3109  
  3115      '/other-licenses/atk-1.0',
  3110 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
  3116 +    '/toolkit/xre'
  3111 +
  3117  ]
  3112  CFLAGS          += $(TK_CFLAGS)
  3118  
  3113  CXXFLAGS        += $(TK_CFLAGS)
  3119  if CONFIG['MOZ_X11']:
  3114  
  3120      LOCAL_INCLUDES += [
  3115  ifdef MOZ_ENABLE_DBUS
  3121          '../shared/x11',
  3116  CXXFLAGS        += $(MOZ_DBUS_GLIB_CFLAGS)
  3122      ]
  3117  endif
  3123  
       
  3124  DEFINES['CAIRO_GFX'] = True
  3118 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  3125 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  3119 --- a/widget/gtk/nsFilePicker.cpp
  3126 --- a/widget/gtk/nsFilePicker.cpp
  3120 +++ b/widget/gtk/nsFilePicker.cpp
  3127 +++ b/widget/gtk/nsFilePicker.cpp
  3121 @@ -1,32 +1,34 @@
  3128 @@ -1,32 +1,34 @@
  3122  /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  3129  /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  3462 +  NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
  3469 +  NS_IMETHODIMP kdeAppsDialog(PRInt16 *aReturn);
  3463 +  nsCString kdeMakeFilter( int index );
  3470 +  nsCString kdeMakeFilter( int index );
  3464  };
  3471  };
  3465  
  3472  
  3466  #endif
  3473  #endif
  3467 diff --git a/xpcom/components/Makefile.in b/xpcom/components/Makefile.in
       
  3468 --- a/xpcom/components/Makefile.in
       
  3469 +++ b/xpcom/components/Makefile.in
       
  3470 @@ -2,9 +2,10 @@
       
  3471  # This Source Code Form is subject to the terms of the Mozilla Public
       
  3472  # License, v. 2.0. If a copy of the MPL was not distributed with this
       
  3473  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
       
  3474  
       
  3475  include $(topsrcdir)/config/rules.mk
       
  3476  
       
  3477  ifdef MOZ_WIDGET_GTK
       
  3478  CXXFLAGS        += $(TK_CFLAGS)
       
  3479 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
       
  3480  endif
       
  3481 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3474 diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
  3482 --- a/xpcom/components/ManifestParser.cpp
  3475 --- a/xpcom/components/ManifestParser.cpp
  3483 +++ b/xpcom/components/ManifestParser.cpp
  3476 +++ b/xpcom/components/ManifestParser.cpp
  3484 @@ -31,16 +31,17 @@
  3477 @@ -34,16 +34,17 @@
  3485  #include "nsTextFormatter.h"
       
  3486  #include "nsVersionComparator.h"
       
  3487  #include "nsXPCOMCIDInternal.h"
       
  3488  
  3478  
  3489  #include "nsIConsoleService.h"
  3479  #include "nsIConsoleService.h"
  3490  #include "nsIScriptError.h"
  3480  #include "nsIScriptError.h"
  3491  #include "nsIXULAppInfo.h"
  3481  #include "nsIXULAppInfo.h"
  3492  #include "nsIXULRuntime.h"
  3482  #include "nsIXULRuntime.h"
       
  3483  #ifdef MOZ_B2G_LOADER
       
  3484  #include "mozilla/XPTInterfaceInfoManager.h"
       
  3485  #endif
  3493 +#include "nsKDEUtils.h"
  3486 +#include "nsKDEUtils.h"
  3494  
  3487  
  3495  using namespace mozilla;
  3488  #ifdef MOZ_B2G_LOADER
  3496  
  3489  #define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest
  3497  struct ManifestDirective
  3490  #define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
  3498  {
  3491  #else
  3499    const char* directive;
  3492  #define XPTONLY_MANIFEST nullptr
  3500    int argc;
  3493  #define XPTONLY_XPT nullptr
  3501  
  3494  #endif
  3502 @@ -398,16 +399,17 @@ ParseManifest(NSLocationType type, FileL
  3495 @@ -488,16 +489,17 @@ ParseManifest(NSLocationType aType, File
  3503    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
  3496    NS_NAMED_LITERAL_STRING(kPlatform, "platform");
  3504    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
  3497    NS_NAMED_LITERAL_STRING(kContentAccessible, "contentaccessible");
  3505    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3498    NS_NAMED_LITERAL_STRING(kApplication, "application");
  3506    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3499    NS_NAMED_LITERAL_STRING(kAppVersion, "appversion");
  3507    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3500    NS_NAMED_LITERAL_STRING(kGeckoVersion, "platformversion");
  3515  
  3508  
  3516    // Obsolete
  3509    // Obsolete
  3517    NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
  3510    NS_NAMED_LITERAL_STRING(kXPCNativeWrappers, "xpcnativewrappers");
  3518  
  3511  
  3519    nsAutoString appID;
  3512    nsAutoString appID;
  3520 @@ -445,42 +447,47 @@ ParseManifest(NSLocationType type, FileL
  3513 @@ -543,44 +545,49 @@ ParseManifest(NSLocationType aType, File
  3521          CopyUTF8toUTF16(s, abi);
  3514          CopyUTF8toUTF16(s, abi);
  3522          abi.Insert(char16_t('_'), 0);
  3515          abi.Insert(char16_t('_'), 0);
  3523          abi.Insert(osTarget, 0);
  3516          abi.Insert(osTarget, 0);
  3524        }
  3517        }
  3525      }
  3518      }
  3531  #pragma warning(push)
  3524  #pragma warning(push)
  3532  #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
  3525  #pragma warning(disable:4996) // VC12+ deprecates GetVersionEx
  3533    OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
  3526    OSVERSIONINFO info = { sizeof(OSVERSIONINFO) };
  3534    if (GetVersionEx(&info)) {
  3527    if (GetVersionEx(&info)) {
  3535      nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
  3528      nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
  3536                                           info.dwMajorVersion,
  3529                                info.dwMajorVersion,
  3537                                           info.dwMinorVersion);
  3530                                info.dwMinorVersion);
  3538    }
  3531    }
  3539 +  desktop = NS_LITERAL_STRING("win");
  3532 +  desktop = NS_LITERAL_STRING("win");
  3540  #pragma warning(pop)
  3533  #pragma warning(pop)
  3541  #elif defined(MOZ_WIDGET_COCOA)
  3534  #elif defined(MOZ_WIDGET_COCOA)
  3542    SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
  3535    SInt32 majorVersion = nsCocoaFeatures::OSXVersionMajor();
  3543    SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
  3536    SInt32 minorVersion = nsCocoaFeatures::OSXVersionMinor();
  3544    nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
  3537    nsTextFormatter::ssprintf(osVersion, NS_LITERAL_STRING("%ld.%ld").get(),
  3545                                         majorVersion,
  3538                              majorVersion,
  3546                                         minorVersion);
  3539                              minorVersion);
  3547 +  desktop = NS_LITERAL_STRING("macosx");
  3540 +  desktop = NS_LITERAL_STRING("macosx");
  3548  #elif defined(MOZ_WIDGET_GTK)
  3541  #elif defined(MOZ_WIDGET_GTK)
  3549    nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
  3542    nsTextFormatter::ssprintf(osVersion, MOZ_UTF16("%ld.%ld"),
  3550                                         gtk_major_version,
  3543                              gtk_major_version,
  3551                                         gtk_minor_version);
  3544                              gtk_minor_version);
  3552 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
  3545 +  desktop = nsKDEUtils::kdeSession() ? NS_LITERAL_STRING("kde") : NS_LITERAL_STRING("gnome");
  3553  #elif defined(MOZ_WIDGET_ANDROID)
  3546  #elif defined(MOZ_WIDGET_ANDROID)
  3554    bool isTablet = false;
  3547    bool isTablet = false;
  3555    if (mozilla::AndroidBridge::Bridge()) {
  3548    if (mozilla::AndroidBridge::Bridge()) {
  3556      mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", osVersion);
  3549      mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
       
  3550                                                             "RELEASE",
       
  3551                                                             osVersion);
  3557      isTablet = mozilla::widget::android::GeckoAppShell::IsTablet();
  3552      isTablet = mozilla::widget::android::GeckoAppShell::IsTablet();
  3558    }
  3553    }
  3559 +  desktop = NS_LITERAL_STRING("android");
  3554 +  desktop = NS_LITERAL_STRING("android");
  3560  #endif
  3555  #endif
  3561  
  3556  
  3562    // Because contracts must be registered after CIDs, we save and process them
  3557    // Because contracts must be registered after CIDs, we save and process them
  3563    // at the end.
  3558    // at the end.
  3564    nsTArray<CachedDirective> contracts;
  3559    nsTArray<CachedDirective> contracts;
  3565  
  3560  
  3566    char *token;
  3561    char* token;
  3567    char *newline = buf;
  3562    char* newline = aBuf;
  3568 @@ -562,24 +569,26 @@ ParseManifest(NSLocationType type, FileL
  3563 @@ -669,25 +676,27 @@ ParseManifest(NSLocationType aType, File
  3569      TriState stOsVersion = eUnspecified;
  3564      TriState stOsVersion = eUnspecified;
  3570      TriState stOs = eUnspecified;
  3565      TriState stOs = eUnspecified;
  3571      TriState stABI = eUnspecified;
  3566      TriState stABI = eUnspecified;
  3572  #if defined(MOZ_WIDGET_ANDROID)
  3567  #if defined(MOZ_WIDGET_ANDROID)
  3573      TriState stTablet = eUnspecified;
  3568      TriState stTablet = eUnspecified;
  3574  #endif
  3569  #endif
  3575      bool platform = false;
  3570      bool platform = false;
  3576      bool contentAccessible = false;
  3571      bool contentAccessible = false;
  3577 +    TriState stDesktop = eUnspecified;
  3572 +    TriState stDesktop = eUnspecified;
  3578  
  3573  
  3579      while (nullptr != (token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) && ok) {
  3574      while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
       
  3575             ok) {
  3580        ToLowerCase(token);
  3576        ToLowerCase(token);
  3581        NS_ConvertASCIItoUTF16 wtoken(token);
  3577        NS_ConvertASCIItoUTF16 wtoken(token);
  3582  
  3578  
  3583        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
  3579        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
  3584            CheckStringFlag(kOs, wtoken, osTarget, stOs) ||
  3580            CheckStringFlag(kOs, wtoken, osTarget, stOs) ||
  3585            CheckStringFlag(kABI, wtoken, abi, stABI) ||
  3581            CheckStringFlag(kABI, wtoken, abi, stABI) ||
  3586 +          CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
  3582 +          CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
  3587            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
  3583            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
  3588            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
  3584            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
  3589            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion))
  3585            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3590          continue;
  3586          continue;
       
  3587        }
  3591  
  3588  
  3592  #if defined(MOZ_WIDGET_ANDROID)
  3589  #if defined(MOZ_WIDGET_ANDROID)
  3593        bool tablet = false;
  3590        bool tablet = false;
  3594        if (CheckFlag(kTablet, wtoken, tablet)) {
  3591 @@ -718,16 +727,17 @@ ParseManifest(NSLocationType aType, File
  3595 @@ -608,16 +617,17 @@ ParseManifest(NSLocationType type, FileL
       
  3596      }
  3592      }
  3597  
  3593  
  3598      if (!ok ||
  3594      if (!ok ||
  3599          stApp == eBad ||
  3595          stApp == eBad ||
  3600          stAppVersion == eBad ||
  3596          stAppVersion == eBad ||
  3603          stOsVersion == eBad ||
  3599          stOsVersion == eBad ||
  3604 +        stDesktop == eBad ||
  3600 +        stDesktop == eBad ||
  3605  #ifdef MOZ_WIDGET_ANDROID
  3601  #ifdef MOZ_WIDGET_ANDROID
  3606          stTablet == eBad ||
  3602          stTablet == eBad ||
  3607  #endif
  3603  #endif
  3608          stABI == eBad)
  3604          stABI == eBad) {
  3609        continue;
  3605        continue;
  3610  
  3606      }
  3611      if (directive->regfunc) {
  3607  
  3612        if (GeckoProcessType_Default != XRE_GetProcessType())
  3608  #ifdef MOZ_B2G_LOADER
       
  3609 diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
       
  3610 --- a/xpcom/components/moz.build
       
  3611 +++ b/xpcom/components/moz.build
       
  3612 @@ -47,12 +47,13 @@ FINAL_LIBRARY = 'xul'
       
  3613  GENERATED_INCLUDES += ['..']
       
  3614  LOCAL_INCLUDES += [
       
  3615      '../base',
       
  3616      '../build',
       
  3617      '../ds',
       
  3618      '../reflect/xptinfo',
       
  3619      '/chrome',
       
  3620      '/modules/libjar',
       
  3621 +    '/toolkit/xre'
       
  3622  ]
       
  3623  
       
  3624  if CONFIG['MOZ_WIDGET_GTK']:
       
  3625      CXXFLAGS += CONFIG['TK_CFLAGS']
  3613 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3626 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3614 --- a/xpcom/io/nsLocalFileUnix.cpp
  3627 --- a/xpcom/io/nsLocalFileUnix.cpp
  3615 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3628 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3616 @@ -44,16 +44,17 @@
  3629 @@ -44,16 +44,17 @@
  3617  #include "nsIDirectoryEnumerator.h"
  3630  #include "nsIDirectoryEnumerator.h"
  3629  #include <Carbon/Carbon.h>
  3642  #include <Carbon/Carbon.h>
  3630  #include "CocoaFileUtils.h"
  3643  #include "CocoaFileUtils.h"
  3631  #include "prmem.h"
  3644  #include "prmem.h"
  3632  #include "plbase64.h"
  3645  #include "plbase64.h"
  3633  
  3646  
  3634 @@ -1962,53 +1963,55 @@ nsLocalFile::SetPersistentDescriptor(con
  3647 @@ -1965,55 +1966,57 @@ nsLocalFile::SetPersistentDescriptor(con
  3635    return InitWithNativePath(aPersistentDescriptor);
  3648    return InitWithNativePath(aPersistentDescriptor);
  3636  #endif
  3649  #endif
  3637  }
  3650  }
  3638  
  3651  
  3639  NS_IMETHODIMP
  3652  NS_IMETHODIMP
  3640  nsLocalFile::Reveal()
  3653  nsLocalFile::Reveal()
  3641  {
  3654  {
  3642  #ifdef MOZ_WIDGET_GTK
  3655  #ifdef MOZ_WIDGET_GTK
  3643 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3656 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3644 -  nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3657 -  nsCOMPtr<nsIGnomeVFSService> gnomevfs =
       
  3658 -    do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3645 -  if (!giovfs && !gnomevfs) {
  3659 -  if (!giovfs && !gnomevfs) {
  3646 -    return NS_ERROR_FAILURE;
  3660 -    return NS_ERROR_FAILURE;
  3647 -  }
  3661 -  }
  3648 -
  3662 -
       
  3663 +
  3649 +  nsAutoCString url;
  3664 +  nsAutoCString url;
  3650    bool isDirectory;
  3665    bool isDirectory;
  3651    if (NS_FAILED(IsDirectory(&isDirectory))) {
  3666    if (NS_FAILED(IsDirectory(&isDirectory))) {
  3652      return NS_ERROR_FAILURE;
  3667      return NS_ERROR_FAILURE;
  3653    }
  3668    }
  3660 -      /* Fallback to GnomeVFS */
  3675 -      /* Fallback to GnomeVFS */
  3661 -    {
  3676 -    {
  3662 -      return gnomevfs->ShowURIForInput(mPath);
  3677 -      return gnomevfs->ShowURIForInput(mPath);
  3663 -    }
  3678 -    }
  3664 +    url = mPath;
  3679 +    url = mPath;
  3665    } else if (giovfs && NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
  3680    } else if (giovfs &&
       
  3681               NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
  3666      return NS_OK;
  3682      return NS_OK;
  3667    } else {
  3683    } else {
  3668      nsCOMPtr<nsIFile> parentDir;
  3684      nsCOMPtr<nsIFile> parentDir;
  3669      nsAutoCString dirPath;
  3685      nsAutoCString dirPath;
  3670      if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
  3686      if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
  3703      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3719      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3704      ::CFRelease(url);
  3720      ::CFRelease(url);
  3705      return rv;
  3721      return rv;
  3706    }
  3722    }
  3707    return NS_ERROR_FAILURE;
  3723    return NS_ERROR_FAILURE;
  3708 @@ -2016,16 +2019,22 @@ nsLocalFile::Reveal()
  3724 @@ -2021,16 +2024,22 @@ nsLocalFile::Reveal()
  3709    return NS_ERROR_FAILURE;
  3725    return NS_ERROR_FAILURE;
  3710  #endif
  3726  #endif
  3711  }
  3727  }
  3712  
  3728  
  3713  NS_IMETHODIMP
  3729  NS_IMETHODIMP
  3719 +    command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3735 +    command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3720 +    command.AppendElement( mPath );
  3736 +    command.AppendElement( mPath );
  3721 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3737 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3722 +  }
  3738 +  }
  3723    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3739    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3724    nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3740    nsCOMPtr<nsIGnomeVFSService> gnomevfs =
       
  3741      do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3725    if (giovfs) {
  3742    if (giovfs) {
  3726      return giovfs->ShowURIForInput(mPath);
  3743      return giovfs->ShowURIForInput(mPath);
  3727    } else if (gnomevfs) {
  3744    } else if (gnomevfs) {
  3728      /* GnomeVFS fallback */
  3745      /* GnomeVFS fallback */
  3729      return gnomevfs->ShowURIForInput(mPath);
  3746      return gnomevfs->ShowURIForInput(mPath);
  3730    }