Merge lp:~brunonova/software-properties/lp1383289 into lp:software-properties

Proposed by Bruno Nova on 2014-10-20
Status: Merged
Merged at revision: 920
Proposed branch: lp:~brunonova/software-properties/lp1383289
Merge into: lp:software-properties
Diff against target: 28 lines (+3/-3)
2 files modified
softwareproperties/SoftwareProperties.py (+2/-2)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+1/-1)
To merge this branch: bzr merge lp:~brunonova/software-properties/lp1383289
Reviewer Review Type Date Requested Status
Michael Vogt 2014-10-20 Approve on 2014-11-21
Review via email: mp+238890@code.launchpad.net

Description of the change

Dragging a key into the list of keys in the "Authentication" tab fails. This commit fixes this.
I tested only the GTK version! I don't know if the problem exists in the KDE one!

Note: in softwareproperties/gtk/SoftwarePropertiesGtk.py, I replaced one occurrence of "selection.data.strip()" by "selection.get_data().strip()".
But there is another occurrence of "selection.data.strip()" in that file, which is not used here. I haven't touched it because I am not sure if "selection" there is also of type "SelectionData". If it is, then that occurrence should be corrected as well!

To post a comment you must log in.
Michael Vogt (mvo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwareproperties/SoftwareProperties.py'
2--- softwareproperties/SoftwareProperties.py 2014-09-24 09:50:37 +0000
3+++ softwareproperties/SoftwareProperties.py 2014-10-20 14:19:54 +0000
4@@ -811,9 +811,9 @@
5 def add_key_from_data(self, keydata):
6 "Add a gnupg key from a data string (e.g. copy-n-paste)"
7 tmp = tempfile.NamedTemporaryFile()
8- tmp.write(keydata.encode())
9+ tmp.write(keydata)
10 tmp.flush()
11- return self.add_key(tmp.name)
12+ return self.backend.AddKey(tmp.name)
13
14 def remove_key(self, keyid):
15 """Remove a gnupg key from the list of trusted software vendors"""
16
17=== modified file 'softwareproperties/gtk/SoftwarePropertiesGtk.py'
18--- softwareproperties/gtk/SoftwarePropertiesGtk.py 2014-01-10 11:23:05 +0000
19+++ softwareproperties/gtk/SoftwarePropertiesGtk.py 2014-10-20 14:19:54 +0000
20@@ -756,7 +756,7 @@
21 def on_auth_drag_data_received(self, widget, context, x, y,
22 selection, target_type, timestamp):
23 """Extract the dropped key and add it to the keyring"""
24- keydata = selection.data.strip()
25+ keydata = selection.get_data().strip()
26 if not self.add_key_from_data(keydata):
27 error(self.window_main,
28 _("Error importing key"),

Subscribers

People subscribed via source and target branches

to status/vote changes: