mozilla-kde.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Sat, 07 Mar 2020 09:48:10 +0100
branchfirefox73
changeset 1122 a9cd24eaa361
parent 1121 004e4b1efb26
child 1123 7fa561e5d7c7
permissions -rw-r--r--
73.0.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
828
59013b3a51f5 update to 36.0b3
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 807
diff changeset
     1
# HG changeset patch
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     2
# User msirringhaus@suse.de
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     3
# Date 1559294891 -7200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     4
#      Fri May 31 11:28:11 2019 +0200
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
     5
# Node ID c2aa7198fb925e7fde96abf65b6f68b9b755f112
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
     6
# Parent  48866e4a200fb5299b94af4d9841e38336cff9f4
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     7
Description: Add KDE integration to Firefox (toolkit parts)
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     8
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
     9
Author: Lubos Lunak <lunak@suse.com>
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    10
Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    11
     https://bugzilla.novell.com/show_bug.cgi?id=170055
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
    12
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    13
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    14
--- a/modules/libpref/Preferences.cpp
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
    15
+++ b/modules/libpref/Preferences.cpp
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
    16
@@ -84,16 +84,17 @@
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    17
 #include "nsXPCOM.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    18
 #include "nsXULAppAPI.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    19
 #include "nsZipArchive.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    20
 #include "plbase64.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    21
 #include "PLDHashTable.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    22
 #include "plstr.h"
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    23
 #include "prlink.h"
1106
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
    24
 #include "xpcpublic.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
 
1106
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
    27
 #ifdef DEBUG
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
    28
 #  include <map>
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
    29
 #endif
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
    30
 
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    31
 #ifdef MOZ_MEMORY
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    32
 #  include "mozmemory.h"
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
    33
 #endif
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
    34
@@ -4539,25 +4540,37 @@ nsresult Preferences::InitInitialObjects
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    35
   // application pref files for backwards compatibility.
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    36
   static const char* specialFiles[] = {
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    37
 #if defined(XP_MACOSX)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    38
     "macprefs.js"
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    39
 #elif defined(XP_WIN)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    40
     "winpref.js"
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    41
 #elif defined(XP_UNIX)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    42
     "unix.js"
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    43
+    , "" // placeholder for KDE  (empty is otherwise harmless)
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    44
 #  if defined(_AIX)
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    45
     ,
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    46
     "aix.js"
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
    47
 #  endif
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    48
 #elif defined(XP_BEOS)
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    49
     "beos.js"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    50
 #endif
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    51
   };
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    52
 
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    53
+  if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
    54
+    for(int i = 0;
716
cef565f1c325 update to Firefox 29.0b7
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 703
diff changeset
    55
+        i < MOZ_ARRAY_LENGTH(specialFiles);
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    56
+        ++i ) {
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    57
+      if( *specialFiles[ i ] == '\0' ) {
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    58
+        specialFiles[ i ] = "kde.js";
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    59
+        break;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    60
+      }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    61
+    }
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    62
+  }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
    63
+
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    64
   rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    65
                            ArrayLength(specialFiles));
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    66
   if (NS_FAILED(rv)) {
340
aabcc7895695 update to version 8.0b1 (just merged stuff; build might still fail)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 294
diff changeset
    67
     NS_WARNING("Error parsing application default preferences.");
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    68
   }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    69
 
289
3c0dff7ca9c4 Update to version 6.0b1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 284
diff changeset
    70
   // Load jar:$app/omni.jar!/defaults/preferences/*.js
438
7d934b2f5014 rebased and removed upstreamed and obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 419
diff changeset
    71
   // or jar:$gre/omni.jar!/defaults/preferences/*.js.
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
    72
@@ -4603,17 +4616,17 @@ nsresult Preferences::InitInitialObjects
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    73
       }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    74
 
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    75
       nsCOMPtr<nsIFile> path = do_QueryInterface(elem);
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    76
       if (!path) {
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    77
         continue;
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    78
       }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    79
 
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    80
       // Do we care if a file provided by this process fails to load?
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    81
-      pref_LoadPrefsInDir(path, nullptr, 0);
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    82
+      pref_LoadPrefsInDir(path, specialFiles, ArrayLength(specialFiles));
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    83
     }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    84
   }
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
    85
 
1055
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    86
   if (XRE_IsParentProcess()) {
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    87
     SetupTelemetryPref();
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    88
   }
526f445635f3 removed obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1050
diff changeset
    89
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
    90
   NS_CreateServicesFromCategory(NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID, nullptr,
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    91
diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    92
--- a/modules/libpref/moz.build
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
    93
+++ b/modules/libpref/moz.build
1119
4c5d44d40a03 Firefox 72.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1112
diff changeset
    94
@@ -113,16 +113,20 @@ EXPORTS.mozilla += [
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    95
 ]
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
    96
 EXPORTS.mozilla += sorted(['!' + g for g in gen_h])
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
    97
 
985
038d048a3940 Firefox 55.0b13
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 982
diff changeset
    98
 UNIFIED_SOURCES += [
038d048a3940 Firefox 55.0b13
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 982
diff changeset
    99
     'Preferences.cpp',
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   100
     'SharedPrefMap.cpp',
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   101
 ]
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   102
 
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   103
+LOCAL_INCLUDES += [
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   104
+    '/toolkit/xre'
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   105
+]
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   106
+
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   107
 gen_all_tuple = tuple(gen_h + gen_cpp + gen_rs)
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   108
 
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   109
 GENERATED_FILES += [gen_all_tuple]
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   110
 
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   111
 static_pref_list = GENERATED_FILES[gen_all_tuple]
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   112
 static_pref_list.script = 'init/generate_static_pref_list.py:emit_code'
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   113
 static_pref_list.inputs = ['init/StaticPrefList.yaml']
904
6a889427cd4f 45.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 901
diff changeset
   114
 
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   115
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   116
--- a/python/mozbuild/mozpack/chrome/flags.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   117
+++ b/python/mozbuild/mozpack/chrome/flags.py
1106
6c6375987b6c rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1099
diff changeset
   118
@@ -227,16 +227,17 @@ class Flags(OrderedDict):
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   119
         'contentaccessible': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   120
         'os': StringFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   121
         'osversion': VersionFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   122
         'abi': StringFlag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   123
         'platform': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   124
         'xpcnativewrappers': Flag,
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   125
         'tablet': Flag,
807
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   126
         'process': StringFlag,
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   127
+        'desktop': StringFlag,
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   128
     }
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   129
     RE = re.compile(r'([!<>=]+)')
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   130
 
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   131
     def __init__(self, *flags):
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   132
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   133
         Initialize a set of flags given in string form.
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   134
            flags = Flags('contentaccessible=yes', 'appversion>=3.5')
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   135
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   136
diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpack/chrome/manifest.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   137
--- a/python/mozbuild/mozpack/chrome/manifest.py
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   138
+++ b/python/mozbuild/mozpack/chrome/manifest.py
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   139
@@ -37,16 +37,17 @@ class ManifestEntry(object):
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   140
         'platformversion',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   141
         'os',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   142
         'osversion',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   143
         'abi',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   144
         'xpcnativewrappers',
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   145
         'tablet',
807
f54c68340963 Aurora 35.0 (20141115) uplift
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 779
diff changeset
   146
         'process',
1005
6d716caa6abe 57.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 999
diff changeset
   147
         'contentaccessible',
6d716caa6abe 57.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 999
diff changeset
   148
+	'desktop',
637
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   149
     ]
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   150
 
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   151
     def __init__(self, base, *flags):
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   152
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   153
         Initialize a manifest entry with the given base path and flags.
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   154
         '''
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   155
         self.base = base
73640b76d6c3 first building version of FF21
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 612
diff changeset
   156
         self.flags = Flags(*flags)
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   157
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   158
--- a/toolkit/components/downloads/moz.build
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   159
+++ b/toolkit/components/downloads/moz.build
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   160
@@ -41,10 +41,14 @@ XPCOM_MANIFESTS += [
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   161
 
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   162
 if CONFIG['MOZ_PLACES']:
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   163
     EXTRA_JS_MODULES += [
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   164
         'DownloadHistory.jsm',
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   165
     ]
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   166
 
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   167
 FINAL_LIBRARY = 'xul'
251
4c9ebbedd59c adopt patches to new base
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 244
diff changeset
   168
 
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   169
+LOCAL_INCLUDES += [
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   170
+    '/toolkit/xre'
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   171
+]
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   172
+
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   173
 with Files('**'):
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   174
     BUG_COMPONENT = ('Toolkit', 'Downloads API')
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   175
diff --git a/toolkit/mozapps/downloads/HelperAppDlg.jsm b/toolkit/mozapps/downloads/HelperAppDlg.jsm
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   176
--- a/toolkit/mozapps/downloads/HelperAppDlg.jsm
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   177
+++ b/toolkit/mozapps/downloads/HelperAppDlg.jsm
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   178
@@ -1195,36 +1195,66 @@ nsUnknownContentTypeDialog.prototype = {
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   179
         params.handlerApp &&
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   180
         params.handlerApp.executable &&
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   181
         params.handlerApp.executable.isFile()
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   182
       ) {
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   183
         // Remember the file they chose to run.
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   184
         this.chosenApp = params.handlerApp;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   185
       }
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   186
     } else if ("@mozilla.org/applicationchooser;1" in Cc) {
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   187
-      var nsIApplicationChooser = Ci.nsIApplicationChooser;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   188
-      var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   189
-        nsIApplicationChooser
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   190
-      );
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   191
-      appChooser.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   192
-        this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   193
-        this.dialogElement("strings").getString("chooseAppFilePickerTitle")
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   194
-      );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   195
-      var contentTypeDialogObj = this;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   196
-      let appChooserCallback = function appChooserCallback_done(aResult) {
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   197
-        if (aResult) {
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   198
-          contentTypeDialogObj.chosenApp = aResult.QueryInterface(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   199
-            Ci.nsILocalHandlerApp
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   200
-          );
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   201
-        }
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   202
-        contentTypeDialogObj.finishChooseApp();
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   203
-      };
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   204
-      appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   205
-      // The finishChooseApp is called from appChooserCallback
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   206
-      return;
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   207
+      // handle the KDE case which is implemented in the filepicker
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   208
+      // therefore falling back to Gtk2 like behaviour if KDE is running
994
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   209
+      // FIXME this should be better handled in the nsIApplicationChooser
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   210
+      // interface
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   211
+      var env = Components.classes["@mozilla.org/process/environment;1"]
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   212
+                          .getService(Components.interfaces.nsIEnvironment);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   213
+      if (env.get('KDE_FULL_SESSION') == "true")
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   214
+      {
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   215
+        var nsIFilePicker = Ci.nsIFilePicker;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   216
+        var fp = Cc["@mozilla.org/filepicker;1"]
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   217
+                    .createInstance(nsIFilePicker);
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   218
+        fp.init(this.mDialog,
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   219
+                this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   220
+                nsIFilePicker.modeOpen);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   221
+
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   222
+        fp.appendFilters(nsIFilePicker.filterApps);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   223
+
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   224
+        fp.open(aResult => {
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   225
+          if (aResult == nsIFilePicker.returnOK && fp.file) {
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   226
+            // Remember the file they chose to run.
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   227
+            var localHandlerApp =
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   228
+              Cc["@mozilla.org/uriloader/local-handler-app;1"].
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   229
+                         createInstance(Ci.nsILocalHandlerApp);
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   230
+            localHandlerApp.executable = fp.file;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   231
+            this.chosenApp = localHandlerApp;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   232
+          }
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   233
+          this.finishChooseApp();
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   234
+        });
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   235
+      } else {
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   236
+        var nsIApplicationChooser = Ci.nsIApplicationChooser;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   237
+        var appChooser = Cc["@mozilla.org/applicationchooser;1"].createInstance(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   238
+          nsIApplicationChooser
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   239
+        );
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   240
+        appChooser.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   241
+          this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   242
+          this.dialogElement("strings").getString("chooseAppFilePickerTitle")
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   243
+        );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   244
+        var contentTypeDialogObj = this;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   245
+        let appChooserCallback = function appChooserCallback_done(aResult) {
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   246
+          if (aResult) {
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   247
+            contentTypeDialogObj.chosenApp = aResult.QueryInterface(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   248
+              Ci.nsILocalHandlerApp
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   249
+            );
944
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   250
+          }
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   251
+          contentTypeDialogObj.finishChooseApp();
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   252
+        };
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   253
+        appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   254
+        // The finishChooseApp is called from appChooserCallback
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   255
+        return;
ce8a98f8d8d7 Firefox 52.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 942
diff changeset
   256
+      }
994
9fc447b00040 Firefox 56.0b12
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 985
diff changeset
   257
     } else {
1045
f645c886d36b rebased
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1033
diff changeset
   258
       var nsIFilePicker = Ci.nsIFilePicker;
1099
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   259
       var fp = Cc["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   260
       fp.init(
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   261
         this.mDialog,
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   262
         this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   263
         nsIFilePicker.modeOpen
8a3c73e74e65 68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate68.1.0 candidate
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1097
diff changeset
   264
       );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   265
diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   266
--- a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   267
+++ b/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   268
@@ -13,16 +13,17 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   269
 #include "nsPrintfCString.h"
885
ee3c462047d5 42 beta cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 881
diff changeset
   270
 #include "nsNetCID.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   271
 #include "nsNetUtil.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   272
 #include "nsISupportsPrimitives.h"
399
20f8b5f0aea6 port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 398
diff changeset
   273
 #include "nsIGSettingsService.h"
419
f6b055dd94bc commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 409
diff changeset
   274
 #include "nsInterfaceHashtable.h"
541
830e50bbfc79 working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 538
diff changeset
   275
 #include "mozilla/Attributes.h"
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   276
 #include "nsIURI.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   277
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   278
 
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   279
 using namespace mozilla;
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   280
 
850
a2bdff616a0e prepare 38beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 837
diff changeset
   281
 class nsUnixSystemProxySettings final : public nsISystemProxySettings {
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   282
  public:
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   283
   NS_DECL_ISUPPORTS
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   284
   NS_DECL_NSISYSTEMPROXYSETTINGS
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   285
 
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   286
@@ -36,16 +37,18 @@ class nsUnixSystemProxySettings final : 
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   287
   nsCOMPtr<nsIGSettingsCollection> mProxySettings;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   288
   nsInterfaceHashtable<nsCStringHashKey, nsIGSettingsCollection>
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   289
       mSchemeProxySettings;
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   290
   nsresult GetProxyFromGSettings(const nsACString& aScheme,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   291
                                  const nsACString& aHost, int32_t aPort,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   292
                                  nsACString& aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   293
   nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   294
                                        nsACString& aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   295
+  nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   296
+                           PRInt32 aPort, nsACString& aResult);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   297
 };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   298
 
738
f118b88b7d7f Aurora 31 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 718
diff changeset
   299
 NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   300
 
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   301
 NS_IMETHODIMP
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   302
 nsUnixSystemProxySettings::GetMainThreadOnly(bool* aMainThreadOnly) {
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   303
   // dbus prevents us from being threadsafe, but this routine should not block
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   304
   // anyhow
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   305
@@ -380,21 +383,50 @@ nsresult nsUnixSystemProxySettings::GetP
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   306
   return NS_OK;
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   307
 }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   308
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   309
 nsresult nsUnixSystemProxySettings::GetProxyForURI(const nsACString& aSpec,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   310
                                                    const nsACString& aScheme,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   311
                                                    const nsACString& aHost,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   312
                                                    const int32_t aPort,
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   313
                                                    nsACString& aResult) {
596
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 589
diff changeset
   314
+  if (nsKDEUtils::kdeSupport())
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   315
+    return GetProxyFromKDE(aScheme, aHost, aPort, aResult);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   316
+
419
f6b055dd94bc commit Aurora 13 state
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 409
diff changeset
   317
   if (mProxySettings) {
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   318
     nsresult rv = GetProxyFromGSettings(aScheme, aHost, aPort, aResult);
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   319
     if (NS_SUCCEEDED(rv)) return rv;
399
20f8b5f0aea6 port KDE patches to Gecko 11
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 398
diff changeset
   320
   }
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   321
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   322
   return GetProxyFromEnvironment(aScheme, aHost, aPort, aResult);
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   323
 }
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   324
 
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   325
+nsresult
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   326
+nsUnixSystemProxySettings::GetProxyFromKDE(const nsACString& aScheme,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   327
+                                           const nsACString& aHost,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   328
+                                           PRInt32 aPort,
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   329
+                                           nsACString& aResult)
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   330
+{
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   331
+  nsAutoCString url;
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   332
+  url = aScheme;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   333
+  url += "://";
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   334
+  url += aHost;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   335
+  if( aPort >= 0 )
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   336
+  {
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   337
+    url += ":";
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   338
+    url += nsPrintfCString("%d", aPort);
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   339
+  }
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   340
+  nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   341
+  command.AppendElement( NS_LITERAL_CSTRING( "GETPROXY" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   342
+  command.AppendElement( url );
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   343
+  nsTArray<nsCString> result;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   344
+  if( !nsKDEUtils::command( command, &result ) || result.Length() != 1 )
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   345
+    return NS_ERROR_FAILURE;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   346
+  aResult = result[0];
284
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   347
+  return NS_OK;
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   348
+}
ccddc8555cdb readd lost method for non libproxy builds
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 260
diff changeset
   349
+
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   350
+
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   351
 NS_IMPL_COMPONENT_FACTORY(nsUnixSystemProxySettings) {
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   352
   auto result = MakeRefPtr<nsUnixSystemProxySettings>();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   353
   result->Init();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   354
   return result.forget().downcast<nsISupports>();
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   355
 }
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   356
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   357
--- a/toolkit/xre/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   358
+++ b/toolkit/xre/moz.build
1121
004e4b1efb26 Firefox 73.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1119
diff changeset
   359
@@ -88,17 +88,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   360
         '../components/printingui',
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   361
     ]
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   362
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   363
     UNIFIED_SOURCES += [
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   364
         'nsNativeAppSupportDefault.cpp',
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
   365
         'UIKitDirProvider.mm',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   366
     ]
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   367
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   368
+    EXPORTS += ['nsKDEUtils.h']
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   369
     UNIFIED_SOURCES += [
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   370
+        'nsKDEUtils.cpp',
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   371
         'nsNativeAppSupportUnix.cpp',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   372
     ]
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   373
 else:
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   374
     UNIFIED_SOURCES += [
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   375
         'nsNativeAppSupportDefault.cpp',
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   376
     ]
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   377
 
1093
3942c205588b 67.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1089
diff changeset
   378
 if CONFIG['MOZ_HAS_REMOTE']:
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   379
diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   380
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   381
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   382
+++ b/toolkit/xre/nsKDEUtils.cpp
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   383
@@ -0,0 +1,344 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   384
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   385
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   386
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   387
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   388
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   389
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   390
+#include "nsIWidget.h"
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   391
+#include "nsISupportsPrimitives.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   392
+#include "nsIMutableArray.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   393
+#include "nsComponentManagerUtils.h"
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   394
+#include "nsArrayUtils.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   395
+
10
1920f0ff04a3 Make mozilla-kde.patch compile with 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 9
diff changeset
   396
+#include <gtk/gtk.h>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   397
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   398
+#include <limits.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   399
+#include <stdio.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   400
+#include <sys/wait.h>
517
fa93154734b8 Fix mozilla-kde.patch to include sys/resource.h for getrlimit etc (glibc 2.16)
Andreas Jaeger <aj@suse.de>
parents: 515
diff changeset
   401
+#include <sys/resource.h>
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   402
+#include <unistd.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   403
+#include <X11/Xlib.h>
935
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   404
+// copied from X11/X.h as a hack since for an unknown
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   405
+// reason it's not picked up from X11/X.h
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   406
+#ifndef None
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   407
+#define None                 0L /* universal null resource or null atom */
9ae2b79d3bb1 prepare FF 51 -> 51.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 932
diff changeset
   408
+#endif
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   409
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   410
+//#define DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   411
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   412
+#define KMOZILLAHELPER "kmozillahelper"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   413
+#else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   414
+// not need for lib64, it's a binary
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   415
+#define KMOZILLAHELPER "/usr/lib/mozilla/kmozillahelper"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   416
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   417
+
538
be682f8c9361 revert API version change for kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 537
diff changeset
   418
+#define KMOZILLAHELPER_VERSION 6
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   419
+#define MAKE_STR2( n ) #n
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   420
+#define MAKE_STR( n ) MAKE_STR2( n )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   421
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   422
+static bool getKdeSession()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   423
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   424
+    Display* dpy = XOpenDisplay( NULL );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   425
+    if( dpy == NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   426
+        return false;
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   427
+    Atom kde_full_session = XInternAtom( dpy, "KDE_FULL_SESSION", true );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   428
+    bool kde = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   429
+    if( kde_full_session != None )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   430
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   431
+        int cnt;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   432
+        if( Atom* props = XListProperties( dpy, DefaultRootWindow( dpy ), &cnt ))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   433
+            {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   434
+            for( int i = 0;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   435
+                 i < cnt;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   436
+                 ++i )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   437
+                {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   438
+                if( props[ i ] == kde_full_session )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   439
+                    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   440
+                    kde = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   441
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   442
+                    fprintf( stderr, "KDE SESSION %d\n", kde );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   443
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   444
+                    break;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   445
+                    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   446
+                }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   447
+            XFree( props );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   448
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   449
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   450
+    XCloseDisplay( dpy );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   451
+    return kde;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   452
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   453
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   454
+static bool getKdeSupport()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   455
+    {
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   456
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   457
+    command.AppendElement( NS_LITERAL_CSTRING( "CHECK" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   458
+    command.AppendElement( NS_LITERAL_CSTRING( MAKE_STR( KMOZILLAHELPER_VERSION )));
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   459
+    bool kde = nsKDEUtils::command( command );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   460
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   461
+    fprintf( stderr, "KDE RUNNING %d\n", kde );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   462
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   463
+    return kde;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   464
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   465
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   466
+nsKDEUtils::nsKDEUtils()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   467
+    : commandFile( NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   468
+    , replyFile( NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   469
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   470
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   471
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   472
+nsKDEUtils::~nsKDEUtils()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   473
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   474
+//    closeHelper(); not actually useful, exiting will close the fd too
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   475
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   476
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   477
+nsKDEUtils* nsKDEUtils::self()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   478
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   479
+    static nsKDEUtils s;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   480
+    return &s;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   481
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   482
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   483
+static bool helperRunning = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   484
+static bool helperFailed = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   485
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   486
+bool nsKDEUtils::kdeSession()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   487
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   488
+    static bool session = getKdeSession();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   489
+    return session;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   490
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   491
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   492
+bool nsKDEUtils::kdeSupport()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   493
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   494
+    static bool support = kdeSession() && getKdeSupport();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   495
+    return support && helperRunning;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   496
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   497
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   498
+struct nsKDECommandData
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   499
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   500
+    FILE* file;
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   501
+    nsTArray<nsCString>* output;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   502
+    GMainLoop* loop;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   503
+    bool success;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   504
+    };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   505
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   506
+static gboolean kdeReadFunc( GIOChannel*, GIOCondition, gpointer data )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   507
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   508
+    nsKDECommandData* p = static_cast< nsKDECommandData* >( data );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   509
+    char buf[ 8192 ]; // TODO big enough
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   510
+    bool command_done = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   511
+    bool command_failed = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   512
+    while( !command_done && !command_failed && fgets( buf, 8192, p->file ) != NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   513
+        { // TODO what if the kernel splits a line into two chunks?
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   514
+//#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   515
+//        fprintf( stderr, "READ: %s %d\n", buf, feof( p->file ));
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   516
+//#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   517
+        if( char* eol = strchr( buf, '\n' ))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   518
+            *eol = '\0';
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   519
+        command_done = ( strcmp( buf, "\\1" ) == 0 );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   520
+        command_failed = ( strcmp( buf, "\\0" ) == 0 );
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   521
+        nsAutoCString line( buf );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   522
+        line.ReplaceSubstring( "\\n", "\n" );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   523
+        line.ReplaceSubstring( "\\" "\\", "\\" ); //  \\ -> \ , i.e. unescape
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   524
+        if( p->output && !( command_done || command_failed ))
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   525
+            p->output->AppendElement( nsCString( buf )); // TODO utf8?
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   526
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   527
+    bool quit = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   528
+    if( feof( p->file ) || command_failed )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   529
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   530
+        quit = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   531
+        p->success = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   532
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   533
+    if( command_done )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   534
+        { // reading one reply finished
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   535
+        quit = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   536
+        p->success = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   537
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   538
+    if( quit )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   539
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   540
+        if( p->loop )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   541
+            g_main_loop_quit( p->loop );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   542
+        return FALSE;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   543
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   544
+    return TRUE;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   545
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   546
+
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   547
+bool nsKDEUtils::command( const nsTArray<nsCString>& command, nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   548
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   549
+    return self()->internalCommand( command, NULL, false, output );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   550
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   551
+
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   552
+bool nsKDEUtils::command( nsIArray* command, nsIArray** output)
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   553
+    {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   554
+    nsTArray<nsCString> in;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   555
+    PRUint32 length;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   556
+    command->GetLength( &length );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   557
+    for ( PRUint32 i = 0; i < length; i++ )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   558
+        {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   559
+        nsCOMPtr<nsISupportsCString> str = do_QueryElementAt( command, i );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   560
+        if( str )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   561
+            {
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   562
+            nsAutoCString s;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   563
+            str->GetData( s );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   564
+            in.AppendElement( s );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   565
+            }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   566
+        }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   567
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   568
+    nsTArray<nsCString> out;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   569
+    bool ret = self()->internalCommand( in, NULL, false, &out );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   570
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   571
+    if ( !output ) return ret;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   572
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   573
+    nsCOMPtr<nsIMutableArray> result = do_CreateInstance( NS_ARRAY_CONTRACTID );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   574
+    if ( !result ) return false;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   575
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   576
+    for ( PRUint32 i = 0; i < out.Length(); i++ )
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   577
+        {
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   578
+        nsCOMPtr<nsISupportsCString> rstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   579
+        if ( !rstr ) return false;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   580
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   581
+        rstr->SetData( out[i] );
1021
1307721d2345 fixed patches for FF58
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1020
diff changeset
   582
+        result->AppendElement( rstr );
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   583
+        }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   584
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   585
+    NS_ADDREF( *output = result);
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   586
+    return ret;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   587
+    }
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   588
+
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   589
+
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   590
+bool nsKDEUtils::commandBlockUi( const nsTArray<nsCString>& command, GtkWindow* parent, nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   591
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   592
+    return self()->internalCommand( command, parent, true, output );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   593
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   594
+
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   595
+bool nsKDEUtils::internalCommand( const nsTArray<nsCString>& command, GtkWindow* parent, bool blockUi,
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   596
+    nsTArray<nsCString>* output )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   597
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   598
+    if( !startHelper())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   599
+        return false;
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   600
+    feedCommand( command );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   601
+    // do not store the data in 'this' but in extra structure, just in case there
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   602
+    // is reentrancy (can there be? the event loop is re-entered)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   603
+    nsKDECommandData data;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   604
+    data.file = replyFile;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   605
+    data.output = output;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   606
+    data.success = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   607
+    if( blockUi )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   608
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   609
+        data.loop = g_main_loop_new( NULL, FALSE );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   610
+        GtkWidget* window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   611
+        if( parent && gtk_window_get_group(parent) )
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   612
+            gtk_window_group_add_window( gtk_window_get_group(parent), GTK_WINDOW( window ));
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   613
+        gtk_widget_realize( window );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   614
+        gtk_widget_set_sensitive( window, TRUE );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   615
+        gtk_grab_add( window );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   616
+        GIOChannel* channel = g_io_channel_unix_new( fileno( data.file ));
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   617
+        g_io_add_watch( channel, static_cast< GIOCondition >( G_IO_IN | G_IO_ERR | G_IO_HUP ), kdeReadFunc, &data );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   618
+        g_io_channel_unref( channel );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   619
+        g_main_loop_run( data.loop );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   620
+        g_main_loop_unref( data.loop );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   621
+        gtk_grab_remove( window );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   622
+        gtk_widget_destroy( window );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   623
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   624
+    else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   625
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   626
+        data.loop = NULL;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   627
+        while( kdeReadFunc( NULL, static_cast< GIOCondition >( 0 ), &data ))
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   628
+            ;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   629
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   630
+    return data.success;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   631
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   632
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   633
+bool nsKDEUtils::startHelper()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   634
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   635
+    if( helperRunning )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   636
+        return true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   637
+    if( helperFailed )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   638
+        return false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   639
+    helperFailed = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   640
+    int fdcommand[ 2 ];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   641
+    int fdreply[ 2 ];
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   642
+    if( pipe( fdcommand ) < 0 )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   643
+        return false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   644
+    if( pipe( fdreply ) < 0 )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   645
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   646
+        close( fdcommand[ 0 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   647
+        close( fdcommand[ 1 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   648
+        return false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   649
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   650
+    char* args[ 2 ] = { const_cast< char* >( KMOZILLAHELPER ), NULL };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   651
+    switch( fork())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   652
+        {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   653
+        case -1:
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   654
+            {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   655
+            close( fdcommand[ 0 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   656
+            close( fdcommand[ 1 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   657
+            close( fdreply[ 0 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   658
+            close( fdreply[ 1 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   659
+            return false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   660
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   661
+        case 0: // child
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   662
+            {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   663
+            if( dup2( fdcommand[ 0 ], STDIN_FILENO ) < 0 )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   664
+                _exit( 1 );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   665
+            if( dup2( fdreply[ 1 ], STDOUT_FILENO ) < 0 )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   666
+                _exit( 1 );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   667
+            int maxfd = 1024; // close all other fds
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   668
+            struct rlimit rl;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   669
+            if( getrlimit( RLIMIT_NOFILE, &rl ) == 0 )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   670
+                maxfd = rl.rlim_max;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   671
+            for( int i = 3;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   672
+                 i < maxfd;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   673
+                 ++i )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   674
+                close( i );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   675
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   676
+            execvp( KMOZILLAHELPER, args );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   677
+#else
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   678
+            execv( KMOZILLAHELPER, args );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   679
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   680
+            _exit( 1 ); // failed
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   681
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   682
+        default: // parent
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   683
+            {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   684
+            commandFile = fdopen( fdcommand[ 1 ], "w" );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   685
+            replyFile = fdopen( fdreply[ 0 ], "r" );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   686
+            close( fdcommand[ 0 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   687
+            close( fdreply[ 1 ] );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   688
+            if( commandFile == NULL || replyFile == NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   689
+                {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   690
+                closeHelper();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   691
+                return false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   692
+                }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   693
+            // ok, helper ready, getKdeRunning() will check if it works
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   694
+            }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   695
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   696
+    helperFailed = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   697
+    helperRunning = true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   698
+    return true;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   699
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   700
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   701
+void nsKDEUtils::closeHelper()
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   702
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   703
+    if( commandFile != NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   704
+        fclose( commandFile ); // this will also make the helper quit
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   705
+    if( replyFile != NULL )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   706
+        fclose( replyFile );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   707
+    helperRunning = false;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   708
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   709
+
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   710
+void nsKDEUtils::feedCommand( const nsTArray<nsCString>& command )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   711
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   712
+    for( int i = 0;
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   713
+         i < command.Length();
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   714
+         ++i )
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   715
+        {
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   716
+        nsCString line = command[ i ];
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   717
+        line.ReplaceSubstring( "\\", "\\" "\\" ); // \ -> \\ , i.e. escape
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   718
+        line.ReplaceSubstring( "\n", "\\n" );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   719
+#ifdef DEBUG_KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   720
+        fprintf( stderr, "COMM: %s\n", line.get());
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   721
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   722
+        fputs( line.get(), commandFile );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   723
+        fputs( "\n", commandFile );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   724
+        }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   725
+    fputs( "\\E\n", commandFile ); // done as \E, so it cannot happen in normal data
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   726
+    fflush( commandFile );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   727
+    }
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   728
diff --git a/toolkit/xre/nsKDEUtils.h b/toolkit/xre/nsKDEUtils.h
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   729
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   730
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   731
+++ b/toolkit/xre/nsKDEUtils.h
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   732
@@ -0,0 +1,48 @@
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   733
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   734
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   735
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   736
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   737
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   738
+#ifndef nsKDEUtils_h__
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   739
+#define nsKDEUtils_h__
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   740
+
1033
51bfdd19b9e9 rebased everything to apply cleanly
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1032
diff changeset
   741
+#include "nsString.h"
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   742
+#include "nsTArray.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   743
+#include <stdio.h>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   744
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   745
+typedef struct _GtkWindow GtkWindow;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   746
+
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   747
+class nsIArray;
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   748
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   749
+class NS_EXPORT nsKDEUtils
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   750
+    {
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   751
+    public:
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   752
+        /* Returns true if running inside a KDE session (regardless of whether there is KDE
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   753
+           support available for Firefox). This should be used e.g. when determining
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   754
+           dialog button order but not for code that requires the KDE support. */
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   755
+        static bool kdeSession();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   756
+        /* Returns true if running inside a KDE session and KDE support is available
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   757
+           for Firefox. This should be used everywhere where the external helper is needed. */
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   758
+        static bool kdeSupport();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   759
+        /* Executes the given helper command, returns true if helper returned success. */
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   760
+        static bool command( const nsTArray<nsCString>& command, nsTArray<nsCString>* output = NULL );
398
937669e1c537 ported and reenabled KDE integration (bnc#746591)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 368
diff changeset
   761
+        static bool command( nsIArray* command, nsIArray** output = NULL );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   762
+        /* Like command(), but additionally blocks the parent widget like if there was
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   763
+           a modal dialog shown and enters the event loop (i.e. there are still paint updates,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   764
+           this is for commands that take long). */
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   765
+        static bool commandBlockUi( const nsTArray<nsCString>& command, GtkWindow* parent, nsTArray<nsCString>* output = NULL );
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   766
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   767
+    private:
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   768
+        nsKDEUtils();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   769
+        ~nsKDEUtils();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   770
+        static nsKDEUtils* self();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   771
+        bool startHelper();
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   772
+        void closeHelper();
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   773
+        void feedCommand( const nsTArray<nsCString>& command );
893
86f72f1e98a4 prepare Gtk3 based builds on a feature branch
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 889
diff changeset
   774
+        bool internalCommand( const nsTArray<nsCString>& command, GtkWindow* parent, bool isParent,
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   775
+            nsTArray<nsCString>* output );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   776
+        FILE* commandFile;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   777
+        FILE* replyFile;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   778
+    };
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   779
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   780
+#endif // nsKDEUtils
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   781
diff --git a/uriloader/exthandler/HandlerServiceParent.cpp b/uriloader/exthandler/HandlerServiceParent.cpp
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   782
--- a/uriloader/exthandler/HandlerServiceParent.cpp
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   783
+++ b/uriloader/exthandler/HandlerServiceParent.cpp
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   784
@@ -7,17 +7,17 @@
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   785
 #include "mozilla/ipc/ProtocolUtils.h"
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   786
 #include "mozilla/Logging.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   787
 #include "HandlerServiceParent.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   788
 #include "nsIHandlerService.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   789
 #include "nsIMIMEInfo.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   790
 #include "ContentHandlerService.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   791
 #include "nsStringEnumerator.h"
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   792
 #ifdef MOZ_WIDGET_GTK
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   793
-#  include "unix/nsGNOMERegistry.h"
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
   794
+#  include "unix/nsCommonRegistry.h"
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   795
 #endif
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   796
 
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   797
 using mozilla::dom::ContentHandlerService;
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   798
 using mozilla::dom::HandlerApp;
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   799
 using mozilla::dom::HandlerInfo;
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   800
 using mozilla::dom::RemoteHandlerApp;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   801
 
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   802
 namespace {
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   803
@@ -288,17 +288,17 @@ mozilla::ipc::IPCResult HandlerServicePa
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   804
 mozilla::ipc::IPCResult HandlerServiceParent::RecvExistsForProtocolOS(
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
   805
     const nsCString& aProtocolScheme, bool* aHandlerExists) {
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   806
   if (aProtocolScheme.Length() > MAX_SCHEME_LENGTH) {
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   807
     *aHandlerExists = false;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   808
     return IPC_OK();
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   809
   }
1050
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   810
 #ifdef MOZ_WIDGET_GTK
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   811
   // Check the GNOME registry for a protocol handler
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   812
-  *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme.get());
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   813
+  *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme.get());
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   814
 #else
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   815
   *aHandlerExists = false;
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   816
 #endif
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   817
   return IPC_OK();
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   818
 }
bf0d08380dcf fix Bug 1094747 - Open with option in download dialog has no effect with kmozillahelper
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1045
diff changeset
   819
 
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   820
 /*
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   821
  * Check if a handler exists for the provided protocol. Check the datastore
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   822
@@ -317,17 +317,17 @@ mozilla::ipc::IPCResult HandlerServicePa
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   823
   nsCOMPtr<nsIExternalProtocolService> protoSvc =
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   824
       do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv);
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   825
   if (NS_WARN_IF(NS_FAILED(rv))) {
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   826
     *aHandlerExists = false;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   827
     return IPC_OK();
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   828
   }
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   829
   rv = protoSvc->ExternalProtocolHandlerExists(aProtocolScheme.get(),
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   830
                                                aHandlerExists);
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   831
-
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   832
+##
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   833
   if (NS_WARN_IF(NS_FAILED(rv))) {
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   834
     *aHandlerExists = false;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   835
   }
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   836
 #else
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   837
   MOZ_RELEASE_ASSERT(false, "No implementation on this platform.");
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   838
   *aHandlerExists = false;
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   839
 #endif
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
   840
   return IPC_OK();
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   841
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   842
--- a/uriloader/exthandler/moz.build
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   843
+++ b/uriloader/exthandler/moz.build
1119
4c5d44d40a03 Firefox 72.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1112
diff changeset
   844
@@ -85,17 +85,19 @@ else:
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   845
     SOURCES += [
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   846
         osdir + '/nsOSHelperAppService.cpp',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   847
     ]
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   848
     if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
929
9fc2ebe6d7f1 Firefox 49.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 923
diff changeset
   849
         CXXFLAGS += ['-Wno-error=shadow']
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   850
 
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   851
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   852
     UNIFIED_SOURCES += [
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   853
+        'unix/nsCommonRegistry.cpp',
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   854
         'unix/nsGNOMERegistry.cpp',
1032
8220ea23b47d remove obsolete patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1021
diff changeset
   855
+        'unix/nsKDERegistry.cpp',
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   856
         'unix/nsMIMEInfoUnix.cpp',
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   857
     ]
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
   858
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
703
c4aab80e472f Firefox 28.0beta1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 691
diff changeset
   859
     UNIFIED_SOURCES += [
691
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   860
         'android/nsAndroidHandlerApp.cpp',
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   861
         'android/nsExternalURLHandlerService.cpp',
18c2dc922e51 update to Firefox 27.0b2
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 686
diff changeset
   862
         'android/nsMIMEInfoAndroid.cpp',
1074
4b99400f6d17 rebased patches and updated spec for 63.0b14
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1067
diff changeset
   863
     ]
1119
4c5d44d40a03 Firefox 72.0.1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1112
diff changeset
   864
@@ -135,16 +137,17 @@ include('/ipc/chromium/chromium-config.m
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   865
 FINAL_LIBRARY = 'xul'
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   866
 
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   867
 LOCAL_INCLUDES += [
1020
d2c159cb9bf2 rebased patches; updated spec file
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1014
diff changeset
   868
     '/docshell/base',
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   869
     '/dom/base',
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   870
     '/dom/ipc',
850
a2bdff616a0e prepare 38beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 837
diff changeset
   871
     '/netwerk/base',
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   872
     '/netwerk/protocol/http',
850
a2bdff616a0e prepare 38beta
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 837
diff changeset
   873
+    '/toolkit/xre',
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   874
 ]
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   875
 
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   876
 if CONFIG['MOZ_ENABLE_DBUS']:
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   877
     CXXFLAGS += CONFIG['TK_CFLAGS']
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   878
     CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   879
 
1112
8a4f5aea2475 Firefox 70.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1106
diff changeset
   880
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk':
779
354c672efefa rebased patches
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 766
diff changeset
   881
     CXXFLAGS += CONFIG['TK_CFLAGS']
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   882
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   883
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   884
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   885
+++ b/uriloader/exthandler/unix/nsCommonRegistry.cpp
869
0dd25a92df97 working FF 40 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 868
diff changeset
   886
@@ -0,0 +1,53 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   887
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   888
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   889
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   890
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   891
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   892
+#include "nsCommonRegistry.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   893
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   894
+#include "nsGNOMERegistry.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   895
+#include "nsKDERegistry.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   896
+#include "nsString.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   897
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   898
+
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   899
+/* static */ bool
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   900
+nsCommonRegistry::HandlerExists(const char *aProtocolScheme)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   901
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   902
+    if( nsKDEUtils::kdeSupport())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   903
+        return nsKDERegistry::HandlerExists( aProtocolScheme );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   904
+    return nsGNOMERegistry::HandlerExists( aProtocolScheme );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   905
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   906
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   907
+/* static */ nsresult
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   908
+nsCommonRegistry::LoadURL(nsIURI *aURL)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   909
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   910
+    if( nsKDEUtils::kdeSupport())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   911
+        return nsKDERegistry::LoadURL( aURL );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   912
+    return nsGNOMERegistry::LoadURL( aURL );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   913
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   914
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   915
+/* static */ void
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   916
+nsCommonRegistry::GetAppDescForScheme(const nsACString& aScheme,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   917
+                                     nsAString& aDesc)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   918
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   919
+    if( nsKDEUtils::kdeSupport())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   920
+        return nsKDERegistry::GetAppDescForScheme( aScheme, aDesc );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   921
+    return nsGNOMERegistry::GetAppDescForScheme( aScheme, aDesc );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   922
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   923
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   924
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   925
+/* static */ already_AddRefed<nsMIMEInfoBase>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   926
+nsCommonRegistry::GetFromExtension(const nsACString& aFileExt)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   927
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   928
+    if( nsKDEUtils::kdeSupport())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   929
+        return nsKDERegistry::GetFromExtension( aFileExt );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   930
+    return nsGNOMERegistry::GetFromExtension( aFileExt );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   931
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   932
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   933
+/* static */ already_AddRefed<nsMIMEInfoBase>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   934
+nsCommonRegistry::GetFromType(const nsACString& aMIMEType)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   935
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   936
+    if( nsKDEUtils::kdeSupport())
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   937
+        return nsKDERegistry::GetFromType( aMIMEType );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   938
+    return nsGNOMERegistry::GetFromType( aMIMEType );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   939
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   940
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.h b/uriloader/exthandler/unix/nsCommonRegistry.h
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   941
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   942
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   943
+++ b/uriloader/exthandler/unix/nsCommonRegistry.h
760
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   944
@@ -0,0 +1,28 @@
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   945
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   946
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   947
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   948
+
760
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   949
+#ifndef nsCommonRegistry_h__
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   950
+#define nsCommonRegistry_h__
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   951
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   952
+#include "nsIURI.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   953
+#include "nsCOMPtr.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   954
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   955
+class nsMIMEInfoBase;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   956
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   957
+class nsCommonRegistry
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   958
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   959
+ public:
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   960
+  static bool HandlerExists(const char *aProtocolScheme);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   961
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   962
+  static nsresult LoadURL(nsIURI *aURL);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   963
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   964
+  static void GetAppDescForScheme(const nsACString& aScheme,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   965
+                                  nsAString& aDesc);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   966
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   967
+  static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   968
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   969
+  static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   970
+};
760
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   971
+
7c3ac3010cc6 added header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 757
diff changeset
   972
+#endif
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   973
diff --git a/uriloader/exthandler/unix/nsKDERegistry.cpp b/uriloader/exthandler/unix/nsKDERegistry.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   974
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   975
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   976
+++ b/uriloader/exthandler/unix/nsKDERegistry.cpp
1007
65e317e42eff fixed KDE custom code and replaced obsolete types
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1006
diff changeset
   977
@@ -0,0 +1,87 @@
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   978
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   979
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   980
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
   981
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   982
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   983
+#include "nsKDERegistry.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   984
+#include "prlink.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   985
+#include "prmem.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   986
+#include "nsString.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   987
+#include "nsMIMEInfoUnix.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   988
+#include "nsAutoPtr.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   989
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   990
+
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   991
+/* static */ bool
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   992
+nsKDERegistry::HandlerExists(const char *aProtocolScheme)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   993
+{
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   994
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
   995
+    command.AppendElement( NS_LITERAL_CSTRING( "HANDLEREXISTS" ));
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
   996
+    command.AppendElement( nsAutoCString( aProtocolScheme ));
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   997
+    return nsKDEUtils::command( command );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   998
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
   999
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1000
+/* static */ nsresult
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1001
+nsKDERegistry::LoadURL(nsIURI *aURL)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1002
+{
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1003
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1004
+    command.AppendElement( NS_LITERAL_CSTRING( "OPEN" ));
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1005
+    nsCString url;
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1006
+    aURL->GetSpec( url );
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1007
+    command.AppendElement( url );
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1008
+    bool rv = nsKDEUtils::command( command );
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1009
+    if (!rv)
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1010
+      return NS_ERROR_FAILURE;
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1011
+
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1012
+    return NS_OK;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1013
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1014
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1015
+/* static */ void
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1016
+nsKDERegistry::GetAppDescForScheme(const nsACString& aScheme,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1017
+                                     nsAString& aDesc)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1018
+{
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1019
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1020
+    command.AppendElement( NS_LITERAL_CSTRING( "GETAPPDESCFORSCHEME" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1021
+    command.AppendElement( aScheme );
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1022
+    nsTArray<nsCString> output;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1023
+    if( nsKDEUtils::command( command, &output ) && output.Length() == 1 )
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1024
+        CopyUTF8toUTF16( output[ 0 ], aDesc );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1025
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1026
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1027
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1028
+/* static */ already_AddRefed<nsMIMEInfoBase>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1029
+nsKDERegistry::GetFromExtension(const nsACString& aFileExt)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1030
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1031
+    NS_ASSERTION(aFileExt[0] != '.', "aFileExt shouldn't start with a dot");
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1032
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1033
+    command.AppendElement( NS_LITERAL_CSTRING( "GETFROMEXTENSION" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1034
+    command.AppendElement( aFileExt );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1035
+    return GetFromHelper( command );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1036
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1037
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1038
+/* static */ already_AddRefed<nsMIMEInfoBase>
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1039
+nsKDERegistry::GetFromType(const nsACString& aMIMEType)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1040
+{
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1041
+    nsTArray<nsCString> command;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1042
+    command.AppendElement( NS_LITERAL_CSTRING( "GETFROMTYPE" ));
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1043
+    command.AppendElement( aMIMEType );
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1044
+    return GetFromHelper( command );
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1045
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1046
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1047
+/* static */ already_AddRefed<nsMIMEInfoBase>
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1048
+nsKDERegistry::GetFromHelper(const nsTArray<nsCString>& command)
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1049
+{
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1050
+    nsTArray<nsCString> output;
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1051
+    if( nsKDEUtils::command( command, &output ) && output.Length() == 3 )
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1052
+        {
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1053
+        nsCString mimetype = output[ 0 ];
901
eb9ebe3e2e6a nsRefPtr -> RefPtr
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 899
diff changeset
  1054
+        RefPtr<nsMIMEInfoUnix> mimeInfo = new nsMIMEInfoUnix( mimetype );
541
830e50bbfc79 working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 538
diff changeset
  1055
+        NS_ENSURE_TRUE(mimeInfo, nullptr);
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1056
+        nsCString description = output[ 1 ];
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1057
+        mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description));
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1058
+        nsCString handlerAppName = output[ 2 ];
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1059
+        mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(handlerAppName));
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1060
+        mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
659
fa96cf6ffd14 Aurora 24 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 653
diff changeset
  1061
+        return mimeInfo.forget();
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1062
+        }
541
830e50bbfc79 working Aurora 17.0 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 538
diff changeset
  1063
+    return nullptr;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1064
+}
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1065
diff --git a/uriloader/exthandler/unix/nsKDERegistry.h b/uriloader/exthandler/unix/nsKDERegistry.h
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1066
new file mode 100644
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1067
--- /dev/null
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1068
+++ b/uriloader/exthandler/unix/nsKDERegistry.h
757
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1069
@@ -0,0 +1,34 @@
546
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
  1070
+/* This Source Code Form is subject to the terms of the Mozilla Public
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
  1071
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
2c9448fe783c MPL-2.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 541
diff changeset
  1072
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1073
+
757
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1074
+#ifndef nsKDERegistry_h__
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1075
+#define nsKDERegistry_h__
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1076
+
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1077
+#include "nsIURI.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1078
+#include "nsCOMPtr.h"
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1079
+#include "nsTArray.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1080
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1081
+class nsMIMEInfoBase;
1007
65e317e42eff fixed KDE custom code and replaced obsolete types
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1006
diff changeset
  1082
+//class nsAutoCString;
65e317e42eff fixed KDE custom code and replaced obsolete types
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1006
diff changeset
  1083
+//class nsCString;
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1084
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1085
+class nsKDERegistry
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1086
+{
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1087
+ public:
568
2c74c5927ea2 first working Aurora 18 build
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 546
diff changeset
  1088
+  static bool HandlerExists(const char *aProtocolScheme);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1089
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1090
+  static nsresult LoadURL(nsIURI *aURL);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1091
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1092
+  static void GetAppDescForScheme(const nsACString& aScheme,
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1093
+                                  nsAString& aDesc);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1094
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1095
+  static already_AddRefed<nsMIMEInfoBase> GetFromExtension(const nsACString& aFileExt);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1096
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1097
+  static already_AddRefed<nsMIMEInfoBase> GetFromType(const nsACString& aMIMEType);
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1098
+ private:
367
3fabd9f66322 begin Firefox 10 cycle
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 356
diff changeset
  1099
+  static already_AddRefed<nsMIMEInfoBase> GetFromHelper(const nsTArray<nsCString>& command);
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1100
+
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1101
+};
757
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1102
+
7913ca5779dc header guards
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 748
diff changeset
  1103
+#endif //nsKDERegistry_h__
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1104
diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1105
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1106
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
1085
87f893cf45b9 Firefox 65.0 release
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1082
diff changeset
  1107
@@ -1,47 +1,50 @@
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1108
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1109
  *
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1110
  * This Source Code Form is subject to the terms of the Mozilla Public
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1111
  * License, v. 2.0. If a copy of the MPL was not distributed with this
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1112
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1113
 
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1114
 #include "nsMIMEInfoUnix.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1115
-#include "nsGNOMERegistry.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1116
+#include "nsCommonRegistry.h"
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
  1117
 #include "nsIGIOService.h"
236
a4f5954df3a3 update for 2.0/4.0rc1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 229
diff changeset
  1118
 #include "nsNetCID.h"
a4f5954df3a3 update for 2.0/4.0rc1
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 229
diff changeset
  1119
 #include "nsIIOService.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1120
 #include "nsAutoPtr.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1121
 #ifdef MOZ_ENABLE_DBUS
1089
eca1c1f2fe50 Firefox 66.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1085
diff changeset
  1122
 #  include "nsDBusHandlerApp.h"
9
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1123
 #endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1124
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1125
+#include "nsKDEUtils.h"
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1126
+#endif
bc5dfe5b853a Rebased KDE integration patches to 1.9.2
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
  1127
 
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
  1128
 nsresult nsMIMEInfoUnix::LoadUriInternal(nsIURI* aURI) {
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1129
-  return nsGNOMERegistry::LoadURL(aURI);
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1130
+  return nsCommonRegistry::LoadURL(aURI);
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1131
 }
127
4c86470ed796 Reenabling KDE integration patches (part 1: rebase and reenable; might need post-fixes)
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 64
diff changeset
  1132
 
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1133
 NS_IMETHODIMP
1097
840132a4a9b3 Firefox 68.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1093
diff changeset
  1134
 nsMIMEInfoUnix::GetHasDefaultHandler(bool* _retval) {
932
a58cc7936ce7 Firefox 50.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 929
diff changeset
  1135
   // if mDefaultApplication is set, it means the application has been set from
650
e8c83b144fd1 22.0b4 update
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 637
diff changeset
  1136
   // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to