mozilla-kde.patch
changeset 748 72ba5129e5fd
parent 738 f118b88b7d7f
child 757 7913ca5779dc
equal deleted inserted replaced
746:b441942b2a3f 748:72ba5129e5fd
    83  
    83  
    84      nsAutoCString leaf;
    84      nsAutoCString leaf;
    85      path->GetNativeLeafName(leaf);
    85      path->GetNativeLeafName(leaf);
    86  
    86  
    87      // Do we care if a file provided by this process fails to load?
    87      // Do we care if a file provided by this process fails to load?
    88      if (Substring(leaf, leaf.Length() - 4).Equals(NS_LITERAL_CSTRING(".xpi")))
    88      if (Substring(leaf, leaf.Length() - 4).EqualsLiteral(".xpi"))
    89        ReadExtensionPrefs(path);
    89        ReadExtensionPrefs(path);
    90      else
    90      else
    91 -      pref_LoadPrefsInDir(path, nullptr, 0);
    91 -      pref_LoadPrefsInDir(path, nullptr, 0);
    92 +      pref_LoadPrefsInDir(path, specialFiles, MOZ_ARRAY_LENGTH(specialFiles));
    92 +      pref_LoadPrefsInDir(path, specialFiles, MOZ_ARRAY_LENGTH(specialFiles));
    93    }
    93    }
   215  
   215  
   216  #ifdef MOZ_WIDGET_ANDROID
   216  #ifdef MOZ_WIDGET_ANDROID
   217  #include "AndroidBridge.h"
   217  #include "AndroidBridge.h"
   218  using namespace mozilla::widget::android;
   218  using namespace mozilla::widget::android;
   219  #endif
   219  #endif
   220 @@ -2722,16 +2726,25 @@ nsDownload::SetState(DownloadState aStat
   220 @@ -2729,16 +2733,25 @@ nsDownload::SetState(DownloadState aStat
   221        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   221        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
   222  
   222  
   223        // Master pref to control this function.
   223        // Master pref to control this function.
   224        bool showTaskbarAlert = true;
   224        bool showTaskbarAlert = true;
   225        if (pref)
   225        if (pref)
   241  
   241  
   242          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   242          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
   243          int64_t goat = PR_Now() - mStartTime;
   243          int64_t goat = PR_Now() - mStartTime;
   244          showTaskbarAlert = goat > alertIntervalUSec;
   244          showTaskbarAlert = goat > alertIntervalUSec;
   245  
   245  
   246 @@ -2759,19 +2772,20 @@ nsDownload::SetState(DownloadState aStat
   246 @@ -2766,19 +2779,20 @@ nsDownload::SetState(DownloadState aStat
   247                // because if it is, they'll click open the download manager and
   247                // because if it is, they'll click open the download manager and
   248                // the items they downloaded will have been removed.
   248                // the items they downloaded will have been removed.
   249                alerts->ShowAlertNotification(
   249                alerts->ShowAlertNotification(
   250                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   250                    NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
   251                    message, !removeWhenDone,
   251                    message, !removeWhenDone,
   266        if (fileURL &&
   266        if (fileURL &&
   267            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
   267            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
   268 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   268 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   269 --- a/toolkit/content/jar.mn
   269 --- a/toolkit/content/jar.mn
   270 +++ b/toolkit/content/jar.mn
   270 +++ b/toolkit/content/jar.mn
   271 @@ -58,29 +58,33 @@ toolkit.jar:
   271 @@ -55,29 +55,33 @@ toolkit.jar:
   272     content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
   272     content/global/viewZoomOverlay.js          (viewZoomOverlay.js)
   273  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
   273  *+ content/global/bindings/autocomplete.xml    (widgets/autocomplete.xml)
   274     content/global/bindings/browser.xml         (widgets/browser.xml)
   274     content/global/bindings/browser.xml         (widgets/browser.xml)
   275     content/global/bindings/button.xml          (widgets/button.xml)
   275     content/global/bindings/button.xml          (widgets/button.xml)
   276     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
   276     content/global/bindings/checkbox.xml        (widgets/checkbox.xml)
   288  *+ content/global/bindings/listbox.xml         (widgets/listbox.xml)
   288  *+ content/global/bindings/listbox.xml         (widgets/listbox.xml)
   289     content/global/bindings/menu.xml            (widgets/menu.xml)
   289     content/global/bindings/menu.xml            (widgets/menu.xml)
   290     content/global/bindings/menulist.xml        (widgets/menulist.xml)
   290     content/global/bindings/menulist.xml        (widgets/menulist.xml)
   291     content/global/bindings/notification.xml    (widgets/notification.xml)
   291     content/global/bindings/notification.xml    (widgets/notification.xml)
   292     content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
   292     content/global/bindings/numberbox.xml       (widgets/numberbox.xml)
   293  *  content/global/bindings/popup.xml           (widgets/popup.xml)
   293     content/global/bindings/popup.xml           (widgets/popup.xml)
   294  *+ content/global/bindings/preferences.xml     (widgets/preferences.xml)
   294  *+ content/global/bindings/preferences.xml     (widgets/preferences.xml)
   295 +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
   295 +*+ content/global/bindings/preferences-kde.xml (widgets/preferences-kde.xml)
   296 +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
   296 +% override chrome://global/content/bindings/preferences.xml chrome://global/content/bindings/preferences-kde.xml desktop=kde
   297     content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
   297     content/global/bindings/progressmeter.xml   (widgets/progressmeter.xml)
   298     content/global/bindings/radio.xml           (widgets/radio.xml)
   298     content/global/bindings/radio.xml           (widgets/radio.xml)
   337 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
   337 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
   338 +        <xul:spacer anonid="spacer" flex="1"/>
   338 +        <xul:spacer anonid="spacer" flex="1"/>
   339 +        <xul:button dlgtype="cancel" class="dialog-button"/>
   339 +        <xul:button dlgtype="cancel" class="dialog-button"/>
   340 +        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
   340 +        <xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
   341 +#elif XP_UNIX
   341 +#elif XP_UNIX
   342 +                pack="end">
   342 +                >
   343 +	<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
   343 +	<xul:button dlgtype="help" class="dialog-button" hidden="true"/>
   344 +	<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
   344 +	<xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
   345 +	<xul:spacer anonid="spacer" flex="1" hidden="true"/>
   345 +	<xul:spacer anonid="spacer" flex="1" hidden="true"/>
   346 +	<xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
   346 +	<xul:button dlgtype="accept" class="dialog-button" xbl:inherits="disabled=buttondisabledaccept"/>
   347 +	<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
   347 +	<xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
   758 +</bindings>
   758 +</bindings>
   759 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   759 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   760 new file mode 100644
   760 new file mode 100644
   761 --- /dev/null
   761 --- /dev/null
   762 +++ b/toolkit/content/widgets/preferences-kde.xml
   762 +++ b/toolkit/content/widgets/preferences-kde.xml
   763 @@ -0,0 +1,1333 @@
   763 @@ -0,0 +1,1343 @@
   764 +<?xml version="1.0"?>
   764 +<?xml version="1.0"?>
   765 +
   765 +
   766 +<!DOCTYPE bindings [
   766 +<!DOCTYPE bindings [
   767 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   767 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   768 +  %preferencesDTD;
   768 +  %preferencesDTD;
   791 +#   </prefwindow>
   791 +#   </prefwindow>
   792 +#
   792 +#
   793 +
   793 +
   794 +  <binding id="preferences">
   794 +  <binding id="preferences">
   795 +    <implementation implements="nsIObserver">
   795 +    <implementation implements="nsIObserver">
       
   796 +      <method name="_constructAfterChildren">
       
   797 +      <body>
       
   798 +      <![CDATA[
       
   799 +      // This method will be called after each one of the child
       
   800 +      // <preference> elements is constructed. Its purpose is to propagate
       
   801 +      // the values to the associated form elements
       
   802 +
       
   803 +      var elements = this.getElementsByTagName("preference");
       
   804 +      for (let element of elements) {
       
   805 +        if (!element._constructed) {
       
   806 +          return;
       
   807 +        }
       
   808 +      }
       
   809 +      for (let element of elements) {
       
   810 +        element.updateElements();
       
   811 +      }
       
   812 +      ]]>
       
   813 +      </body>
       
   814 +      </method>
   796 +      <method name="observe">
   815 +      <method name="observe">
   797 +        <parameter name="aSubject"/>
   816 +        <parameter name="aSubject"/>
   798 +        <parameter name="aTopic"/>
   817 +        <parameter name="aTopic"/>
   799 +        <parameter name="aData"/>
   818 +        <parameter name="aData"/>
   800 +        <body>
   819 +        <body>
   862 +
   881 +
   863 +  <binding id="preference">
   882 +  <binding id="preference">
   864 +    <implementation>
   883 +    <implementation>
   865 +      <constructor>
   884 +      <constructor>
   866 +      <![CDATA[
   885 +      <![CDATA[
       
   886 +        this._constructed = true;
       
   887 +
   867 +        // if the element has been inserted without the name attribute set,
   888 +        // if the element has been inserted without the name attribute set,
   868 +        // we have nothing to do here
   889 +        // we have nothing to do here
   869 +        if (!this.name)
   890 +        if (!this.name)
   870 +          return;
   891 +          return;
   871 +
   892 +
   887 +            for (var l = 0; (l < parentPrefs.length && !preference); ++l) {
   908 +            for (var l = 0; (l < parentPrefs.length && !preference); ++l) {
   888 +              if (parentPrefs[l].localName == "preference")
   909 +              if (parentPrefs[l].localName == "preference")
   889 +                preference = parentPrefs[l];
   910 +                preference = parentPrefs[l];
   890 +            }
   911 +            }
   891 +          }
   912 +          }
   892 +          this._setValue(preference ? preference.value 
   913 +
   893 +                                    : this.valueFromPreferences, false);
   914 +          // Don't use the value setter here, we don't want updateElements to be prematurely fired.
       
   915 +          this._value = preference ? preference.value : this.valueFromPreferences;
   894 +        }
   916 +        }
   895 +        else
   917 +        else
   896 +          this._setValue(this.valueFromPreferences, false);
   918 +          this._value = this.valueFromPreferences;
       
   919 +        this.preferences._constructAfterChildren();
   897 +      ]]>
   920 +      ]]>
   898 +      </constructor>
   921 +      </constructor>
   899 +      <destructor>
   922 +      <destructor>
   900 +        this.preferences.rootBranchInternal
   923 +        this.preferences.rootBranchInternal
   901 +            .removeObserver(this.name, this.preferences);
   924 +            .removeObserver(this.name, this.preferences);
   902 +      </destructor>
   925 +      </destructor>
   903 +      
   926 +      <field name="_constructed">false</field>
   904 +      <property name="instantApply">
   927 +      <property name="instantApply">
   905 +        <getter>
   928 +        <getter>
   906 +          return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
   929 +          return this.getAttribute("instantApply") == "true" || this.preferences.instantApply;
   907 +        </getter>
   930 +        </getter>
   908 +      </property>
   931 +      </property>
   930 +                                onset="this.setAttribute('readonly', val); return val;"/>
   953 +                                onset="this.setAttribute('readonly', val); return val;"/>
   931 +
   954 +
   932 +      <field name="_value">null</field>
   955 +      <field name="_value">null</field>
   933 +      <method name="_setValue">
   956 +      <method name="_setValue">
   934 +        <parameter name="aValue"/>
   957 +        <parameter name="aValue"/>
   935 +        <parameter name="aUpdate"/>
       
   936 +        <body>
   958 +        <body>
   937 +        <![CDATA[
   959 +        <![CDATA[
   938 +          if (aUpdate && this.value !== aValue) {
   960 +          if (this.value !== aValue) {
   939 +            this._value = aValue;
   961 +            this._value = aValue;
   940 +            if (this.instantApply)
   962 +            if (this.instantApply)
   941 +              this.valueFromPreferences = aValue;
   963 +              this.valueFromPreferences = aValue;
   942 +            this.preferences.fireChangedEvent(this);
   964 +            this.preferences.fireChangedEvent(this);
   943 +          }
   965 +          }
   944 +          else if (!aUpdate) {
       
   945 +            this._value = aValue;
       
   946 +            this.updateElements();
       
   947 +          }
       
   948 +          return aValue;
   966 +          return aValue;
   949 +        ]]>
   967 +        ]]>
   950 +        </body>
   968 +        </body>
   951 +      </method>
   969 +      </method>
   952 +      <property name="value" onget="return this._value" onset="return this._setValue(val, true);"/>
   970 +      <property name="value" onget="return this._value" onset="return this._setValue(val);"/>
   953 +      
   971 +      
   954 +      <property name="locked">
   972 +      <property name="locked">
   955 +        <getter>
   973 +        <getter>
   956 +          return this.preferences.rootBranch.prefIsLocked(this.name);
   974 +          return this.preferences.rootBranch.prefIsLocked(this.name);
   957 +        </getter>
   975 +        </getter>
  1334 +        <xul:deck anonid="paneDeck" flex="1">
  1352 +        <xul:deck anonid="paneDeck" flex="1">
  1335 +          <children includes="prefpane"/>
  1353 +          <children includes="prefpane"/>
  1336 +        </xul:deck>
  1354 +        </xul:deck>
  1337 +      </xul:hbox>
  1355 +      </xul:hbox>
  1338 +      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" pack="end">
  1356 +      <xul:hbox anonid="dlg-buttons" class="prefWindow-dlgbuttons" pack="end">
  1339 +#ifdef XP_UNIX_GNOME
  1357 +#ifndef XP_UNIX
  1340 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
  1358 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
  1341 +        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
  1359 +        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
  1342 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
  1360 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
  1343 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
  1361 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
  1344 +        <xul:spacer anonid="spacer" flex="1"/>
  1362 +        <xul:spacer anonid="spacer" flex="1"/>
  1345 +        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
  1363 +        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
  1346 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
  1364 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
  1347 +#elif XP_UNIX
       
  1348 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
       
  1349 +        <xul:spacer anonid="spacer" flex="1"/>
       
  1350 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
       
  1351 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
       
  1352 +        <xul:button dlgtype="cancel" class="dialog-button" icon="cancel"/>
       
  1353 +        <xul:button dlgtype="help" class="dialog-button" hidden="true" icon="help"/>
       
  1354 +        <xul:button dlgtype="disclosure" class="dialog-button" hidden="true"/>
       
  1355 +#else
  1365 +#else
  1356 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
  1366 +        <xul:button dlgtype="extra2" class="dialog-button" hidden="true"/>
  1357 +        <xul:spacer anonid="spacer" flex="1"/>
  1367 +        <xul:spacer anonid="spacer" flex="1"/>
  1358 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
  1368 +        <xul:button dlgtype="accept" class="dialog-button" icon="accept"/>
  1359 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
  1369 +        <xul:button dlgtype="extra1" class="dialog-button" hidden="true"/>
  2624 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
  2634 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
  2625  endif
  2635  endif
  2626 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
  2636 diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
  2627 --- a/uriloader/exthandler/moz.build
  2637 --- a/uriloader/exthandler/moz.build
  2628 +++ b/uriloader/exthandler/moz.build
  2638 +++ b/uriloader/exthandler/moz.build
  2629 @@ -80,17 +80,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
  2639 @@ -75,17 +75,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
  2630  else:
  2640  else:
  2631      # These files can't be built in unified mode because they force NSPR logging.
  2641      # These files can't be built in unified mode because they force NSPR logging.
  2632      SOURCES += [
  2642      SOURCES += [
  2633          osdir + '/nsOSHelperAppService.cpp',
  2643          osdir + '/nsOSHelperAppService.cpp',
  2634      ]
  2644      ]
  3582      if (directive->regfunc) {
  3592      if (directive->regfunc) {
  3583        if (GeckoProcessType_Default != XRE_GetProcessType())
  3593        if (GeckoProcessType_Default != XRE_GetProcessType())
  3584 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3594 diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
  3585 --- a/xpcom/io/nsLocalFileUnix.cpp
  3595 --- a/xpcom/io/nsLocalFileUnix.cpp
  3586 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3596 +++ b/xpcom/io/nsLocalFileUnix.cpp
  3587 @@ -43,16 +43,17 @@
  3597 @@ -44,16 +44,17 @@
  3588  #include "nsIDirectoryEnumerator.h"
  3598  #include "nsIDirectoryEnumerator.h"
  3589  #include "nsISimpleEnumerator.h"
  3599  #include "nsISimpleEnumerator.h"
  3590  #include "private/pprio.h"
  3600  #include "private/pprio.h"
  3591  #include "prlink.h"
  3601  #include "prlink.h"
  3592  
  3602  
  3600  #include <Carbon/Carbon.h>
  3610  #include <Carbon/Carbon.h>
  3601  #include "CocoaFileUtils.h"
  3611  #include "CocoaFileUtils.h"
  3602  #include "prmem.h"
  3612  #include "prmem.h"
  3603  #include "plbase64.h"
  3613  #include "plbase64.h"
  3604  
  3614  
  3605 @@ -1816,46 +1817,52 @@ nsLocalFile::SetPersistentDescriptor(con
  3615 @@ -1962,53 +1963,55 @@ nsLocalFile::SetPersistentDescriptor(con
  3606      return InitWithNativePath(aPersistentDescriptor);
  3616    return InitWithNativePath(aPersistentDescriptor);
  3607  #endif
  3617  #endif
  3608  }
  3618  }
  3609  
  3619  
  3610  NS_IMETHODIMP
  3620  NS_IMETHODIMP
  3611  nsLocalFile::Reveal()
  3621  nsLocalFile::Reveal()
  3612  {
  3622  {
  3613  #ifdef MOZ_WIDGET_GTK
  3623  #ifdef MOZ_WIDGET_GTK
  3614 -    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3624 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3615 -    nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3625 -  nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3616 -    if (!giovfs && !gnomevfs)
  3626 -  if (!giovfs && !gnomevfs) {
  3617 -        return NS_ERROR_FAILURE;
  3627 -    return NS_ERROR_FAILURE;
       
  3628 -  }
  3618 -
  3629 -
  3619 +    nsAutoCString url;
  3630 +  nsAutoCString url;
  3620      bool isDirectory;
  3631    bool isDirectory;
  3621      if (NS_FAILED(IsDirectory(&isDirectory)))
  3632    if (NS_FAILED(IsDirectory(&isDirectory))) {
  3622          return NS_ERROR_FAILURE;
  3633      return NS_ERROR_FAILURE;
  3623  
  3634    }
  3624 +    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3635  
  3625      if (isDirectory) {
  3636 +  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3626 -        if (giovfs)
  3637    if (isDirectory) {
  3627 -            return giovfs->ShowURIForInput(mPath);
  3638 -    if (giovfs) {
  3628 -        else 
  3639 -      return giovfs->ShowURIForInput(mPath);
  3629 -            /* Fallback to GnomeVFS */
  3640 -    } else
  3630 -            return gnomevfs->ShowURIForInput(mPath);
  3641 -      /* Fallback to GnomeVFS */
  3631 +        url = mPath;
  3642 -    {
  3632      } else if (giovfs && NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
  3643 -      return gnomevfs->ShowURIForInput(mPath);
  3633          return NS_OK;
  3644 -    }
  3634      } else {
  3645 +    url = mPath;
  3635          nsCOMPtr<nsIFile> parentDir;
  3646    } else if (giovfs && NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
  3636          nsAutoCString dirPath;
  3647      return NS_OK;
  3637          if (NS_FAILED(GetParent(getter_AddRefs(parentDir))))
  3648    } else {
  3638              return NS_ERROR_FAILURE;
  3649      nsCOMPtr<nsIFile> parentDir;
  3639          if (NS_FAILED(parentDir->GetNativePath(dirPath)))
  3650      nsAutoCString dirPath;
  3640              return NS_ERROR_FAILURE;
  3651      if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
  3641  
  3652        return NS_ERROR_FAILURE;
  3642 -        if (giovfs)
       
  3643 -            return giovfs->ShowURIForInput(dirPath);
       
  3644 -        else 
       
  3645 -            return gnomevfs->ShowURIForInput(dirPath);        
       
  3646 +        url = dirPath;
       
  3647      }
  3653      }
  3648 +
  3654      if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
  3649 +    if(nsKDEUtils::kdeSupport()) {
  3655        return NS_ERROR_FAILURE;
  3650 +      nsTArray<nsCString> command;
  3656      }
  3651 +      command.AppendElement( NS_LITERAL_CSTRING("REVEAL") );
  3657  
  3652 +      command.AppendElement( mPath );
  3658 -    if (giovfs) {
  3653 +      return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3659 -      return giovfs->ShowURIForInput(dirPath);
  3654 +    }
  3660 -    } else {
  3655 +
  3661 -      return gnomevfs->ShowURIForInput(dirPath);
  3656 +    nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3662 -    }
  3657 +    if (!giovfs && !gnomevfs)
  3663 +    url = dirPath;
  3658 +      return NS_ERROR_FAILURE;
  3664    }
  3659 +
  3665 +
  3660 +    if (giovfs)
  3666 +  if(nsKDEUtils::kdeSupport()) {
  3661 +      return giovfs->ShowURIForInput(url);
  3667 +    nsTArray<nsCString> command;
  3662 +    else
  3668 +    command.AppendElement( NS_LITERAL_CSTRING("REVEAL") );
  3663 +      return gnomevfs->ShowURIForInput(url);
  3669 +    command.AppendElement( mPath );
       
  3670 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
  3671 +  }
       
  3672 +
       
  3673 +  nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
       
  3674 +  if (!giovfs && !gnomevfs)
       
  3675 +    return NS_ERROR_FAILURE;
       
  3676 +
       
  3677 +  if (giovfs)
       
  3678 +    return giovfs->ShowURIForInput(url);
       
  3679 +  else
       
  3680 +    return gnomevfs->ShowURIForInput(url);
  3664  #elif defined(MOZ_WIDGET_COCOA)
  3681  #elif defined(MOZ_WIDGET_COCOA)
  3665      CFURLRef url;
  3682    CFURLRef url;
  3666      if (NS_SUCCEEDED(GetCFURL(&url))) {
  3683    if (NS_SUCCEEDED(GetCFURL(&url))) {
  3667        nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3684      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  3668        ::CFRelease(url);
  3685      ::CFRelease(url);
  3669        return rv;
  3686      return rv;
  3670      }
  3687    }
  3671      return NS_ERROR_FAILURE;
  3688    return NS_ERROR_FAILURE;
  3672 @@ -1863,16 +1870,23 @@ nsLocalFile::Reveal()
  3689 @@ -2016,16 +2019,22 @@ nsLocalFile::Reveal()
  3673      return NS_ERROR_FAILURE;
  3690    return NS_ERROR_FAILURE;
  3674  #endif
  3691  #endif
  3675  }
  3692  }
  3676  
  3693  
  3677  NS_IMETHODIMP
  3694  NS_IMETHODIMP
  3678  nsLocalFile::Launch()
  3695  nsLocalFile::Launch()
  3679  {
  3696  {
  3680  #ifdef MOZ_WIDGET_GTK
  3697  #ifdef MOZ_WIDGET_GTK
  3681 +    if( nsKDEUtils::kdeSupport()) {
  3698 +  if( nsKDEUtils::kdeSupport()) {
  3682 +      nsTArray<nsCString> command;
  3699 +    nsTArray<nsCString> command;
  3683 +      command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3700 +    command.AppendElement( NS_LITERAL_CSTRING("OPEN") );
  3684 +      command.AppendElement( mPath );
  3701 +    command.AppendElement( mPath );
  3685 +      return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3702 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  3686 +    }
  3703 +  }
  3687 +
  3704    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3688      nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  3705    nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3689      nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
  3706    if (giovfs) {
  3690      if (giovfs) {
  3707      return giovfs->ShowURIForInput(mPath);
  3691        return giovfs->ShowURIForInput(mPath);
  3708    } else if (gnomevfs) {
  3692      } else if (gnomevfs) {
  3709      /* GnomeVFS fallback */
  3693        /* GnomeVFS fallback */
  3710      return gnomevfs->ShowURIForInput(mPath);
  3694        return gnomevfs->ShowURIForInput(mPath);
  3711    }
  3695      }