Merge lp:~davidc3/unity-scope-calculator/glib-bindings-crash into lp:unity-scope-calculator

Proposed by David Callé on 2014-03-28
Status: Merged
Approved by: Paweł Stołowski on 2014-03-28
Approved revision: 43
Merged at revision: 43
Proposed branch: lp:~davidc3/unity-scope-calculator/glib-bindings-crash
Merge into: lp:unity-scope-calculator
Diff against target: 36 lines (+2/-14)
2 files modified
data/calculator.scope.in (+1/-1)
src/unity_calculator_daemon.py (+1/-13)
To merge this branch: bzr merge lp:~davidc3/unity-scope-calculator/glib-bindings-crash
Reviewer Review Type Date Requested Status
Paweł Stołowski 2014-03-28 Approve on 2014-03-28
PS Jenkins bot (community) continuous-integration Approve on 2014-03-28
Review via email: mp+213213@code.launchpad.net

Commit message

Don't crash Unity bindings when building results.

Description of the change

- Don't crash Unity bindings when building results.
- Add a calc keyword

Test plan : https://wiki.ubuntu.com/Process/Merges/TestPlan/unity-scope-calculator

 * Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes) Yes
 * Did you build your software in a clean sbuild/pbuilder chroot or ppa? Yes
 * Has your component "TestPlan” been executed successfully on desktop? Yes
 * If you changed the packaging (debian), did you subscribe a core-dev to this MP? N/A
 * If you changed the UI, did you subscribe the design-reviewers to this MP? N/A
 * What components might get impacted by your changes? None
 * Have you requested review by the teams of these owning components? N/A

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/calculator.scope.in'
2--- data/calculator.scope.in 2013-07-08 07:45:24 +0000
3+++ data/calculator.scope.in 2014-03-28 08:55:15 +0000
4@@ -3,7 +3,7 @@
5 DBusPath=/com/canonical/unity/scope/info/calculator
6 Icon=/usr/share/icons/unity-icon-theme/places/svg/service-calculator.svg
7 QueryBinary=gnome-calculator
8-_Keywords=calculator;result;calculate;
9+_Keywords=calculator;result;calculate;calc;
10 RequiredMetadata=
11 OptionalMetadata=
12 Loader=/usr/share/unity-scopes/calculator/unity_calculator_daemon.py
13
14=== modified file 'src/unity_calculator_daemon.py'
15--- src/unity_calculator_daemon.py 2013-05-10 05:39:22 +0000
16+++ src/unity_calculator_daemon.py 2014-03-28 08:55:15 +0000
17@@ -127,19 +127,7 @@
18 i['comment'] = ''
19 if not 'dnd_uri' in i or not i['dnd_uri'] or i['dnd_uri'] == '':
20 i['dnd_uri'] = i['uri']
21- i['metadata'] = {}
22- if EXTRA_METADATA:
23- for e in i:
24- for m in EXTRA_METADATA:
25- if m['id'] == e:
26- i['metadata'][e] = i[e]
27- i['metadata']['provider_credits'] = GLib.Variant('s', PROVIDER_CREDITS)
28- result = Unity.ScopeResult.create(str(i['uri']), str(i['icon']),
29- i['category'], i['result_type'],
30- str(i['mimetype']), str(i['title']),
31- str(i['comment']), str(i['dnd_uri']),
32- i['metadata'])
33- result_set.add_result(result)
34+ result_set.add_result(**i)
35 except Exception as error:
36 print (error)
37

Subscribers

People subscribed via source and target branches

to all changes: