forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.6'
This commit is contained in:
@@ -170,7 +170,7 @@ void QmlProject::refresh(RefreshOptions options)
|
||||
|
||||
QmlJS::ModelManagerInterface::ProjectInfo pinfo(this);
|
||||
pinfo.sourceFiles = files();
|
||||
pinfo.importPaths = importPaths();
|
||||
pinfo.importPaths = customImportPaths();
|
||||
QtSupport::BaseQtVersion *version = 0;
|
||||
if (activeTarget()) {
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit());
|
||||
@@ -220,26 +220,12 @@ bool QmlProject::validProjectFile() const
|
||||
return !m_projectItem.isNull();
|
||||
}
|
||||
|
||||
QStringList QmlProject::importPaths() const
|
||||
QStringList QmlProject::customImportPaths() const
|
||||
{
|
||||
QStringList importPaths;
|
||||
if (m_projectItem)
|
||||
importPaths = m_projectItem.data()->importPaths();
|
||||
|
||||
// add the default import path for the target Qt version
|
||||
if (activeTarget()) {
|
||||
const QmlProjectRunConfiguration *runConfig =
|
||||
qobject_cast<QmlProjectRunConfiguration*>(activeTarget()->activeRunConfiguration());
|
||||
if (runConfig) {
|
||||
const QtSupport::BaseQtVersion *qtVersion = runConfig->qtVersion();
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
const QString qtVersionImportPath = qtVersion->qmakeProperty("QT_INSTALL_IMPORTS");
|
||||
if (!qtVersionImportPath.isEmpty())
|
||||
importPaths += qtVersionImportPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return importPaths;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
QDir projectDir() const;
|
||||
QStringList files() const;
|
||||
QString mainFile() const;
|
||||
QStringList importPaths() const;
|
||||
QStringList customImportPaths() const;
|
||||
|
||||
bool addFiles(const QStringList &filePaths);
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ QString QmlProjectRunConfiguration::viewerArguments() const
|
||||
|
||||
// arguments from .qmlproject file
|
||||
QmlProject *project = static_cast<QmlProject *>(target()->project());
|
||||
foreach (const QString &importPath, project->importPaths()) {
|
||||
foreach (const QString &importPath, project->customImportPaths()) {
|
||||
Utils::QtcProcess::addArg(&args, "-I");
|
||||
Utils::QtcProcess::addArg(&args, importPath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user