Autogen: Rename header extension Join method to JoinExts

While at it, simplify the signature and avoid a trailing separator.
This commit is contained in:
Sebastian Holtermann 2016-04-18 11:39:06 +02:00 committed by Brad King
parent 7a73c404dd
commit 95064a6d35
2 changed files with 10 additions and 6 deletions

View File

@ -762,7 +762,7 @@ void cmQtAutoGenerators::ParseCppFile(const std::string& absFilename,
std::cerr << "AUTOGEN: error: " << absFilename << ": The file " std::cerr << "AUTOGEN: error: " << absFilename << ": The file "
<< "includes the moc file \"" << currentMoc << "\", " << "includes the moc file \"" << currentMoc << "\", "
<< "but could not find header \"" << basename << "but could not find header \"" << basename
<< '{' << this->Join(headerExtensions, ',') << "}\" "; << '{' << this->JoinExts(headerExtensions) << "}\" ";
if (mocSubDir.empty()) if (mocSubDir.empty())
{ {
std::cerr << "in " << absPath << "\n" << std::endl; std::cerr << "in " << absPath << "\n" << std::endl;
@ -937,7 +937,7 @@ void cmQtAutoGenerators::StrictParseCppFile(const std::string& absFilename,
std::cerr << "AUTOGEN: error: " << absFilename << " The file " std::cerr << "AUTOGEN: error: " << absFilename << " The file "
<< "includes the moc file \"" << currentMoc << "\", " << "includes the moc file \"" << currentMoc << "\", "
<< "but could not find header \"" << basename << "but could not find header \"" << basename
<< '{' << this->Join(headerExtensions, ',') << "}\" "; << '{' << this->JoinExts(headerExtensions) << "}\" ";
if (mocSubDir.empty()) if (mocSubDir.empty())
{ {
std::cerr << "in " << absPath << "\n" << std::endl; std::cerr << "in " << absPath << "\n" << std::endl;
@ -1347,8 +1347,7 @@ bool cmQtAutoGenerators::GenerateQrc()
return true; return true;
} }
std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst, std::string cmQtAutoGenerators::JoinExts(const std::vector<std::string>& lst)
char separator)
{ {
if (lst.empty()) if (lst.empty())
{ {
@ -1356,11 +1355,16 @@ std::string cmQtAutoGenerators::Join(const std::vector<std::string>& lst,
} }
std::string result; std::string result;
std::string separator = ",";
for (std::vector<std::string>::const_iterator it = lst.begin(); for (std::vector<std::string>::const_iterator it = lst.begin();
it != lst.end(); it != lst.end();
++it) ++it)
{ {
result += "." + (*it) + separator; if(it != lst.begin())
{
result += separator;
}
result += '.' + (*it);
} }
result.erase(result.end() - 1); result.erase(result.end() - 1);
return result; return result;

View File

@ -69,7 +69,7 @@ private:
void Init(); void Init();
std::string Join(const std::vector<std::string>& lst, char separator); std::string JoinExts(const std::vector<std::string>& lst);
static void MergeUicOptions(std::vector<std::string> &opts, static void MergeUicOptions(std::vector<std::string> &opts,
const std::vector<std::string> &fileOpts, bool isQt5); const std::vector<std::string> &fileOpts, bool isQt5);