Commit dae8df05 authored by Tobias Hunger's avatar Tobias Hunger

Vcs: Make checkout wizards work, even when VCS in unconfigured

They used to grab the first page in the set of pages and that
is the VCS setup page if the VCS was not configured before the
wizard was started. Then the wizards just stopped.

Change-Id: I8ea5bc373c07fb5c68a4814396864de6b8413747
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent 6644a08c
......@@ -71,7 +71,11 @@ QList<QWizardPage *> CloneWizardFactory::createParameterPages(const QString &pat
VcsBase::Command *CloneWizardFactory::createCommand(const QList<QWizardPage *> &parameterPages,
QString *checkoutPath)
{
const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front());
const CloneWizardPage *page = 0;
foreach (QWizardPage *p, parameterPages) {
if ((page = qobject_cast<const CloneWizardPage *>(p)))
break;
}
if (!page)
return 0;
......
......@@ -70,7 +70,11 @@ VcsBase::Command *CheckoutWizardFactory::createCommand(const QList<QWizardPage*>
{
// Collect parameters for the checkout command.
// CVS does not allow for checking out into a different directory.
const CheckoutWizardPage *cwp = qobject_cast<const CheckoutWizardPage *>(parameterPages.front());
const CheckoutWizardPage *cwp = 0;
foreach (QWizardPage *p, parameterPages) {
if ((cwp = qobject_cast<const CheckoutWizardPage *>(p)))
break;
}
QTC_ASSERT(cwp, return 0);
const CvsSettings settings = CvsPlugin::instance()->settings();
const QString binary = settings.binaryPath();
......
......@@ -71,8 +71,7 @@ VcsBase::Command *CloneWizardFactory::createCommand(const QList<QWizardPage*> &p
// Collect parameters for the clone command.
const CloneWizardPage *cwp = 0;
foreach (QWizardPage *wp, parameterPages) {
cwp = qobject_cast<const CloneWizardPage *>(wp);
if (cwp)
if ((cwp = qobject_cast<const CloneWizardPage *>(wp)))
break;
}
......
......@@ -102,7 +102,11 @@ QList<QWizardPage*> GitoriousCloneWizardFactory::createParameterPages(const QStr
VcsBase::Command *GitoriousCloneWizardFactory::createCommand(const QList<QWizardPage*> &parameterPages,
QString *checkoutPath)
{
const Git::CloneWizardPage *cwp = qobject_cast<const Git::CloneWizardPage *>(parameterPages.back());
const Git::CloneWizardPage *cwp = 0;
foreach (QWizardPage *p, parameterPages) {
if ((cwp = qobject_cast<const Git::CloneWizardPage *>(p)))
break;
}
QTC_ASSERT(cwp, return 0);
return cwp->createCheckoutJob(checkoutPath);
}
......
......@@ -68,7 +68,11 @@ QList<QWizardPage *> CloneWizardFactory::createParameterPages(const QString &pat
Command *CloneWizardFactory::createCommand(const QList<QWizardPage *> &parameterPages,
QString *checkoutPath)
{
const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front());
const CloneWizardPage *page = 0;
foreach (QWizardPage *p, parameterPages) {
if ((page = qobject_cast<const CloneWizardPage *>(p)))
break;
}
if (!page)
return 0;
......
......@@ -67,7 +67,11 @@ VcsBase::Command *CheckoutWizardFactory::createCommand(const QList<QWizardPage*>
QString *checkoutPath)
{
// Collect parameters for the checkout command.
const CheckoutWizardPage *cwp = qobject_cast<const CheckoutWizardPage *>(parameterPages.front());
const CheckoutWizardPage *cwp = 0;
foreach (const QWizardPage *p, parameterPages) {
if ((cwp = qobject_cast<const CheckoutWizardPage *>(p)))
break;
}
QTC_ASSERT(cwp, return 0);
const SubversionSettings settings = SubversionPlugin::instance()->settings();
const QString binary = settings.binaryPath();
......
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