CheckoutWizards: Simplify code to look up specific pages

Change-Id: I0098e17585d73e05632027676e7712ef9c843da2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Tobias Hunger
2015-05-11 13:02:36 +02:00
parent 75f067550f
commit caca9dfa6f
5 changed files with 12 additions and 33 deletions

View File

@@ -67,12 +67,7 @@ CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) :
VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir)
{
// Collect parameters for the clone command.
const CloneWizardPage *cwp = 0;
foreach (int pageId, pageIds()) {
if ((cwp = qobject_cast<const CloneWizardPage *>(page(pageId))))
break;
}
const CloneWizardPage *cwp = find<CloneWizardPage>();
QTC_ASSERT(cwp, return 0);
return cwp->createCheckoutJob(checkoutDir);
}