/[gentoo-x86]/net-wireless/blueman/files/blueman-1.23-set-codeset-for-gettext-to-UTF-8-always.patch
Gentoo

Contents of /net-wireless/blueman/files/blueman-1.23-set-codeset-for-gettext-to-UTF-8-always.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Tue Jun 19 06:10:22 2012 UTC (7 years, 8 months ago) by dev-zero
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-diff
Fix segfault with non-UTF-8 locale (bug #414871).

(Portage version: 2.1.10.65/cvs/Linux x86_64)

1 From f585aea768ad98440d4967894aa9213cea6e6f14 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Tiziano=20M=C3=BCller?= <tm@dev-zero.ch>
3 Date: Tue, 19 Jun 2012 08:03:47 +0200
4 Subject: [PATCH] Set codeset for gettext to UTF-8 always
5
6 This fixes a segfault in g_markup_escape_text when loading the UI files
7 with a non-UTF-8 locale since GTK+ expects all strings (including translation)
8 to be in UTF-8.
9 ---
10 apps/blueman-adapters | 2 ++
11 apps/blueman-assistant | 2 ++
12 apps/blueman-manager | 2 ++
13 apps/blueman-sendto | 2 ++
14 apps/blueman-services | 2 ++
15 blueman/gui/GsmSettings.py | 2 ++
16 blueman/gui/applet/PluginDialog.py | 2 ++
17 blueman/main/applet/BluezAgent.py | 2 ++
18 blueman/plugins/applet/NetUsage.py | 2 ++
19 blueman/plugins/services/Audio.py | 2 ++
20 blueman/plugins/services/Network.py | 2 ++
21 blueman/plugins/services/Transfer.py | 2 ++
22 12 files changed, 24 insertions(+), 0 deletions(-)
23
24 diff --git a/apps/blueman-adapters b/apps/blueman-adapters
25 index 6adc642..51325ad 100755
26 --- a/apps/blueman-adapters
27 +++ b/apps/blueman-adapters
28 @@ -26,6 +26,7 @@ import gobject
29 import pango
30 import os.path
31 import sys
32 +from locale import bind_textdomain_codeset
33
34 #support running uninstalled
35 _dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
36 @@ -47,6 +48,7 @@ class BluemanAdapters:
37
38 builder = gtk.Builder()
39 builder.set_translation_domain("blueman")
40 + bind_textdomain_codeset("blueman", "UTF-8")
41 builder.add_from_file(UI_PATH +"/adapters.ui")
42 self.dialog = builder.get_object("dialog")
43
44 diff --git a/apps/blueman-assistant b/apps/blueman-assistant
45 index 32d8bd8..c30f663 100755
46 --- a/apps/blueman-assistant
47 +++ b/apps/blueman-assistant
48 @@ -35,6 +35,7 @@ import gtk
49 import random
50 import dbus.glib
51 from optparse import OptionParser
52 +from locale import bind_textdomain_codeset
53
54 #support running uninstalled
55 _dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
56 @@ -74,6 +75,7 @@ class Assistant(Agent):
57
58 self.Builder = gtk.Builder()
59 self.Builder.set_translation_domain("blueman")
60 + bind_textdomain_codeset("blueman", "UTF-8")
61 self.Builder.add_from_file(UI_PATH +"/assistant.ui")
62 self.assistant = self.Builder.get_object("assistant")
63 self.assistant.set_title(_("Bluetooth Assistant"))
64 diff --git a/apps/blueman-manager b/apps/blueman-manager
65 index e4a04e3..3aeb80f 100755
66 --- a/apps/blueman-manager
67 +++ b/apps/blueman-manager
68 @@ -25,6 +25,7 @@ import sys
69 import gtk
70 import dbus, dbus.glib
71 import gobject
72 +from locale import bind_textdomain_codeset
73
74 #support running uninstalled
75 _dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
76 @@ -56,6 +57,7 @@ class Blueman:
77
78 self.Builder = gtk.Builder()
79 self.Builder.set_translation_domain("blueman")
80 + bind_textdomain_codeset("blueman", "UTF-8")
81 self.Builder.add_from_file(UI_PATH +"/manager-main.ui")
82
83 self.window = self.Builder.get_object("window")
84 diff --git a/apps/blueman-sendto b/apps/blueman-sendto
85 index 72fcfa9..f8c082a 100755
86 --- a/apps/blueman-sendto
87 +++ b/apps/blueman-sendto
88 @@ -33,6 +33,7 @@ from optparse import OptionParser
89 import gettext
90 import urllib
91 import time
92 +from locale import bind_textdomain_codeset
93
94 from blueman.bluez.Adapter import Adapter
95 from blueman.main.Device import Device
96 @@ -56,6 +57,7 @@ class Sender(gobject.GObject):
97 gobject.GObject.__init__(self)
98 self.Builder = gtk.Builder()
99 self.Builder.set_translation_domain("blueman")
100 + bind_textdomain_codeset("blueman", "UTF-8")
101 self.Builder.add_from_file(UI_PATH +"/send-dialog.ui")
102 self.window = self.Builder.get_object("window")
103
104 diff --git a/apps/blueman-services b/apps/blueman-services
105 index d6d4545..2c15f03 100755
106 --- a/apps/blueman-services
107 +++ b/apps/blueman-services
108 @@ -8,6 +8,7 @@ if os.path.exists(os.path.join(_dirname,"ChangeLog")):
109 sys.path.insert(0, _dirname)
110
111 import gtk
112 +from locale import bind_textdomain_codeset
113 from blueman.gui.GenericList import GenericList
114
115 from blueman.Functions import *
116 @@ -25,6 +26,7 @@ class BluemanServices:
117
118 self.Builder = gtk.Builder()
119 self.Builder.set_translation_domain("blueman")
120 + bind_textdomain_codeset("blueman", "UTF-8")
121 self.Builder.add_from_file(UI_PATH +"/services.ui")
122
123 self.Config = Config()
124 diff --git a/blueman/gui/GsmSettings.py b/blueman/gui/GsmSettings.py
125 index 2e845ec..b4e1059 100644
126 --- a/blueman/gui/GsmSettings.py
127 +++ b/blueman/gui/GsmSettings.py
128 @@ -20,6 +20,7 @@ from blueman.main.Config import Config
129 from blueman.Functions import *
130 from blueman.Constants import *
131 import gtk
132 +from locale import bind_textdomain_codeset
133
134 class GsmSettings(gtk.Dialog):
135 def __init__(self, bd_address):
136 @@ -29,6 +30,7 @@ class GsmSettings(gtk.Dialog):
137
138 self.Builder = gtk.Builder()
139 self.Builder.set_translation_domain("blueman")
140 + bind_textdomain_codeset("blueman", "UTF-8")
141 self.Builder.add_from_file(UI_PATH +"/gsm-settings.ui")
142
143 vbox = self.Builder.get_object("vbox1")
144 diff --git a/blueman/gui/applet/PluginDialog.py b/blueman/gui/applet/PluginDialog.py
145 index 1d8cbec..299aa32 100644
146 --- a/blueman/gui/applet/PluginDialog.py
147 +++ b/blueman/gui/applet/PluginDialog.py
148 @@ -23,6 +23,7 @@ from blueman.Functions import *
149
150 from blueman.gui.GenericList import GenericList
151 import weakref
152 +from locale import bind_textdomain_codeset
153
154 class SettingsWidget(gtk.VBox):
155 def __init__(self, inst):
156 @@ -118,6 +119,7 @@ class PluginDialog(gtk.Dialog):
157
158 self.Builder = gtk.Builder()
159 self.Builder.set_translation_domain("blueman")
160 + bind_textdomain_codeset("blueman", "UTF-8")
161 self.Builder.add_from_file(UI_PATH +"/applet-plugins-widget.ui")
162
163 self.set_title(_("Plugins"))
164 diff --git a/blueman/main/applet/BluezAgent.py b/blueman/main/applet/BluezAgent.py
165 index 9c7f93e..377f84b 100644
166 --- a/blueman/main/applet/BluezAgent.py
167 +++ b/blueman/main/applet/BluezAgent.py
168 @@ -24,6 +24,7 @@ from blueman.Functions import get_icon, dprint
169 import gtk
170 import gobject
171 import cgi
172 +from locale import bind_textdomain_codeset
173 import blueman.bluez as Bluez
174 from blueman.Sdp import *
175 from blueman.Constants import *
176 @@ -65,6 +66,7 @@ class CommonAgent(gobject.GObject, Agent):
177 builder = gtk.Builder()
178 builder.add_from_file(UI_PATH +"/applet-passkey.ui")
179 builder.set_translation_domain("blueman")
180 + bind_textdomain_codeset("blueman", "UTF-8")
181 dialog = builder.get_object("dialog")
182
183 dialog.props.icon_name = "blueman"
184 diff --git a/blueman/plugins/applet/NetUsage.py b/blueman/plugins/applet/NetUsage.py
185 index 0cf15e8..bcebb44 100644
186 --- a/blueman/plugins/applet/NetUsage.py
187 +++ b/blueman/plugins/applet/NetUsage.py
188 @@ -33,6 +33,7 @@ import dbus
189 import time
190 import datetime
191 import gettext
192 +from locale import bind_textdomain_codeset
193
194 class MonitorBase(gobject.GObject):
195 __gsignals__ = {
196 @@ -146,6 +147,7 @@ class Dialog:
197 builder = gtk.Builder()
198 builder.add_from_file(UI_PATH + "/net-usage.ui")
199 builder.set_translation_domain("blueman")
200 + bind_textdomain_codeset("blueman", "UTF-8")
201
202 self.dialog = builder.get_object("dialog")
203 self.dialog.connect("response", self.on_response)
204 diff --git a/blueman/plugins/services/Audio.py b/blueman/plugins/services/Audio.py
205 index a725923..6a67fb0 100644
206 --- a/blueman/plugins/services/Audio.py
207 +++ b/blueman/plugins/services/Audio.py
208 @@ -19,6 +19,7 @@
209
210 import gtk
211 import dbus
212 +from locale import bind_textdomain_codeset
213 from blueman.Constants import *
214 from blueman.plugins.ServicePlugin import ServicePlugin
215
216 @@ -35,6 +36,7 @@ class Audio(ServicePlugin):
217
218 self.Builder = gtk.Builder()
219 self.Builder.set_translation_domain("blueman")
220 + bind_textdomain_codeset("blueman", "UTF-8")
221 self.Builder.add_from_file(UI_PATH +"/services-audio.ui")
222 self.widget = self.Builder.get_object("audio")
223
224 diff --git a/blueman/plugins/services/Network.py b/blueman/plugins/services/Network.py
225 index d7b9f45..fc8a8f4 100644
226 --- a/blueman/plugins/services/Network.py
227 +++ b/blueman/plugins/services/Network.py
228 @@ -18,6 +18,7 @@
229 #
230
231 import gtk
232 +from locale import bind_textdomain_codeset
233 from blueman.Constants import *
234 from blueman.Functions import have, dprint, mask_ip4_address
235 from blueman.Lib import get_net_interfaces, get_net_address, get_net_netmask
236 @@ -36,6 +37,7 @@ class Network(ServicePlugin):
237
238 self.Builder = gtk.Builder()
239 self.Builder.set_translation_domain("blueman")
240 + bind_textdomain_codeset("blueman", "UTF-8")
241 self.Builder.add_from_file(UI_PATH +"/services-network.ui")
242 self.widget = self.Builder.get_object("network")
243
244 diff --git a/blueman/plugins/services/Transfer.py b/blueman/plugins/services/Transfer.py
245 index d8ba6be..5dd44f0 100644
246 --- a/blueman/plugins/services/Transfer.py
247 +++ b/blueman/plugins/services/Transfer.py
248 @@ -18,6 +18,7 @@
249 #
250
251 import gtk
252 +from locale import bind_textdomain_codeset
253 from blueman.Constants import *
254 from blueman.plugins.ServicePlugin import ServicePlugin
255
256 @@ -32,6 +33,7 @@ class Transfer(ServicePlugin):
257
258 self.Builder = gtk.Builder()
259 self.Builder.set_translation_domain("blueman")
260 + bind_textdomain_codeset("blueman", "UTF-8")
261 self.Builder.add_from_file(UI_PATH +"/services-transfer.ui")
262 self.widget = self.Builder.get_object("transfer")
263
264 --
265 1.7.8.6
266

  ViewVC Help
Powered by ViewVC 1.1.20