Merge lp:~mhr3/libunity/fix-1063300-6.0 into lp:libunity/6.0
- fix-1063300-6.0
- Merge into 6.0
Proposed by
Michal Hruby
Status: | Merged |
---|---|
Approved by: | Łukasz Zemczak |
Approved revision: | 186 |
Merged at revision: | 186 |
Proposed branch: | lp:~mhr3/libunity/fix-1063300-6.0 |
Merge into: | lp:libunity/6.0 |
Diff against target: |
346 lines (+94/-35) 3 files modified
protocol/protocol-lens-interface.vala (+12/-3) src/unity-lens-private.vala (+15/-7) test/vala/test-lens.vala (+67/-25) |
To merge this branch: | bzr merge lp:~mhr3/libunity/fix-1063300-6.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Łukasz Zemczak | Approve | ||
Review via email: mp+130042@code.launchpad.net |
Commit message
Fix possible crash when splitting uris
Description of the change
Fix possible crash when splitting uris
UNBLOCK
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 'protocol/protocol-lens-interface.vala' | |||
2 | --- protocol/protocol-lens-interface.vala 2012-09-04 11:40:42 +0000 | |||
3 | +++ protocol/protocol-lens-interface.vala 2012-10-17 08:16:32 +0000 | |||
4 | @@ -38,6 +38,15 @@ | |||
5 | 38 | public HashTable<string, Variant> hints; | 38 | public HashTable<string, Variant> hints; |
6 | 39 | } | 39 | } |
7 | 40 | 40 | ||
8 | 41 | /* The error types that can be thrown from DBus methods */ | ||
9 | 42 | [DBus (name = "com.canonical.Unity.LensError")] | ||
10 | 43 | public errordomain LensError | ||
11 | 44 | { | ||
12 | 45 | FAILED, | ||
13 | 46 | INVALID_SCOPE | ||
14 | 47 | } | ||
15 | 48 | |||
16 | 49 | |||
17 | 41 | public enum HandledType | 50 | public enum HandledType |
18 | 42 | { | 51 | { |
19 | 43 | NOT_HANDLED, | 52 | NOT_HANDLED, |
20 | @@ -74,12 +83,12 @@ | |||
21 | 74 | 83 | ||
22 | 75 | // FIXME: should have the hints param and activate_with_hints should go away | 84 | // FIXME: should have the hints param and activate_with_hints should go away |
23 | 76 | public async abstract ActivationReplyRaw activate ( | 85 | public async abstract ActivationReplyRaw activate ( |
25 | 77 | string uri, uint action_type) throws IOError; | 86 | string uri, uint action_type) throws IOError, LensError; |
26 | 78 | 87 | ||
27 | 79 | public async abstract ActivationReplyRaw activate_with_hints ( | 88 | public async abstract ActivationReplyRaw activate_with_hints ( |
29 | 80 | string uri, uint action_type, HashTable<string, Variant> hints) throws IOError; | 89 | string uri, uint action_type, HashTable<string, Variant> hints) throws IOError, LensError; |
30 | 81 | 90 | ||
32 | 82 | public async abstract HashTable<string, Variant> update_preview_property (string uri, HashTable<string, Variant> values) throws IOError; | 91 | public async abstract HashTable<string, Variant> update_preview_property (string uri, HashTable<string, Variant> values) throws IOError, LensError; |
33 | 83 | 92 | ||
34 | 84 | public async abstract HashTable<string, Variant> search ( | 93 | public async abstract HashTable<string, Variant> search ( |
35 | 85 | string search_string, HashTable<string, Variant> hints) throws IOError; | 94 | string search_string, HashTable<string, Variant> hints) throws IOError; |
36 | 86 | 95 | ||
37 | === modified file 'src/unity-lens-private.vala' | |||
38 | --- src/unity-lens-private.vala 2012-09-04 11:40:42 +0000 | |||
39 | +++ src/unity-lens-private.vala 2012-10-17 08:16:32 +0000 | |||
40 | @@ -493,8 +493,8 @@ | |||
41 | 493 | queue_info_changed (); | 493 | queue_info_changed (); |
42 | 494 | } | 494 | } |
43 | 495 | 495 | ||
46 | 496 | public async ActivationReplyRaw activate (string uri, | 496 | public async ActivationReplyRaw activate ( |
47 | 497 | uint action_type) throws IOError | 497 | string uri, uint action_type) throws IOError, LensError |
48 | 498 | { | 498 | { |
49 | 499 | var hints = new HashTable<string, Variant> (null, null); | 499 | var hints = new HashTable<string, Variant> (null, null); |
50 | 500 | var reply = yield activate_with_hints (uri, action_type, hints); | 500 | var reply = yield activate_with_hints (uri, action_type, hints); |
51 | @@ -503,7 +503,7 @@ | |||
52 | 503 | 503 | ||
53 | 504 | public async ActivationReplyRaw activate_with_hints ( | 504 | public async ActivationReplyRaw activate_with_hints ( |
54 | 505 | string uri, uint action_type, | 505 | string uri, uint action_type, |
56 | 506 | HashTable<string, Variant> hints) throws IOError | 506 | HashTable<string, Variant> hints) throws IOError, LensError |
57 | 507 | { | 507 | { |
58 | 508 | string[] tokens; | 508 | string[] tokens; |
59 | 509 | ScopeProxy? scope = null; | 509 | ScopeProxy? scope = null; |
60 | @@ -513,11 +513,15 @@ | |||
61 | 513 | { | 513 | { |
62 | 514 | case ActionType.PREVIEW_ACTION: | 514 | case ActionType.PREVIEW_ACTION: |
63 | 515 | tokens = uri.split (":", 3); | 515 | tokens = uri.split (":", 3); |
64 | 516 | if (tokens.length < 3) | ||
65 | 517 | throw new LensError.FAILED ("Malformatted URI parameter"); | ||
66 | 516 | scope = get_scope_for_uid (tokens[1]); | 518 | scope = get_scope_for_uid (tokens[1]); |
67 | 517 | scope_uri = "%s:%s".printf (tokens[0], tokens[2]); | 519 | scope_uri = "%s:%s".printf (tokens[0], tokens[2]); |
68 | 518 | break; | 520 | break; |
69 | 519 | default: | 521 | default: |
70 | 520 | tokens = uri.split (":", 2); | 522 | tokens = uri.split (":", 2); |
71 | 523 | if (tokens.length < 2) | ||
72 | 524 | throw new LensError.FAILED ("Malformatted URI parameter"); | ||
73 | 521 | scope = get_scope_for_uid (tokens[0]); | 525 | scope = get_scope_for_uid (tokens[0]); |
74 | 522 | scope_uri = tokens[1]; | 526 | scope_uri = tokens[1]; |
75 | 523 | break; | 527 | break; |
76 | @@ -535,7 +539,7 @@ | |||
77 | 535 | else | 539 | else |
78 | 536 | { | 540 | { |
79 | 537 | warning ("Unable to find scope for activation request: %s", uri); | 541 | warning ("Unable to find scope for activation request: %s", uri); |
81 | 538 | raw.uri = uri; | 542 | throw new LensError.INVALID_SCOPE ("Invalid URI parameter"); |
82 | 539 | } | 543 | } |
83 | 540 | 544 | ||
84 | 541 | // FIXME: do we need to mangle uris/actions that the scope provided? | 545 | // FIXME: do we need to mangle uris/actions that the scope provided? |
85 | @@ -546,11 +550,14 @@ | |||
86 | 546 | return raw; | 550 | return raw; |
87 | 547 | } | 551 | } |
88 | 548 | 552 | ||
91 | 549 | public async HashTable<string, Variant> update_preview_property (string uri, | 553 | public async HashTable<string, Variant> update_preview_property ( |
92 | 550 | HashTable<string, Variant> values) throws IOError | 554 | string uri, HashTable<string, Variant> values) throws IOError, LensError |
93 | 551 | { | 555 | { |
94 | 552 | string[] tokens = uri.split (":", 2); | 556 | string[] tokens = uri.split (":", 2); |
96 | 553 | string? scope_uri = tokens[1]; | 557 | if (tokens.length < 2) |
97 | 558 | throw new LensError.FAILED ("Malformatted URI parameter"); | ||
98 | 559 | |||
99 | 560 | string scope_uri = tokens[1]; | ||
100 | 554 | ScopeProxy? scope = get_scope_for_uid (tokens[0]); | 561 | ScopeProxy? scope = get_scope_for_uid (tokens[0]); |
101 | 555 | 562 | ||
102 | 556 | if (scope is ScopeProxy) | 563 | if (scope is ScopeProxy) |
103 | @@ -561,6 +568,7 @@ | |||
104 | 561 | else | 568 | else |
105 | 562 | { | 569 | { |
106 | 563 | warning ("Unable to find scope for activation request: %s", uri); | 570 | warning ("Unable to find scope for activation request: %s", uri); |
107 | 571 | throw new LensError.INVALID_SCOPE ("Invalid URI parameter"); | ||
108 | 564 | } | 572 | } |
109 | 565 | 573 | ||
110 | 566 | return new HashTable<string, Variant> (str_hash, str_equal); | 574 | return new HashTable<string, Variant> (str_hash, str_equal); |
111 | 567 | 575 | ||
112 | === modified file 'test/vala/test-lens.vala' | |||
113 | --- test/vala/test-lens.vala 2012-10-02 16:16:29 +0000 | |||
114 | +++ test/vala/test-lens.vala 2012-10-17 08:16:32 +0000 | |||
115 | @@ -54,6 +54,7 @@ | |||
116 | 54 | Test.add_data_func ("/Unit/Lens/ReplyHint", test_lens_reply_hint); | 54 | Test.add_data_func ("/Unit/Lens/ReplyHint", test_lens_reply_hint); |
117 | 55 | Test.add_data_func ("/Unit/Lens/Sources", test_lens_sources); | 55 | Test.add_data_func ("/Unit/Lens/Sources", test_lens_sources); |
118 | 56 | Test.add_data_func ("/Unit/Lens/Activation", test_lens_activation); | 56 | Test.add_data_func ("/Unit/Lens/Activation", test_lens_activation); |
119 | 57 | Test.add_data_func ("/Unit/Lens/InvalidActivation", test_lens_invalid_activation); | ||
120 | 57 | Test.add_data_func ("/Unit/Lens/Preview", test_lens_preview); | 58 | Test.add_data_func ("/Unit/Lens/Preview", test_lens_preview); |
121 | 58 | Test.add_data_func ("/Unit/Lens/Preview/Async", test_lens_preview_async); | 59 | Test.add_data_func ("/Unit/Lens/Preview/Async", test_lens_preview_async); |
122 | 59 | Test.add_data_func ("/Unit/Lens/Preview/AsyncWithNull", test_lens_preview_async_with_null); | 60 | Test.add_data_func ("/Unit/Lens/Preview/AsyncWithNull", test_lens_preview_async_with_null); |
123 | @@ -163,9 +164,10 @@ | |||
124 | 163 | assert (scope_up == true); | 164 | assert (scope_up == true); |
125 | 164 | } | 165 | } |
126 | 165 | 166 | ||
128 | 166 | private static void call_lens_method (string method_name, | 167 | private static void call_lens_method (string method_name, |
129 | 167 | Variant? parameters, | 168 | Variant? parameters, |
131 | 168 | Func<Variant?>? cb) | 169 | Func<Variant?>? cb, |
132 | 170 | Func<Error?>? error_cb = null) | ||
133 | 169 | { | 171 | { |
134 | 170 | DBusConnection? bus = null; | 172 | DBusConnection? bus = null; |
135 | 171 | try | 173 | try |
136 | @@ -190,35 +192,43 @@ | |||
137 | 190 | var reply = bus.call.end (res); | 192 | var reply = bus.call.end (res); |
138 | 191 | if (cb != null) cb (reply); | 193 | if (cb != null) cb (reply); |
139 | 192 | } | 194 | } |
141 | 193 | catch (Error e) | 195 | catch (Error err) |
142 | 194 | { | 196 | { |
144 | 195 | warning ("%s", e.message); | 197 | if (error_cb != null) |
145 | 198 | error_cb (err); | ||
146 | 199 | else | ||
147 | 200 | warning ("%s", err.message); | ||
148 | 196 | } | 201 | } |
149 | 197 | }); | 202 | }); |
150 | 198 | } | 203 | } |
151 | 199 | 204 | ||
152 | 200 | private static void call_lens_search (string search_string, | 205 | private static void call_lens_search (string search_string, |
154 | 201 | Func<Variant?>? cb = null) | 206 | Func<Variant?>? cb = null, |
155 | 207 | Func<Error?>? error_cb = null) | ||
156 | 202 | { | 208 | { |
157 | 203 | var vb = new VariantBuilder (new VariantType ("(sa{sv})")); | 209 | var vb = new VariantBuilder (new VariantType ("(sa{sv})")); |
158 | 204 | vb.add ("s", search_string); | 210 | vb.add ("s", search_string); |
159 | 205 | vb.open (new VariantType ("a{sv}")); | 211 | vb.open (new VariantType ("a{sv}")); |
160 | 206 | vb.close (); | 212 | vb.close (); |
161 | 207 | 213 | ||
163 | 208 | call_lens_method ("Search", vb.end (), cb); | 214 | call_lens_method ("Search", vb.end (), cb, error_cb); |
164 | 209 | } | 215 | } |
165 | 210 | 216 | ||
168 | 211 | private static void call_lens_activate (string uri, uint action_type, | 217 | private static void call_lens_activate (string uri, |
169 | 212 | Func<Variant?>? cb = null) | 218 | Unity.Protocol.ActionType action_type, |
170 | 219 | Func<Variant?>? cb = null, | ||
171 | 220 | Func<Error?>? error_cb = null) | ||
172 | 213 | { | 221 | { |
173 | 214 | call_lens_activate_with_hints (uri, action_type, | 222 | call_lens_activate_with_hints (uri, action_type, |
174 | 215 | new HashTable<string, Variant> (null, null), | 223 | new HashTable<string, Variant> (null, null), |
176 | 216 | cb); | 224 | cb, error_cb); |
177 | 217 | } | 225 | } |
178 | 218 | 226 | ||
179 | 219 | private static void call_lens_activate_with_hints ( | 227 | private static void call_lens_activate_with_hints ( |
182 | 220 | string uri, uint action_type, HashTable<string, Variant> hints, | 228 | string uri, Unity.Protocol.ActionType action_type, |
183 | 221 | Func<Variant?>? cb = null) | 229 | HashTable<string, Variant> hints, |
184 | 230 | Func<Variant?>? cb = null, | ||
185 | 231 | Func<Error?>? error_cb = null) | ||
186 | 222 | { | 232 | { |
187 | 223 | Variant parameters; | 233 | Variant parameters; |
188 | 224 | // let's make sure we test both variants, since we have to support them | 234 | // let's make sure we test both variants, since we have to support them |
189 | @@ -227,24 +237,25 @@ | |||
190 | 227 | Variant ht = hints; | 237 | Variant ht = hints; |
191 | 228 | parameters = new Variant ("(su@a{sv})", uri, action_type, ht); | 238 | parameters = new Variant ("(su@a{sv})", uri, action_type, ht); |
192 | 229 | 239 | ||
194 | 230 | call_lens_method ("ActivateWithHints", parameters, cb); | 240 | call_lens_method ("ActivateWithHints", parameters, cb, error_cb); |
195 | 231 | } | 241 | } |
196 | 232 | else | 242 | else |
197 | 233 | { | 243 | { |
198 | 234 | parameters = new Variant ("(su)", uri, action_type); | 244 | parameters = new Variant ("(su)", uri, action_type); |
199 | 235 | 245 | ||
201 | 236 | call_lens_method ("Activate", parameters, cb); | 246 | call_lens_method ("Activate", parameters, cb, error_cb); |
202 | 237 | } | 247 | } |
203 | 238 | } | 248 | } |
204 | 239 | 249 | ||
205 | 240 | private static void call_lens_update_preview_property (string uri, HashTable<string, Variant> props, | 250 | private static void call_lens_update_preview_property (string uri, HashTable<string, Variant> props, |
207 | 241 | Func<Variant?>? cb = null) | 251 | Func<Variant?>? cb = null, |
208 | 252 | Func<Error?>? error_cb = null) | ||
209 | 242 | { | 253 | { |
210 | 243 | var vb = new VariantBuilder (new VariantType ("(sa{sv})")); | 254 | var vb = new VariantBuilder (new VariantType ("(sa{sv})")); |
211 | 244 | vb.add ("s", uri); | 255 | vb.add ("s", uri); |
212 | 245 | vb.add_value (props); | 256 | vb.add_value (props); |
213 | 246 | 257 | ||
215 | 247 | call_lens_method ("UpdatePreviewProperty", vb.end(), cb); | 258 | call_lens_method ("UpdatePreviewProperty", vb.end(), cb, error_cb); |
216 | 248 | } | 259 | } |
217 | 249 | 260 | ||
218 | 250 | public static void test_lens_search () | 261 | public static void test_lens_search () |
219 | @@ -747,7 +758,8 @@ | |||
220 | 747 | })); | 758 | })); |
221 | 748 | 759 | ||
222 | 749 | ml = new MainLoop (); | 760 | ml = new MainLoop (); |
224 | 750 | call_lens_activate (mangled_uri, 0, () => | 761 | var action = Unity.Protocol.ActionType.ACTIVATE_RESULT; |
225 | 762 | call_lens_activate (mangled_uri, action, () => | ||
226 | 751 | { | 763 | { |
227 | 752 | ml.quit (); | 764 | ml.quit (); |
228 | 753 | }); | 765 | }); |
229 | @@ -756,6 +768,28 @@ | |||
230 | 756 | assert (got_activate_uri_signal); | 768 | assert (got_activate_uri_signal); |
231 | 757 | } | 769 | } |
232 | 758 | 770 | ||
233 | 771 | public static void test_lens_invalid_activation () | ||
234 | 772 | { | ||
235 | 773 | // ignore warnings | ||
236 | 774 | Test.log_set_fatal_handler (() => { return false; }); | ||
237 | 775 | Unity.Protocol.ActionType action; | ||
238 | 776 | var ml = new MainLoop (); | ||
239 | 777 | |||
240 | 778 | Func<Error?> err_cb = (err) => | ||
241 | 779 | { | ||
242 | 780 | assert (err is Unity.Protocol.LensError); | ||
243 | 781 | ml.quit (); | ||
244 | 782 | }; | ||
245 | 783 | action = Unity.Protocol.ActionType.ACTIVATE_RESULT; | ||
246 | 784 | call_lens_activate ("", action, null, err_cb); | ||
247 | 785 | assert (run_with_timeout (ml, 5000)); | ||
248 | 786 | |||
249 | 787 | ml = new MainLoop (); | ||
250 | 788 | action = Unity.Protocol.ActionType.PREVIEW_RESULT; | ||
251 | 789 | call_lens_activate (":", action, null, err_cb); | ||
252 | 790 | assert (run_with_timeout (ml, 5000)); | ||
253 | 791 | } | ||
254 | 792 | |||
255 | 759 | public static void test_lens_preview () | 793 | public static void test_lens_preview () |
256 | 760 | { | 794 | { |
257 | 761 | SignalWrapper[] signals = null; | 795 | SignalWrapper[] signals = null; |
258 | @@ -792,7 +826,8 @@ | |||
259 | 792 | 826 | ||
260 | 793 | ml = new MainLoop (); | 827 | ml = new MainLoop (); |
261 | 794 | Unity.Protocol.Preview? reconstructed = null; | 828 | Unity.Protocol.Preview? reconstructed = null; |
263 | 795 | call_lens_activate (mangled_uri, 1, (reply) => | 829 | var action_type = Unity.Protocol.ActionType.PREVIEW_RESULT; |
264 | 830 | call_lens_activate (mangled_uri, action_type, (reply) => | ||
265 | 796 | { | 831 | { |
266 | 797 | var v = reply.get_child_value (0); | 832 | var v = reply.get_child_value (0); |
267 | 798 | Unity.Protocol.ActivationReplyRaw reply_struct = | 833 | Unity.Protocol.ActivationReplyRaw reply_struct = |
268 | @@ -816,7 +851,9 @@ | |||
269 | 816 | 851 | ||
270 | 817 | // expecting button_id:scope_uid:uri | 852 | // expecting button_id:scope_uid:uri |
271 | 818 | ml = new MainLoop (); | 853 | ml = new MainLoop (); |
273 | 819 | call_lens_activate ("%s:%s".printf (action.id, mangled_uri), 2, (reply) => | 854 | action_type = Unity.Protocol.ActionType.PREVIEW_ACTION; |
274 | 855 | var activate_uri = "%s:%s".printf (action.id, mangled_uri); | ||
275 | 856 | call_lens_activate (activate_uri, action_type, (reply) => | ||
276 | 820 | { | 857 | { |
277 | 821 | ml.quit (); | 858 | ml.quit (); |
278 | 822 | }); | 859 | }); |
279 | @@ -871,7 +908,8 @@ | |||
280 | 871 | 908 | ||
281 | 872 | ml = new MainLoop (); | 909 | ml = new MainLoop (); |
282 | 873 | Unity.Protocol.Preview? reconstructed = null; | 910 | Unity.Protocol.Preview? reconstructed = null; |
284 | 874 | call_lens_activate (mangled_uri, 1, (reply) => | 911 | var action_type = Unity.Protocol.ActionType.PREVIEW_RESULT; |
285 | 912 | call_lens_activate (mangled_uri, action_type, (reply) => | ||
286 | 875 | { | 913 | { |
287 | 876 | var v = reply.get_child_value (0); | 914 | var v = reply.get_child_value (0); |
288 | 877 | Unity.Protocol.ActivationReplyRaw reply_struct = | 915 | Unity.Protocol.ActivationReplyRaw reply_struct = |
289 | @@ -897,7 +935,9 @@ | |||
290 | 897 | 935 | ||
291 | 898 | // expecting button_id:scope_uid:uri | 936 | // expecting button_id:scope_uid:uri |
292 | 899 | ml = new MainLoop (); | 937 | ml = new MainLoop (); |
294 | 900 | call_lens_activate ("%s:%s".printf (action.id, mangled_uri), 2, (reply) => | 938 | action_type = Unity.Protocol.ActionType.PREVIEW_ACTION; |
295 | 939 | var activate_uri = "%s:%s".printf (action.id, mangled_uri); | ||
296 | 940 | call_lens_activate (activate_uri, action_type, (reply) => | ||
297 | 901 | { | 941 | { |
298 | 902 | ml.quit (); | 942 | ml.quit (); |
299 | 903 | }); | 943 | }); |
300 | @@ -945,7 +985,8 @@ | |||
301 | 945 | 985 | ||
302 | 946 | ml = new MainLoop (); | 986 | ml = new MainLoop (); |
303 | 947 | Unity.Protocol.Preview? reconstructed = null; | 987 | Unity.Protocol.Preview? reconstructed = null; |
305 | 948 | call_lens_activate (mangled_uri, 1, (reply) => | 988 | var action = Unity.Protocol.ActionType.PREVIEW_RESULT; |
306 | 989 | call_lens_activate (mangled_uri, action, (reply) => | ||
307 | 949 | { | 990 | { |
308 | 950 | var v = reply.get_child_value (0); | 991 | var v = reply.get_child_value (0); |
309 | 951 | Unity.Protocol.ActivationReplyRaw reply_struct = | 992 | Unity.Protocol.ActivationReplyRaw reply_struct = |
310 | @@ -979,7 +1020,6 @@ | |||
311 | 979 | bool got_preview_uri_signal = false; | 1020 | bool got_preview_uri_signal = false; |
312 | 980 | string? request_item_signal_uri = null; | 1021 | string? request_item_signal_uri = null; |
313 | 981 | int request_item_signal_count = 0; | 1022 | int request_item_signal_count = 0; |
314 | 982 | Unity.PreviewAction? action = null; | ||
315 | 983 | 1023 | ||
316 | 984 | signals += new SignalWrapper (local_scope, | 1024 | signals += new SignalWrapper (local_scope, |
317 | 985 | local_scope.activate_uri.connect ((uri) => | 1025 | local_scope.activate_uri.connect ((uri) => |
318 | @@ -1113,7 +1153,8 @@ | |||
319 | 1113 | var mangled_uri = lens_results_model.get_string (iter, 0); | 1153 | var mangled_uri = lens_results_model.get_string (iter, 0); |
320 | 1114 | 1154 | ||
321 | 1115 | Unity.Protocol.GenericPreview? reconstructed = null; | 1155 | Unity.Protocol.GenericPreview? reconstructed = null; |
323 | 1116 | call_lens_activate (mangled_uri, Unity.Protocol.ActionType.PREVIEW_RESULT, (reply) => | 1156 | var action = Unity.Protocol.ActionType.PREVIEW_RESULT; |
324 | 1157 | call_lens_activate (mangled_uri, action, (reply) => | ||
325 | 1117 | { | 1158 | { |
326 | 1118 | var v = reply.get_child_value (0); | 1159 | var v = reply.get_child_value (0); |
327 | 1119 | Unity.Protocol.ActivationReplyRaw reply_struct = | 1160 | Unity.Protocol.ActivationReplyRaw reply_struct = |
328 | @@ -1167,7 +1208,7 @@ | |||
329 | 1167 | { | 1208 | { |
330 | 1168 | got_activated_signal = true; | 1209 | got_activated_signal = true; |
331 | 1169 | assert (action.hints["passing-extra-info"].get_boolean () == true); | 1210 | assert (action.hints["passing-extra-info"].get_boolean () == true); |
333 | 1170 | return null; | 1211 | return new Unity.ActivationResponse (Unity.HandledType.NOT_HANDLED); |
334 | 1171 | })); | 1212 | })); |
335 | 1172 | 1213 | ||
336 | 1173 | // this signal handler gets called when activate is called with PREVIEW_RESULT | 1214 | // this signal handler gets called when activate is called with PREVIEW_RESULT |
337 | @@ -1187,7 +1228,8 @@ | |||
338 | 1187 | var mangled_uri = lens_results_model.get_string (iter, 0); | 1228 | var mangled_uri = lens_results_model.get_string (iter, 0); |
339 | 1188 | 1229 | ||
340 | 1189 | Unity.Protocol.Preview? reconstructed = null; | 1230 | Unity.Protocol.Preview? reconstructed = null; |
342 | 1190 | call_lens_activate (mangled_uri, Unity.Protocol.ActionType.PREVIEW_RESULT, (reply) => | 1231 | var action_type = Unity.Protocol.ActionType.PREVIEW_RESULT; |
343 | 1232 | call_lens_activate (mangled_uri, action_type, (reply) => | ||
344 | 1191 | { | 1233 | { |
345 | 1192 | var v = reply.get_child_value (0); | 1234 | var v = reply.get_child_value (0); |
346 | 1193 | Unity.Protocol.ActivationReplyRaw reply_struct = | 1235 | Unity.Protocol.ActivationReplyRaw reply_struct = |
+1