27 #include <IceUtil/UUID.h>
29 #include <QDirIterator>
43 if (!groupCloner->cloneGroupsTo({{group, newName}}, group->getPackagePath(),
StatechartGroupMapping(),
false))
45 ARMARX_ERROR_S <<
"Renaming group '" << group->getName() <<
"' to '" << newName <<
"' failed";
49 const QString oldRSOName = group->getName() +
"RemoteStateOfferer";
50 const QString newRSOName = newName +
"RemoteStateOfferer";
52 auto xmlProcessor = [&](
const std::string&,
const std::string & attribName,
const std::string & attribValue) -> std::string
54 QString
value = QString::fromUtf8(attribValue.c_str());
56 if (attribName ==
"proxyName" &&
value == oldRSOName)
58 return newRSOName.toUtf8().data();
66 QDirIterator it(g->getGroupPath(), QDir::Files, QDirIterator::Subdirectories);
70 const auto f = QFileInfo(it.next());
77 if (f.suffix() ==
"xml")
87 writer.
saveToFile(f.absoluteFilePath().toUtf8().data(),
true);
93 QDir oldDir(group->getGroupPath());
95 QString newGroupPath = oldDir.path() + QDir::separator() + newName;
96 QString cmakeListsPath = oldDir.path() + QDir::separator() +
"CMakeLists.txt";
99 cmakeLists = cmakeLists.replace(QRegExp(
"add_subdirectory\\(" + group->getName() +
"\\)\\n"),
"");
104 ARMARX_INFO_S <<
"Package '" << group->getPackagePath() <<
"' contains a mapping file; updating...";
108 return groupMapping.newGroupName == group->getName();