forked from qt-creator/qt-creator
Utils: Use more FilePath in ProjectIntroPage
Change-Id: I0cdc18f4b88012f00d6403125c7bd3ba0b6d80df Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -62,7 +62,7 @@ public:
|
||||
bool m_complete = false;
|
||||
QRegularExpressionValidator m_projectNameValidator;
|
||||
bool m_forceSubProject = false;
|
||||
QStringList m_projectDirectories;
|
||||
FilePaths m_projectDirectories;
|
||||
};
|
||||
|
||||
ProjectIntroPage::ProjectIntroPage(QWidget *parent) :
|
||||
@@ -157,7 +157,7 @@ bool ProjectIntroPage::validate()
|
||||
int index = d->m_ui.projectComboBox->currentIndex();
|
||||
if (index == 0)
|
||||
return false;
|
||||
d->m_ui.pathChooser->setPath(d->m_projectDirectories.at(index));
|
||||
d->m_ui.pathChooser->setFilePath(d->m_projectDirectories.at(index));
|
||||
}
|
||||
// Validate and display status
|
||||
if (!d->m_ui.pathChooser->isValid()) {
|
||||
@@ -230,7 +230,7 @@ void ProjectIntroPage::setProjectList(const QStringList &projectList)
|
||||
d->m_ui.projectComboBox->addItems(projectList);
|
||||
}
|
||||
|
||||
void ProjectIntroPage::setProjectDirectories(const QStringList &directoryList)
|
||||
void ProjectIntroPage::setProjectDirectories(const FilePaths &directoryList)
|
||||
{
|
||||
d->m_projectDirectories = directoryList;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
bool forceSubProject() const;
|
||||
void setForceSubProject(bool force);
|
||||
void setProjectList(const QStringList &projectList);
|
||||
void setProjectDirectories(const QStringList &directoryList);
|
||||
void setProjectDirectories(const Utils::FilePaths &directoryList);
|
||||
int projectIndex() const;
|
||||
|
||||
bool validateProjectName(const QString &name, QString *errorMessage);
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "baseprojectwizarddialog.h"
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/projectintropage.h>
|
||||
|
||||
#include <QDir>
|
||||
@@ -45,28 +44,25 @@ using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
struct BaseProjectWizardDialogPrivate {
|
||||
explicit BaseProjectWizardDialogPrivate(Utils::ProjectIntroPage *page, int id = -1);
|
||||
struct BaseProjectWizardDialogPrivate
|
||||
{
|
||||
explicit BaseProjectWizardDialogPrivate(ProjectIntroPage *page, int id = -1)
|
||||
: desiredIntroPageId(id), introPage(page)
|
||||
{}
|
||||
|
||||
const int desiredIntroPageId;
|
||||
Utils::ProjectIntroPage *introPage;
|
||||
int introPageId;
|
||||
Utils::Id selectedPlatform;
|
||||
QSet<Utils::Id> requiredFeatureSet;
|
||||
ProjectIntroPage *introPage;
|
||||
int introPageId = -1;
|
||||
Id selectedPlatform;
|
||||
QSet<Id> requiredFeatureSet;
|
||||
};
|
||||
|
||||
BaseProjectWizardDialogPrivate::BaseProjectWizardDialogPrivate(Utils::ProjectIntroPage *page, int id) :
|
||||
desiredIntroPageId(id),
|
||||
introPage(page),
|
||||
introPageId(-1)
|
||||
{
|
||||
}
|
||||
|
||||
BaseProjectWizardDialog::BaseProjectWizardDialog(const Core::BaseFileWizardFactory *factory,
|
||||
QWidget *parent,
|
||||
const Core::WizardDialogParameters ¶meters) :
|
||||
Core::BaseFileWizard(factory, parameters.extraValues(), parent),
|
||||
d(std::make_unique<BaseProjectWizardDialogPrivate>(new Utils::ProjectIntroPage))
|
||||
d(std::make_unique<BaseProjectWizardDialogPrivate>(new ProjectIntroPage))
|
||||
{
|
||||
setFilePath(FilePath::fromString(parameters.defaultPath()));
|
||||
setSelectedPlatform(parameters.selectedPlatform());
|
||||
@@ -130,7 +126,7 @@ void BaseProjectWizardDialog::setProjectList(const QStringList &projectList)
|
||||
d->introPage->setProjectList(projectList);
|
||||
}
|
||||
|
||||
void BaseProjectWizardDialog::setProjectDirectories(const QStringList &directories)
|
||||
void BaseProjectWizardDialog::setProjectDirectories(const FilePaths &directories)
|
||||
{
|
||||
d->introPage->setProjectDirectories(directories);
|
||||
}
|
||||
@@ -156,7 +152,7 @@ bool BaseProjectWizardDialog::validateCurrentPage()
|
||||
return Core::BaseFileWizard::validateCurrentPage();
|
||||
}
|
||||
|
||||
Utils::ProjectIntroPage *BaseProjectWizardDialog::introPage() const
|
||||
ProjectIntroPage *BaseProjectWizardDialog::introPage() const
|
||||
{
|
||||
return d->introPage;
|
||||
}
|
||||
@@ -180,26 +176,26 @@ QString BaseProjectWizardDialog::uniqueProjectName(const QString &path)
|
||||
|
||||
void BaseProjectWizardDialog::addExtensionPages(const QList<QWizardPage *> &wizardPageList)
|
||||
{
|
||||
foreach (QWizardPage *p,wizardPageList)
|
||||
for (QWizardPage *p : wizardPageList)
|
||||
addPage(p);
|
||||
}
|
||||
|
||||
Utils::Id BaseProjectWizardDialog::selectedPlatform() const
|
||||
Id BaseProjectWizardDialog::selectedPlatform() const
|
||||
{
|
||||
return d->selectedPlatform;
|
||||
}
|
||||
|
||||
void BaseProjectWizardDialog::setSelectedPlatform(Utils::Id platform)
|
||||
void BaseProjectWizardDialog::setSelectedPlatform(Id platform)
|
||||
{
|
||||
d->selectedPlatform = platform;
|
||||
}
|
||||
|
||||
QSet<Utils::Id> BaseProjectWizardDialog::requiredFeatures() const
|
||||
QSet<Id> BaseProjectWizardDialog::requiredFeatures() const
|
||||
{
|
||||
return d->requiredFeatureSet;
|
||||
}
|
||||
|
||||
void BaseProjectWizardDialog::setRequiredFeatures(const QSet<Utils::Id> &featureSet)
|
||||
void BaseProjectWizardDialog::setRequiredFeatures(const QSet<Id> &featureSet)
|
||||
{
|
||||
d->requiredFeatureSet = featureSet;
|
||||
}
|
||||
|
||||
@@ -30,12 +30,11 @@
|
||||
#include <coreplugin/basefilewizard.h>
|
||||
#include <coreplugin/basefilewizardfactory.h>
|
||||
|
||||
#include <utils/filepath.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace Utils {
|
||||
class FilePath;
|
||||
class ProjectIntroPage;
|
||||
} // Utils
|
||||
namespace Utils { class ProjectIntroPage; }
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
@@ -68,7 +67,7 @@ public:
|
||||
void setFilePath(const Utils::FilePath &path);
|
||||
void setProjectName(const QString &name);
|
||||
void setProjectList(const QStringList &projectList);
|
||||
void setProjectDirectories(const QStringList &directories);
|
||||
void setProjectDirectories(const Utils::FilePaths &directories);
|
||||
void setForceSubProject(bool force);
|
||||
|
||||
signals:
|
||||
|
||||
Reference in New Issue
Block a user