summaryrefslogtreecommitdiffstats
path: root/Source/cmQTWrapUICommand.cxx
diff options
context:
space:
mode:
authorArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
committerArtur Ryt <artur.ryt@gmail.com>2019-02-07 21:39:05 (GMT)
commit01b2d6ab7465e7f22fb821876027df86b0c8f363 (patch)
tree7ae313670e3655269ef7f9db6feabdc4bb2aaf25 /Source/cmQTWrapUICommand.cxx
parent15bdbec0176e3aa620bb5bda3631819c5ca18eaf (diff)
downloadCMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.zip
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.gz
CMake-01b2d6ab7465e7f22fb821876027df86b0c8f363.tar.bz2
Modernize: Use ranged for-loops when possible
Replaced most manual `const_iterator`-based loops and some reverse-iterator loops with range loops. Fixes: #18858
Diffstat (limited to 'Source/cmQTWrapUICommand.cxx')
-rw-r--r--Source/cmQTWrapUICommand.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index 43b1fb9..6a620c1 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQTWrapUICommand.h"
+#include "cmAlgorithms.h"
#include "cmCustomCommandLines.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
@@ -33,13 +34,13 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
std::string sourceListValue = this->Makefile->GetSafeDefinition(sourceList);
// Create rules for all sources listed.
- for (std::vector<std::string>::const_iterator j = (args.begin() + 3);
- j != args.end(); ++j) {
- cmSourceFile* curr = this->Makefile->GetSource(*j);
+ for (std::string const& arg : cmMakeRange(args).advance(3)) {
+ cmSourceFile* curr = this->Makefile->GetSource(arg);
// if we should wrap the class
if (!(curr && curr->GetPropertyAsBool("WRAP_EXCLUDE"))) {
// Compute the name of the files to generate.
- std::string srcName = cmSystemTools::GetFilenameWithoutLastExtension(*j);
+ std::string srcName =
+ cmSystemTools::GetFilenameWithoutLastExtension(arg);
std::string hName = this->Makefile->GetCurrentBinaryDirectory();
hName += "/";
hName += srcName;
@@ -55,8 +56,8 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
// Compute the name of the ui file from which to generate others.
std::string uiName;
- if (cmSystemTools::FileIsFullPath(*j)) {
- uiName = *j;
+ if (cmSystemTools::FileIsFullPath(arg)) {
+ uiName = arg;
} else {
if (curr && curr->GetIsGenerated()) {
uiName = this->Makefile->GetCurrentBinaryDirectory();
@@ -64,7 +65,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
uiName = this->Makefile->GetCurrentSourceDirectory();
}
uiName += "/";
- uiName += *j;
+ uiName += arg;
}
// create the list of headers