From d342ea36783f62aae3aef5989ccd1a234498f65e Mon Sep 17 00:00:00 2001
From: Daniel Teske <daniel.teske@nokia.com>
Date: Fri, 13 Jul 2012 17:41:05 +0200
Subject: [PATCH] CMakeProject: use static_cast not qojbect_cast

Change-Id: I5568316edb16fb3c797b8d403d75617279c1bcae
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
---
 src/plugins/cmakeprojectmanager/cmakeproject.cpp | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index aec60ba3ac3..2028ddd0e3f 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -142,9 +142,7 @@ void CMakeProject::changeActiveBuildConfiguration(ProjectExplorer::BuildConfigur
     if (!bc || bc->target() != activeTarget())
         return;
 
-    CMakeBuildConfiguration * cmakebc(qobject_cast<CMakeBuildConfiguration *>(bc));
-    if (!cmakebc)
-        return;
+    CMakeBuildConfiguration *cmakebc = static_cast<CMakeBuildConfiguration *>(bc);
 
     // Pop up a dialog asking the user to rerun cmake
     QFileInfo sourceFileInfo(m_fileName);
@@ -845,9 +843,7 @@ void CMakeBuildSettingsWidget::init(BuildConfiguration *bc)
 
 void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
 {
-    CMakeProject *project = qobject_cast<CMakeProject *>(m_buildConfiguration->target()->project());
-    if (!project)
-        return;
+    CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
     CMakeOpenProjectWizard copw(project->projectManager(),
                                 project->projectDirectory(),
                                 m_buildConfiguration->buildDirectory(),
@@ -861,9 +857,7 @@ void CMakeBuildSettingsWidget::openChangeBuildDirectoryDialog()
 void CMakeBuildSettingsWidget::runCMake()
 {
     // TODO skip build directory
-    CMakeProject *project = qobject_cast<CMakeProject *>(m_buildConfiguration->target()->project());
-    if (!project)
-        return;
+    CMakeProject *project = static_cast<CMakeProject *>(m_buildConfiguration->target()->project());
     CMakeOpenProjectWizard copw(project->projectManager(),
                                 project->projectDirectory(),
                                 m_buildConfiguration->buildDirectory(),
-- 
GitLab