Merge lp:~gary-wzl77/scope-aggregator/fix_1509307 into lp:scope-aggregator
- fix_1509307
- Merge into vivid-trunk
Proposed by
Gary.Wang
Status: | Merged |
---|---|
Merged at revision: | 154 |
Proposed branch: | lp:~gary-wzl77/scope-aggregator/fix_1509307 |
Merge into: | lp:scope-aggregator |
Prerequisite: | lp:~knitzsche/scope-aggregator/persistent_cat_ids_bug1507666 |
Diff against target: |
326 lines (+40/-41) 2 files modified
CMakeLists.txt (+1/-1) src/query.cpp (+39/-40) |
To merge this branch: | bzr merge lp:~gary-wzl77/scope-aggregator/fix_1509307 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kyle Nitzsche | Pending | ||
Review via email: mp+275518@code.launchpad.net |
Commit message
Description of the change
Bug fixed for invalid argument exceptioh when call set_category.
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 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2015-10-23 11:06:31 +0000 |
3 | +++ CMakeLists.txt 2015-10-23 11:06:31 +0000 |
4 | @@ -1,4 +1,4 @@ |
5 | -set(VERSION "4.0") |
6 | +set(VERSION "4.1") |
7 | |
8 | # Supress qDebug() output |
9 | ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) |
10 | |
11 | === modified file 'src/query.cpp' |
12 | --- src/query.cpp 2015-10-23 11:06:31 +0000 |
13 | +++ src/query.cpp 2015-10-23 11:06:31 +0000 |
14 | @@ -444,13 +444,13 @@ |
15 | if (keyword_catname_search_renderer.find(keyword) != keyword_catname_search_renderer.end()) // keyword has declared cat search renderer |
16 | { |
17 | qDebug() << "==== SEARCH keyword using search renderer"; |
18 | - cat_id = scope->local_id() + ":keyword:shared_cat:search_renderer::search"; |
19 | + cat_id = scope->local_id() + ":keyword:shared_cat:search_renderer::search" + cat_title; |
20 | rdr = keyword_catname_search_renderer[keyword]; |
21 | } |
22 | else |
23 | { |
24 | qDebug() << "==== SEARCH using incoming result renderer"; |
25 | - cat_id = scope->local_id() + ":keyowrd:shared_cat:incoming_renderer::search"; |
26 | + cat_id = scope->local_id() + ":keyowrd:shared_cat:incoming_renderer::search" + cat_title; |
27 | rdr = inc_res_rdr; |
28 | } |
29 | if (!upstream_reply->lookup_category(cat_id)) |
30 | @@ -475,7 +475,7 @@ |
31 | first_result_owner = keyword; |
32 | qDebug() << "==== KW RESULT is FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); |
33 | qDebug() << "==== KW RESULT claims FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); |
34 | - cat_id = keyword + ":keyword:is_shared_category:is_first_result"; |
35 | + cat_id = keyword + ":keyword:is_shared_category:is_first_result" + cat_title; |
36 | rdr = keyword_catname_first_result_renderers[keyword]; |
37 | keywordSharedCat_isFirstResult[keyword] = false; |
38 | keywordSharedCat_isSecondResult[keyword] = true; |
39 | @@ -497,13 +497,13 @@ |
40 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer |
41 | { |
42 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. uses surface_template "; |
43 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:surface_template"; |
44 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:surface_template" + cat_title; |
45 | rdr = keyword_catname_renderer[keyword]; |
46 | } |
47 | else // use result template |
48 | { |
49 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. NOT uses serface_template "; |
50 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:result_template"; |
51 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:result_template" + cat_title; |
52 | rdr = res.category()->renderer_template().data(); |
53 | } |
54 | if (!upstream_reply->lookup_category(cat_id)) |
55 | @@ -526,7 +526,7 @@ |
56 | qDebug() << "==== KW RESULT uses FIRST result. other claims it.. uses surface_template "; |
57 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
58 | { |
59 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:surface_template"; |
60 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:surface_template" + cat_title; |
61 | rdr = keyword_catname_renderer[keyword]; |
62 | if (!upstream_reply->lookup_category(cat_id)) |
63 | { |
64 | @@ -545,7 +545,7 @@ |
65 | qDebug() << "==== KW RESULT uses FIRST result. other claims it. uses result template "; |
66 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
67 | { |
68 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:result_template"; |
69 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:result_template" + cat_title; |
70 | rdr = res.category()->renderer_template().data(); |
71 | if (!upstream_reply->lookup_category(cat_id)) |
72 | { |
73 | @@ -567,14 +567,14 @@ |
74 | if (!scope->surface_template().empty())// has a decared surface template |
75 | { |
76 | qDebug() << "==== KW RESULT not uses first result. uses surface template"; |
77 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:surface_template"; |
78 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:surface_template" + cat_title; |
79 | qDebug() << "==== KW RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); |
80 | rdr = scope->surface_template(); |
81 | } |
82 | else // use result template |
83 | { |
84 | qDebug() << "==== KW RESULT not uses first result. NOT uses surface template"; |
85 | - cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:result_template"; |
86 | + cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:result_template" + cat_title; |
87 | rdr = res.category()->renderer_template().data(); |
88 | } |
89 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
90 | @@ -627,13 +627,13 @@ |
91 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer |
92 | { |
93 | qDebug() << "==== KW RESULT not shared declared renderer "; |
94 | - cat_id = scope->keyword() + ":keyword:not_shared_category:declared_renderer"; |
95 | + cat_id = scope->keyword() + ":keyword:not_shared_category:declared_renderer" + cat_title; |
96 | rdr = keyword_catname_renderer[keyword]; |
97 | } |
98 | else // use result template |
99 | { |
100 | qDebug() << "==== KW RESULT not shared incoming renderer"; |
101 | - cat_id = scope->keyword() + ":keyword:not_shared_category:incoming_renderer"; |
102 | + cat_id = scope->keyword() + ":keyword:not_shared_category:incoming_renderer" + cat_title; |
103 | rdr = res.category()->renderer_template().data(); |
104 | } |
105 | if (!upstream_reply->lookup_category(cat_id)) |
106 | @@ -692,13 +692,13 @@ |
107 | if (!scope->search_template().empty()) |
108 | { |
109 | qDebug() << "==== CATREG keyword using search renderer"; |
110 | - cat_id = scope->local_id() + ":category:search_renderer::search"; |
111 | + cat_id = scope->local_id() + ":category:search_renderer::search" + cat_title; |
112 | rdr = scope->search_template(); |
113 | } |
114 | else |
115 | { |
116 | qDebug() << "==== CATREG using incoming result renderer"; |
117 | - cat_id = scope->local_id() + ":category:incoming_renderer::search"; |
118 | + cat_id = scope->local_id() + ":category:incoming_renderer::search" + cat_title; |
119 | rdr = inc_res_rdr; |
120 | } |
121 | if (!upstream_reply->lookup_category(cat_id)) |
122 | @@ -731,7 +731,7 @@ |
123 | first_result_owner = category_id; |
124 | qDebug() << "==== CATREG RESULT is FIRST result: " << qstr(scope->category_id()); |
125 | qDebug() << "==== CATREG RESULT claims FIRST result: " << qstr(scope->category_id()); |
126 | - cat_id = category_id + ":category:is_first_result"; |
127 | + cat_id = category_id + ":category:is_first_result" + cat_title; |
128 | rdr = categoryId_first_result_renderers[category_id]; |
129 | categoryId_isFirstResult[category_id] = false; |
130 | categoryId_isSecondResult[category_id] = true; |
131 | @@ -773,14 +773,14 @@ |
132 | qDebug()<<"==== CATREG SURFACE: " << qstr(scope->surface_template()).replace("\n"," "); |
133 | if (!scope->surface_template().empty()) // keyword has declared cat renderer |
134 | { |
135 | - qDebug() << "==== CATREG R=ESULT uses FIRST result. is SECOND result. uses surface_renderer "; |
136 | - cat_id = category_id + ":category:uses_first_result:second_result:surface_template"; |
137 | + qDebug() << "==== CATREG RESULT uses FIRST result. is SECOND result. uses surface_renderer "; |
138 | + cat_id = category_id + ":category:uses_first_result:second_result:surface_template" + cat_title; |
139 | rdr = scope->surface_template(); |
140 | } |
141 | else // use result template |
142 | { |
143 | qDebug() << "==== CATREG RESULT uses FIRST result. is SECOND result. NOT uses surface_template "; |
144 | - cat_id = category_id + ":category:uses_first_result:second_result:result_template"; |
145 | + cat_id = category_id + ":category:uses_first_result:second_result:result_template" + cat_title; |
146 | rdr = res.category()->renderer_template().data(); |
147 | } |
148 | if (!upstream_reply->lookup_category(cat_id)) |
149 | @@ -808,7 +808,7 @@ |
150 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. using surface_template "; |
151 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
152 | { |
153 | - cat_id = category_id + ":category:uses_first_result:other_claims_it:surface_template"; |
154 | + cat_id = category_id + ":category:uses_first_result:other_claims_it:surface_template" + cat_title; |
155 | rdr = categoryId_renderer[category_id]; |
156 | if (!upstream_reply->lookup_category(cat_id)) |
157 | { |
158 | @@ -827,7 +827,7 @@ |
159 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. uses result template "; |
160 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
161 | { |
162 | - cat_id = category_id + ":category:uses_first_result:other_claims_it:result_template"; |
163 | + cat_id = category_id + ":category:uses_first_result:other_claims_it:result_template" + cat_title; |
164 | rdr = res.category()->renderer_template().data(); |
165 | if (!upstream_reply->lookup_category(cat_id)) |
166 | { |
167 | @@ -854,11 +854,10 @@ |
168 | check_result_fallbacks(res, scope->surface_common_template_id()); |
169 | } |
170 | |
171 | - |
172 | if (!scope->surface_template().empty())// has a decared surface template |
173 | { |
174 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template"; |
175 | - cat_id = scope->category_id() + ":category:not_uses_first_result:surface_template"; |
176 | + cat_id = scope->category_id() + ":category:not_uses_first_result:surface_template" + cat_title; |
177 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); |
178 | rdr = scope->surface_template(); |
179 | } |
180 | @@ -866,7 +865,7 @@ |
181 | { |
182 | qDebug() << "==== CATREG RESULT not uses first result. NOT uses surface template"; |
183 | qDebug() << "==== CATREG RESULT not uses first result. does use incoming result (not impld yet): " << qstr(category_id); |
184 | - cat_id = scope->keyword_scope_shared_cat_name() + ":category:not_uses_first_result:result_template"; |
185 | + cat_id = scope->keyword_scope_shared_cat_name() + ":category:not_uses_first_result:result_template" + cat_title; |
186 | rdr = res.category()->renderer_template().data(); |
187 | } |
188 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
189 | @@ -945,7 +944,7 @@ |
190 | |
191 | cat_title = scope->category_title(); |
192 | |
193 | - cat_id = scope->id() + ":declared_default"; |
194 | + cat_id = scope->id() + ":declared_default" + cat_title; |
195 | |
196 | qDebug() << "==== first_result_owner: " << qstr(first_result_owner); |
197 | |
198 | @@ -955,19 +954,19 @@ |
199 | if (!scope->search_template().empty()) |
200 | { |
201 | qDebug() << "==== FIRST RESULT: SEARCH using search renderer"; |
202 | - cat_id = scope->local_id() + ":declared:first_result:search_renderer::search"; |
203 | + cat_id = scope->local_id() + ":declared:first_result:search_renderer::search" + cat_title; |
204 | rdr = scope->search_template(); |
205 | } |
206 | else if (!scope->surface_template().empty()) |
207 | { |
208 | qDebug() << "==== FIRST RESULT: SEARCH using surface renderer"; |
209 | - cat_id = scope->local_id() + ":declared:first_result:surface_renderer::search"; |
210 | + cat_id = scope->local_id() + ":declared:first_result:surface_renderer::search" + cat_title; |
211 | rdr = scope->surface_template(); |
212 | } |
213 | else |
214 | { |
215 | qDebug() << "==== FIRST RESULT: SEARCH using incoming result renderer"; |
216 | - cat_id = scope->local_id() + ":declared:first_result:incomiing_renderer::search"; |
217 | + cat_id = scope->local_id() + ":declared:first_result:incomiing_renderer::search" + cat_title; |
218 | rdr = inc_res_rdr; |
219 | } |
220 | } |
221 | @@ -977,31 +976,31 @@ |
222 | if (!scope->first_result_template().empty()) |
223 | { |
224 | qDebug() << "==== FIRST RESULT: using first result template"; |
225 | - cat_id = scope->local_id() + ":declared:first_result:first_result_template::surface"; |
226 | + cat_id = scope->local_id() + ":declared:first_result:first_result_template::surface" + cat_title; |
227 | rdr = scope->first_result_template(); |
228 | } |
229 | else if (!scope->surface_template().empty()) |
230 | { |
231 | - cat_id = scope->local_id() + ":declared:first_result:surface_template::surface"; |
232 | + cat_id = scope->local_id() + ":declared:first_result:surface_template::surface" + cat_title; |
233 | rdr = scope->surface_template(); |
234 | qDebug() << "==== FIRST RESULT: using surface template"; |
235 | } |
236 | else |
237 | { |
238 | - cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface"; |
239 | + cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface" + cat_title; |
240 | rdr = inc_res_rdr; |
241 | qDebug() << "==== FIRST RESULT: using incoming template"; |
242 | } |
243 | } |
244 | else if (!scope->surface_template().empty()) |
245 | { |
246 | - cat_id = scope->local_id() + ":declared:first_result:surface_template::surface"; |
247 | + cat_id = scope->local_id() + ":declared:first_result:surface_template::surface" + cat_title; |
248 | rdr = scope->surface_template(); |
249 | qDebug() << "==== FIRST RESULT: using surface template"; |
250 | } |
251 | else |
252 | { |
253 | - cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface"; |
254 | + cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface" + cat_title; |
255 | rdr = inc_res_rdr; |
256 | qDebug() << "==== FIRST RESULT: using incoming template"; |
257 | } |
258 | @@ -1038,12 +1037,12 @@ |
259 | qDebug() << " CAT: scope->category_title(): " << qstr(scope->category_title()); |
260 | if (scope->override_surface_template()) // use declared renderer |
261 | { |
262 | - cat_id = scope->local_id() + ":declared:not_first_result:link-override:surface_template:surface"; |
263 | + cat_id = scope->local_id() + ":declared:not_first_result:link-override:surface_template:surface" + cat_title; |
264 | rdr = scope->surface_template(); |
265 | } |
266 | else // use incoming renderer |
267 | { |
268 | - cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:surface"; |
269 | + cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:surface" + cat_title; |
270 | rdr = inc_res_rdr; |
271 | } |
272 | } |
273 | @@ -1051,12 +1050,12 @@ |
274 | { |
275 | if (scope->override_search_template()) |
276 | { |
277 | - cat_id = scope->local_id() + ":declared:not_first_result:link-override:search_template:search"; |
278 | + cat_id = scope->local_id() + ":declared:not_first_result:link-override:search_template:search" + cat_title; |
279 | rdr = scope->search_template().data(); |
280 | } |
281 | else |
282 | { |
283 | - cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:search"; |
284 | + cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:search" + cat_title; |
285 | rdr = inc_res_rdr; |
286 | } |
287 | } |
288 | @@ -1067,12 +1066,12 @@ |
289 | { |
290 | if (scope->override_surface_template()) |
291 | { |
292 | - cat_id = scope->local_id() + "_nolink-override-surface"; |
293 | + cat_id = scope->local_id() + "_nolink-override-surface" + cat_title; |
294 | rdr = scope->surface_template().data(); |
295 | } |
296 | else if (!scope->first_result_template().empty()) |
297 | { |
298 | - cat_id = scope->local_id() + "_nolink-nooverride-surface"; |
299 | + cat_id = scope->local_id() + "_nolink-nooverride-surface" + cat_title; |
300 | rdr = inc_res_rdr;; |
301 | } |
302 | } |
303 | @@ -1080,12 +1079,12 @@ |
304 | { |
305 | if (scope->override_search_template()) |
306 | { |
307 | - cat_id = scope->local_id() + "_nolink-override-search"; |
308 | + cat_id = scope->local_id() + "_nolink-override-search" + cat_title; |
309 | rdr = scope->search_template().data(); |
310 | } |
311 | else |
312 | { |
313 | - cat_id = scope->local_id() + "_nolink-nooverride-search"; |
314 | + cat_id = scope->local_id() + "_nolink-nooverride-search" + cat_title; |
315 | rdr = inc_res_rdr;; |
316 | } |
317 | } |
318 | @@ -1151,7 +1150,7 @@ |
319 | if (common_templates.find(child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]) != common_templates.end()) |
320 | { |
321 | std::string common_template_id = child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]; |
322 | - std::string cat_id = common_template_id + ":" + scope->local_id(); |
323 | + std::string cat_id = common_template_id + ":" + scope->local_id() + cat_title; |
324 | |
325 | // if the common category has not yet been registered, register it |
326 | if (!upstream_reply->lookup_category(cat_id)) |