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 @@ | |||
6 | 1 | set(VERSION "4.0") | 1 | set(VERSION "4.1") |
7 | 2 | 2 | ||
8 | 3 | # Supress qDebug() output | 3 | # Supress qDebug() output |
9 | 4 | ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) | 4 | ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT ) |
10 | 5 | 5 | ||
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 | 444 | if (keyword_catname_search_renderer.find(keyword) != keyword_catname_search_renderer.end()) // keyword has declared cat search renderer | 444 | if (keyword_catname_search_renderer.find(keyword) != keyword_catname_search_renderer.end()) // keyword has declared cat search renderer |
16 | 445 | { | 445 | { |
17 | 446 | qDebug() << "==== SEARCH keyword using search renderer"; | 446 | qDebug() << "==== SEARCH keyword using search renderer"; |
19 | 447 | cat_id = scope->local_id() + ":keyword:shared_cat:search_renderer::search"; | 447 | cat_id = scope->local_id() + ":keyword:shared_cat:search_renderer::search" + cat_title; |
20 | 448 | rdr = keyword_catname_search_renderer[keyword]; | 448 | rdr = keyword_catname_search_renderer[keyword]; |
21 | 449 | } | 449 | } |
22 | 450 | else | 450 | else |
23 | 451 | { | 451 | { |
24 | 452 | qDebug() << "==== SEARCH using incoming result renderer"; | 452 | qDebug() << "==== SEARCH using incoming result renderer"; |
26 | 453 | cat_id = scope->local_id() + ":keyowrd:shared_cat:incoming_renderer::search"; | 453 | cat_id = scope->local_id() + ":keyowrd:shared_cat:incoming_renderer::search" + cat_title; |
27 | 454 | rdr = inc_res_rdr; | 454 | rdr = inc_res_rdr; |
28 | 455 | } | 455 | } |
29 | 456 | if (!upstream_reply->lookup_category(cat_id)) | 456 | if (!upstream_reply->lookup_category(cat_id)) |
30 | @@ -475,7 +475,7 @@ | |||
31 | 475 | first_result_owner = keyword; | 475 | first_result_owner = keyword; |
32 | 476 | qDebug() << "==== KW RESULT is FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); | 476 | qDebug() << "==== KW RESULT is FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); |
33 | 477 | qDebug() << "==== KW RESULT claims FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); | 477 | qDebug() << "==== KW RESULT claims FIRST result: " << qstr(scope->keyword_scope_shared_cat_name()); |
35 | 478 | cat_id = keyword + ":keyword:is_shared_category:is_first_result"; | 478 | cat_id = keyword + ":keyword:is_shared_category:is_first_result" + cat_title; |
36 | 479 | rdr = keyword_catname_first_result_renderers[keyword]; | 479 | rdr = keyword_catname_first_result_renderers[keyword]; |
37 | 480 | keywordSharedCat_isFirstResult[keyword] = false; | 480 | keywordSharedCat_isFirstResult[keyword] = false; |
38 | 481 | keywordSharedCat_isSecondResult[keyword] = true; | 481 | keywordSharedCat_isSecondResult[keyword] = true; |
39 | @@ -497,13 +497,13 @@ | |||
40 | 497 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer | 497 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer |
41 | 498 | { | 498 | { |
42 | 499 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. uses surface_template "; | 499 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. uses surface_template "; |
44 | 500 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:surface_template"; | 500 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:surface_template" + cat_title; |
45 | 501 | rdr = keyword_catname_renderer[keyword]; | 501 | rdr = keyword_catname_renderer[keyword]; |
46 | 502 | } | 502 | } |
47 | 503 | else // use result template | 503 | else // use result template |
48 | 504 | { | 504 | { |
49 | 505 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. NOT uses serface_template "; | 505 | qDebug() << "==== KW RESULT uses FIRST result. is SECOND result. NOT uses serface_template "; |
51 | 506 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:result_template"; | 506 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:second_result:result_template" + cat_title; |
52 | 507 | rdr = res.category()->renderer_template().data(); | 507 | rdr = res.category()->renderer_template().data(); |
53 | 508 | } | 508 | } |
54 | 509 | if (!upstream_reply->lookup_category(cat_id)) | 509 | if (!upstream_reply->lookup_category(cat_id)) |
55 | @@ -526,7 +526,7 @@ | |||
56 | 526 | qDebug() << "==== KW RESULT uses FIRST result. other claims it.. uses surface_template "; | 526 | qDebug() << "==== KW RESULT uses FIRST result. other claims it.. uses surface_template "; |
57 | 527 | if (catname_catptr.find(keyword) == catname_catptr.end()) | 527 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
58 | 528 | { | 528 | { |
60 | 529 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:surface_template"; | 529 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:surface_template" + cat_title; |
61 | 530 | rdr = keyword_catname_renderer[keyword]; | 530 | rdr = keyword_catname_renderer[keyword]; |
62 | 531 | if (!upstream_reply->lookup_category(cat_id)) | 531 | if (!upstream_reply->lookup_category(cat_id)) |
63 | 532 | { | 532 | { |
64 | @@ -545,7 +545,7 @@ | |||
65 | 545 | qDebug() << "==== KW RESULT uses FIRST result. other claims it. uses result template "; | 545 | qDebug() << "==== KW RESULT uses FIRST result. other claims it. uses result template "; |
66 | 546 | if (catname_catptr.find(keyword) == catname_catptr.end()) | 546 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
67 | 547 | { | 547 | { |
69 | 548 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:result_template"; | 548 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:uses_first_result:other_claims_it:result_template" + cat_title; |
70 | 549 | rdr = res.category()->renderer_template().data(); | 549 | rdr = res.category()->renderer_template().data(); |
71 | 550 | if (!upstream_reply->lookup_category(cat_id)) | 550 | if (!upstream_reply->lookup_category(cat_id)) |
72 | 551 | { | 551 | { |
73 | @@ -567,14 +567,14 @@ | |||
74 | 567 | if (!scope->surface_template().empty())// has a decared surface template | 567 | if (!scope->surface_template().empty())// has a decared surface template |
75 | 568 | { | 568 | { |
76 | 569 | qDebug() << "==== KW RESULT not uses first result. uses surface template"; | 569 | qDebug() << "==== KW RESULT not uses first result. uses surface template"; |
78 | 570 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:surface_template"; | 570 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:surface_template" + cat_title; |
79 | 571 | qDebug() << "==== KW RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); | 571 | qDebug() << "==== KW RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); |
80 | 572 | rdr = scope->surface_template(); | 572 | rdr = scope->surface_template(); |
81 | 573 | } | 573 | } |
82 | 574 | else // use result template | 574 | else // use result template |
83 | 575 | { | 575 | { |
84 | 576 | qDebug() << "==== KW RESULT not uses first result. NOT uses surface template"; | 576 | qDebug() << "==== KW RESULT not uses first result. NOT uses surface template"; |
86 | 577 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:result_template"; | 577 | cat_id = scope->keyword_scope_shared_cat_name() + ":keyword:is_shared_category:not_uses_first_result:result_template" + cat_title; |
87 | 578 | rdr = res.category()->renderer_template().data(); | 578 | rdr = res.category()->renderer_template().data(); |
88 | 579 | } | 579 | } |
89 | 580 | if (catname_catptr.find(keyword) == catname_catptr.end()) | 580 | if (catname_catptr.find(keyword) == catname_catptr.end()) |
90 | @@ -627,13 +627,13 @@ | |||
91 | 627 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer | 627 | if (keyword_catname_renderer.find(keyword) != keyword_catname_renderer.end()) // keyword has declared cat renderer |
92 | 628 | { | 628 | { |
93 | 629 | qDebug() << "==== KW RESULT not shared declared renderer "; | 629 | qDebug() << "==== KW RESULT not shared declared renderer "; |
95 | 630 | cat_id = scope->keyword() + ":keyword:not_shared_category:declared_renderer"; | 630 | cat_id = scope->keyword() + ":keyword:not_shared_category:declared_renderer" + cat_title; |
96 | 631 | rdr = keyword_catname_renderer[keyword]; | 631 | rdr = keyword_catname_renderer[keyword]; |
97 | 632 | } | 632 | } |
98 | 633 | else // use result template | 633 | else // use result template |
99 | 634 | { | 634 | { |
100 | 635 | qDebug() << "==== KW RESULT not shared incoming renderer"; | 635 | qDebug() << "==== KW RESULT not shared incoming renderer"; |
102 | 636 | cat_id = scope->keyword() + ":keyword:not_shared_category:incoming_renderer"; | 636 | cat_id = scope->keyword() + ":keyword:not_shared_category:incoming_renderer" + cat_title; |
103 | 637 | rdr = res.category()->renderer_template().data(); | 637 | rdr = res.category()->renderer_template().data(); |
104 | 638 | } | 638 | } |
105 | 639 | if (!upstream_reply->lookup_category(cat_id)) | 639 | if (!upstream_reply->lookup_category(cat_id)) |
106 | @@ -692,13 +692,13 @@ | |||
107 | 692 | if (!scope->search_template().empty()) | 692 | if (!scope->search_template().empty()) |
108 | 693 | { | 693 | { |
109 | 694 | qDebug() << "==== CATREG keyword using search renderer"; | 694 | qDebug() << "==== CATREG keyword using search renderer"; |
111 | 695 | cat_id = scope->local_id() + ":category:search_renderer::search"; | 695 | cat_id = scope->local_id() + ":category:search_renderer::search" + cat_title; |
112 | 696 | rdr = scope->search_template(); | 696 | rdr = scope->search_template(); |
113 | 697 | } | 697 | } |
114 | 698 | else | 698 | else |
115 | 699 | { | 699 | { |
116 | 700 | qDebug() << "==== CATREG using incoming result renderer"; | 700 | qDebug() << "==== CATREG using incoming result renderer"; |
118 | 701 | cat_id = scope->local_id() + ":category:incoming_renderer::search"; | 701 | cat_id = scope->local_id() + ":category:incoming_renderer::search" + cat_title; |
119 | 702 | rdr = inc_res_rdr; | 702 | rdr = inc_res_rdr; |
120 | 703 | } | 703 | } |
121 | 704 | if (!upstream_reply->lookup_category(cat_id)) | 704 | if (!upstream_reply->lookup_category(cat_id)) |
122 | @@ -731,7 +731,7 @@ | |||
123 | 731 | first_result_owner = category_id; | 731 | first_result_owner = category_id; |
124 | 732 | qDebug() << "==== CATREG RESULT is FIRST result: " << qstr(scope->category_id()); | 732 | qDebug() << "==== CATREG RESULT is FIRST result: " << qstr(scope->category_id()); |
125 | 733 | qDebug() << "==== CATREG RESULT claims FIRST result: " << qstr(scope->category_id()); | 733 | qDebug() << "==== CATREG RESULT claims FIRST result: " << qstr(scope->category_id()); |
127 | 734 | cat_id = category_id + ":category:is_first_result"; | 734 | cat_id = category_id + ":category:is_first_result" + cat_title; |
128 | 735 | rdr = categoryId_first_result_renderers[category_id]; | 735 | rdr = categoryId_first_result_renderers[category_id]; |
129 | 736 | categoryId_isFirstResult[category_id] = false; | 736 | categoryId_isFirstResult[category_id] = false; |
130 | 737 | categoryId_isSecondResult[category_id] = true; | 737 | categoryId_isSecondResult[category_id] = true; |
131 | @@ -773,14 +773,14 @@ | |||
132 | 773 | qDebug()<<"==== CATREG SURFACE: " << qstr(scope->surface_template()).replace("\n"," "); | 773 | qDebug()<<"==== CATREG SURFACE: " << qstr(scope->surface_template()).replace("\n"," "); |
133 | 774 | if (!scope->surface_template().empty()) // keyword has declared cat renderer | 774 | if (!scope->surface_template().empty()) // keyword has declared cat renderer |
134 | 775 | { | 775 | { |
137 | 776 | qDebug() << "==== CATREG R=ESULT uses FIRST result. is SECOND result. uses surface_renderer "; | 776 | qDebug() << "==== CATREG RESULT uses FIRST result. is SECOND result. uses surface_renderer "; |
138 | 777 | cat_id = category_id + ":category:uses_first_result:second_result:surface_template"; | 777 | cat_id = category_id + ":category:uses_first_result:second_result:surface_template" + cat_title; |
139 | 778 | rdr = scope->surface_template(); | 778 | rdr = scope->surface_template(); |
140 | 779 | } | 779 | } |
141 | 780 | else // use result template | 780 | else // use result template |
142 | 781 | { | 781 | { |
143 | 782 | qDebug() << "==== CATREG RESULT uses FIRST result. is SECOND result. NOT uses surface_template "; | 782 | qDebug() << "==== CATREG RESULT uses FIRST result. is SECOND result. NOT uses surface_template "; |
145 | 783 | cat_id = category_id + ":category:uses_first_result:second_result:result_template"; | 783 | cat_id = category_id + ":category:uses_first_result:second_result:result_template" + cat_title; |
146 | 784 | rdr = res.category()->renderer_template().data(); | 784 | rdr = res.category()->renderer_template().data(); |
147 | 785 | } | 785 | } |
148 | 786 | if (!upstream_reply->lookup_category(cat_id)) | 786 | if (!upstream_reply->lookup_category(cat_id)) |
149 | @@ -808,7 +808,7 @@ | |||
150 | 808 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. using surface_template "; | 808 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. using surface_template "; |
151 | 809 | if (catname_catptr.find(category_id) == catname_catptr.end()) | 809 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
152 | 810 | { | 810 | { |
154 | 811 | cat_id = category_id + ":category:uses_first_result:other_claims_it:surface_template"; | 811 | cat_id = category_id + ":category:uses_first_result:other_claims_it:surface_template" + cat_title; |
155 | 812 | rdr = categoryId_renderer[category_id]; | 812 | rdr = categoryId_renderer[category_id]; |
156 | 813 | if (!upstream_reply->lookup_category(cat_id)) | 813 | if (!upstream_reply->lookup_category(cat_id)) |
157 | 814 | { | 814 | { |
158 | @@ -827,7 +827,7 @@ | |||
159 | 827 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. uses result template "; | 827 | qDebug() << "==== CATREG RESULT uses FIRST result. other claims it. uses result template "; |
160 | 828 | if (catname_catptr.find(category_id) == catname_catptr.end()) | 828 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
161 | 829 | { | 829 | { |
163 | 830 | cat_id = category_id + ":category:uses_first_result:other_claims_it:result_template"; | 830 | cat_id = category_id + ":category:uses_first_result:other_claims_it:result_template" + cat_title; |
164 | 831 | rdr = res.category()->renderer_template().data(); | 831 | rdr = res.category()->renderer_template().data(); |
165 | 832 | if (!upstream_reply->lookup_category(cat_id)) | 832 | if (!upstream_reply->lookup_category(cat_id)) |
166 | 833 | { | 833 | { |
167 | @@ -854,11 +854,10 @@ | |||
168 | 854 | check_result_fallbacks(res, scope->surface_common_template_id()); | 854 | check_result_fallbacks(res, scope->surface_common_template_id()); |
169 | 855 | } | 855 | } |
170 | 856 | 856 | ||
171 | 857 | |||
172 | 858 | if (!scope->surface_template().empty())// has a decared surface template | 857 | if (!scope->surface_template().empty())// has a decared surface template |
173 | 859 | { | 858 | { |
174 | 860 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template"; | 859 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template"; |
176 | 861 | cat_id = scope->category_id() + ":category:not_uses_first_result:surface_template"; | 860 | cat_id = scope->category_id() + ":category:not_uses_first_result:surface_template" + cat_title; |
177 | 862 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); | 861 | qDebug() << "==== CATREG RESULT not uses first result. uses surface template. surface temlate: " << qstr(scope->surface_template()).replace("\n", " "); |
178 | 863 | rdr = scope->surface_template(); | 862 | rdr = scope->surface_template(); |
179 | 864 | } | 863 | } |
180 | @@ -866,7 +865,7 @@ | |||
181 | 866 | { | 865 | { |
182 | 867 | qDebug() << "==== CATREG RESULT not uses first result. NOT uses surface template"; | 866 | qDebug() << "==== CATREG RESULT not uses first result. NOT uses surface template"; |
183 | 868 | qDebug() << "==== CATREG RESULT not uses first result. does use incoming result (not impld yet): " << qstr(category_id); | 867 | qDebug() << "==== CATREG RESULT not uses first result. does use incoming result (not impld yet): " << qstr(category_id); |
185 | 869 | cat_id = scope->keyword_scope_shared_cat_name() + ":category:not_uses_first_result:result_template"; | 868 | cat_id = scope->keyword_scope_shared_cat_name() + ":category:not_uses_first_result:result_template" + cat_title; |
186 | 870 | rdr = res.category()->renderer_template().data(); | 869 | rdr = res.category()->renderer_template().data(); |
187 | 871 | } | 870 | } |
188 | 872 | if (catname_catptr.find(category_id) == catname_catptr.end()) | 871 | if (catname_catptr.find(category_id) == catname_catptr.end()) |
189 | @@ -945,7 +944,7 @@ | |||
190 | 945 | 944 | ||
191 | 946 | cat_title = scope->category_title(); | 945 | cat_title = scope->category_title(); |
192 | 947 | 946 | ||
194 | 948 | cat_id = scope->id() + ":declared_default"; | 947 | cat_id = scope->id() + ":declared_default" + cat_title; |
195 | 949 | 948 | ||
196 | 950 | qDebug() << "==== first_result_owner: " << qstr(first_result_owner); | 949 | qDebug() << "==== first_result_owner: " << qstr(first_result_owner); |
197 | 951 | 950 | ||
198 | @@ -955,19 +954,19 @@ | |||
199 | 955 | if (!scope->search_template().empty()) | 954 | if (!scope->search_template().empty()) |
200 | 956 | { | 955 | { |
201 | 957 | qDebug() << "==== FIRST RESULT: SEARCH using search renderer"; | 956 | qDebug() << "==== FIRST RESULT: SEARCH using search renderer"; |
203 | 958 | cat_id = scope->local_id() + ":declared:first_result:search_renderer::search"; | 957 | cat_id = scope->local_id() + ":declared:first_result:search_renderer::search" + cat_title; |
204 | 959 | rdr = scope->search_template(); | 958 | rdr = scope->search_template(); |
205 | 960 | } | 959 | } |
206 | 961 | else if (!scope->surface_template().empty()) | 960 | else if (!scope->surface_template().empty()) |
207 | 962 | { | 961 | { |
208 | 963 | qDebug() << "==== FIRST RESULT: SEARCH using surface renderer"; | 962 | qDebug() << "==== FIRST RESULT: SEARCH using surface renderer"; |
210 | 964 | cat_id = scope->local_id() + ":declared:first_result:surface_renderer::search"; | 963 | cat_id = scope->local_id() + ":declared:first_result:surface_renderer::search" + cat_title; |
211 | 965 | rdr = scope->surface_template(); | 964 | rdr = scope->surface_template(); |
212 | 966 | } | 965 | } |
213 | 967 | else | 966 | else |
214 | 968 | { | 967 | { |
215 | 969 | qDebug() << "==== FIRST RESULT: SEARCH using incoming result renderer"; | 968 | qDebug() << "==== FIRST RESULT: SEARCH using incoming result renderer"; |
217 | 970 | cat_id = scope->local_id() + ":declared:first_result:incomiing_renderer::search"; | 969 | cat_id = scope->local_id() + ":declared:first_result:incomiing_renderer::search" + cat_title; |
218 | 971 | rdr = inc_res_rdr; | 970 | rdr = inc_res_rdr; |
219 | 972 | } | 971 | } |
220 | 973 | } | 972 | } |
221 | @@ -977,31 +976,31 @@ | |||
222 | 977 | if (!scope->first_result_template().empty()) | 976 | if (!scope->first_result_template().empty()) |
223 | 978 | { | 977 | { |
224 | 979 | qDebug() << "==== FIRST RESULT: using first result template"; | 978 | qDebug() << "==== FIRST RESULT: using first result template"; |
226 | 980 | cat_id = scope->local_id() + ":declared:first_result:first_result_template::surface"; | 979 | cat_id = scope->local_id() + ":declared:first_result:first_result_template::surface" + cat_title; |
227 | 981 | rdr = scope->first_result_template(); | 980 | rdr = scope->first_result_template(); |
228 | 982 | } | 981 | } |
229 | 983 | else if (!scope->surface_template().empty()) | 982 | else if (!scope->surface_template().empty()) |
230 | 984 | { | 983 | { |
232 | 985 | cat_id = scope->local_id() + ":declared:first_result:surface_template::surface"; | 984 | cat_id = scope->local_id() + ":declared:first_result:surface_template::surface" + cat_title; |
233 | 986 | rdr = scope->surface_template(); | 985 | rdr = scope->surface_template(); |
234 | 987 | qDebug() << "==== FIRST RESULT: using surface template"; | 986 | qDebug() << "==== FIRST RESULT: using surface template"; |
235 | 988 | } | 987 | } |
236 | 989 | else | 988 | else |
237 | 990 | { | 989 | { |
239 | 991 | cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface"; | 990 | cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface" + cat_title; |
240 | 992 | rdr = inc_res_rdr; | 991 | rdr = inc_res_rdr; |
241 | 993 | qDebug() << "==== FIRST RESULT: using incoming template"; | 992 | qDebug() << "==== FIRST RESULT: using incoming template"; |
242 | 994 | } | 993 | } |
243 | 995 | } | 994 | } |
244 | 996 | else if (!scope->surface_template().empty()) | 995 | else if (!scope->surface_template().empty()) |
245 | 997 | { | 996 | { |
247 | 998 | cat_id = scope->local_id() + ":declared:first_result:surface_template::surface"; | 997 | cat_id = scope->local_id() + ":declared:first_result:surface_template::surface" + cat_title; |
248 | 999 | rdr = scope->surface_template(); | 998 | rdr = scope->surface_template(); |
249 | 1000 | qDebug() << "==== FIRST RESULT: using surface template"; | 999 | qDebug() << "==== FIRST RESULT: using surface template"; |
250 | 1001 | } | 1000 | } |
251 | 1002 | else | 1001 | else |
252 | 1003 | { | 1002 | { |
254 | 1004 | cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface"; | 1003 | cat_id = scope->local_id() + ":declared:first_result:incoming_template::surface" + cat_title; |
255 | 1005 | rdr = inc_res_rdr; | 1004 | rdr = inc_res_rdr; |
256 | 1006 | qDebug() << "==== FIRST RESULT: using incoming template"; | 1005 | qDebug() << "==== FIRST RESULT: using incoming template"; |
257 | 1007 | } | 1006 | } |
258 | @@ -1038,12 +1037,12 @@ | |||
259 | 1038 | qDebug() << " CAT: scope->category_title(): " << qstr(scope->category_title()); | 1037 | qDebug() << " CAT: scope->category_title(): " << qstr(scope->category_title()); |
260 | 1039 | if (scope->override_surface_template()) // use declared renderer | 1038 | if (scope->override_surface_template()) // use declared renderer |
261 | 1040 | { | 1039 | { |
263 | 1041 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:surface_template:surface"; | 1040 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:surface_template:surface" + cat_title; |
264 | 1042 | rdr = scope->surface_template(); | 1041 | rdr = scope->surface_template(); |
265 | 1043 | } | 1042 | } |
266 | 1044 | else // use incoming renderer | 1043 | else // use incoming renderer |
267 | 1045 | { | 1044 | { |
269 | 1046 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:surface"; | 1045 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:surface" + cat_title; |
270 | 1047 | rdr = inc_res_rdr; | 1046 | rdr = inc_res_rdr; |
271 | 1048 | } | 1047 | } |
272 | 1049 | } | 1048 | } |
273 | @@ -1051,12 +1050,12 @@ | |||
274 | 1051 | { | 1050 | { |
275 | 1052 | if (scope->override_search_template()) | 1051 | if (scope->override_search_template()) |
276 | 1053 | { | 1052 | { |
278 | 1054 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:search_template:search"; | 1053 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:search_template:search" + cat_title; |
279 | 1055 | rdr = scope->search_template().data(); | 1054 | rdr = scope->search_template().data(); |
280 | 1056 | } | 1055 | } |
281 | 1057 | else | 1056 | else |
282 | 1058 | { | 1057 | { |
284 | 1059 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:search"; | 1058 | cat_id = scope->local_id() + ":declared:not_first_result:link-override:incoming_template:search" + cat_title; |
285 | 1060 | rdr = inc_res_rdr; | 1059 | rdr = inc_res_rdr; |
286 | 1061 | } | 1060 | } |
287 | 1062 | } | 1061 | } |
288 | @@ -1067,12 +1066,12 @@ | |||
289 | 1067 | { | 1066 | { |
290 | 1068 | if (scope->override_surface_template()) | 1067 | if (scope->override_surface_template()) |
291 | 1069 | { | 1068 | { |
293 | 1070 | cat_id = scope->local_id() + "_nolink-override-surface"; | 1069 | cat_id = scope->local_id() + "_nolink-override-surface" + cat_title; |
294 | 1071 | rdr = scope->surface_template().data(); | 1070 | rdr = scope->surface_template().data(); |
295 | 1072 | } | 1071 | } |
296 | 1073 | else if (!scope->first_result_template().empty()) | 1072 | else if (!scope->first_result_template().empty()) |
297 | 1074 | { | 1073 | { |
299 | 1075 | cat_id = scope->local_id() + "_nolink-nooverride-surface"; | 1074 | cat_id = scope->local_id() + "_nolink-nooverride-surface" + cat_title; |
300 | 1076 | rdr = inc_res_rdr;; | 1075 | rdr = inc_res_rdr;; |
301 | 1077 | } | 1076 | } |
302 | 1078 | } | 1077 | } |
303 | @@ -1080,12 +1079,12 @@ | |||
304 | 1080 | { | 1079 | { |
305 | 1081 | if (scope->override_search_template()) | 1080 | if (scope->override_search_template()) |
306 | 1082 | { | 1081 | { |
308 | 1083 | cat_id = scope->local_id() + "_nolink-override-search"; | 1082 | cat_id = scope->local_id() + "_nolink-override-search" + cat_title; |
309 | 1084 | rdr = scope->search_template().data(); | 1083 | rdr = scope->search_template().data(); |
310 | 1085 | } | 1084 | } |
311 | 1086 | else | 1085 | else |
312 | 1087 | { | 1086 | { |
314 | 1088 | cat_id = scope->local_id() + "_nolink-nooverride-search"; | 1087 | cat_id = scope->local_id() + "_nolink-nooverride-search" + cat_title; |
315 | 1089 | rdr = inc_res_rdr;; | 1088 | rdr = inc_res_rdr;; |
316 | 1090 | } | 1089 | } |
317 | 1091 | } | 1090 | } |
318 | @@ -1151,7 +1150,7 @@ | |||
319 | 1151 | if (common_templates.find(child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]) != common_templates.end()) | 1150 | if (common_templates.find(child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]) != common_templates.end()) |
320 | 1152 | { | 1151 | { |
321 | 1153 | std::string common_template_id = child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]; | 1152 | std::string common_template_id = child_scopes_m[scope->local_id()]->result_category_id_to_common_template[res.category()->id()]; |
323 | 1154 | std::string cat_id = common_template_id + ":" + scope->local_id(); | 1153 | std::string cat_id = common_template_id + ":" + scope->local_id() + cat_title; |
324 | 1155 | 1154 | ||
325 | 1156 | // if the common category has not yet been registered, register it | 1155 | // if the common category has not yet been registered, register it |
326 | 1157 | if (!upstream_reply->lookup_category(cat_id)) | 1156 | if (!upstream_reply->lookup_category(cat_id)) |