From 67f0c1647f8e09955fb4b886b26891f42aa7f5c6 Mon Sep 17 00:00:00 2001 From: mpv Date: Wed, 30 Jan 2019 11:14:06 +0300 Subject: [PATCH] Fix for the issue #2754 : the rename error message --- src/XGUI/XGUI_Tools.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index e058ff8cf..e28c4ac43 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -171,8 +171,8 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) ObjectPtr aObj = aDoc->objectByName(aType, theName.toStdString()); - if (aObj.get()) { - QString aErrMsg(QObject::tr("%1 with name %2 already exists."). + if (aObj.get() && theObject != aObj) { + QString aErrMsg(QObject::tr("Name %2 already exists in %1."). arg(aType.c_str()).arg(theName)); // We can not use here a dialog box for message - // it will crash editing process in ObjectBrowser -- 2.39.2