mirror of
https://github.com/reactos/CMake.git
synced 2025-03-06 02:48:38 +00:00
AUTOGEN: Generators: Cleanup and optimize ParseForUic method
This commit is contained in:
parent
794fdf40a1
commit
2f67aef23d
@ -931,23 +931,17 @@ void cmQtAutoGenerators::ParseForUic(
|
|||||||
"[\n][ \t]*#[ \t]*include[ \t]+"
|
"[\n][ \t]*#[ \t]*include[ \t]+"
|
||||||
"[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
|
"[\"<](([^ \">]+/)?ui_[^ \">/]+\\.h)[\">]");
|
||||||
|
|
||||||
std::string::size_type matchOffset = 0;
|
const char* contentChars = contentsString.c_str();
|
||||||
if ((strstr(contentsString.c_str(), "ui_") != CM_NULLPTR) &&
|
if (strstr(contentChars, "ui_") != CM_NULLPTR) {
|
||||||
(uiIncludeRegExp.find(contentsString))) {
|
while (uiIncludeRegExp.find(contentChars)) {
|
||||||
do {
|
|
||||||
const std::string currentUi = uiIncludeRegExp.match(1);
|
const std::string currentUi = uiIncludeRegExp.match(1);
|
||||||
|
const std::string basename =
|
||||||
std::string basename =
|
|
||||||
cmsys::SystemTools::GetFilenameWithoutLastExtension(currentUi);
|
cmsys::SystemTools::GetFilenameWithoutLastExtension(currentUi);
|
||||||
|
|
||||||
// basename should be the part of the ui filename used for
|
// basename should be the part of the ui filename used for
|
||||||
// finding the correct header, so we need to remove the ui_ part
|
// finding the correct header, so we need to remove the ui_ part
|
||||||
basename = basename.substr(3);
|
includedUis[realName].push_back(basename.substr(3));
|
||||||
|
contentChars += uiIncludeRegExp.end();
|
||||||
includedUis[realName].push_back(basename);
|
}
|
||||||
|
|
||||||
matchOffset += uiIncludeRegExp.end();
|
|
||||||
} while (uiIncludeRegExp.find(contentsString.c_str() + matchOffset));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user