QmakeProjectManager: various renaming cleanup

Change-Id: I0433317d03aefb8e175f2208ca7ae29fa3e9fa49
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2013-10-29 17:37:39 +01:00
parent 8664de853a
commit 7ce22266de
12 changed files with 96 additions and 97 deletions

View File

@@ -330,10 +330,10 @@ Utils::FileName AndroidManager::apkPath(ProjectExplorer::Target *target, BuildTy
QStringList AndroidManager::availableTargetApplications(ProjectExplorer::Target *target) QStringList AndroidManager::availableTargetApplications(ProjectExplorer::Target *target)
{ {
QStringList apps; QStringList apps;
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project()); QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
if (!qt4Project) if (!qmakeProject)
return apps; return apps;
foreach (QmakeProjectManager::QmakeProFileNode *proFile, qt4Project->applicationProFiles()) { foreach (QmakeProjectManager::QmakeProFileNode *proFile, qmakeProject->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) { if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib")) if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so"))) && proFile->targetInformation().target.endsWith(QLatin1String(".so")))
@@ -509,8 +509,8 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
QString selectedApp = targetApplication(target); QString selectedApp = targetApplication(target);
if (selectedApp.isEmpty()) if (selectedApp.isEmpty())
return QString(); return QString();
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project()); QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
foreach (QmakeProjectManager::QmakeProFileNode *proFile, qt4Project->applicationProFiles()) { foreach (QmakeProjectManager::QmakeProFileNode *proFile, qmakeProject->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) { if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib")) if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so"))) { && proFile->targetInformation().target.endsWith(QLatin1String(".so"))) {
@@ -529,8 +529,8 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *target) bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *target)
{ {
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit()); QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject*>(target->project()); QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject*>(target->project());
if (!qt4Project || !qt4Project->rootProjectNode() || !version) if (!qmakeProject || !qmakeProject->rootProjectNode() || !version)
return false; return false;
// TODO we should create the AndroidManifest.xml file for that version // TODO we should create the AndroidManifest.xml file for that version
@@ -540,7 +540,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
Utils::FileName javaSrcPath Utils::FileName javaSrcPath
= Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX")) = Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX"))
.appendPath(QLatin1String("src/android/java")); .appendPath(QLatin1String("src/android/java"));
QDir projectDir(qt4Project->projectDirectory()); QDir projectDir(qmakeProject->projectDirectory());
Utils::FileName androidPath = dirPath(target); Utils::FileName androidPath = dirPath(target);
QStringList m_ignoreFiles; QStringList m_ignoreFiles;
@@ -607,7 +607,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
} }
} }
if (!androidFiles.isEmpty()) if (!androidFiles.isEmpty())
qt4Project->rootProjectNode()->addFiles(androidFiles); qmakeProject->rootProjectNode()->addFiles(androidFiles);
int minApiLevel = 4; int minApiLevel = 4;
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit())) if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
@@ -812,9 +812,9 @@ QVector<AndroidManager::Library> AndroidManager::availableQtLibsWithDependencies
Utils::FileName readelfPath = AndroidConfigurations::instance().readelfPath(target->activeRunConfiguration()->abi().architecture(), Utils::FileName readelfPath = AndroidConfigurations::instance().readelfPath(target->activeRunConfiguration()->abi().architecture(),
atc->ndkToolChainVersion()); atc->ndkToolChainVersion());
const QmakeProjectManager::QmakeProject *const qt4Project const QmakeProjectManager::QmakeProject *const qmakeProject
= qobject_cast<const QmakeProjectManager::QmakeProject *>(target->project()); = qobject_cast<const QmakeProjectManager::QmakeProject *>(target->project());
if (!qt4Project || !version) if (!qmakeProject || !version)
return QVector<AndroidManager::Library>(); return QVector<AndroidManager::Library>();
QString qtLibsPath = version->qmakeProperty("QT_INSTALL_LIBS"); QString qtLibsPath = version->qmakeProperty("QT_INSTALL_LIBS");
if (!readelfPath.toFileInfo().exists()) { if (!readelfPath.toFileInfo().exists()) {
@@ -904,11 +904,11 @@ bool AndroidManager::setBundledInLib(ProjectExplorer::Target *target, const QStr
QStringList AndroidManager::availablePrebundledLibs(ProjectExplorer::Target *target) QStringList AndroidManager::availablePrebundledLibs(ProjectExplorer::Target *target)
{ {
QStringList libs; QStringList libs;
QmakeProjectManager::QmakeProject *qt4Project = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project()); QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
if (!qt4Project) if (!qmakeProject)
return libs; return libs;
foreach (QmakeProjectManager::QmakeProFileNode *node, qt4Project->allProFiles()) foreach (QmakeProjectManager::QmakeProFileNode *node, qmakeProject->allProFiles())
if (node->projectType() == QmakeProjectManager::LibraryTemplate) if (node->projectType() == QmakeProjectManager::LibraryTemplate)
libs << node->targetInformation().target; libs << node->targetInformation().target;
return libs; return libs;

View File

@@ -109,12 +109,12 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost); env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput()); env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
QmakeProject *qt4pro = qobject_cast<QmakeProjectManager::QmakeProject *>(ProjectExplorerPlugin::instance()->currentProject()); QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qt4pro || !qt4pro->activeTarget() if (!qmakeProject || !qmakeProject->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT)) || QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT))
return; return;
Target *target = qt4pro->activeTarget(); Target *target = qmakeProject->activeTarget();
if (DeviceTypeKitInformation::deviceTypeId(target->kit()) != Constants::ANDROID_DEVICE_TYPE) if (DeviceTypeKitInformation::deviceTypeId(target->kit()) != Constants::ANDROID_DEVICE_TYPE)
return; return;
if (AndroidConfigurations::instance().config().ndkLocation.isEmpty() if (AndroidConfigurations::instance().config().ndkLocation.isEmpty()

View File

@@ -312,7 +312,7 @@ FolderNode *FolderNode::findSubFolder(const QString &path)
In-memory presentation of a virtual folder. In-memory presentation of a virtual folder.
Note that the node itself + all children (files and folders) are "managed" by the owning project. Note that the node itself + all children (files and folders) are "managed" by the owning project.
A virtual folder does not correspond to a actual folder on the file system. See for example the A virtual folder does not correspond to a actual folder on the file system. See for example the
sources, headers and forms folder the qt4projectmanager creates sources, headers and forms folder the QmakeProjectManager creates
VirtualFolderNodes are always sorted before FolderNodes and are sorted according to their priority. VirtualFolderNodes are always sorted before FolderNodes and are sorted according to their priority.
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode \sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode

View File

@@ -52,7 +52,7 @@ namespace QmakeProjectManager {
namespace Internal { namespace Internal {
// Figure out the Qt4 project used by the file if any // Figure out the Qt4 project used by the file if any
static QmakeProject *qt4ProjectFor(const QString &fileName) static QmakeProject *qmakeProjectFor(const QString &fileName)
{ {
if (ProjectExplorer::Project *baseProject = ProjectExplorer::SessionManager::projectForFile(fileName)) if (ProjectExplorer::Project *baseProject = ProjectExplorer::SessionManager::projectForFile(fileName))
if (QmakeProject *project = qobject_cast<QmakeProject*>(baseProject)) if (QmakeProject *project = qobject_cast<QmakeProject*>(baseProject))
@@ -138,7 +138,7 @@ bool ExternalQtEditor::getEditorLaunchData(const QString &fileName,
QString *errorMessage) const QString *errorMessage) const
{ {
// Get the binary either from the current Qt version of the project or Path // Get the binary either from the current Qt version of the project or Path
if (const QmakeProject *project = qt4ProjectFor(fileName)) { if (const QmakeProject *project = qmakeProjectFor(fileName)) {
if (const ProjectExplorer::Target *target = project->activeTarget()) { if (const ProjectExplorer::Target *target = project->activeTarget()) {
if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) { if (const QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target->kit())) {
data->binary = (qtVersion->*commandAccessor)(); data->binary = (qtVersion->*commandAccessor)();

View File

@@ -78,8 +78,8 @@ public:
// Those functions are used in a few places. // Those functions are used in a few places.
// The drawback is that we shouldn't actually depend on them being always there // The drawback is that we shouldn't actually depend on them being always there
// That is generally the stuff that is asked should normally be transferred to // That is generally the stuff that is asked should normally be transferred to
// Qt4Project * // QmakeProject *
// So that we can later enable people to build qt4projects the way they would like // So that we can later enable people to build qmake the way they would like
QMakeStep *qmakeStep() const; QMakeStep *qmakeStep() const;
MakeStep *makeStep() const; MakeStep *makeStep() const;

View File

@@ -157,12 +157,12 @@ QmakeNodeStaticData::QmakeNodeStaticData()
qAddPostRoutine(clearQmakeNodeStaticData); qAddPostRoutine(clearQmakeNodeStaticData);
} }
Q_GLOBAL_STATIC(QmakeNodeStaticData, qt4NodeStaticData) Q_GLOBAL_STATIC(QmakeNodeStaticData, qmakeNodeStaticData)
static void clearQmakeNodeStaticData() static void clearQmakeNodeStaticData()
{ {
qt4NodeStaticData()->fileTypeData.clear(); qmakeNodeStaticData()->fileTypeData.clear();
qt4NodeStaticData()->projectIcon = QIcon(); qmakeNodeStaticData()->projectIcon = QIcon();
} }
enum { debug = 0 }; enum { debug = 0 };
@@ -233,10 +233,10 @@ bool QmakePriFile::reload(QString *errorString, ReloadFlag flag, ChangeType type
namespace QmakeProjectManager { namespace QmakeProjectManager {
QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode* qt4ProFileNode, const QString &filePath) QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, const QString &filePath)
: ProjectNode(filePath), : ProjectNode(filePath),
m_project(project), m_project(project),
m_qmakeProFileNode(qt4ProFileNode), m_qmakeProFileNode(qmakeProFileNode),
m_projectFilePath(QDir::fromNativeSeparators(filePath)), m_projectFilePath(QDir::fromNativeSeparators(filePath)),
m_projectDir(QFileInfo(filePath).absolutePath()), m_projectDir(QFileInfo(filePath).absolutePath()),
m_includedInExactParse(true) m_includedInExactParse(true)
@@ -246,8 +246,7 @@ QmakePriFileNode::QmakePriFileNode(QmakeProject *project, QmakeProFileNode* qt4P
Core::DocumentManager::addDocument(m_qmakePriFile); Core::DocumentManager::addDocument(m_qmakePriFile);
setDisplayName(QFileInfo(filePath).completeBaseName()); setDisplayName(QFileInfo(filePath).completeBaseName());
setIcon(qmakeNodeStaticData()->projectIcon);
setIcon(qt4NodeStaticData()->projectIcon);
} }
QmakePriFileNode::~QmakePriFileNode() QmakePriFileNode::~QmakePriFileNode()
@@ -635,7 +634,7 @@ void QmakePriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReade
if (includeFileCumlative) if (includeFileCumlative)
baseVPathsCumulative = baseVPaths(readerCumulative, projectDir, m_qmakeProFileNode->buildDir()); baseVPathsCumulative = baseVPaths(readerCumulative, projectDir, m_qmakeProFileNode->buildDir());
const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qt4NodeStaticData()->fileTypeData; const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qmakeNodeStaticData()->fileTypeData;
// update files // update files
QFileInfo tmpFi; QFileInfo tmpFi;
@@ -738,7 +737,7 @@ bool QmakePriFileNode::folderChanged(const QString &changedFolder, const QSet<Ut
// Apply the differences // Apply the differences
// per file type // per file type
const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qt4NodeStaticData()->fileTypeData; const QVector<QmakeNodeStaticData::FileTypeData> &fileTypes = qmakeNodeStaticData()->fileTypeData;
for (int i = 0; i < fileTypes.size(); ++i) { for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type; FileType type = fileTypes.at(i).type;
QSet<Utils::FileName> add = filterFilesRecursiveEnumerata(type, addedFiles); QSet<Utils::FileName> add = filterFilesRecursiveEnumerata(type, addedFiles);
@@ -1073,7 +1072,7 @@ bool QmakePriFileNode::saveModifiedEditors()
return false; return false;
// force instant reload of ourselves // force instant reload of ourselves
QtSupport::ProFileCacheManager::instance()->discardFile(m_projectFilePath); QtSupport::ProFileCacheManager::instance()->discardFile(m_projectFilePath);
m_project->qt4ProjectManager()->notifyChanged(m_projectFilePath); m_project->qmakeProjectManager()->notifyChanged(m_projectFilePath);
return true; return true;
} }
@@ -1220,7 +1219,7 @@ void QmakePriFileNode::save(const QStringList &lines)
saver.write(lines.join(QLatin1String("\n")).toLocal8Bit()); saver.write(lines.join(QLatin1String("\n")).toLocal8Bit());
saver.finalize(Core::ICore::mainWindow()); saver.finalize(Core::ICore::mainWindow());
m_project->qt4ProjectManager()->notifyChanged(m_projectFilePath); m_project->qmakeProjectManager()->notifyChanged(m_projectFilePath);
Core::DocumentManager::unexpectFileChange(m_projectFilePath); Core::DocumentManager::unexpectFileChange(m_projectFilePath);
// This is a hack. // This is a hack.
// We are saving twice in a very short timeframe, once the editor and once the ProFile. // We are saving twice in a very short timeframe, once the editor and once the ProFile.
@@ -1449,8 +1448,8 @@ const QmakeProFileNode *QmakeProFileNode::findProFileFor(const QString &fileName
if (fileName == path()) if (fileName == path())
return this; return this;
foreach (ProjectNode *pn, subProjectNodes()) foreach (ProjectNode *pn, subProjectNodes())
if (QmakeProFileNode *qt4ProFileNode = qobject_cast<QmakeProFileNode *>(pn)) if (QmakeProFileNode *qmakeProFileNode = qobject_cast<QmakeProFileNode *>(pn))
if (const QmakeProFileNode *result = qt4ProFileNode->findProFileFor(fileName)) if (const QmakeProFileNode *result = qmakeProFileNode->findProFileFor(fileName))
return result; return result;
return 0; return 0;
} }
@@ -1743,9 +1742,9 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
// probably all subfiles/projects have changed anyway // probably all subfiles/projects have changed anyway
// delete files && folders && projects // delete files && folders && projects
foreach (ProjectNode *projectNode, subProjectNodes()) { foreach (ProjectNode *projectNode, subProjectNodes()) {
if (QmakeProFileNode *qt4ProFileNode = qobject_cast<QmakeProFileNode *>(projectNode)) { if (QmakeProFileNode *qmakeProFileNode = qobject_cast<QmakeProFileNode *>(projectNode)) {
qt4ProFileNode->setValidParseRecursive(false); qmakeProFileNode->setValidParseRecursive(false);
qt4ProFileNode->setParseInProgressRecursive(false); qmakeProFileNode->setParseInProgressRecursive(false);
} }
} }
@@ -1918,11 +1917,11 @@ void QmakeProFileNode::applyEvaluate(EvalResult evalResult, bool async)
if (loop) { if (loop) {
// Do nothing // Do nothing
} else if (fileExact || fileCumlative) { } else if (fileExact || fileCumlative) {
QmakePriFileNode *qt4PriFileNode = new QmakePriFileNode(m_project, this, nodeToAdd); QmakePriFileNode *qmakePriFileNode = new QmakePriFileNode(m_project, this, nodeToAdd);
qt4PriFileNode->setParentFolderNode(this); // Needed for loop detection qmakePriFileNode->setParentFolderNode(this); // Needed for loop detection
qt4PriFileNode->setIncludedInExactParse(fileExact != 0 && includedInExactParse()); qmakePriFileNode->setIncludedInExactParse(fileExact != 0 && includedInExactParse());
qt4PriFileNode->update(fileExact, m_readerExact, fileCumlative, m_readerCumulative); qmakePriFileNode->update(fileExact, m_readerExact, fileCumlative, m_readerCumulative);
toAdd << qt4PriFileNode; toAdd << qmakePriFileNode;
} else { } else {
QmakeProFileNode *qmakeProFileNode = new QmakeProFileNode(m_project, nodeToAdd); QmakeProFileNode *qmakeProFileNode = new QmakeProFileNode(m_project, nodeToAdd);
qmakeProFileNode->setParentFolderNode(this); // Needed for loop detection qmakeProFileNode->setParentFolderNode(this); // Needed for loop detection

View File

@@ -134,13 +134,13 @@ class QmakePriFile;
struct InternalNode; struct InternalNode;
} }
// Implements ProjectNode for qt4 pro files // Implements ProjectNode for qmake .pri files
class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode class QMAKEPROJECTMANAGER_EXPORT QmakePriFileNode : public ProjectExplorer::ProjectNode
{ {
Q_OBJECT Q_OBJECT
public: public:
QmakePriFileNode(QmakeProject *project, QmakeProFileNode* qt4ProFileNode, const QString &filePath); QmakePriFileNode(QmakeProject *project, QmakeProFileNode *qmakeProFileNode, const QString &filePath);
~QmakePriFileNode(); ~QmakePriFileNode();
void update(ProFile *includeFileExact, QtSupport::ProFileReader *readerExact, ProFile *includeFileCumlative, QtSupport::ProFileReader *readerCumalative); void update(ProFile *includeFileExact, QtSupport::ProFileReader *readerExact, ProFile *includeFileCumlative, QtSupport::ProFileReader *readerCumalative);
@@ -354,7 +354,7 @@ struct QMAKEPROJECTMANAGER_EXPORT ProjectVersion {
int patch; int patch;
}; };
// Implements ProjectNode for qt4 pro files // Implements ProjectNode for qmake .pro files
class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode class QMAKEPROJECTMANAGER_EXPORT QmakeProFileNode : public QmakePriFileNode
{ {
Q_OBJECT Q_OBJECT

View File

@@ -870,7 +870,7 @@ ProjectExplorer::IProjectManager *QmakeProject::projectManager() const
return m_manager; return m_manager;
} }
QmakeManager *QmakeProject::qt4ProjectManager() const QmakeManager *QmakeProject::qmakeProjectManager() const
{ {
return m_manager; return m_manager;
} }
@@ -1048,9 +1048,9 @@ void QmakeProject::collectAllfProFiles(QList<QmakeProFileNode *> &list, QmakePro
if (parse == ExactAndCumulativeParse || node->includedInExactParse()) if (parse == ExactAndCumulativeParse || node->includedInExactParse())
list.append(node); list.append(node);
foreach (ProjectNode *n, node->subProjectNodes()) { foreach (ProjectNode *n, node->subProjectNodes()) {
QmakeProFileNode *qt4ProFileNode = qobject_cast<QmakeProFileNode *>(n); QmakeProFileNode *qmakeProFileNode = qobject_cast<QmakeProFileNode *>(n);
if (qt4ProFileNode) if (qmakeProFileNode)
collectAllfProFiles(list, qt4ProFileNode, parse); collectAllfProFiles(list, qmakeProFileNode, parse);
} }
} }
@@ -1062,9 +1062,9 @@ void QmakeProject::collectApplicationProFiles(QList<QmakeProFileNode *> &list, Q
list.append(node); list.append(node);
} }
foreach (ProjectNode *n, node->subProjectNodes()) { foreach (ProjectNode *n, node->subProjectNodes()) {
QmakeProFileNode *qt4ProFileNode = qobject_cast<QmakeProFileNode *>(n); QmakeProFileNode *qmakeProFileNode = qobject_cast<QmakeProFileNode *>(n);
if (qt4ProFileNode) if (qmakeProFileNode)
collectApplicationProFiles(list, qt4ProFileNode, parse); collectApplicationProFiles(list, qmakeProFileNode, parse);
} }
} }

View File

@@ -79,7 +79,7 @@ public:
Core::Id id() const; Core::Id id() const;
Core::IDocument *document() const; Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const; ProjectExplorer::IProjectManager *projectManager() const;
QmakeManager *qt4ProjectManager() const; QmakeManager *qmakeProjectManager() const;
bool supportsKit(ProjectExplorer::Kit *k, QString *errorMesage) const; bool supportsKit(ProjectExplorer::Kit *k, QString *errorMesage) const;

View File

@@ -56,7 +56,7 @@ using namespace QmakeProjectManager;
using namespace QmakeProjectManager::Internal; using namespace QmakeProjectManager::Internal;
// Known file types of a Qt 4 project // Known file types of a Qt 4 project
static const char *qt4FileTypes[] = { static const char *qmakeFileTypes[] = {
"CppHeaderFiles", "CppHeaderFiles",
"CppSourceFiles", "CppSourceFiles",
"Qt4FormFiles", "Qt4FormFiles",
@@ -198,14 +198,14 @@ void QmakeManager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *
{ {
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles()) if (!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles())
return; return;
QmakeProject *qt4pro = qobject_cast<QmakeProject *>(p); QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(p);
QTC_ASSERT(qt4pro, return); QTC_ASSERT(qmakeProject, return);
if (!qt4pro->activeTarget() || if (!qmakeProject->activeTarget() ||
!qt4pro->activeTarget()->activeBuildConfiguration()) !qmakeProject->activeTarget()->activeBuildConfiguration())
return; return;
QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(qt4pro->activeTarget()->activeBuildConfiguration()); QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
QMakeStep *qs = bc->qmakeStep(); QMakeStep *qs = bc->qmakeStep();
if (!qs) if (!qs)
return; return;
@@ -213,7 +213,7 @@ void QmakeManager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *
//found qmakeStep, now use it //found qmakeStep, now use it
qs->setForced(true); qs->setForced(true);
if (node != 0 && node != qt4pro->rootProjectNode()) if (node != 0 && node != qmakeProject->rootProjectNode())
if (QmakeProFileNode *profile = qobject_cast<QmakeProFileNode *>(node)) if (QmakeProFileNode *profile = qobject_cast<QmakeProFileNode *>(node))
bc->setSubNodeBuild(profile); bc->setSubNodeBuild(profile);
@@ -263,23 +263,23 @@ void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isF
ProjectExplorer::Node *contextNode, ProjectExplorer::Node *contextNode,
ProjectExplorer::FileNode *contextFile) ProjectExplorer::FileNode *contextFile)
{ {
QmakeProject *qt4pro = qobject_cast<QmakeProject *>(contextProject); QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(contextProject);
QTC_ASSERT(qt4pro, return); QTC_ASSERT(qmakeProject, return);
if (!qt4pro->activeTarget() || if (!qmakeProject->activeTarget() ||
!qt4pro->activeTarget()->activeBuildConfiguration()) !qmakeProject->activeTarget()->activeBuildConfiguration())
return; return;
if (!contextNode || !contextFile) if (!contextNode || !contextFile)
isFileBuild = false; isFileBuild = false;
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(qt4pro->activeTarget()->activeBuildConfiguration()); QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
if (!bc) if (!bc)
return; return;
if (contextNode) { if (contextNode) {
if (QmakePriFileNode *prifile = qobject_cast<QmakePriFileNode *>(contextNode)) { if (QmakePriFileNode *prifile = qobject_cast<QmakePriFileNode *>(contextNode)) {
if (QmakeProFileNode *profile = prifile->proFileNode()) { if (QmakeProFileNode *profile = prifile->proFileNode()) {
if (profile != qt4pro->rootProjectNode() || isFileBuild) if (profile != qmakeProject->rootProjectNode() || isFileBuild)
bc->setSubNodeBuild(profile); bc->setSubNodeBuild(profile);
} }
} }
@@ -315,13 +315,13 @@ QString QmakeManager::fileTypeId(ProjectExplorer::FileType type)
{ {
switch (type) { switch (type) {
case HeaderType: case HeaderType:
return QLatin1String(qt4FileTypes[0]); return QLatin1String(qmakeFileTypes[0]);
case SourceType: case SourceType:
return QLatin1String(qt4FileTypes[1]); return QLatin1String(qmakeFileTypes[1]);
case FormType: case FormType:
return QLatin1String(qt4FileTypes[2]); return QLatin1String(qmakeFileTypes[2]);
case ResourceType: case ResourceType:
return QLatin1String(qt4FileTypes[3]); return QLatin1String(qmakeFileTypes[3]);
case UnknownFileType: case UnknownFileType:
default: default:
break; break;

View File

@@ -92,8 +92,8 @@ QmakeProjectManagerPlugin::~QmakeProjectManagerPlugin()
removeObject(m_proFileEditorFactory); removeObject(m_proFileEditorFactory);
delete m_proFileEditorFactory; delete m_proFileEditorFactory;
removeObject(m_qt4ProjectManager); removeObject(m_qmakeProjectManager);
delete m_qt4ProjectManager; delete m_qmakeProjectManager;
} }
bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage) bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
@@ -108,15 +108,15 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance(); m_projectExplorer = ProjectExplorer::ProjectExplorerPlugin::instance();
//create and register objects //create and register objects
m_qt4ProjectManager = new QmakeManager(this); m_qmakeProjectManager = new QmakeManager(this);
addObject(m_qt4ProjectManager); addObject(m_qmakeProjectManager);
TextEditor::TextEditorActionHandler *editorHandler TextEditor::TextEditorActionHandler *editorHandler
= new TextEditor::TextEditorActionHandler(Constants::C_PROFILEEDITOR, = new TextEditor::TextEditorActionHandler(Constants::C_PROFILEEDITOR,
TextEditor::TextEditorActionHandler::UnCommentSelection TextEditor::TextEditorActionHandler::UnCommentSelection
| TextEditor::TextEditorActionHandler::JumpToFileUnderCursor); | TextEditor::TextEditorActionHandler::JumpToFileUnderCursor);
m_proFileEditorFactory = new ProFileEditorFactory(m_qt4ProjectManager, editorHandler); m_proFileEditorFactory = new ProFileEditorFactory(m_qmakeProjectManager, editorHandler);
ProjectExplorer::KitManager::registerKitInformation(new QmakeKitInformation); ProjectExplorer::KitManager::registerKitInformation(new QmakeKitInformation);
@@ -171,14 +171,14 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_buildSubProjectContextMenu->text()); command->setDescription(m_buildSubProjectContextMenu->text());
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_buildSubProjectContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildSubDirContextMenu())); connect(m_buildSubProjectContextMenu, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(buildSubDirContextMenu()));
m_runQMakeActionContextMenu = new QAction(tr("Run qmake"), this); m_runQMakeActionContextMenu = new QAction(tr("Run qmake"), this);
command = Core::ActionManager::registerAction(m_runQMakeActionContextMenu, Constants::RUNQMAKECONTEXTMENU, projectContext); command = Core::ActionManager::registerAction(m_runQMakeActionContextMenu, Constants::RUNQMAKECONTEXTMENU, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_runQMakeActionContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(runQMakeContextMenu())); connect(m_runQMakeActionContextMenu, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(runQMakeContextMenu()));
command = msubproject->addSeparator(projectContext, ProjectExplorer::Constants::G_PROJECT_BUILD, command = msubproject->addSeparator(projectContext, ProjectExplorer::Constants::G_PROJECT_BUILD,
&m_subProjectRebuildSeparator); &m_subProjectRebuildSeparator);
@@ -189,20 +189,20 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
m_rebuildSubProjectContextMenu, Constants::REBUILDSUBDIRCONTEXTMENU, projectContext); m_rebuildSubProjectContextMenu, Constants::REBUILDSUBDIRCONTEXTMENU, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_rebuildSubProjectContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(rebuildSubDirContextMenu())); connect(m_rebuildSubProjectContextMenu, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(rebuildSubDirContextMenu()));
m_cleanSubProjectContextMenu = new QAction(tr("Clean"), this); m_cleanSubProjectContextMenu = new QAction(tr("Clean"), this);
command = Core::ActionManager::registerAction( command = Core::ActionManager::registerAction(
m_cleanSubProjectContextMenu, Constants::CLEANSUBDIRCONTEXTMENU, projectContext); m_cleanSubProjectContextMenu, Constants::CLEANSUBDIRCONTEXTMENU, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_BUILD);
connect(m_cleanSubProjectContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(cleanSubDirContextMenu())); connect(m_cleanSubProjectContextMenu, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(cleanSubDirContextMenu()));
m_buildFileContextMenu = new QAction(tr("Build"), this); m_buildFileContextMenu = new QAction(tr("Build"), this);
command = Core::ActionManager::registerAction(m_buildFileContextMenu, Constants::BUILDFILECONTEXTMENU, projectContext); command = Core::ActionManager::registerAction(m_buildFileContextMenu, Constants::BUILDFILECONTEXTMENU, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER); mfile->addAction(command, ProjectExplorer::Constants::G_FILE_OTHER);
connect(m_buildFileContextMenu, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildFileContextMenu())); connect(m_buildFileContextMenu, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(buildFileContextMenu()));
m_buildSubProjectAction = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""), m_buildSubProjectAction = new Utils::ParameterAction(tr("Build Subproject"), tr("Build Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -211,13 +211,13 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_buildSubProjectAction->text()); command->setDescription(m_buildSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_buildSubProjectAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildSubDirContextMenu())); connect(m_buildSubProjectAction, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(buildSubDirContextMenu()));
m_runQMakeAction = new QAction(tr("Run qmake"), this); m_runQMakeAction = new QAction(tr("Run qmake"), this);
command = Core::ActionManager::registerAction(m_runQMakeAction, Constants::RUNQMAKE, projectContext); command = Core::ActionManager::registerAction(m_runQMakeAction, Constants::RUNQMAKE, projectContext);
command->setAttribute(Core::Command::CA_Hide); command->setAttribute(Core::Command::CA_Hide);
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_runQMakeAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(runQMake())); connect(m_runQMakeAction, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(runQMake()));
m_rebuildSubProjectAction = new Utils::ParameterAction(tr("Rebuild Subproject"), tr("Rebuild Subproject \"%1\""), m_rebuildSubProjectAction = new Utils::ParameterAction(tr("Rebuild Subproject"), tr("Rebuild Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -226,7 +226,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_rebuildSubProjectAction->text()); command->setDescription(m_rebuildSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_REBUILD);
connect(m_rebuildSubProjectAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(rebuildSubDirContextMenu())); connect(m_rebuildSubProjectAction, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(rebuildSubDirContextMenu()));
m_cleanSubProjectAction = new Utils::ParameterAction(tr("Clean Subproject"), tr("Clean Subproject \"%1\""), m_cleanSubProjectAction = new Utils::ParameterAction(tr("Clean Subproject"), tr("Clean Subproject \"%1\""),
Utils::ParameterAction::AlwaysEnabled, this); Utils::ParameterAction::AlwaysEnabled, this);
@@ -235,7 +235,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setAttribute(Core::Command::CA_UpdateText); command->setAttribute(Core::Command::CA_UpdateText);
command->setDescription(m_cleanSubProjectAction->text()); command->setDescription(m_cleanSubProjectAction->text());
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_CLEAN);
connect(m_cleanSubProjectAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(cleanSubDirContextMenu())); connect(m_cleanSubProjectAction, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(cleanSubDirContextMenu()));
const Core::Context globalcontext(Core::Constants::C_GLOBAL); const Core::Context globalcontext(Core::Constants::C_GLOBAL);
m_buildFileAction = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""), m_buildFileAction = new Utils::ParameterAction(tr("Build File"), tr("Build File \"%1\""),
@@ -246,7 +246,7 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command->setDescription(m_buildFileAction->text()); command->setDescription(m_buildFileAction->text());
command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B"))); command->setDefaultKeySequence(QKeySequence(tr("Ctrl+Alt+B")));
mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD); mbuild->addAction(command, ProjectExplorer::Constants::G_BUILD_BUILD);
connect(m_buildFileAction, SIGNAL(triggered()), m_qt4ProjectManager, SLOT(buildFile())); connect(m_buildFileAction, SIGNAL(triggered()), m_qmakeProjectManager, SLOT(buildFile()));
connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)), connect(BuildManager::instance(), SIGNAL(buildStateChanged(ProjectExplorer::Project*)),
this, SLOT(buildStateChanged(ProjectExplorer::Project*))); this, SLOT(buildStateChanged(ProjectExplorer::Project*)));
@@ -266,14 +266,14 @@ bool QmakeProjectManagerPlugin::initialize(const QStringList &arguments, QString
command = Core::ActionManager::registerAction(m_addLibraryAction, command = Core::ActionManager::registerAction(m_addLibraryAction,
Constants::ADDLIBRARY, proFileEditorContext); Constants::ADDLIBRARY, proFileEditorContext);
connect(m_addLibraryAction, SIGNAL(triggered()), connect(m_addLibraryAction, SIGNAL(triggered()),
m_qt4ProjectManager, SLOT(addLibrary())); m_qmakeProjectManager, SLOT(addLibrary()));
contextMenu->addAction(command); contextMenu->addAction(command);
m_addLibraryActionContextMenu = new QAction(tr("Add Library..."), this); m_addLibraryActionContextMenu = new QAction(tr("Add Library..."), this);
command = Core::ActionManager::registerAction(m_addLibraryActionContextMenu, command = Core::ActionManager::registerAction(m_addLibraryActionContextMenu,
Constants::ADDLIBRARY, projecTreeContext); Constants::ADDLIBRARY, projecTreeContext);
connect(m_addLibraryActionContextMenu, SIGNAL(triggered()), connect(m_addLibraryActionContextMenu, SIGNAL(triggered()),
m_qt4ProjectManager, SLOT(addLibraryContextMenu())); m_qmakeProjectManager, SLOT(addLibraryContextMenu()));
mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES); mproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES);
msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES); msubproject->addAction(command, ProjectExplorer::Constants::G_PROJECT_FILES);
@@ -340,7 +340,7 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
m_addLibraryActionContextMenu->setEnabled(qobject_cast<QmakeProFileNode *>(node)); m_addLibraryActionContextMenu->setEnabled(qobject_cast<QmakeProFileNode *>(node));
QmakeProFileNode *proFileNode = qobject_cast<QmakeProFileNode *>(node); QmakeProFileNode *proFileNode = qobject_cast<QmakeProFileNode *>(node);
QmakeProject *qt4Project = qobject_cast<QmakeProject *>(project); QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(project);
QmakeProFileNode *subProjectNode = 0; QmakeProFileNode *subProjectNode = 0;
if (node) { if (node) {
if (QmakePriFileNode *subPriFileNode = qobject_cast<QmakePriFileNode *>(node->projectNode())) if (QmakePriFileNode *subPriFileNode = qobject_cast<QmakePriFileNode *>(node->projectNode()))
@@ -350,11 +350,11 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
bool buildFilePossible = subProjectNode && fileNode bool buildFilePossible = subProjectNode && fileNode
&& (fileNode->fileType() == ProjectExplorer::SourceType); && (fileNode->fileType() == ProjectExplorer::SourceType);
m_qt4ProjectManager->setContextNode(subProjectNode); m_qmakeProjectManager->setContextNode(subProjectNode);
m_qt4ProjectManager->setContextProject(qt4Project); m_qmakeProjectManager->setContextProject(qmakeProject);
m_qt4ProjectManager->setContextFile(buildFilePossible ? fileNode : 0); m_qmakeProjectManager->setContextFile(buildFilePossible ? fileNode : 0);
bool subProjectActionsVisible = qt4Project && subProjectNode && (subProjectNode != qt4Project->rootProjectNode()); bool subProjectActionsVisible = qmakeProject && subProjectNode && (subProjectNode != qmakeProject->rootProjectNode());
QString subProjectName; QString subProjectName;
if (subProjectActionsVisible) if (subProjectActionsVisible)
@@ -366,9 +366,9 @@ void QmakeProjectManagerPlugin::updateContextActions(ProjectExplorer::Node *node
m_buildSubProjectContextMenu->setParameter(subProjectName); m_buildSubProjectContextMenu->setParameter(subProjectName);
m_buildFileAction->setParameter(buildFilePossible ? QFileInfo(fileNode->path()).fileName() : QString()); m_buildFileAction->setParameter(buildFilePossible ? QFileInfo(fileNode->path()).fileName() : QString());
QmakeBuildConfiguration *buildConfiguration = (qt4Project && qt4Project->activeTarget()) ? QmakeBuildConfiguration *buildConfiguration = (qmakeProject && qmakeProject->activeTarget()) ?
static_cast<QmakeBuildConfiguration *>(qt4Project->activeTarget()->activeBuildConfiguration()) : 0; static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration()) : 0;
bool isProjectNode = qt4Project && proFileNode && buildConfiguration; bool isProjectNode = qmakeProject && proFileNode && buildConfiguration;
bool isBuilding = BuildManager::isBuilding(project); bool isBuilding = BuildManager::isBuilding(project);
bool enabled = subProjectActionsVisible && !isBuilding; bool enabled = subProjectActionsVisible && !isBuilding;

View File

@@ -83,7 +83,7 @@ private slots:
private: private:
ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer;
ProFileEditorFactory *m_proFileEditorFactory; ProFileEditorFactory *m_proFileEditorFactory;
QmakeManager *m_qt4ProjectManager; QmakeManager *m_qmakeProjectManager;
QmakeProject *m_previousStartupProject; QmakeProject *m_previousStartupProject;
ProjectExplorer::Target *m_previousTarget; ProjectExplorer::Target *m_previousTarget;