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/mercurial | |
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/mercurial')
-rw-r--r-- | src/plugins/mercurial/clonewizard.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/mercurial/clonewizard.cpp b/src/plugins/mercurial/clonewizard.cpp index 59ba563bf3..90339e34c2 100644 --- a/src/plugins/mercurial/clonewizard.cpp +++ b/src/plugins/mercurial/clonewizard.cpp @@ -39,6 +39,8 @@ #include <vcsbase/vcsbaseconstants.h> #include <vcsbase/wizard/vcsconfigurationpage.h> +#include <utils/qtcassert.h> + using namespace VcsBase; namespace Mercurial { @@ -66,14 +68,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 = MercurialPlugin::client()->settings(); |