@@ -82,13 +82,16 @@ def scan_for_bad_import(file_path, all_pat, good_pats):
82 return bool(errors)
82 return bool(errors)
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')
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
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
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)