on xenial help sign in
Append, don't prepend - and maintain order in main.cpp.
commitb59908349b20d1b6faf6fdccc561ec7c1ab5bb01 authorMichał Sawicz <michal.sawicz@canonical.com> dateFri 4 Oct 2013, 18:03 (13 years ago) parentebf2cc9
2 files changed+5−9
main.cpp+3−7 tests/autopilot/unity8/shell/tests/__init__.py+2−2
main.cpp+3−7
@@ -161,13 +161,9 @@ int startShell(int argc, const char** argv, void* server)
161161 appendImportPaths(view->engine(), ::fallbackImportPaths());
162162
163163 if (isUbuntuMirServer) {
164− QStringList importPath = view->engine()->importPathList().filter("qt5/imports");
165− if (!importPath.isEmpty()) {
166− importPath.first().append("/Unity-Mir");
167− view->engine()->addImportPath(importPath.first());
168− } else {
169− qDebug() << "unable to patch import path";
170− }
164+ QStringList importPaths = view->engine()->importPathList();
165+ importPaths.replaceInStrings(QRegExp("qt5/imports$"), "qt5/imports/Unity-Mir");
166+ view->engine()->setImportPathList(importPaths);
171167 }
172168
173169 view->setSource(source);
tests/autopilot/unity8/shell/tests/__init__.py+2−2
@@ -188,7 +188,7 @@ class UnityTestCase(AutopilotTestCase):
188188 self._get_lightdm_mock_path(mock_type)
189189 ]
190190 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'))
192192
193193 new_ld_library_path = ':'.join(new_ld_library_path)
194194 logger.info("New library path: %s", new_ld_library_path)
@@ -211,7 +211,7 @@ class UnityTestCase(AutopilotTestCase):
211211 def _setup_extra_mock_environment_patch(self):
212212 qml_import_path = [get_mocks_library_path()]
213213 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'))
215215
216216 qml_import_path = ':'.join(qml_import_path)
217217 logger.info("New QML2 import path: %s", qml_import_path)