2 ** Copyright (C) 2012 Christophe CHAPUIS <chris.chapuis _at_ gmail _dot_ com>
4 ** This package is free software; you can redistribute it and/or modify
5 ** it under the terms of the GNU General Public License as published by
6 ** the Free Software Foundation; either version 2 of the License, or
7 ** (at your option) any later version.
9 ** This package is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ** GNU General Public License for more details.
14 ** You should have received a copy of the GNU General Public License
15 ** along with this package; if not, write to the Free Software
16 ** Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 { viewComponent: 'content/view/Categories.qml' } ,
27 { viewComponent: 'content/view/News.qml' },
28 { viewComponent: 'content/view/NewsDetail.qml' },
29 { viewComponent: 'content/view/NewsComments.qml' }
35 newsModelDetailComments
38 function getSeqId(categoryIndex)
40 if( typeof categoriesModel.get(categoryIndex) != "undefined" )
41 if( typeof categoriesModel.get(categoryIndex).seqid != "undefined" )
42 return categoriesModel.get(categoryIndex).seqid
47 function getNewsModelItem(prop)
49 var newsIndex = currentPath[2]
51 if( typeof newsModel.get(newsIndex) != "undefined" )
52 if( typeof newsModel.get(newsIndex)[prop] != "undefined" )
53 return newsModel.get(newsIndex)[prop]
58 property variant categoriesModel: LeMondeSequencesList { }
59 property variant newsModel: LeMondeSequenceNews {
60 seqid: getSeqId(currentPath[1])
62 property variant newsModelDetail: QtObject {
63 property variant parentModel: newsModel
64 property int sourceDepth: 3
66 property string urllink: getNewsModelItem('link')
67 property string htmlcontent: getNewsModelItem('detailedContent')
68 property string title: getNewsModelItem('title')
69 property string image: getNewsModelItem('image')
71 property variant newsModelDetailComments: QtObject {
72 property variant parentModel: newsModel
73 property int sourceDepth: 4
75 property string commentURL: "http://www.lemonde.fr" + getNewsModelItem('commentURL')
76 property string title: getNewsModelItem('title')
77 property string image: getNewsModelItem('image')
80 loading: categoriesModel.loading || newsModel.loading