diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-05-11 13:02:36 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-05-11 11:52:00 +0000 |
commit | caca9dfa6f63c942d591f6cf8e41475ebf68d93d (patch) | |
tree | 8ebe195669e695b4eb458c2a0b35b488ec4e4c6a /src/plugins/bazaar | |
parent | 75f067550f15fe384f2b59989a90dcb7dd8d5e43 (diff) | |
download | qt-creator-caca9dfa6f63c942d591f6cf8e41475ebf68d93d.tar.gz |
CheckoutWizards: Simplify code to look up specific pages
Change-Id: I0098e17585d73e05632027676e7712ef9c843da2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/bazaar')
-rw-r--r-- | src/plugins/bazaar/clonewizard.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/bazaar/clonewizard.cpp b/src/plugins/bazaar/clonewizard.cpp index f3d4b48ac7..8ee1a69e21 100644 --- a/src/plugins/bazaar/clonewizard.cpp +++ b/src/plugins/bazaar/clonewizard.cpp @@ -40,6 +40,8 @@ #include <vcsbase/vcsbaseconstants.h> #include <vcsbase/wizard/vcsconfigurationpage.h> +#include <utils/qtcassert.h> + #include <QDebug> using namespace VcsBase; @@ -70,14 +72,8 @@ CloneWizard::CloneWizard(const Utils::FileName &path, QWidget *parent) : VcsCommand *CloneWizard::createCommand(Utils::FileName *checkoutDir) { - const CloneWizardPage *cwp = 0; - foreach (int pageId, pageIds()) { - if ((cwp = qobject_cast<const CloneWizardPage *>(page(pageId)))) - break; - } - - if (!cwp) - return 0; + const CloneWizardPage *cwp = find<CloneWizardPage>(); + QTC_ASSERT(cwp, return 0); const VcsBaseClientSettings &settings = BazaarPlugin::instance()->client()->settings(); *checkoutDir = Utils::FileName::fromString(cwp->path() + QLatin1Char('/') + cwp->directory()); |