on xenial help sign in
Append, don't prepend - and maintain order in main.cpp.
b599083Michał Sawicz
main.cpp+3−7
@@ -161,13 +161,9 @@ int startShell(int argc, const char** argv, void* server)
161 appendImportPaths(view->engine(), ::fallbackImportPaths());
161 appendImportPaths(view->engine(), ::fallbackImportPaths());
162
162
163 if (isUbuntuMirServer) {
163 if (isUbuntuMirServer) {
164− QStringList importPath = view->engine()->importPathList().filter("qt5/imports");
164+ QStringList importPaths = view->engine()->importPathList();
165− if (!importPath.isEmpty()) {
165+ importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
166− importPath.first().append("/Unity-Mir");
166+ view->engine()->setImportPathList(importPaths);
167− view->engine()->addImportPath(importPath.first());
168− } else {
169− qDebug() << "unable to patch import path";
170− }
171 }
167 }
172
168
173 view->setSource(source);
169 view->setSource(source);
tests/autopilot/unity8/shell/tests/__init__.py+2−2
@@ -188,7 +188,7 @@ class UnityTestCase(AutopilotTestCase):
188 self._get_lightdm_mock_path(mock_type)
188 self._get_lightdm_mock_path(mock_type)
189 ]
189 ]
190 if os.getenv('LD_LIBRARY_PATH') is not None:
190 if os.getenv('LD_LIBRARY_PATH') is not None:
191− new_ld_library_path.insert(0, os.getenv('LD_LIBRARY_PATH'))
191+ new_ld_library_path.append(os.getenv('LD_LIBRARY_PATH'))
192
192
193 new_ld_library_path = ':'.join(new_ld_library_path)
193 new_ld_library_path = ':'.join(new_ld_library_path)
194 logger.info("New library path: %s", new_ld_library_path)
194 logger.info("New library path: %s", new_ld_library_path)
@@ -211,7 +211,7 @@ class UnityTestCase(AutopilotTestCase):
211 def _setup_extra_mock_environment_patch(self):
211 def _setup_extra_mock_environment_patch(self):
212 qml_import_path = [get_mocks_library_path()]
212 qml_import_path = [get_mocks_library_path()]
213 if os.getenv('QML2_IMPORT_PATH') is not None:
213 if os.getenv('QML2_IMPORT_PATH') is not None:
214− qml_import_path.insert(0, os.getenv('QML2_IMPORT_PATH'))
214+ qml_import_path.append(os.getenv('QML2_IMPORT_PATH'))
215
215
216 qml_import_path = ':'.join(qml_import_path)
216 qml_import_path = ':'.join(qml_import_path)
217 logger.info("New QML2 import path: %s", qml_import_path)
217 logger.info("New QML2 import path: %s", qml_import_path)