on 2f04183 help sign in
unity8/tests/mocks/Unity/Indicators/IndicatorsModel.qml
104 lines 3.4 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program 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; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.0
18import Unity.Indicators 0.1 as Indicators
20ListModel {
22 property var indicatorData : undefined
24 function load() {}
26 ListElement {
27 identifier: "indicator-fake1";
28 priority: 0
29 title: "Menu1";
30 description: "";
31 widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget1.qml";
32 pageSource: "qrc:/tests/indciators/qml/fake_menu_page1.qml";
33 indicatorProperties: "";
34 isValid: "";
35 }
36 ListElement {
37 identifier: "indicator-fake2";
38 priority: 1
39 title: "Menu2";
40 description: "";
41 widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget2.qml";
42 pageSource: "qrc:/tests/indciators/qml/fake_menu_page2.qml";
43 indicatorProperties: "";
44 isValid: "";
45 }
46 ListElement {
47 identifier: "indicator-fake3";
48 priority: 2
49 title: "Menu3";
50 description: "";
51 widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget3.qml";
52 pageSource: "qrc:/tests/indciators/qml/fake_menu_page3.qml";
53 indicatorProperties: "";
54 isValid: "";
55 }
56 ListElement {
57 identifier: "indicator-fake4";
58 priority: 3
59 title: "Menu4";
60 description: "";
61 widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget4.qml";
62 pageSource: "qrc:/tests/indciators/qml/fake_menu_page4.qml";
63 indicatorProperties: "";
64 isValid: "";
65 }
66 ListElement {
67 identifier: "indicator-fake4";
68 priority: 4
69 title: "Menu5";
70 description: "";
71 widgetSource: "qrc:/tests/indciators/qml/fake_menu_widget5.qml";
72 pageSource: "qrc:/tests/indciators/qml/fake_menu_page5.qml";
73 indicatorProperties: "";
74 isValid: "";
75 }
77 function data(row, role) {
78 if (role == Indicators.IndicatorsModelRole.Identifier) {
79 return get(row).identifier;
80 }
81 else if (role == Indicators.IndicatorsModelRole.Priority) {
82 return get(row).priority
83 }
84 else if (role == Indicators.IndicatorsModelRole.Title) {
85 return get(row).title
86 }
87 else if (role == Indicators.IndicatorsModelRole.Description) {
88 return get(row).description
89 }
90 else if (role == Indicators.IndicatorsModelRole.WidgetSource) {
91 return get(row).widgetSource
92 }
93 else if (role == Indicators.IndicatorsModelRole.PageSource) {
94 return get(row).pageSource
95 }
96 else if (role == Indicators.IndicatorsModelRole.IndicatorProperties) {
97 return get(row).indicatorProperties
98 }
99 else if (role == Indicators.IndicatorsModelRole.IsValid) {
100 return get(row).isValid
101 }
102 }