mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-04 08:43:42 +02:00
[consider merging] Library rename now removes an existing library
This commit is contained in:
@@ -149,7 +149,15 @@ void
|
||||
Library::rename (const std::string &name)
|
||||
{
|
||||
if (name != get_name () && db::LibraryManager::initialized ()) {
|
||||
|
||||
std::pair<bool, lib_id_type> n2l = db::LibraryManager::instance ().lib_by_name (name, get_technologies ());
|
||||
if (n2l.first && n2l.second != get_id ()) {
|
||||
// remove any existing library that has our target name/tech combination
|
||||
db::LibraryManager::instance ().delete_lib (db::LibraryManager::instance ().lib (n2l.second));
|
||||
}
|
||||
|
||||
db::LibraryManager::instance ().rename (get_id (), name);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user