on xenial help sign in
Last test
56c732aAndrea Cimitan
qml/Components/flickableUtils.js+3
@@ -16,6 +16,9 @@
16
16
17.pragma library
17.pragma library
18
18
19+/* TODO the "8" is is DEFAULT_GRID_UNIT_PX, we use it to normalize the values with the current grid unit size.
20+ Add a way to fetch this default grid unit px value from UITK. */
21+
19function getFlickDeceleration(gridUnit) {
22function getFlickDeceleration(gridUnit) {
20 return 1500 * gridUnit / 8;
23 return 1500 * gridUnit / 8;
21}
24}
tests/imports/check_imports.py+11−5
@@ -82,13 +82,16 @@ def scan_for_bad_import(file_path, all_pat, good_pats):
82 return bool(errors)
82 return bool(errors)
83
83
84# Flickable matches
84# Flickable matches
85−flickable_pat = re.compile(r'.*\ Flickable {')
85+flickable_pat = re.compile(r'.*\s*Flickable\s*{')
86−listview_pat = re.compile(r'.*\ ListView {')
86+listview_pat = re.compile(r'.*\s*ListView\s*{')
87−gridview_pat = re.compile(r'.*\ GridView {')
87+gridview_pat = re.compile(r'.*\s*GridView\s*{')
88flickable_pats = [flickable_pat, listview_pat, gridview_pat]
88flickable_pats = [flickable_pat, listview_pat, gridview_pat]
89unity_components_pat = re.compile(r'.*import ".*Components"')
89unity_components_pat = re.compile(r'.*import ".*Components"')
90components_import_pat = re.compile(r'.*import "."')
90components_import_pat = re.compile(r'.*import "."')
91components_path = re.compile(r'.*qml/Components.*')
91components_path = re.compile(r'.*qml/Components.*')
92+skip_components_flickable_path = re.compile(r'.*qml/Components/Flickable.qml')
93+skip_components_listview_path = re.compile(r'.*qml/Components/ListView.qml')
94+skip_components_gridview_path = re.compile(r'.*qml/Components/GridView.qml')
92
95
93def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, unitycomponents_pat):
96def scan_for_flickable_imports(file_path, component_pats, qtquick_pat, unitycomponents_pat):
94 errors = []
97 errors = []
@@ -163,8 +166,11 @@ try:
163 if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, unity_components_pat):
166 if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, unity_components_pat):
164 found_bad_import = True
167 found_bad_import = True
165 else:
168 else:
169+ if not skip_components_flickable_path.match(path) and \
170+ not skip_components_listview_path.match(path) and \
171+ not skip_components_gridview_path.match(path):
166− if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, components_import_pat):
172+ if scan_for_flickable_imports(path, flickable_pats, quick_good_pat, components_import_pat):
167− found_bad_import = True
173+ found_bad_import = True
168
174
169except OSError as e:
175except OSError as e:
170 error("cannot create file list for \"" + dir + "\": " + e.strerror)
176 error("cannot create file list for \"" + dir + "\": " + e.strerror)
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplayCreationRanges.qml+1
@@ -18,6 +18,7 @@ import QtQuick 2.4
18import QtTest 1.0
18import QtTest 1.0
19import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
20import "../../../../qml/Dash/Previews"
20import "../../../../qml/Dash/Previews"
21+import "../../../../qml/Components"
21import Unity.Test 0.1 as UT
22import Unity.Test 0.1 as UT
22
23
23Flickable {
24Flickable {