Package: pan / 0.146-2

use-x-www-browser Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Bug-Debian: https://bugs.debian.org/472110
Bug-Debian: https://bugs.debian.org/835934
Author: dod
Applied-Upstream: NA
Description: Use x-www-browser as a fallback browser
 call xdg-open as a fallback browser or fallback mailer. This mechanism is provided by freedesktop-org.
--- a/pan/gui/url.cc
+++ b/pan/gui/url.cc
@@ -106,14 +106,11 @@
 
   const char * mode_key = mode==WEB ? "browser-mode" : "mailer-mode";
   const char * custom_key = mode==WEB ? "custom-browser" : "custom-mailer";
-  const char * custom_fallback = mode==WEB ? "firefox" : "thunderbird";
+  const char * custom_fallback = "xdg-open";
+
   std::string cmd;
   const std::string env (prefs.get_string (mode_key, get_environment()));
-       if (env == "gnome")   cmd = "xdg-open";
-  else if (env == "kde")     cmd = "kfmclient exec";
-  else if (env == "mac")     cmd = "open";
-  else if (env == "windows") cmd = "rundll32 url.dll,FileProtocolHandler";
-  else                       cmd = prefs.get_string (custom_key, custom_fallback);
+  cmd = prefs.get_string (custom_key, custom_fallback);
 
   cmd += std::string(" \"") + tmp + '"';
   // std::cerr << __FILE__ << ':' << __LINE__ << " cmd [" << cmd << ']' << std::endl;
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -1290,10 +1290,10 @@
   HIG :: workarea_add_section_title (t, &row, _("Preferred Applications"));
     HIG :: workarea_add_section_spacer (t, row, 3);
     w = url_handler_new (prefs, "browser-mode", URL::get_environment(),
-                                "custom-browser", "firefox", b);
+                                "custom-browser", "xdg-open", b);
     HIG :: workarea_add_row (t, &row, _("_Web browser:"), w);
     w = url_handler_new (prefs, "mailer-mode", URL::get_environment(),
-                                "custom-mailer", "thunderbird", b);
+                                "custom-mailer", "xdg-open", b);
     HIG :: workarea_add_row (t, &row, _("_Mail reader:"), w);
     w = editor_new (prefs);
     HIG :: workarea_add_row (t, &row, _("_Text editor:"), w);