MCPcopy Create free account
hub / github.com/LibrePCB/LibrePCB / copyLibraryElementNames

Function copyLibraryElementNames

libs/librepcb/editor/mainwindow.cpp:119–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119static LocalizedNameMap copyLibraryElementNames(const LocalizedNameMap& names) {
120 // Note: We copy only the default locale for now because the UI doesn't show
121 // the other locales so the user can't edit them.
122 QString newNameStr = *names.getDefaultValue() % " (" %
123 MainWindow::tr("Copy", "The noun (a copy of), not the verb (to copy)") %
124 ")";
125 if (auto newName = parseElementName(newNameStr)) {
126 return LocalizedNameMap(*newName);
127 }
128 newNameStr = *names.getDefaultValue() % " (Copy)";
129 if (auto newName = parseElementName(newNameStr)) {
130 return LocalizedNameMap(*newName);
131 }
132 return LocalizedNameMap(names.getDefaultValue());
133}
134
135template <typename T>
136static void duplicateLibraryElement(T& element, const T& other) {

Callers 1

duplicateLibraryElementFunction · 0.85

Calls 1

parseElementNameFunction · 0.85

Tested by

no test coverage detected