mozilla-kde.patch
branchfirefox101
changeset 1174 90e3d0cf8567
parent 1172 7bdeb580be51
child 1175 4c6576f9cf04
equal deleted inserted replaced
1173:56ecd2ae6e61 1174:90e3d0cf8567
     1 # HG changeset patch
     1 # HG changeset patch
     2 # User msirringhaus@suse.de
     2 # User msirringhaus@suse.de
     3 # Date 1559294891 -7200
     3 # Date 1559294891 -7200
     4 #      Fri May 31 11:28:11 2019 +0200
     4 #      Fri May 31 11:28:11 2019 +0200
     5 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
     5 # Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
     6 # Parent  8d1110b6918acc4e7d3f655d1e55f4b4ff630abe
     6 # Parent  eeedc49c16aba3b50d1547315a88091a1c765904
     7 Description: Add KDE integration to Firefox (toolkit parts)
     7 Description: Add KDE integration to Firefox (toolkit parts)
     8 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     8 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     9 Author: Lubos Lunak <lunak@suse.com>
     9 Author: Lubos Lunak <lunak@suse.com>
    10 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
    10 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
    11      https://bugzilla.novell.com/show_bug.cgi?id=170055
    11      https://bugzilla.novell.com/show_bug.cgi?id=170055
    12 
    12 
    13 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
    13 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
    14 --- a/modules/libpref/Preferences.cpp
    14 --- a/modules/libpref/Preferences.cpp
    15 +++ b/modules/libpref/Preferences.cpp
    15 +++ b/modules/libpref/Preferences.cpp
    16 @@ -84,16 +84,17 @@
    16 @@ -88,16 +88,17 @@
    17  #include "plbase64.h"
       
    18  #include "PLDHashTable.h"
    17  #include "PLDHashTable.h"
    19  #include "plstr.h"
    18  #include "plstr.h"
    20  #include "prlink.h"
    19  #include "prlink.h"
    21  #include "xpcpublic.h"
    20  #include "xpcpublic.h"
       
    21  #include "js/RootingAPI.h"
    22  #ifdef MOZ_BACKGROUNDTASKS
    22  #ifdef MOZ_BACKGROUNDTASKS
    23  #  include "mozilla/BackgroundTasks.h"
    23  #  include "mozilla/BackgroundTasks.h"
    24  #endif
    24  #endif
    25 +#include "nsKDEUtils.h"
    25 +#include "nsKDEUtils.h"
    26  
    26  
    29  #endif
    29  #endif
    30  
    30  
    31  #ifdef MOZ_MEMORY
    31  #ifdef MOZ_MEMORY
    32  #  include "mozmemory.h"
    32  #  include "mozmemory.h"
    33  #endif
    33  #endif
    34 @@ -4634,16 +4635,27 @@ nsresult Preferences::InitInitialObjects
    34 @@ -4767,16 +4768,27 @@ nsresult Preferences::InitInitialObjects
    35      "unix.js"
    35      "unix.js"
    36  #  if defined(_AIX)
    36  #  if defined(_AIX)
    37      ,
    37      ,
    38      "aix.js"
    38      "aix.js"
    39  #  endif
    39  #  endif
    57      NS_WARNING("Error parsing application default preferences.");
    57      NS_WARNING("Error parsing application default preferences.");
    58    }
    58    }
    59  
    59  
    60    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    60    // Load jar:$app/omni.jar!/defaults/preferences/*.js
    61    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
    61    // or jar:$gre/omni.jar!/defaults/preferences/*.js.
    62 @@ -4708,17 +4720,17 @@ nsresult Preferences::InitInitialObjects
    62 @@ -4841,17 +4853,17 @@ nsresult Preferences::InitInitialObjects
    63        }
    63        }
    64  
    64  
    65        nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
    65        nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
    66        if (!path) {
    66        if (!path) {
    67          continue;
    67          continue;
    79  
    79  
    80    if (aIsStartup) {
    80    if (aIsStartup) {
    81 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
    81 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
    82 --- a/modules/libpref/moz.build
    82 --- a/modules/libpref/moz.build
    83 +++ b/modules/libpref/moz.build
    83 +++ b/modules/libpref/moz.build
    84 @@ -118,16 +118,20 @@ EXPORTS.mozilla += [
    84 @@ -120,16 +120,20 @@ EXPORTS.mozilla += [
    85  ]
    85  ]
    86  EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
    86  EXPORTS.mozilla += sorted(["!" + g for g in gen_h])
    87  
    87  
    88  UNIFIED_SOURCES += [
    88  UNIFIED_SOURCES += [
    89      "Preferences.cpp",
    89      "Preferences.cpp",
   826      UNIFIED_SOURCES += [
   826      UNIFIED_SOURCES += [
   827          "android/nsMIMEInfoAndroid.cpp",
   827          "android/nsMIMEInfoAndroid.cpp",
   828      ]
   828      ]
   829  elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
   829  elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
   830      UNIFIED_SOURCES += [
   830      UNIFIED_SOURCES += [
   831 @@ -126,16 +128,17 @@ include("/ipc/chromium/chromium-config.m
   831 @@ -130,16 +132,17 @@ include("/ipc/chromium/chromium-config.m
   832  FINAL_LIBRARY = "xul"
   832  FINAL_LIBRARY = "xul"
   833  
   833  
   834  LOCAL_INCLUDES += [
   834  LOCAL_INCLUDES += [
   835      "/docshell/base",
   835      "/docshell/base",
   836      "/dom/base",
   836      "/dom/base",
  1261        NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
  1261        NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
  1262        gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
  1262        gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
  1263 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  1263 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  1264 --- a/widget/gtk/moz.build
  1264 --- a/widget/gtk/moz.build
  1265 +++ b/widget/gtk/moz.build
  1265 +++ b/widget/gtk/moz.build
  1266 @@ -136,16 +136,17 @@ FINAL_LIBRARY = "xul"
  1266 @@ -154,16 +154,17 @@ FINAL_LIBRARY = "xul"
  1267  
  1267  
  1268  LOCAL_INCLUDES += [
  1268  LOCAL_INCLUDES += [
  1269      "/layout/base",
  1269      "/layout/base",
  1270      "/layout/forms",
  1270      "/layout/forms",
  1271      "/layout/generic",
  1271      "/layout/generic",
  1275 +    "/toolkit/xre",
  1275 +    "/toolkit/xre",
  1276      "/widget",
  1276      "/widget",
  1277      "/widget/headless",
  1277      "/widget/headless",
  1278  ]
  1278  ]
  1279  
  1279  
  1280  if CONFIG["MOZ_X11"]:
  1280  if CONFIG["MOZ_X11"] or CONFIG["MOZ_WAYLAND"]:
  1281      LOCAL_INCLUDES += [
  1281      LOCAL_INCLUDES += [
  1282          "/widget/x11",
  1282          "/widget/x11",
  1283      ]
  1283      ]
  1284 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  1284 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  1285 --- a/widget/gtk/nsFilePicker.cpp
  1285 --- a/widget/gtk/nsFilePicker.cpp
  1823  #  include <Carbon/Carbon.h>
  1823  #  include <Carbon/Carbon.h>
  1824  #  include "CocoaFileUtils.h"
  1824  #  include "CocoaFileUtils.h"
  1825  #  include "prmem.h"
  1825  #  include "prmem.h"
  1826  #  include "plbase64.h"
  1826  #  include "plbase64.h"
  1827  
  1827  
  1828 @@ -2071,62 +2072,77 @@ nsLocalFile::SetPersistentDescriptor(con
  1828 @@ -2071,20 +2072,29 @@ nsLocalFile::SetPersistentDescriptor(con
  1829  
  1829  
  1830  NS_IMETHODIMP
  1830  NS_IMETHODIMP
  1831  nsLocalFile::Reveal() {
  1831  nsLocalFile::Reveal() {
  1832    if (!FilePreferences::IsAllowedPath(mPath)) {
  1832    if (!FilePreferences::IsAllowedPath(mPath)) {
  1833      return NS_ERROR_FILE_ACCESS_DENIED;
  1833      return NS_ERROR_FILE_ACCESS_DENIED;
  1834    }
  1834    }
  1835  
  1835  
  1836  #ifdef MOZ_WIDGET_GTK
  1836  #ifdef MOZ_WIDGET_GTK
  1837 -  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  1837 +  nsAutoCString url;
       
  1838    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  1838 -  if (!giovfs) {
  1839 -  if (!giovfs) {
  1839 -    return NS_ERROR_FAILURE;
  1840 +  url = mPath;
       
  1841 +  if(nsKDEUtils::kdeSupport()) {
       
  1842 +    nsTArray<nsCString> command;
       
  1843 +    command.AppendElement( "REVEAL"_ns );
       
  1844 +    command.AppendElement( mPath );
       
  1845 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
  1846 +  }
       
  1847 +
       
  1848 +  if (!giovfs)
       
  1849      return NS_ERROR_FAILURE;
  1840 -  }
  1850 -  }
  1841 +  nsAutoCString url;
  1851 +
  1842  
  1852    return giovfs->RevealFile(this);
  1843    bool isDirectory;
       
  1844    if (NS_FAILED(IsDirectory(&isDirectory))) {
       
  1845      return NS_ERROR_FAILURE;
       
  1846    }
       
  1847  
       
  1848 +  nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
       
  1849    if (isDirectory) {
       
  1850 -    return giovfs->ShowURIForInput(mPath);
       
  1851 +    url = mPath;
       
  1852    }
       
  1853    if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
       
  1854      return NS_OK;
       
  1855    }
       
  1856    nsCOMPtr<nsIFile> parentDir;
       
  1857    nsAutoCString dirPath;
       
  1858    if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
       
  1859      return NS_ERROR_FAILURE;
       
  1860    }
       
  1861    if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
       
  1862      return NS_ERROR_FAILURE;
       
  1863    }
       
  1864  
       
  1865 -  return giovfs->ShowURIForInput(dirPath);
       
  1866 +  url = dirPath;
       
  1867  #elif defined(MOZ_WIDGET_COCOA)
  1853  #elif defined(MOZ_WIDGET_COCOA)
  1868    CFURLRef url;
  1854    CFURLRef url;
  1869    if (NS_SUCCEEDED(GetCFURL(&url))) {
  1855    if (NS_SUCCEEDED(GetCFURL(&url))) {
  1870      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  1856      nsresult rv = CocoaFileUtils::RevealFileInFinder(url);
  1871      ::CFRelease(url);
  1857      ::CFRelease(url);
  1872      return rv;
  1858      return rv;
  1873    }
  1859    }
  1874    return NS_ERROR_FAILURE;
  1860 @@ -2096,16 +2106,23 @@ nsLocalFile::Reveal() {
  1875  #else
       
  1876    return NS_ERROR_FAILURE;
       
  1877  #endif
       
  1878 +  if(nsKDEUtils::kdeSupport()) {
       
  1879 +    nsTArray<nsCString> command;
       
  1880 +    command.AppendElement( "REVEAL"_ns );
       
  1881 +    command.AppendElement( mPath );
       
  1882 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
  1883 +  }
       
  1884 +
       
  1885 +  if (!giovfs)
       
  1886 +    return NS_ERROR_FAILURE;
       
  1887 +
       
  1888 +  return giovfs->ShowURIForInput(url);
       
  1889  }
       
  1890  
  1861  
  1891  NS_IMETHODIMP
  1862  NS_IMETHODIMP
  1892  nsLocalFile::Launch() {
  1863  nsLocalFile::Launch() {
  1893    if (!FilePreferences::IsAllowedPath(mPath)) {
  1864    if (!FilePreferences::IsAllowedPath(mPath)) {
  1894      return NS_ERROR_FILE_ACCESS_DENIED;
  1865      return NS_ERROR_FILE_ACCESS_DENIED;
  1899 +    nsTArray<nsCString> command;
  1870 +    nsTArray<nsCString> command;
  1900 +    command.AppendElement( "OPEN"_ns );
  1871 +    command.AppendElement( "OPEN"_ns );
  1901 +    command.AppendElement( mPath );
  1872 +    command.AppendElement( mPath );
  1902 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  1873 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
  1903 +  }
  1874 +  }
       
  1875 +
  1904    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  1876    nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
  1905    if (!giovfs) {
  1877    if (!giovfs) {
  1906      return NS_ERROR_FAILURE;
  1878      return NS_ERROR_FAILURE;
  1907    }
  1879    }
  1908  
  1880  
  1909    return giovfs->ShowURIForInput(mPath);
  1881    return giovfs->LaunchFile(mPath);
  1910  #elif defined(MOZ_WIDGET_ANDROID)
  1882  #elif defined(MOZ_WIDGET_ANDROID)
  1911    // Not supported on GeckoView
  1883    // Not supported on GeckoView