forked from qt-creator/qt-creator
qmlpreview: fix init locale issue
The init language was never found, because the findValidI18nDirectoryAsUrl() uses the m_lastLoadedUrl to find the translation file path. Change-Id: I6e9b62f3d846795d68ddef5e3a4caf3e3d953c7c Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -49,8 +49,7 @@ QmlPreviewRunner::QmlPreviewRunner(ProjectExplorer::RunControl *runControl,
|
||||
QmlPreviewFileLoader fileLoader,
|
||||
QmlPreviewFileClassifier fileClassifier,
|
||||
QmlPreviewFpsHandler fpsHandler,
|
||||
float initialZoom,
|
||||
const QString &initialLocale)
|
||||
float initialZoom)
|
||||
: RunWorker(runControl)
|
||||
{
|
||||
setId("QmlPreviewRunner");
|
||||
@@ -68,11 +67,9 @@ QmlPreviewRunner::QmlPreviewRunner(ProjectExplorer::RunControl *runControl,
|
||||
connect(this, &QmlPreviewRunner::language,
|
||||
&m_connectionManager, &Internal::QmlPreviewConnectionManager::language);
|
||||
connect(&m_connectionManager, &Internal::QmlPreviewConnectionManager::connectionOpened,
|
||||
this, [this, initialZoom, initialLocale]() {
|
||||
this, [this, initialZoom]() {
|
||||
if (initialZoom > 0)
|
||||
emit zoom(initialZoom);
|
||||
if (!initialLocale.isEmpty())
|
||||
emit language(initialLocale);
|
||||
emit ready();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user