Merge lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-ng-refactor into lp:ubuntu-rssreader-app
- ubuntu-rssreader-app-ng-refactor
- Merge into reboot
Status: | Merged |
---|---|
Approved by: | Joey Chan |
Approved revision: | 419 |
Merged at revision: | 416 |
Proposed branch: | lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-ng-refactor |
Merge into: | lp:ubuntu-rssreader-app |
Diff against target: |
609 lines (+95/-203) 8 files modified
shorts/qml/components/NetworkManager.qml (+42/-109) shorts/qml/components/OptionsKeeper.qml (+4/-7) shorts/qml/nongoogle/AppendNGFeedPage.qml (+8/-17) shorts/qml/nongoogle/Positioner.qml (+1/-4) shorts/qml/nongoogle/XmlNetwork.qml (+0/-13) shorts/qml/pages/EditFeedPage.qml (+22/-40) shorts/qml/pages/PageSettings.qml (+17/-12) shorts/qml/shorts-app.qml (+1/-1) |
To merge this branch: | bzr merge lp:~mrqtros/ubuntu-rssreader-app/ubuntu-rssreader-app-ng-refactor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joey Chan | Approve | ||
Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+281508@code.launchpad.net |
Commit message
Non-Google engine refactor.
Description of the change
Non-Google engine refactor.
Please, check carefully its functionality.
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
Joey Chan (qqworini) wrote : | # |
Autually functions are work fine,
but BE CAREFUL , in NetworkManager.qml, line 28 : function cancelDownload()
U forgot to clean another "dNG" :P
- 418. By Roman Shchekin
-
Forgot "else".
Roman Shchekin (mrqtros) wrote : | # |
Do you mean that I forgot "else"? Fixing...
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:418
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 419. By Roman Shchekin
-
"cancelDownload" fixed.
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:419
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Joey Chan (qqworini) : | # |
Preview Diff
1 | === modified file 'shorts/qml/components/NetworkManager.qml' |
2 | --- shorts/qml/components/NetworkManager.qml 2015-12-02 17:03:41 +0000 |
3 | +++ shorts/qml/components/NetworkManager.qml 2016-01-04 18:43:59 +0000 |
4 | @@ -19,23 +19,14 @@ |
5 | signal downloadStarted(int tagId) |
6 | |
7 | property string operationStatus: "success" |
8 | + property bool __useGFA: optionsKeeper.useGoogleSearch |
9 | |
10 | function updateFeeds(feedsArray, topicId) { |
11 | - if (optionsKeeper.useGoogleSearch()) { |
12 | - d.updateFeeds(feedsArray, topicId) |
13 | - } |
14 | - else { |
15 | - dNG.updateFeeds(feedsArray, topicId) |
16 | - } |
17 | + d.updateFeeds(feedsArray, topicId) |
18 | } |
19 | |
20 | function cancelDownload() { |
21 | - if (optionsKeeper.useGoogleSearch()) { |
22 | - d.cancelDownload() |
23 | - } |
24 | - else { |
25 | - dNG.cancelDownload() |
26 | - } |
27 | + d.cancelDownload() |
28 | } |
29 | |
30 | /* All private method are inside QtObject. |
31 | @@ -69,13 +60,17 @@ |
32 | } |
33 | |
34 | currentFeed = feedList.shift() |
35 | - googleFeedApi.loadFeed(currentFeed.source) |
36 | + if (__useGFA) |
37 | + googleFeedApi.loadFeed(currentFeed.source) |
38 | + else nonGoogleFeedApi.loadFeed(currentFeed.source) |
39 | } |
40 | |
41 | function cancelDownload() { |
42 | feedList = [] |
43 | operationStatus = "abort" |
44 | - googleFeedApi.abort() |
45 | + if (__useGFA) |
46 | + googleFeedApi.abort() |
47 | + else nonGoogleFeedApi.abort() |
48 | } |
49 | |
50 | function updateFeedInfo(feedId, feedLink, responseData) { |
51 | @@ -122,67 +117,7 @@ |
52 | console.timeEnd("addArticlesEx") |
53 | } |
54 | |
55 | - function clearFromBadTags(content) { |
56 | - /* Remove non empty too. Useless anyway. |
57 | - */ |
58 | - content = content.replace(/alt=".*?"/g, "") |
59 | - content = content.replace(/title=".*?"/g, "") |
60 | - return content |
61 | - } |
62 | - |
63 | - property var googleFeedApi: GoogleFeedApi { |
64 | - onLoadResult: { |
65 | - if (result.responseStatus !== 200) { |
66 | - console.log("XML NETWORK GFA:", JSON.stringify(result)) |
67 | - if (operationStatus == "success") |
68 | - operationStatus = "withErrors" |
69 | - } else d.updateFeedInfo(d.currentFeed.id, d.currentFeed.link, result.responseData) |
70 | - |
71 | - d.updateNextFeed() |
72 | - } |
73 | - } // GFA |
74 | - } // QtObject |
75 | - |
76 | - ////////////////////////////////////////// add a new object to refresh non-google feeds |
77 | - QtObject { |
78 | - id: dNG |
79 | - |
80 | - property var feedList: [] // Feed list to update. |
81 | - property var currentFeed // Current downloading feed. |
82 | - property int tagId: 0 // Tag to update. |
83 | - |
84 | - /* Method updates feeds one by another. |
85 | - * Input: array of objects, each should include |
86 | - * source, link and id (of feed in DB) properties. |
87 | - */ |
88 | - function updateFeeds(feedsArray, topicId) { |
89 | - tagId = topicId || 0 |
90 | - |
91 | - downloadStarted(tagId) |
92 | - |
93 | - feedList = feedsArray |
94 | - operationStatus = "success" |
95 | - updateNextFeed() |
96 | - } |
97 | - |
98 | - // For inner usage only. |
99 | - function updateNextFeed() { |
100 | - if (feedList.length == 0) { |
101 | - downloadFinished(tagId) |
102 | - return |
103 | - } |
104 | - |
105 | - currentFeed = feedList.shift() |
106 | - nonGoogleFeedApi.loadFeed(currentFeed.source) |
107 | - } |
108 | - |
109 | - function cancelDownload() { |
110 | - feedList = [] |
111 | - operationStatus = "abort" |
112 | - nonGoogleFeedApi.abort() |
113 | - } |
114 | - |
115 | - function updateFeedInfo(feedId, feedLink, responseData) { |
116 | + function updateFeedInfoNg(feedId, feedLink, responseData) { |
117 | var entries = responseData.item |
118 | var f = responseData |
119 | |
120 | @@ -190,8 +125,8 @@ |
121 | var fti = f.title == undefined ? "" : f.title["#text"] == undefined ? f.title : f.title["#text"] |
122 | |
123 | DB.updateFeedByXml(feedId, feedLink, fde, fti) |
124 | - console.log(" -------- UPDATE INFO -------- ") |
125 | - // console.log(f.title, f.link, f.feedUrl, f.description) |
126 | + console.log(" -------- UPDATE INFO (NG) -------- ") |
127 | + console.log(fti, feedLink, f.feedUrl, fde) |
128 | |
129 | console.time("addArticlesEx") |
130 | |
131 | @@ -200,11 +135,6 @@ |
132 | for (var i = 0; i < maxLength; i++) { |
133 | var e = entries[i] |
134 | |
135 | - // print("article detail: ", JSON.stringify(e)) |
136 | - // Grab image from for article. |
137 | - // var articleImage = ImageUtils.grabArticleImage(e) |
138 | - // e.content = clearFromBadTags(e.content) |
139 | - |
140 | var ti = e.title == undefined ? "" : e.title["#text"] == undefined ? e.title : e.title["#text"] |
141 | var li = e.link == undefined ? "" : e.link["#text"] == undefined ? e.link : e.link["#text"] |
142 | var au = e.author == undefined ? "" : e.author["#text"] == undefined ? e.author : e.author["#text"] |
143 | @@ -212,34 +142,25 @@ |
144 | var de = e.description == undefined ? "" : e.description["#text"] == undefined ? e.description : e.description["#text"] |
145 | var pu = e.pubDate == undefined ? "" : e.pubDate["#text"] == undefined ? e.pubDate : e.pubDate["#text"] |
146 | var co = e.content == undefined ? "" : e.content["#text"] == undefined ? e.content : e.content["#text"] |
147 | + |
148 | var articleImage = utilities.htmlGetImg(de) |
149 | - if (articleImage.length == 0) { articleImage = utilities.htmlGetImg(co) } |
150 | - else { |
151 | - print("articleImage: ", articleImage[0]) |
152 | - } |
153 | - // print("date parse 0: ", pu, DateUtils.parseDate(pu)) |
154 | - // print("date parse 1: ", DateUtils.formatRelativeTime(i18n, DateUtils.parseDate(pu))) |
155 | + if (!articleImage.length) |
156 | + articleImage = utilities.htmlGetImg(co) |
157 | |
158 | - var temp = |
159 | - { |
160 | + var temp = { |
161 | "title": ti, |
162 | - "content": co == "" ? de : co, |
163 | - "link": li, |
164 | - "author": creator == "" ? au : creator, |
165 | - "description": de, |
166 | - "pubDate": DateUtils.parseDate(pu), |
167 | - "guid": Qt.md5(li + pu), |
168 | - "image" : articleImage.length > 0 ? articleImage[0] : "", |
169 | - "media_groups" : "" |
170 | + "content": co ? co : de, |
171 | + "link": li, |
172 | + "author": creator ? creator : au , |
173 | + "description": de, |
174 | + "pubDate": DateUtils.parseDate(pu), |
175 | + "guid": Qt.md5(li + pu), |
176 | + "image" : articleImage.length ? articleImage[0] : "", |
177 | + "media_groups" : "" |
178 | } |
179 | |
180 | newArticles.push(temp) |
181 | } |
182 | -// print("new article length: ", newArticles.length) |
183 | - |
184 | - // /* Add new articles to DB and restore 'read' status of some of them. |
185 | - // */ |
186 | - // DB.addArticles(articleModel, feedId, articleProperties); |
187 | |
188 | /* Add new articles to DB and restore 'read' status of some of them. */ |
189 | try { |
190 | @@ -253,22 +174,34 @@ |
191 | |
192 | function clearFromBadTags(content) { |
193 | /* Remove non empty too. Useless anyway. |
194 | - */ |
195 | + */ |
196 | content = content.replace(/alt=".*?"/g, "") |
197 | content = content.replace(/title=".*?"/g, "") |
198 | return content |
199 | } |
200 | |
201 | + property var googleFeedApi: GoogleFeedApi { |
202 | + onLoadResult: { |
203 | + if (result.responseStatus !== 200) { |
204 | + console.log("XML NETWORK GFA:", JSON.stringify(result)) |
205 | + if (operationStatus == "success") |
206 | + operationStatus = "withErrors" |
207 | + } else d.updateFeedInfo(d.currentFeed.id, d.currentFeed.link, result.responseData) |
208 | + |
209 | + d.updateNextFeed() |
210 | + } |
211 | + } // GFA |
212 | + |
213 | property var nonGoogleFeedApi: XmlNetwork { |
214 | onLoadResult: { |
215 | - if (result.rss == undefined || result.rss == "") { |
216 | -// console.log("XML NETWORK GFA:", JSON.stringify(result)) |
217 | + if (!result.rss) { |
218 | + console.log("XML NETWORK NGA:", JSON.stringify(result)) |
219 | if (operationStatus == "success") |
220 | operationStatus = "withErrors" |
221 | - } else dNG.updateFeedInfo(dNG.currentFeed.id, dNG.currentFeed.link, result.rss.channel) |
222 | + } else d.updateFeedInfoNg(d.currentFeed.id, d.currentFeed.link, result.rss.channel) |
223 | |
224 | - dNG.updateNextFeed() |
225 | + d.updateNextFeed() |
226 | } |
227 | - } // GFA |
228 | + } // NGA |
229 | } // QtObject |
230 | } |
231 | |
232 | === modified file 'shorts/qml/components/OptionsKeeper.qml' |
233 | --- shorts/qml/components/OptionsKeeper.qml 2015-12-02 17:03:41 +0000 |
234 | +++ shorts/qml/components/OptionsKeeper.qml 2016-01-04 18:43:59 +0000 |
235 | @@ -9,21 +9,19 @@ |
236 | property int fontSize |
237 | property bool useDarkTheme |
238 | property bool useListMode |
239 | + property bool useGoogleSearch |
240 | |
241 | Component.onCompleted: { |
242 | fontSize = getFontSize() |
243 | useDarkTheme = getUseDarkTheme() |
244 | useListMode = getUseListMode() |
245 | - |
246 | - |
247 | - if (useGoogleSearch() == undefined ) { |
248 | - setUseGoogleSearch(true) |
249 | - } |
250 | + useGoogleSearch = getUseGoogleSearch() |
251 | } |
252 | |
253 | onFontSizeChanged: setFontSize(fontSize) |
254 | onUseDarkThemeChanged: setUseDarkTheme(useDarkTheme) |
255 | onUseListModeChanged: setUseListMode(useListMode) |
256 | + onUseGoogleSearchChanged: setUseGoogleSearch(useGoogleSearch) |
257 | |
258 | function getFontSize() { |
259 | return settingsDocument.contents.fontSize |
260 | @@ -69,8 +67,7 @@ |
261 | return settingsDocument.contents.dbLastUpdate |
262 | } |
263 | |
264 | - /////////////////////////////////////////////////////// below two functions are get/set "useGoogleSearch" value |
265 | - function useGoogleSearch() { |
266 | + function getUseGoogleSearch() { |
267 | return settingsDocument.contents.useGoogleSearch |
268 | } |
269 | |
270 | |
271 | === modified file 'shorts/qml/nongoogle/AppendNGFeedPage.qml' |
272 | --- shorts/qml/nongoogle/AppendNGFeedPage.qml 2015-12-15 15:58:12 +0000 |
273 | +++ shorts/qml/nongoogle/AppendNGFeedPage.qml 2016-01-04 18:43:59 +0000 |
274 | @@ -58,18 +58,15 @@ |
275 | id: xmlFeedApi |
276 | |
277 | onLoadResult: { |
278 | - if (result.rss == undefined || result.rss == "") { |
279 | - // TODO alert that fail retriving feed data |
280 | + if (!result.rss) { |
281 | print("onLoadResult failed") |
282 | } |
283 | else { |
284 | -// d.updateFeedInfo(d.currentFeed.id, d.currentFeed.link, result.rss.channel) |
285 | var f = result.rss.channel |
286 | |
287 | - feedDesc = f.description == undefined ? "" : f.description["#text"] == undefined ? f.description : f.description["#text"] |
288 | - feedTitle = f.title == undefined ? "" : f.title["#text"] == undefined ? f.title : f.title["#text"] |
289 | -// feedUrl = l |
290 | - feedLink = f.link == undefined ? "" : f.link["#text"] == undefined ? f.link : f.link["#text"] |
291 | + feedDesc = f.description ? (f.description["#text"] ? f.description["#text"] : f.description ) : "" |
292 | + feedTitle = f.title ? (f.title["#text"] ? f.title["#text"] : f.title ) : "" |
293 | + feedLink = f.link ? (f.link["#text"] ? f.link["#text"] : f.link) : "" |
294 | feedObj = { |
295 | "url" : feedUrl, |
296 | "title" : feedTitle, |
297 | @@ -77,7 +74,6 @@ |
298 | "link" : feedLink |
299 | } |
300 | } |
301 | - |
302 | } |
303 | } |
304 | |
305 | @@ -114,20 +110,18 @@ |
306 | anchors.fill: parent |
307 | onClicked: { |
308 | if (Qt.inputMethod.visible) |
309 | - tfFeedUrl.accapt() |
310 | + tfFeedUrl.accept() |
311 | } |
312 | } |
313 | } |
314 | |
315 | - onAccepted: { |
316 | - accapt() |
317 | - } |
318 | + onAccepted: accept() |
319 | |
320 | - function accapt() { |
321 | + function accept() { |
322 | Qt.inputMethod.hide() |
323 | var userInput = text |
324 | |
325 | - if (userInput == "") |
326 | + if (!userInput) |
327 | return |
328 | |
329 | // Very simple logic, URL if there are no spaces and contains dots. |
330 | @@ -240,11 +234,8 @@ |
331 | return |
332 | |
333 | var selectedFeeds = [] |
334 | - |
335 | selectedFeeds.push(feedObj) |
336 | - |
337 | pageStack.push(chooseTopicPage, {"feedsToAdd" : selectedFeeds}) |
338 | -// pageStack.push(Qt.resolvedUrl("../pages/ChooseTopicPage.qml"), {"feedsToAdd" : selectedFeeds}) |
339 | } |
340 | } |
341 | } // Button |
342 | |
343 | === modified file 'shorts/qml/nongoogle/Positioner.qml' |
344 | --- shorts/qml/nongoogle/Positioner.qml 2015-12-15 15:58:12 +0000 |
345 | +++ shorts/qml/nongoogle/Positioner.qml 2016-01-04 18:43:59 +0000 |
346 | @@ -82,8 +82,6 @@ |
347 | var doc = new XMLHttpRequest() |
348 | |
349 | doc.onreadystatechange = function() { |
350 | - |
351 | - // print("positioner onreadystatechange: ", doc.readyState, doc.status, feedUrl) |
352 | if (doc.readyState === XMLHttpRequest.DONE) { |
353 | |
354 | var resObj |
355 | @@ -92,14 +90,13 @@ |
356 | } else { // Error |
357 | resObj = {"responseDetails" : doc.statusText, |
358 | "responseStatus" : doc.status} |
359 | -// resObj = "" |
360 | } |
361 | |
362 | countryCode = resObj.countryName |
363 | print("countryCode", resObj) |
364 | |
365 | if (countryCode == "China") { |
366 | - if (optionsKeeper.useGoogleSearch()) { |
367 | + if (optionsKeeper.useGoogleSearch) { |
368 | PopupUtils.open(componentDialogNG, tabstabs) |
369 | } |
370 | } |
371 | |
372 | === modified file 'shorts/qml/nongoogle/XmlNetwork.qml' |
373 | --- shorts/qml/nongoogle/XmlNetwork.qml 2015-12-15 15:58:12 +0000 |
374 | +++ shorts/qml/nongoogle/XmlNetwork.qml 2016-01-04 18:43:59 +0000 |
375 | @@ -29,7 +29,6 @@ |
376 | |
377 | var resObj |
378 | if (doc.status == 200) { |
379 | -// resObj = JSON.parse(doc.responseText) |
380 | resObj = utilities.xmlToJson(doc.responseText) |
381 | } else { // Error |
382 | resObj = {"responseDetails" : doc.statusText, |
383 | @@ -41,18 +40,6 @@ |
384 | } |
385 | } |
386 | |
387 | - |
388 | - /* Number of articles to download. |
389 | - */ |
390 | -// finalRequest += "&num=" + num |
391 | - |
392 | - /* Add some optional params. |
393 | - * May be usable: |
394 | - * hl - host language, for example "hl=ru", default en. |
395 | - * num - number of entries, for example "num=50", default 4, maximum 100. |
396 | - * output - format of output, for example "output=json", may be xml, json_xml, json. |
397 | - */ |
398 | -// doc.open("GET", finalRequest, true); |
399 | doc.open("GET", feedUrl, true); |
400 | doc.send(); |
401 | } |
402 | |
403 | === modified file 'shorts/qml/pages/EditFeedPage.qml' |
404 | --- shorts/qml/pages/EditFeedPage.qml 2015-10-24 07:06:24 +0000 |
405 | +++ shorts/qml/pages/EditFeedPage.qml 2016-01-04 18:43:59 +0000 |
406 | @@ -11,7 +11,6 @@ |
407 | objectName: "editfeedpage" |
408 | title: i18n.tr("Edit Feed") |
409 | flickable: null/*content*/ |
410 | -// tools: null |
411 | |
412 | head.actions: [ |
413 | Action { |
414 | @@ -20,7 +19,6 @@ |
415 | text: i18n.tr("Done") |
416 | onTriggered: { |
417 | if (previousTopicId != newTopicId) { |
418 | - // DB.updateFeedByUser(feedId, feedTitle, feedURL) |
419 | DB.deleteFeedTag(feedId, previousTopicId) |
420 | DB.addFeedTag(feedId, newTopicId) |
421 | apply(feedId, newTopicId, previousTopicId) |
422 | @@ -41,8 +39,7 @@ |
423 | property var dbTags |
424 | property var topicArray |
425 | |
426 | - function setValues(feedid, title, url, pTopicId) |
427 | - { |
428 | + function setValues(feedid, title, url, pTopicId) { |
429 | feedId = feedid ; |
430 | feedTitle = title ; |
431 | feedURL = url ; |
432 | @@ -53,12 +50,9 @@ |
433 | var tArray = [] ; |
434 | var tagsArray = [] ; |
435 | var index |
436 | - for (var i=0; i<tags.rows.length; i++) |
437 | - { |
438 | + for (var i=0; i<tags.rows.length; i++) { |
439 | if(tags.rows[i].id == previousTopicId) |
440 | - { |
441 | - index = i ; |
442 | - } |
443 | + index = i |
444 | tArray.push(tags.rows[i].name) ; |
445 | tagsArray.push(tags.rows[i]) ; |
446 | } |
447 | @@ -67,28 +61,23 @@ |
448 | seletorTopic.selectedIndex = index ; |
449 | } |
450 | |
451 | - function reloadPageContent() { |
452 | -// editPage.tools = toolbar |
453 | - } |
454 | + function reloadPageContent() { } |
455 | |
456 | Flickable { |
457 | id: content |
458 | - anchors { fill: parent; topMargin: units.gu(2)/*margins: units.gu(2)*/ } |
459 | + anchors { fill: parent; topMargin: units.gu(2) } |
460 | contentHeight: contentItem.childrenRect.height |
461 | boundsBehavior: (contentHeight > editPage.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds |
462 | |
463 | - Column |
464 | - { |
465 | + Column { |
466 | anchors{ left: parent.left; right: parent.right } |
467 | spacing: units.gu(2) |
468 | |
469 | - Row |
470 | - { |
471 | + Row { |
472 | anchors{ left: parent.left; right: parent.right; leftMargin: units.gu(2); rightMargin: units.gu(2) } |
473 | spacing: units.gu(1) |
474 | |
475 | - Label |
476 | - { |
477 | + Label { |
478 | id: labelTitle |
479 | text: i18n.tr("Title: ") |
480 | width: units.gu(6) |
481 | @@ -105,21 +94,18 @@ |
482 | } |
483 | } |
484 | |
485 | - Row |
486 | - { |
487 | + Row { |
488 | anchors{ left: parent.left; right: parent.right; leftMargin: units.gu(2); rightMargin: units.gu(2) } |
489 | spacing: units.gu(1) |
490 | |
491 | - Label |
492 | - { |
493 | + Label { |
494 | id: labelURL |
495 | text: i18n.tr("URL: ") |
496 | width: labelTitle.width |
497 | anchors.verticalCenter: parent.verticalCenter |
498 | } |
499 | |
500 | - TextField |
501 | - { |
502 | + TextField { |
503 | text: feedURL |
504 | width: parent.width - labelURL.width - parent.spacing |
505 | anchors.verticalCenter: parent.verticalCenter |
506 | @@ -132,24 +118,20 @@ |
507 | objectName: "valueselector" |
508 | id: seletorTopic |
509 | text: i18n.tr("Topic: ") |
510 | - values: (topicArray == undefined || topicArray.length == 0) ? [""] : topicArray |
511 | -// selectedIndex: 0 |
512 | + values: (topicArray && topicArray.length) ? topicArray : [""] |
513 | |
514 | - onSelectedIndexChanged: |
515 | - { |
516 | - var tArray = topicArray ; |
517 | - var topicname = tArray[seletorTopic.selectedIndex] ; |
518 | - var tags = dbTags ; |
519 | - console.log("detail: ", JSON.stringify(tags)) ; |
520 | - for (var i=0; i<tags.length; i++) |
521 | - { |
522 | - if(tags[i].name == topicname) |
523 | - { |
524 | - newTopicId = tags[i].id ; |
525 | - break ; |
526 | + onSelectedIndexChanged: { |
527 | + var tArray = topicArray |
528 | + var topicname = tArray[seletorTopic.selectedIndex] |
529 | + var tags = dbTags |
530 | + console.log("detail: ", JSON.stringify(tags)) |
531 | + for (var i=0; i<tags.length; i++) { |
532 | + if(tags[i].name == topicname) { |
533 | + newTopicId = tags[i].id |
534 | + break |
535 | } |
536 | } |
537 | - console.log("new topic id: ", newTopicId) ; |
538 | + console.log("new topic id: ", newTopicId) |
539 | } |
540 | } |
541 | } |
542 | |
543 | === modified file 'shorts/qml/pages/PageSettings.qml' |
544 | --- shorts/qml/pages/PageSettings.qml 2015-12-03 16:01:09 +0000 |
545 | +++ shorts/qml/pages/PageSettings.qml 2016-01-04 18:43:59 +0000 |
546 | @@ -9,6 +9,18 @@ |
547 | title: i18n.tr("Settings") |
548 | flickable: null |
549 | |
550 | + property bool preventSave: false |
551 | + |
552 | + Component.onCompleted: updateInfoFromOptions() |
553 | + |
554 | + function updateInfoFromOptions() { |
555 | + preventSave = true |
556 | + |
557 | + swUseGfa.checked = optionsKeeper.useGoogleSearch |
558 | + |
559 | + preventSave = false |
560 | + } |
561 | + |
562 | Column { |
563 | anchors { |
564 | top: parent.top; topMargin: units.gu(1) |
565 | @@ -37,26 +49,19 @@ |
566 | } |
567 | |
568 | Switch { |
569 | + id: swUseGfa |
570 | anchors.right: parent.right |
571 | - checked: optionsKeeper.useGoogleSearch() |
572 | - |
573 | - Component.onCompleted: { |
574 | - if (optionsKeeper.useGoogleSearch() == undefined ) { |
575 | - optionsKeeper.setUseGoogleSearch(true) |
576 | - checked = true |
577 | - } |
578 | - } |
579 | |
580 | onCheckedChanged: { |
581 | - optionsKeeper.setUseGoogleSearch(checked) |
582 | + if (preventSave) |
583 | + return |
584 | + optionsKeeper.useGoogleSearch = checked |
585 | } |
586 | } |
587 | } |
588 | |
589 | - ListItem.ThinDivider{} |
590 | + ListItem.ThinDivider{ } |
591 | ///////////////////////////////////////////////////////////////////// Google RSS engine switch end here |
592 | - |
593 | - |
594 | }// Column |
595 | |
596 | } |
597 | |
598 | === modified file 'shorts/qml/shorts-app.qml' |
599 | --- shorts/qml/shorts-app.qml 2015-12-02 17:03:41 +0000 |
600 | +++ shorts/qml/shorts-app.qml 2016-01-04 18:43:59 +0000 |
601 | @@ -251,7 +251,7 @@ |
602 | objectName: "tabstabs" |
603 | visible: false |
604 | |
605 | - bottomEdgePage: optionsKeeper.useGoogleSearch() ? appendFeedPage : appendNGFeedPage |
606 | + bottomEdgePage: optionsKeeper.useGoogleSearch ? appendFeedPage : appendNGFeedPage |
607 | bottomEdgeTitle: i18n.tr("Add feeds") |
608 | bottomEdgeBackgroundColor: "#F5F5F5" // "#875864" |
609 | bottomEdgeTipColor: "#5533b5e5"// "#E0E0E0" //"#9b616c" |
PASSED: Continuous integration, rev:417 /core-apps- jenkins. ubuntu. com/job/ shorts- app-ci/ 11/ /core-apps- jenkins. ubuntu. com/job/ generic- update- mp/286/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /core-apps- jenkins. ubuntu. com/job/ shorts- app-ci/ 11/rebuild
https:/