Pass library paths specified in .qmlproject file on to qmlviewer

This commit is contained in:
Kai Koehne
2010-02-03 09:13:23 +01:00
parent 8577347446
commit d5326f37c0
2 changed files with 20 additions and 1 deletions

View File

@@ -211,6 +211,14 @@ QStringList QmlProject::files() const
return files;
}
QStringList QmlProject::libraryPaths() const
{
QStringList libraryPaths;
if (m_projectItem)
libraryPaths = m_projectItem.data()->libraryPaths();
return libraryPaths;
}
void QmlProject::refreshProjectFile()
{
refresh(QmlProject::ProjectFile | Files);
@@ -403,9 +411,18 @@ QStringList QmlRunConfiguration::viewerArguments() const
{
QStringList args;
// arguments in .user file
if (!m_qmlViewerArgs.isEmpty())
args.append(m_qmlViewerArgs);
// arguments from .qmlproject file
if (qmlProject()) {
foreach (const QString &libraryPath, qmlProject()->libraryPaths()) {
args.append(QLatin1String("-L"));
args.append(libraryPath);
}
}
const QString s = mainScript();
if (! s.isEmpty())
args.append(s);
@@ -642,7 +659,8 @@ void QmlRunControl::start()
{
m_applicationLauncher.start(ApplicationLauncher::Gui, m_executable, m_commandLineArguments);
emit started();
emit addToOutputWindow(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)));
emit addToOutputWindow(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable),
m_commandLineArguments.join(QLatin1String(" "))));
}
void QmlRunControl::stop()