Commit 33878202 authored by Tobias Hunger's avatar Tobias Hunger

BaseCheckoutWizardFactory: Remove private class

Change-Id: Ia82a8cd8182e41ea88fdf98429c418a4016a1537
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 8e126df5
......@@ -62,27 +62,8 @@
*/
namespace VcsBase {
namespace Internal {
class BaseCheckoutWizardFactoryPrivate
{
public:
BaseCheckoutWizardFactoryPrivate() : wizard(0) {}
void clear();
BaseCheckoutWizard *wizard;
};
void BaseCheckoutWizardFactoryPrivate::clear()
{
delete wizard;
wizard = 0;
}
} // namespace Internal
BaseCheckoutWizardFactory::BaseCheckoutWizardFactory() :
d(new Internal::BaseCheckoutWizardFactoryPrivate)
BaseCheckoutWizardFactory::BaseCheckoutWizardFactory()
{
setWizardKind(IWizardFactory::ProjectWizard);
setCategory(QLatin1String(ProjectExplorer::Constants::IMPORT_WIZARD_CATEGORY));
......@@ -91,28 +72,24 @@ BaseCheckoutWizardFactory::BaseCheckoutWizardFactory() :
setFlags(Core::IWizardFactory::PlatformIndependent);
}
BaseCheckoutWizardFactory::~BaseCheckoutWizardFactory()
{
delete d;
}
void BaseCheckoutWizardFactory::runWizard(const QString &path, QWidget *parent, const QString &platform,
const QVariantMap &extraValues)
{
Q_UNUSED(platform);
Q_UNUSED(extraValues);
QTC_ASSERT(!d->wizard, return);
// Create dialog and launch
d->wizard = create(path, parent);
d->wizard->setWindowTitle(displayName());
const QString checkoutPath = d->wizard->run();
if (checkoutPath.isEmpty()) {
d->clear();
return;
QString checkoutPath;
{
QScopedPointer<BaseCheckoutWizard> wizard(create(path, parent));
wizard->setWindowTitle(displayName());
checkoutPath = wizard->run();
}
if (checkoutPath.isEmpty())
return;
// Now try to find the project file and open
d->clear();
QString errorMessage;
const QString projectFile = openProject(checkoutPath, &errorMessage);
if (projectFile.isEmpty()) {
......
......@@ -41,8 +41,6 @@ class QWizardPage;
QT_END_NAMESPACE
namespace VcsBase {
namespace Internal { class BaseCheckoutWizardFactoryPrivate; }
class BaseCheckoutWizard;
class Command;
......@@ -52,16 +50,12 @@ class VCSBASE_EXPORT BaseCheckoutWizardFactory : public Core::IWizardFactory
public:
BaseCheckoutWizardFactory();
~BaseCheckoutWizardFactory();
void runWizard(const QString &path, QWidget *parent, const QString &platform, const QVariantMap &extraValues);
static QString openProject(const QString &path, QString *errorMessage);
virtual BaseCheckoutWizard *create(const QString &path, QWidget *parent = 0) const = 0;
private:
Internal::BaseCheckoutWizardFactoryPrivate *const d;
};
} // namespace VcsBase
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment