forked from qt-creator/qt-creator
QmakePM: QtWizard Code cosmetics
Unused code, namespaces, foreach. Change-Id: I1a4fd2be2f4005a35b1d9ab0e38cc260ae459fda Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -39,20 +39,21 @@
|
|||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/projectexplorerconstants.h>
|
#include <projectexplorer/projectexplorerconstants.h>
|
||||||
#include <projectexplorer/targetsetuppage.h>
|
#include <projectexplorer/targetsetuppage.h>
|
||||||
|
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace QmakeProjectManager;
|
|
||||||
using namespace QmakeProjectManager::Internal;
|
|
||||||
using namespace QtSupport;
|
using namespace QtSupport;
|
||||||
|
|
||||||
|
namespace QmakeProjectManager {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
// -------------------- QtWizard
|
// -------------------- QtWizard
|
||||||
QtWizard::QtWizard()
|
QtWizard::QtWizard()
|
||||||
{
|
{
|
||||||
@@ -91,7 +92,7 @@ bool QtWizard::qt4ProjectPostGenerateFiles(const QWizard *w,
|
|||||||
const auto *dialog = qobject_cast<const BaseQmakeProjectWizardDialog *>(w);
|
const auto *dialog = qobject_cast<const BaseQmakeProjectWizardDialog *>(w);
|
||||||
|
|
||||||
// Generate user settings
|
// Generate user settings
|
||||||
foreach (const Core::GeneratedFile &file, generatedFiles)
|
for (const Core::GeneratedFile &file : generatedFiles)
|
||||||
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
|
if (file.attributes() & Core::GeneratedFile::OpenProjectAttribute) {
|
||||||
dialog->writeUserFile(file.path());
|
dialog->writeUserFile(file.path());
|
||||||
break;
|
break;
|
||||||
@@ -229,7 +230,7 @@ void BaseQmakeProjectWizardDialog::setSelectedModules(const QString &modules, bo
|
|||||||
{
|
{
|
||||||
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
||||||
if (m_modulesPage) {
|
if (m_modulesPage) {
|
||||||
foreach (const QString &module, modulesList) {
|
for (const QString &module : modulesList) {
|
||||||
m_modulesPage->setModuleSelected(module, true);
|
m_modulesPage->setModuleSelected(module, true);
|
||||||
m_modulesPage->setModuleEnabled(module, !lock);
|
m_modulesPage->setModuleEnabled(module, !lock);
|
||||||
}
|
}
|
||||||
@@ -247,7 +248,7 @@ void BaseQmakeProjectWizardDialog::setDeselectedModules(const QString &modules)
|
|||||||
{
|
{
|
||||||
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
const QStringList modulesList = modules.split(QLatin1Char(' '));
|
||||||
if (m_modulesPage) {
|
if (m_modulesPage) {
|
||||||
foreach (const QString &module, modulesList)
|
for (const QString &module : modulesList)
|
||||||
m_modulesPage->setModuleSelected(module, false);
|
m_modulesPage->setModuleSelected(module, false);
|
||||||
} else {
|
} else {
|
||||||
m_deselectedModules = modulesList;
|
m_deselectedModules = modulesList;
|
||||||
@@ -267,14 +268,6 @@ bool BaseQmakeProjectWizardDialog::writeUserFile(const QString &proFileName) con
|
|||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BaseQmakeProjectWizardDialog::isQtPlatformSelected(Core::Id platform) const
|
|
||||||
{
|
|
||||||
QList<Core::Id> selectedKitList = selectedKits();
|
|
||||||
|
|
||||||
return Utils::contains(KitManager::kits(QtKitAspect::platformPredicate(platform)),
|
|
||||||
[selectedKitList](const Kit *k) { return selectedKitList.contains(k->id()); });
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<Core::Id> BaseQmakeProjectWizardDialog::selectedKits() const
|
QList<Core::Id> BaseQmakeProjectWizardDialog::selectedKits() const
|
||||||
{
|
{
|
||||||
if (!m_targetSetupPage)
|
if (!m_targetSetupPage)
|
||||||
@@ -282,12 +275,6 @@ QList<Core::Id> BaseQmakeProjectWizardDialog::selectedKits() const
|
|||||||
return m_targetSetupPage->selectedKits();
|
return m_targetSetupPage->selectedKits();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseQmakeProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
|
|
||||||
{
|
|
||||||
foreach (QWizardPage *p,wizardPageList)
|
|
||||||
addPage(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BaseQmakeProjectWizardDialog::generateProfileName(const QString &name, const QString &path)
|
void BaseQmakeProjectWizardDialog::generateProfileName(const QString &name, const QString &path)
|
||||||
{
|
{
|
||||||
if (!m_targetSetupPage)
|
if (!m_targetSetupPage)
|
||||||
@@ -297,3 +284,6 @@ void BaseQmakeProjectWizardDialog::generateProfileName(const QString &name, cons
|
|||||||
|
|
||||||
m_targetSetupPage->setProjectPath(Utils::FilePath::fromString(proFile));
|
m_targetSetupPage->setProjectPath(Utils::FilePath::fromString(proFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Internal
|
||||||
|
} // QmakeProjectManager
|
||||||
|
@@ -124,11 +124,8 @@ public:
|
|||||||
void setDeselectedModules(const QString &);
|
void setDeselectedModules(const QString &);
|
||||||
|
|
||||||
bool writeUserFile(const QString &proFileName) const;
|
bool writeUserFile(const QString &proFileName) const;
|
||||||
bool isQtPlatformSelected(Core::Id platform) const;
|
|
||||||
QList<Core::Id> selectedKits() const;
|
QList<Core::Id> selectedKits() const;
|
||||||
|
|
||||||
void addExtensionPages(const QList<QWizardPage *> &wizardPageList);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void generateProfileName(const QString &name, const QString &path);
|
void generateProfileName(const QString &name, const QString &path);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user