From 47e60bc5a09f5b3a71ce015025cd93af4270afb5 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Mon, 18 Apr 2016 14:07:12 +0200 Subject: [PATCH] Autogen: Split out UI file generation code to dedicated method --- Source/cmQtAutoGenerators.cxx | 38 ++++++++++++++++++++++++----------- Source/cmQtAutoGenerators.h | 2 ++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 7f7dbadb6..91bacceea 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -595,20 +595,10 @@ bool cmQtAutoGenerators::RunAutogen(cmMakefile* makefile) { this->GenerateMocFiles ( includedMocs, notIncludedMocs ); } - - for(std::map >::const_iterator - it = includedUis.begin(); - it != includedUis.end(); - ++it) + if(!this->UicExecutable.empty()) { - for (std::vector::const_iterator nit = it->second.begin(); - nit != it->second.end(); - ++nit) - { - this->GenerateUi(it->first, *nit); - } + this->GenerateUiFiles ( includedUis ); } - if(!this->RccExecutable.empty()) { this->GenerateQrcFiles(); @@ -1227,6 +1217,30 @@ bool cmQtAutoGenerators::GenerateMoc(const std::string& sourceFile, return false; } + +bool cmQtAutoGenerators::GenerateUiFiles( + const std::map >& includedUis ) +{ + for(std::map >::const_iterator + it = includedUis.begin(); it != includedUis.end(); ++it) + { + for (std::vector::const_iterator nit = it->second.begin(); + nit != it->second.end(); ++nit) + { + if (!this->GenerateUi(it->first, *nit) ) + { + if (this->RunUicFailed) + { + return false; + } + } + } + } + + return true; +} + + bool cmQtAutoGenerators::GenerateUi(const std::string& realName, const std::string& uiFileName) { diff --git a/Source/cmQtAutoGenerators.h b/Source/cmQtAutoGenerators.h index 51959be5f..cb2be4a96 100644 --- a/Source/cmQtAutoGenerators.h +++ b/Source/cmQtAutoGenerators.h @@ -44,6 +44,8 @@ private: const std::map& notIncludedMocs); bool GenerateMoc(const std::string& sourceFile, const std::string& mocFileName); + bool GenerateUiFiles( + const std::map >& includedUis ); bool GenerateUi(const std::string& realName, const std::string& uiFileName); bool GenerateQrcFiles(); void ParseCppFile(const std::string& absFilename,