forked from qt-creator/qt-creator
Header cleanup in Qt4ProjectManager.
Disentangle the covariant returns and introduce convenience accessors. Move internal classes away from Qt4Project. Change-Id: I6c3158988824d2a159b1b3f8ecdf8432c32be2bc Reviewed-on: http://codereview.qt.nokia.com/3216 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
#include "subcomponentmanager.h"
|
||||
#include "model/viewlogger.h"
|
||||
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
|
||||
#include <itemlibraryview.h>
|
||||
#include <itemlibrarywidget.h>
|
||||
#include <navigatorview.h>
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "externaleditors.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
@@ -142,7 +143,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
|
||||
// Get the binary either from the current Qt version of the project or Path
|
||||
if (const Qt4Project *project = qt4ProjectFor(fileName)) {
|
||||
if (const Qt4BaseTarget *target = project->activeTarget()) {
|
||||
if (const Qt4BuildConfiguration *qt4bc = target->activeBuildConfiguration()) {
|
||||
if (const Qt4BuildConfiguration *qt4bc = target->activeQt4BuildConfiguration()) {
|
||||
if (const QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion()) {
|
||||
data->binary = (qtVersion->*commandAccessor)();
|
||||
data->workingDirectory = project->projectDirectory();
|
||||
|
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
|
||||
@@ -222,7 +223,7 @@ bool MakeStep::init()
|
||||
|
||||
void MakeStep::run(QFutureInterface<bool> & fi)
|
||||
{
|
||||
if (qt4BuildConfiguration()->qt4Target()->qt4Project()->rootProjectNode()->projectType() == ScriptTemplate) {
|
||||
if (qt4BuildConfiguration()->qt4Target()->qt4Project()->rootQt4ProjectNode()->projectType() == ScriptTemplate) {
|
||||
fi.reportResult(true);
|
||||
return;
|
||||
}
|
||||
|
@@ -34,6 +34,8 @@
|
||||
#include "wizards/targetsetuppage.h"
|
||||
#include "qt4project.h"
|
||||
|
||||
#include <coreplugin/ifile.h>
|
||||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QHeaderView>
|
||||
#include <QtGui/QLabel>
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4basetargetfactory.h"
|
||||
#include "ui_showbuildlog.h"
|
||||
|
||||
@@ -264,7 +265,7 @@ bool QMakeStep::init()
|
||||
|
||||
setOutputParser(new QMakeParser);
|
||||
|
||||
Qt4ProFileNode *node = qt4bc->qt4Target()->qt4Project()->rootProjectNode();
|
||||
Qt4ProFileNode *node = qt4bc->qt4Target()->qt4Project()->rootQt4ProjectNode();
|
||||
if (qt4bc->subNodeBuild())
|
||||
node = qt4bc->subNodeBuild();
|
||||
QString proFile = node->path();
|
||||
|
@@ -34,16 +34,14 @@
|
||||
#define QMAKESTEP_H
|
||||
|
||||
#include "qt4projectmanager_global.h"
|
||||
#include <QtCore/qglobal.h>
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class QMakeStep; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include <projectexplorer/abstractprocessstep.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class BuildStep;
|
||||
class IBuildStepFactory;
|
||||
|
@@ -32,7 +32,9 @@
|
||||
|
||||
#include "qt4desktoptarget.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4runconfiguration.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
#include <QtGui/QApplication>
|
||||
@@ -58,7 +60,7 @@ QString Qt4DesktopTarget::defaultDisplayName()
|
||||
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Desktop", "Qt4 Desktop target display name");
|
||||
}
|
||||
|
||||
Qt4BuildConfigurationFactory *Qt4DesktopTarget::buildConfigurationFactory() const
|
||||
ProjectExplorer::IBuildConfigurationFactory *Qt4DesktopTarget::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class Qt4Project;
|
||||
class Qt4BuildConfigurationFactory;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -49,7 +50,7 @@ public:
|
||||
explicit Qt4DesktopTarget(Qt4Project *parent, const QString &id);
|
||||
virtual ~Qt4DesktopTarget();
|
||||
|
||||
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
|
||||
void createApplicationProFiles();
|
||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||
|
@@ -42,6 +42,8 @@
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <QtGui/QVBoxLayout>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QStyle>
|
||||
|
@@ -529,7 +529,7 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map)
|
||||
QString Qt4RunConfiguration::executable() const
|
||||
{
|
||||
Qt4Project *pro = qt4Target()->qt4Project();
|
||||
TargetInformation ti = pro->rootProjectNode()->targetInformation(m_proFilePath);
|
||||
TargetInformation ti = pro->rootQt4ProjectNode()->targetInformation(m_proFilePath);
|
||||
if (!ti.valid)
|
||||
return QString();
|
||||
return ti.executable;
|
||||
@@ -565,7 +565,7 @@ QString Qt4RunConfiguration::baseWorkingDirectory() const
|
||||
|
||||
// else what the pro file reader tells us
|
||||
Qt4Project *pro = qt4Target()->qt4Project();
|
||||
TargetInformation ti = pro->rootProjectNode()->targetInformation(m_proFilePath);
|
||||
TargetInformation ti = pro->rootQt4ProjectNode()->targetInformation(m_proFilePath);
|
||||
if(!ti.valid)
|
||||
return QString();
|
||||
return ti.workingDir;
|
||||
@@ -609,7 +609,7 @@ Utils::Environment Qt4RunConfiguration::baseEnvironment() const
|
||||
// The user could be linking to a library found via a -L/some/dir switch
|
||||
// to find those libraries while actually running we explicitly prepend those
|
||||
// dirs to the library search path
|
||||
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootProjectNode()->findProFileFor(m_proFilePath);
|
||||
const Qt4ProFileNode *node = qt4Target()->qt4Project()->rootQt4ProjectNode()->findProFileFor(m_proFilePath);
|
||||
if (node) {
|
||||
const QStringList libDirectories = node->variableValue(LibDirectoriesVar);
|
||||
if (!libDirectories.isEmpty()) {
|
||||
@@ -676,7 +676,7 @@ QString Qt4RunConfiguration::proFilePath() const
|
||||
|
||||
QString Qt4RunConfiguration::dumperLibrary() const
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
QtSupport::BaseQtVersion *version = qt4Target()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->gdbDebuggingHelperLibrary();
|
||||
return QString();
|
||||
@@ -684,7 +684,7 @@ QString Qt4RunConfiguration::dumperLibrary() const
|
||||
|
||||
QStringList Qt4RunConfiguration::dumperLibraryLocations() const
|
||||
{
|
||||
QtSupport::BaseQtVersion *version = qt4Target()->activeBuildConfiguration()->qtVersion();
|
||||
QtSupport::BaseQtVersion *version = qt4Target()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (version)
|
||||
return version->debuggingHelperLibraryLocations();
|
||||
return QStringList();
|
||||
|
@@ -32,7 +32,9 @@
|
||||
|
||||
#include "qt4simulatortarget.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4runconfiguration.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
@@ -63,7 +65,7 @@ QString Qt4SimulatorTarget::defaultDisplayName()
|
||||
return QApplication::translate("Qt4ProjectManager::Qt4Target", "Qt Simulator", "Qt4 Simulator target display name");
|
||||
}
|
||||
|
||||
Qt4BuildConfigurationFactory *Qt4SimulatorTarget::buildConfigurationFactory() const
|
||||
ProjectExplorer::IBuildConfigurationFactory *Qt4SimulatorTarget::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@
|
||||
namespace Qt4ProjectManager {
|
||||
|
||||
class Qt4Project;
|
||||
class Qt4BuildConfigurationFactory;
|
||||
|
||||
namespace Internal {
|
||||
|
||||
@@ -49,7 +50,7 @@ public:
|
||||
explicit Qt4SimulatorTarget(Qt4Project *parent, const QString &id);
|
||||
virtual ~Qt4SimulatorTarget();
|
||||
|
||||
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
|
||||
void createApplicationProFiles();
|
||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include "qt4project.h"
|
||||
#include "qt4runconfiguration.h"
|
||||
#include "qt4simulatortarget.h"
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
@@ -33,6 +33,9 @@
|
||||
#include "qt4symbiantarget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include "qt-s60/s60deployconfiguration.h"
|
||||
#include "qt-s60/s60emulatorrunconfiguration.h"
|
||||
#include "qt-s60/s60devicerunconfiguration.h"
|
||||
@@ -87,7 +90,7 @@ QIcon Qt4SymbianTarget::iconForId(const QString &id)
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
Qt4BuildConfigurationFactory *Qt4SymbianTarget::buildConfigurationFactory() const
|
||||
ProjectExplorer::IBuildConfigurationFactory *Qt4SymbianTarget::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
}
|
||||
|
@@ -39,6 +39,7 @@
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
class Qt4BuildConfigurationFactory;
|
||||
namespace Internal {
|
||||
|
||||
|
||||
@@ -50,7 +51,7 @@ public:
|
||||
explicit Qt4SymbianTarget(Qt4Project *parent, const QString &id);
|
||||
virtual ~Qt4SymbianTarget();
|
||||
|
||||
Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
|
||||
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
|
||||
|
@@ -46,6 +46,8 @@
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
|
||||
using ProjectExplorer::idFromMap;
|
||||
using ProjectExplorer::Task;
|
||||
using namespace Qt4ProjectManager;
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include "s60manager.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "qt4symbiantarget.h"
|
||||
@@ -267,7 +268,7 @@ ProjectExplorer::ToolChain *S60DeployConfiguration::toolChain() const
|
||||
|
||||
bool S60DeployConfiguration::isDebug() const
|
||||
{
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration();
|
||||
return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
|
||||
}
|
||||
|
||||
@@ -278,7 +279,7 @@ QString S60DeployConfiguration::symbianTarget() const
|
||||
|
||||
const QtSupport::BaseQtVersion *S60DeployConfiguration::qtVersion() const
|
||||
{
|
||||
if (const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration())
|
||||
if (const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration())
|
||||
return qt4bc->qtVersion();
|
||||
return 0;
|
||||
}
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <debugger/debuggerengine.h>
|
||||
#include <debugger/debuggerstartparameters.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
|
@@ -33,9 +33,11 @@
|
||||
#include "s60devicerunconfiguration.h"
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4symbiantarget.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "s60deployconfiguration.h"
|
||||
#include "s60devicerunconfigurationwidget.h"
|
||||
#include "s60manager.h"
|
||||
@@ -191,7 +193,7 @@ static inline QString fixBaseNameTarget(const QString &in)
|
||||
|
||||
QString S60DeviceRunConfiguration::targetName() const
|
||||
{
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath());
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()->targetInformation(projectFilePath());
|
||||
if (!ti.valid)
|
||||
return QString();
|
||||
return ti.target;
|
||||
@@ -207,7 +209,7 @@ SymbianQtVersion *S60DeviceRunConfiguration::qtVersion() const
|
||||
|
||||
bool S60DeviceRunConfiguration::isDebug() const
|
||||
{
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
const Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration();
|
||||
return (qt4bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
|
||||
}
|
||||
|
||||
@@ -237,7 +239,7 @@ static inline QString localExecutableFromVersion(const SymbianQtVersion *qtv,
|
||||
|
||||
QString S60DeviceRunConfiguration::localExecutableFileName() const
|
||||
{
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(projectFilePath());
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()->targetInformation(projectFilePath());
|
||||
if (!ti.valid)
|
||||
return QString();
|
||||
|
||||
|
@@ -34,9 +34,11 @@
|
||||
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "s60manager.h"
|
||||
#include "qt4symbiantarget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
|
||||
@@ -178,7 +180,7 @@ QString S60EmulatorRunConfiguration::executable() const
|
||||
{
|
||||
if (!qt4Target())
|
||||
return QString();
|
||||
Qt4BuildConfiguration *qt4bc = qt4Target()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *qt4bc = qt4Target()->activeQt4BuildConfiguration();
|
||||
if (!qt4bc)
|
||||
return QString();
|
||||
QtSupport::BaseQtVersion *qtVersion = qt4bc->qtVersion();
|
||||
@@ -190,7 +192,7 @@ QString S60EmulatorRunConfiguration::executable() const
|
||||
qmakeBuildConfig = "udeb";
|
||||
baseDir += "/epoc32/release/winscw/" + qmakeBuildConfig;
|
||||
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()->targetInformation(m_proFilePath);
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()->targetInformation(m_proFilePath);
|
||||
if (!ti.valid)
|
||||
return QString();
|
||||
QString executable = QDir::toNativeSeparators(QDir::cleanPath(baseDir + QLatin1Char('/') + ti.target));
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "qmakestep.h"
|
||||
#include "makestep.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4nodes.h"
|
||||
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/buildstep.h>
|
||||
@@ -138,7 +139,7 @@ void S60PublisherOvi::completeCreation()
|
||||
m_qt4project = m_activeTargetOfProject->qt4Project();
|
||||
|
||||
// set up pro file reader
|
||||
m_reader = m_qt4project->createProFileReader(m_qt4project->rootProjectNode(), m_qt4bc);
|
||||
m_reader = m_qt4project->createProFileReader(m_qt4project->rootQt4ProjectNode(), m_qt4bc);
|
||||
//m_reader->setCumulative(false); // todo need to reenable that, after fixing parsing for symbian scopes
|
||||
|
||||
ProFile *profile = m_reader->parsedProFile(m_qt4project->rootProjectNode()->path());
|
||||
@@ -215,7 +216,7 @@ void S60PublisherOvi::completeCreation()
|
||||
|
||||
bool S60PublisherOvi::isDynamicLibrary(const Qt4Project &project) const
|
||||
{
|
||||
Qt4ProFileNode *proFile = project.rootProjectNode();
|
||||
Qt4ProFileNode *proFile = project.rootQt4ProjectNode();
|
||||
if (proFile->projectType() == LibraryTemplate) {
|
||||
const QStringList &config(proFile->variableValue(ConfigVar));
|
||||
if (!config.contains(QLatin1String("static")) && !config.contains(QLatin1String("staticlib")))
|
||||
|
@@ -49,7 +49,7 @@
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <qtsupport/qtversionfactory.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
#include <QtGui/QInputDialog>
|
||||
@@ -327,7 +327,7 @@ QString Qt4BuildConfiguration::defaultMakeTarget() const
|
||||
|
||||
QString Qt4BuildConfiguration::makefile() const
|
||||
{
|
||||
return qt4Target()->qt4Project()->rootProjectNode()->makefile();
|
||||
return qt4Target()->qt4Project()->rootQt4ProjectNode()->makefile();
|
||||
}
|
||||
|
||||
QtSupport::BaseQtVersion *Qt4BuildConfiguration::qtVersion() const
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class ToolChain;
|
||||
|
@@ -32,12 +32,15 @@
|
||||
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4project.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qtuicodemodelsupport.h"
|
||||
#include "qmakestep.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include <projectexplorer/nodesvisitor.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
@@ -653,9 +656,9 @@ void Qt4PriFileNode::watchFolders(const QSet<QString> &folders)
|
||||
toWatch.subtract(m_watchedFolders);
|
||||
|
||||
if (!toUnwatch.isEmpty())
|
||||
m_project->centralizedFolderWatcher()->unwatchFolders(toUnwatch.toList(), this);
|
||||
m_project->unwatchFolders(toUnwatch.toList(), this);
|
||||
if (!toWatch.isEmpty())
|
||||
m_project->centralizedFolderWatcher()->watchFolders(toWatch.toList(), this);
|
||||
m_project->watchFolders(toWatch.toList(), this);
|
||||
|
||||
m_watchedFolders = folders;
|
||||
}
|
||||
@@ -2086,7 +2089,7 @@ TargetInformation Qt4ProFileNode::targetInformation(QtSupport::ProFileReader *re
|
||||
// Hmm can we find out whether it's debug or release in a saner way?
|
||||
// Theoretically it's in CONFIG
|
||||
QString qmakeBuildConfig = "release";
|
||||
if (m_project->activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild)
|
||||
if (m_project->activeTarget()->activeQt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild)
|
||||
qmakeBuildConfig = "debug";
|
||||
wd += QLatin1Char('/') + qmakeBuildConfig;
|
||||
}
|
||||
@@ -2213,7 +2216,7 @@ QString Qt4ProFileNode::buildDir(Qt4BuildConfiguration *bc) const
|
||||
const QDir srcDirRoot = QFileInfo(m_project->rootProjectNode()->path()).absoluteDir();
|
||||
const QString relativeDir = srcDirRoot.relativeFilePath(m_projectDir);
|
||||
if (!bc && m_project->activeTarget())
|
||||
bc = m_project->activeTarget()->activeBuildConfiguration();
|
||||
bc = m_project->activeTarget()->activeQt4BuildConfiguration();
|
||||
if (!bc)
|
||||
return QString();
|
||||
return QDir(bc->buildDirectory()).absoluteFilePath(relativeDir);
|
||||
|
@@ -33,19 +33,16 @@
|
||||
#ifndef QT4NODES_H
|
||||
#define QT4NODES_H
|
||||
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include <coreplugin/ifile.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QFutureWatcher>
|
||||
#include <QtCore/QFileSystemWatcher>
|
||||
|
||||
// defined in proitems.h
|
||||
QT_BEGIN_NAMESPACE
|
||||
@@ -60,8 +57,13 @@ namespace QtSupport {
|
||||
class ProFileReader;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
namespace ProjectExplorer {
|
||||
class RunConfiguration;
|
||||
class Project;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4BuildConfiguration;
|
||||
class Qt4ProFileNode;
|
||||
class Qt4Project;
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "qt4project.h"
|
||||
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4target.h"
|
||||
#include "makestep.h"
|
||||
#include "qmakestep.h"
|
||||
#include "qt4nodes.h"
|
||||
@@ -43,6 +44,7 @@
|
||||
#include "findqt4profiles.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/ifile.h>
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
@@ -52,6 +54,7 @@
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/headerpath.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/buildenvironmentwidget.h>
|
||||
#include <projectexplorer/customexecutablerunconfiguration.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
@@ -63,6 +66,7 @@
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileSystemWatcher>
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtGui/QInputDialog>
|
||||
|
||||
@@ -75,6 +79,62 @@ enum { debug = 0 };
|
||||
namespace Qt4ProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
class Qt4ProjectFile : public Core::IFile
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Qt4ProjectFile(Qt4Project *project, const QString &filePath, QObject *parent = 0);
|
||||
|
||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
||||
QString fileName() const;
|
||||
virtual void rename(const QString &newName);
|
||||
|
||||
QString defaultPath() const;
|
||||
QString suggestedFileName() const;
|
||||
virtual QString mimeType() const;
|
||||
|
||||
bool isModified() const;
|
||||
bool isReadOnly() const;
|
||||
bool isSaveAsAllowed() const;
|
||||
|
||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
||||
|
||||
private:
|
||||
const QString m_mimeType;
|
||||
Qt4Project *m_project;
|
||||
QString m_filePath;
|
||||
};
|
||||
|
||||
/// Watches folders for Qt4PriFile nodes
|
||||
/// use one file system watcher to watch all folders
|
||||
/// such minimizing system ressouce usage
|
||||
|
||||
class CentralizedFolderWatcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CentralizedFolderWatcher(QObject *parent);
|
||||
~CentralizedFolderWatcher();
|
||||
void watchFolders(const QList<QString> &folders, Qt4PriFileNode *node);
|
||||
void unwatchFolders(const QList<QString> &folders, Qt4PriFileNode *node);
|
||||
|
||||
private slots:
|
||||
void folderChanged(const QString &folder);
|
||||
void onTimer();
|
||||
void delayedFolderChanged(const QString &folder);
|
||||
|
||||
private:
|
||||
QSet<QString> recursiveDirs(const QString &folder);
|
||||
QFileSystemWatcher m_watcher;
|
||||
QMultiMap<QString, Qt4PriFileNode *> m_map;
|
||||
|
||||
QSet<QString> m_recursiveWatchedFolders;
|
||||
QTimer m_compressTimer;
|
||||
QSet<QString> m_changedFolders;
|
||||
};
|
||||
|
||||
// Qt4ProjectFiles: Struct for (Cached) lists of files in a project
|
||||
struct Qt4ProjectFiles {
|
||||
void clear();
|
||||
@@ -171,10 +231,10 @@ void ProjectFilesVisitor::visitFolderNode(FolderNode *folderNode)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// ----------- Qt4ProjectFile
|
||||
|
||||
Qt4ProjectFile::Qt4ProjectFile(Qt4Project *project, const QString &filePath, QObject *parent)
|
||||
: Core::IFile(parent),
|
||||
m_mimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE)),
|
||||
@@ -247,6 +307,8 @@ bool Qt4ProjectFile::reload(QString *errorString, ReloadFlag flag, ChangeType ty
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
/*!
|
||||
\class Qt4Project
|
||||
|
||||
@@ -264,7 +326,8 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
|
||||
m_pendingEvaluateFuturesCount(0),
|
||||
m_asyncUpdateState(NoState),
|
||||
m_cancelEvaluate(false),
|
||||
m_codeModelCanceled(false)
|
||||
m_codeModelCanceled(false),
|
||||
m_centralizedFolderWatcher(0)
|
||||
{
|
||||
setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID));
|
||||
setProjectLanguage(Core::Context(ProjectExplorer::Constants::LANG_CXX));
|
||||
@@ -419,7 +482,7 @@ void Qt4Project::updateCodeModels()
|
||||
|
||||
void Qt4Project::updateCppCodeModel()
|
||||
{
|
||||
Qt4BuildConfiguration *activeBC = activeTarget()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *activeBC = activeTarget()->activeQt4BuildConfiguration();
|
||||
|
||||
CPlusPlus::CppModelManagerInterface *modelmanager =
|
||||
CPlusPlus::CppModelManagerInterface::instance();
|
||||
@@ -555,17 +618,18 @@ void Qt4Project::updateQmlJSCodeModel()
|
||||
}
|
||||
bool preferDebugDump = false;
|
||||
if (activeTarget() && activeTarget()->activeBuildConfiguration()) {
|
||||
preferDebugDump = activeTarget()->activeBuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
|
||||
QtSupport::BaseQtVersion *qtVersion = activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
preferDebugDump = activeTarget()->activeQt4BuildConfiguration()->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild;
|
||||
QtSupport::BaseQtVersion *qtVersion = activeTarget()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
projectInfo.qtImportsPath = qtVersion->versionInfo().value("QT_INSTALL_IMPORTS");
|
||||
if (!projectInfo.qtImportsPath.isEmpty())
|
||||
projectInfo.importPaths += projectInfo.qtImportsPath;
|
||||
projectInfo.qtVersionString = qtVersion->qtVersionString();
|
||||
}
|
||||
|
||||
}
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, activeTarget()->activeBuildConfiguration()->qtVersion(),
|
||||
activeTarget()->activeBuildConfiguration()->toolChain(),
|
||||
const Qt4BuildConfiguration *bc = activeTarget()->activeQt4BuildConfiguration();
|
||||
QtSupport::QmlDumpTool::pathAndEnvironment(this, bc->qtVersion(), bc->toolChain(),
|
||||
preferDebugDump, &projectInfo.qmlDumpPath, &projectInfo.qmlDumpEnvironment);
|
||||
projectInfo.importPaths.removeDuplicates();
|
||||
|
||||
@@ -584,7 +648,7 @@ void Qt4Project::update()
|
||||
if (debug)
|
||||
qDebug()<<"State is now Base";
|
||||
m_asyncUpdateState = Base;
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(true);
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
}
|
||||
|
||||
void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
|
||||
@@ -605,7 +669,7 @@ void Qt4Project::scheduleAsyncUpdate(Qt4ProFileNode *node)
|
||||
return;
|
||||
}
|
||||
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(false);
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
|
||||
if (m_asyncUpdateState == AsyncFullUpdatePending) {
|
||||
// Just postpone
|
||||
@@ -675,7 +739,7 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
qDebug()<<" update in progress, canceling and setting state to full update pending";
|
||||
m_cancelEvaluate = true;
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(false);
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->setParseInProgressRecursive();
|
||||
m_rootProjectNode->emitProFileUpdated();
|
||||
return;
|
||||
@@ -684,7 +748,7 @@ void Qt4Project::scheduleAsyncUpdate()
|
||||
if (debug)
|
||||
qDebug()<<" starting timer for full update, setting state to full update pending";
|
||||
m_partialEvaluate.clear();
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(false);
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(false);
|
||||
m_rootProjectNode->setParseInProgressRecursive();
|
||||
m_rootProjectNode->emitProFileUpdated();
|
||||
m_asyncUpdateState = AsyncFullUpdatePending;
|
||||
@@ -732,7 +796,7 @@ void Qt4Project::decrementPendingEvaluateFutures()
|
||||
m_asyncUpdateTimer.start();
|
||||
} else if (m_asyncUpdateState != ShuttingDown){
|
||||
// After being done, we need to call:
|
||||
activeTarget()->activeBuildConfiguration()->setEnabled(true);
|
||||
activeTarget()->activeQt4BuildConfiguration()->setEnabled(true);
|
||||
foreach (Target *t, targets())
|
||||
static_cast<Qt4BaseTarget *>(t)->createApplicationProFiles();
|
||||
updateFileList();
|
||||
@@ -878,7 +942,7 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
||||
m_proFileOptionRefCnt = 0;
|
||||
|
||||
if (!bc && activeTarget())
|
||||
bc = activeTarget()->activeBuildConfiguration();
|
||||
bc = activeTarget()->activeQt4BuildConfiguration();
|
||||
|
||||
if (bc) {
|
||||
QtSupport::BaseQtVersion *version = bc->qtVersion();
|
||||
@@ -927,7 +991,12 @@ void Qt4Project::destroyProFileReader(QtSupport::ProFileReader *reader)
|
||||
}
|
||||
}
|
||||
|
||||
Qt4ProFileNode *Qt4Project::rootProjectNode() const
|
||||
ProjectExplorer::ProjectNode *Qt4Project::rootProjectNode() const
|
||||
{
|
||||
return m_rootProjectNode;
|
||||
}
|
||||
|
||||
Qt4ProFileNode *Qt4Project::rootQt4ProjectNode() const
|
||||
{
|
||||
return m_rootProjectNode;
|
||||
}
|
||||
@@ -984,7 +1053,7 @@ QList<Qt4ProFileNode *> Qt4Project::allProFiles() const
|
||||
QList<Qt4ProFileNode *> list;
|
||||
if (!rootProjectNode())
|
||||
return list;
|
||||
collectAllfProFiles(list, rootProjectNode());
|
||||
collectAllfProFiles(list, rootQt4ProjectNode());
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -993,7 +1062,7 @@ QList<Qt4ProFileNode *> Qt4Project::applicationProFiles() const
|
||||
QList<Qt4ProFileNode *> list;
|
||||
if (!rootProjectNode())
|
||||
return list;
|
||||
collectApplicationProFiles(list, rootProjectNode());
|
||||
collectApplicationProFiles(list, rootQt4ProjectNode());
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -1054,7 +1123,7 @@ void Qt4Project::notifyChanged(const QString &name)
|
||||
{
|
||||
if (files(Qt4Project::ExcludeGeneratedFiles).contains(name)) {
|
||||
QList<Qt4ProFileNode *> list;
|
||||
findProFile(name, rootProjectNode(), list);
|
||||
findProFile(name, rootQt4ProjectNode(), list);
|
||||
foreach(Qt4ProFileNode *node, list) {
|
||||
QtSupport::ProFileCacheManager::instance()->discardFile(name);
|
||||
node->update();
|
||||
@@ -1063,9 +1132,19 @@ void Qt4Project::notifyChanged(const QString &name)
|
||||
}
|
||||
}
|
||||
|
||||
CentralizedFolderWatcher *Qt4Project::centralizedFolderWatcher()
|
||||
void Qt4Project::watchFolders(const QStringList &l, Qt4PriFileNode *node)
|
||||
{
|
||||
return &m_centralizedFolderWatcher;
|
||||
if (l.isEmpty())
|
||||
return;
|
||||
if (!m_centralizedFolderWatcher)
|
||||
m_centralizedFolderWatcher = new Internal::CentralizedFolderWatcher(this);
|
||||
m_centralizedFolderWatcher->watchFolders(l, node);
|
||||
}
|
||||
|
||||
void Qt4Project::unwatchFolders(const QStringList &l, Qt4PriFileNode *node)
|
||||
{
|
||||
if (m_centralizedFolderWatcher && !l.isEmpty())
|
||||
m_centralizedFolderWatcher->unwatchFolders(l, node);
|
||||
}
|
||||
|
||||
/////////////
|
||||
@@ -1078,7 +1157,7 @@ namespace {
|
||||
bool debugCFW = false;
|
||||
}
|
||||
|
||||
CentralizedFolderWatcher::CentralizedFolderWatcher()
|
||||
CentralizedFolderWatcher::CentralizedFolderWatcher(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_compressTimer.setSingleShot(true);
|
||||
m_compressTimer.setInterval(200);
|
||||
@@ -1264,4 +1343,4 @@ void CentralizedFolderWatcher::delayedFolderChanged(const QString &folder)
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
#include "qt4project.moc"
|
||||
|
@@ -33,13 +33,10 @@
|
||||
#ifndef QT4PROJECT_H
|
||||
#define QT4PROJECT_H
|
||||
|
||||
#include "qt4nodes.h"
|
||||
#include "qt4target.h"
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <coreplugin/ifile.h>
|
||||
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QMap>
|
||||
@@ -57,6 +54,8 @@ class ProFileReader;
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4ProFileNode;
|
||||
class Qt4BaseTarget;
|
||||
class Qt4BuildConfiguration;
|
||||
|
||||
namespace Internal {
|
||||
class DeployHelperRunStep;
|
||||
@@ -65,7 +64,8 @@ namespace Internal {
|
||||
class GCCPreprocessor;
|
||||
struct Qt4ProjectFiles;
|
||||
class Qt4ProjectConfigWidget;
|
||||
|
||||
class Qt4ProjectFile;
|
||||
class Qt4PriFileNode;
|
||||
class Qt4NodesWatcher;
|
||||
}
|
||||
|
||||
@@ -76,62 +76,8 @@ class Qt4Manager;
|
||||
class Qt4Project;
|
||||
class Qt4RunStep;
|
||||
|
||||
class Qt4ProjectFile : public Core::IFile
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Qt4ProjectFile(Qt4Project *project, const QString &filePath, QObject *parent = 0);
|
||||
|
||||
bool save(QString *errorString, const QString &fileName, bool autoSave);
|
||||
QString fileName() const;
|
||||
virtual void rename(const QString &newName);
|
||||
|
||||
QString defaultPath() const;
|
||||
QString suggestedFileName() const;
|
||||
virtual QString mimeType() const;
|
||||
|
||||
bool isModified() const;
|
||||
bool isReadOnly() const;
|
||||
bool isSaveAsAllowed() const;
|
||||
|
||||
ReloadBehavior reloadBehavior(ChangeTrigger state, ChangeType type) const;
|
||||
bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
|
||||
|
||||
private:
|
||||
const QString m_mimeType;
|
||||
Qt4Project *m_project;
|
||||
QString m_filePath;
|
||||
};
|
||||
|
||||
/// Watches folders for Qt4PriFile nodes
|
||||
/// use one file system watcher to watch all folders
|
||||
/// such minimizing system ressouce usage
|
||||
namespace Internal {
|
||||
class CentralizedFolderWatcher : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CentralizedFolderWatcher();
|
||||
~CentralizedFolderWatcher();
|
||||
void watchFolders(const QList<QString> &folders, Qt4PriFileNode *node);
|
||||
void unwatchFolders(const QList<QString> &folders, Qt4PriFileNode *node);
|
||||
|
||||
private slots:
|
||||
void folderChanged(const QString &folder);
|
||||
void onTimer();
|
||||
void delayedFolderChanged(const QString &folder);
|
||||
|
||||
private:
|
||||
QSet<QString> recursiveDirs(const QString &folder);
|
||||
QFileSystemWatcher m_watcher;
|
||||
QMultiMap<QString, Qt4PriFileNode *> m_map;
|
||||
|
||||
QSet<QString> m_recursiveWatchedFolders;
|
||||
QTimer m_compressTimer;
|
||||
QSet<QString> m_changedFolders;
|
||||
};
|
||||
|
||||
class CentralizedFolderWatcher;
|
||||
}
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT Qt4Project : public ProjectExplorer::Project
|
||||
@@ -153,7 +99,8 @@ public:
|
||||
QList<Core::IFile *> dependencies(); //NBS remove
|
||||
QList<ProjectExplorer::Project *>dependsOn();
|
||||
|
||||
Qt4ProFileNode *rootProjectNode() const;
|
||||
ProjectExplorer::ProjectNode *rootProjectNode() const;
|
||||
Qt4ProFileNode *rootQt4ProjectNode() const;
|
||||
bool validParse(const QString &proFilePath) const;
|
||||
bool parseInProgress(const QString &proFilePath) const;
|
||||
|
||||
@@ -183,11 +130,12 @@ public:
|
||||
/// \internal
|
||||
bool wasEvaluateCanceled();
|
||||
|
||||
Internal::CentralizedFolderWatcher *centralizedFolderWatcher();
|
||||
|
||||
// For Qt4ProFileNode after a on disk change
|
||||
void updateFileList();
|
||||
|
||||
void watchFolders(const QStringList &l, Internal::Qt4PriFileNode *node);
|
||||
void unwatchFolders(const QStringList &l, Internal::Qt4PriFileNode *node);
|
||||
|
||||
signals:
|
||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool, bool);
|
||||
void buildDirectoryInitialized();
|
||||
@@ -231,7 +179,7 @@ private:
|
||||
Qt4ProFileNode *m_rootProjectNode;
|
||||
Internal::Qt4NodesWatcher *m_nodesWatcher;
|
||||
|
||||
Qt4ProjectFile *m_fileInfo;
|
||||
Internal::Qt4ProjectFile *m_fileInfo;
|
||||
|
||||
// Current configuration
|
||||
QString m_oldQtIncludePath;
|
||||
@@ -255,7 +203,7 @@ private:
|
||||
|
||||
QFuture<void> m_codeModelFuture;
|
||||
|
||||
Internal::CentralizedFolderWatcher m_centralizedFolderWatcher;
|
||||
Internal::CentralizedFolderWatcher *m_centralizedFolderWatcher;
|
||||
|
||||
friend class Qt4ProjectFile;
|
||||
friend class Internal::Qt4ProjectConfigWidget;
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include "ui_qt4projectconfigwidget.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/ifile.h>
|
||||
|
||||
#include <projectexplorer/toolchainmanager.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
@@ -51,6 +52,7 @@
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <qtsupport/qtversionfactory.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/qtsupportconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
@@ -153,7 +153,7 @@ void Qt4Manager::editorChanged(Core::IEditor *editor)
|
||||
if (m_dirty) {
|
||||
const QString contents = formWindowEditorContents(m_lastEditor);
|
||||
foreach(Qt4Project *project, m_projects)
|
||||
project->rootProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
|
||||
project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
|
||||
m_dirty = false;
|
||||
}
|
||||
}
|
||||
@@ -175,7 +175,7 @@ void Qt4Manager::editorAboutToClose(Core::IEditor *editor)
|
||||
if (m_dirty) {
|
||||
const QString contents = formWindowEditorContents(m_lastEditor);
|
||||
foreach(Qt4Project *project, m_projects)
|
||||
project->rootProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
|
||||
project->rootQt4ProjectNode()->updateCodeModelSupportFromEditor(m_lastEditor->file()->fileName(), contents);
|
||||
m_dirty = false;
|
||||
}
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void Qt4Manager::updateVariable(const QString &variable)
|
||||
return;
|
||||
}
|
||||
QString value;
|
||||
QtSupport::BaseQtVersion *qtv = qt4pro->activeTarget()->activeBuildConfiguration()->qtVersion();
|
||||
QtSupport::BaseQtVersion *qtv = qt4pro->activeTarget()->activeQt4BuildConfiguration()->qtVersion();
|
||||
if (qtv)
|
||||
value = qtv->versionInfo().value(QLatin1String("QT_INSTALL_BINS"));
|
||||
Core::VariableManager::instance()->insert(QLatin1String(kInstallBins), value);
|
||||
@@ -355,7 +355,7 @@ void Qt4Manager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *no
|
||||
!qt4pro->activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
Qt4BuildConfiguration *bc = qt4pro->activeTarget()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *bc = qt4pro->activeTarget()->activeQt4BuildConfiguration();
|
||||
QMakeStep *qs = bc->qmakeStep();
|
||||
|
||||
if (!qs)
|
||||
@@ -395,7 +395,7 @@ void Qt4Manager::handleSubDirContexMenu(Qt4Manager::Action action)
|
||||
!qt4pro->activeTarget()->activeBuildConfiguration())
|
||||
return;
|
||||
|
||||
Qt4BuildConfiguration *bc = qt4pro->activeTarget()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *bc = qt4pro->activeTarget()->activeQt4BuildConfiguration();
|
||||
if (m_contextNode != 0 && m_contextNode != qt4pro->rootProjectNode())
|
||||
if (Qt4ProFileNode *profile = qobject_cast<Qt4ProFileNode *>(m_contextNode))
|
||||
bc->setSubNodeBuild(profile);
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "qt4projectmanagerplugin.h"
|
||||
|
||||
#include "qt4projectmanager.h"
|
||||
#include "qt4nodes.h"
|
||||
#include "qmakestep.h"
|
||||
#include "makestep.h"
|
||||
#include "wizards/consoleappwizard.h"
|
||||
@@ -51,7 +52,6 @@
|
||||
#include "profileeditor.h"
|
||||
#include "externaleditors.h"
|
||||
#include "profilecompletionassist.h"
|
||||
|
||||
#include "qt-s60/s60manager.h"
|
||||
#include "qt-desktop/qt4desktoptargetfactory.h"
|
||||
#include "qt-desktop/qt4simulatortargetfactory.h"
|
||||
@@ -335,7 +335,7 @@ void Qt4ProjectManagerPlugin::testBasicProjectLoading()
|
||||
QVERIFY(!m_projectExplorer->session()->projects().isEmpty());
|
||||
Qt4Project *qt4project = qobject_cast<Qt4Project *>(m_projectExplorer->session()->projects().first());
|
||||
QVERIFY(qt4project);
|
||||
QVERIFY(qt4project->rootProjectNode()->projectType() == ApplicationTemplate);
|
||||
QVERIFY(qt4project->rootQt4ProjectNode()->projectType() == ApplicationTemplate);
|
||||
QVERIFY(m_projectExplorer->currentProject() != 0);
|
||||
}
|
||||
#endif
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include "qt4basetargetfactory.h"
|
||||
#include "qt4projectconfigwidget.h"
|
||||
#include "qt4projectmanagerconstants.h"
|
||||
#include "qt4buildconfiguration.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
@@ -51,6 +52,7 @@
|
||||
#include <projectexplorer/task.h>
|
||||
#include <qtsupport/qtversionfactory.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
@@ -245,7 +247,7 @@ ProjectExplorer::BuildConfigWidget *Qt4BaseTarget::createConfigWidget()
|
||||
return new Qt4ProjectConfigWidget(this);
|
||||
}
|
||||
|
||||
Qt4BuildConfiguration *Qt4BaseTarget::activeBuildConfiguration() const
|
||||
Qt4BuildConfiguration *Qt4BaseTarget::activeQt4BuildConfiguration() const
|
||||
{
|
||||
return static_cast<Qt4BuildConfiguration *>(Target::activeBuildConfiguration());
|
||||
}
|
||||
|
@@ -33,13 +33,11 @@
|
||||
#ifndef QT4TARGET_H
|
||||
#define QT4TARGET_H
|
||||
|
||||
#include "qt4buildconfiguration.h"
|
||||
#include "qt4targetsetupwidget.h"
|
||||
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/task.h>
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
|
||||
namespace Utils {
|
||||
class DetailsWidget;
|
||||
@@ -55,10 +53,15 @@ class QComboBox;
|
||||
class QPushButton;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class Node;
|
||||
}
|
||||
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
class Qt4BaseTargetFactory;
|
||||
class Qt4ProFileNode;
|
||||
class Qt4BuildConfiguration;
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT Qt4BaseTarget : public ProjectExplorer::Target
|
||||
{
|
||||
@@ -69,7 +72,7 @@ public:
|
||||
|
||||
ProjectExplorer::BuildConfigWidget *createConfigWidget();
|
||||
|
||||
Qt4BuildConfiguration *activeBuildConfiguration() const;
|
||||
Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
|
||||
Qt4ProjectManager::Qt4Project *qt4Project() const;
|
||||
|
||||
// This is the same for almost all Qt4Targets
|
||||
|
@@ -57,7 +57,7 @@ Qt4UiCodeModelSupport::~Qt4UiCodeModelSupport()
|
||||
|
||||
QString Qt4UiCodeModelSupport::uicCommand() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeTarget()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeTarget()->activeQt4BuildConfiguration();
|
||||
if (!qt4bc->qtVersion())
|
||||
return QString();
|
||||
return qt4bc->qtVersion()->uicCommand();
|
||||
@@ -65,6 +65,6 @@ QString Qt4UiCodeModelSupport::uicCommand() const
|
||||
|
||||
QStringList Qt4UiCodeModelSupport::environment() const
|
||||
{
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeTarget()->activeBuildConfiguration();
|
||||
Qt4BuildConfiguration *qt4bc = m_project->activeTarget()->activeQt4BuildConfiguration();
|
||||
return qt4bc->environment().toStringList();
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QBrush>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
|
@@ -87,8 +87,8 @@ void DeploymentInfo::createModels()
|
||||
{
|
||||
if (m_d->target->project()->activeTarget() != m_d->target)
|
||||
return;
|
||||
if (!m_d->target->activeBuildConfiguration() || !m_d->target->activeBuildConfiguration()->qtVersion()
|
||||
|| !m_d->target->activeBuildConfiguration()->qtVersion()->isValid()) {
|
||||
const Qt4BuildConfiguration *bc = m_d->target->activeQt4BuildConfiguration();
|
||||
if (!bc || !bc->qtVersion() || !bc->qtVersion()->isValid()) {
|
||||
beginResetModel();
|
||||
qDeleteAll(m_d->listModels);
|
||||
m_d->listModels.clear();
|
||||
@@ -96,7 +96,7 @@ void DeploymentInfo::createModels()
|
||||
return;
|
||||
}
|
||||
const Qt4ProFileNode *const rootNode
|
||||
= m_d->target->qt4Project()->rootProjectNode();
|
||||
= m_d->target->qt4Project()->rootQt4ProjectNode();
|
||||
if (!rootNode || rootNode->parseInProgress()) // Can be null right after project creation by wizard.
|
||||
return;
|
||||
m_d->updateTimer.stop();
|
||||
|
@@ -158,7 +158,7 @@ RemoteLinuxDeployConfiguration *AbstractMaemoInstallPackageToSysrootStep::deploy
|
||||
void AbstractMaemoInstallPackageToSysrootStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
const Qt4BuildConfiguration * const bc
|
||||
= qobject_cast<Qt4BaseTarget *>(target())->activeBuildConfiguration();
|
||||
= qobject_cast<Qt4BaseTarget *>(target())->activeQt4BuildConfiguration();
|
||||
if (!bc) {
|
||||
addOutput(tr("Cannot install to sysroot without build configuration."),
|
||||
ErrorMessageOutput);
|
||||
@@ -305,7 +305,7 @@ MaemoCopyToSysrootStep::MaemoCopyToSysrootStep(BuildStepList *bsl,
|
||||
void MaemoCopyToSysrootStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
const Qt4BuildConfiguration * const bc
|
||||
= qobject_cast<Qt4BaseTarget *>(target())->activeBuildConfiguration();
|
||||
= qobject_cast<Qt4BaseTarget *>(target())->activeQt4BuildConfiguration();
|
||||
if (!bc) {
|
||||
addOutput(tr("Cannot copy to sysroot without build configuration."),
|
||||
ErrorMessageOutput);
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <utils/environment.h>
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <qt4projectmanager/qmakestep.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
@@ -50,7 +50,9 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/session.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <remotelinux/linuxdeviceconfiguration.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
|
||||
@@ -529,7 +531,7 @@ void MaemoQemuManager::toggleStarterButton(Target *target)
|
||||
int uniqueId = -1;
|
||||
if (target) {
|
||||
if (AbstractQt4MaemoTarget *qt4Target = qobject_cast<AbstractQt4MaemoTarget*>(target)) {
|
||||
if (Qt4BuildConfiguration *bc = qt4Target->activeBuildConfiguration()) {
|
||||
if (Qt4BuildConfiguration *bc = qt4Target->activeQt4BuildConfiguration()) {
|
||||
if (QtSupport::BaseQtVersion *version = bc->qtVersion())
|
||||
uniqueId = version->uniqueId();
|
||||
}
|
||||
|
@@ -48,6 +48,8 @@
|
||||
#include <projectexplorer/projectnodes.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/filesystemwatcher.h>
|
||||
#include <qtsupport/baseqtversion.h>
|
||||
@@ -150,8 +152,7 @@ QList<ProjectExplorer::ToolChain *> AbstractQt4MaemoTarget::possibleToolChains(P
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Qt4BuildConfigurationFactory *AbstractQt4MaemoTarget::buildConfigurationFactory() const
|
||||
ProjectExplorer::IBuildConfigurationFactory *AbstractQt4MaemoTarget::buildConfigurationFactory() const
|
||||
{
|
||||
return m_buildConfigurationFactory;
|
||||
}
|
||||
@@ -705,7 +706,7 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci
|
||||
QDir projectDir(project()->projectDirectory());
|
||||
QProcess dh_makeProc;
|
||||
QString error;
|
||||
const Qt4BuildConfiguration * const bc = activeBuildConfiguration();
|
||||
const Qt4BuildConfiguration * const bc = qobject_cast<Qt4BuildConfiguration * >(activeBuildConfiguration());
|
||||
AbstractMaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
|
||||
projectDir.path() + QLatin1Char('/') + PackagingDirName);
|
||||
const QString dhMakeDebianDir = projectDir.path() + QLatin1Char('/')
|
||||
@@ -715,7 +716,7 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci
|
||||
<< QLatin1String("-s") << QLatin1String("-n") << QLatin1String("-p")
|
||||
<< (defaultPackageFileName() + QLatin1Char('_')
|
||||
+ AbstractMaemoPackageCreationStep::DefaultVersionNumber);
|
||||
QtSupport::BaseQtVersion *lqt = activeBuildConfiguration()->qtVersion();
|
||||
QtSupport::BaseQtVersion *lqt = activeQt4BuildConfiguration()->qtVersion();
|
||||
if (!lqt) {
|
||||
raiseError(tr("Unable to create Debian templates: No Qt version set"));
|
||||
return ActionFailed;
|
||||
@@ -919,7 +920,7 @@ QString AbstractRpmBasedQt4MaemoTarget::shortDescription() const
|
||||
|
||||
QString AbstractRpmBasedQt4MaemoTarget::packageFileName() const
|
||||
{
|
||||
QtSupport::BaseQtVersion *lqt = activeBuildConfiguration()->qtVersion();
|
||||
QtSupport::BaseQtVersion *lqt = activeQt4BuildConfiguration()->qtVersion();
|
||||
if (!lqt)
|
||||
return QString();
|
||||
return packageName() + QLatin1Char('-') + projectVersion() + QLatin1Char('-')
|
||||
|
@@ -41,7 +41,10 @@
|
||||
|
||||
QT_FORWARD_DECLARE_CLASS(QFile)
|
||||
|
||||
namespace Qt4ProjectManager { class Qt4Project; }
|
||||
namespace Qt4ProjectManager {
|
||||
class Qt4Project;
|
||||
class Qt4BuildConfigurationFactory;
|
||||
}
|
||||
namespace Utils { class FileSystemWatcher; }
|
||||
|
||||
namespace RemoteLinux {
|
||||
@@ -58,7 +61,7 @@ public:
|
||||
const QString &id);
|
||||
virtual ~AbstractQt4MaemoTarget();
|
||||
|
||||
Qt4ProjectManager::Qt4BuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
ProjectExplorer::IBuildConfigurationFactory *buildConfigurationFactory() const;
|
||||
void createApplicationProFiles();
|
||||
QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Node *n);
|
||||
QList<ProjectExplorer::ToolChain *> possibleToolChains(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include <qt4projectmanager/buildconfigurationinfo.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <qtsupport/qtversionmanager.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
using namespace Qt4ProjectManager;
|
||||
|
@@ -272,7 +272,7 @@ QString RemoteLinuxRunConfiguration::commandPrefix() const
|
||||
|
||||
QString RemoteLinuxRunConfiguration::localExecutableFilePath() const
|
||||
{
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootProjectNode()
|
||||
TargetInformation ti = qt4Target()->qt4Project()->rootQt4ProjectNode()
|
||||
->targetInformation(m_d->proFilePath);
|
||||
if (!ti.valid)
|
||||
return QString();
|
||||
|
@@ -72,7 +72,7 @@ bool RemoteLinuxUtils::hasLinuxQt(const Target *target)
|
||||
const Qt4BaseTarget * const qtTarget = qobject_cast<const Qt4BaseTarget *>(target);
|
||||
if (!qtTarget)
|
||||
return false;
|
||||
const Qt4BuildConfiguration * const bc = qtTarget->activeBuildConfiguration();
|
||||
const Qt4BuildConfiguration * const bc = qtTarget->activeQt4BuildConfiguration();
|
||||
return bc && Internal::isLinuxQt(bc->qtVersion());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user