Commit cb210c0c authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Rename class CmdRenameUMLObjectInstance to CmdRenameUMLInstance.

It handles class UMLInstance and should be named similar to
CmdRenameUMLObject which handles UMLObject.
parent 17026115
......@@ -337,7 +337,7 @@ set(libcmds_SRCS
cmds/generic/cmdcreateumlobject.cpp
cmds/generic/cmdremoveumlobject.cpp
cmds/generic/cmdrenameumlobject.cpp
cmds/generic/cmdrenameumlobjectinstance.cpp
cmds/generic/cmdrenameumlinstance.cpp
cmds/widget/cmdbasewidgetcommand.cpp
cmds/widget/cmdchangefont.cpp
cmds/widget/cmdchangetextcolor.cpp
......
......@@ -27,7 +27,7 @@
#include "cmds/generic/cmdcreateumlobject.h"
#include "cmds/generic/cmdremoveumlobject.h"
#include "cmds/generic/cmdrenameumlobject.h"
#include "cmds/generic/cmdrenameumlobjectinstance.h"
#include "cmds/generic/cmdrenameumlinstance.h"
/************************************************************
* Widgets
......
......@@ -8,7 +8,7 @@
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
#include "cmdrenameumlobjectinstance.h"
#include "cmdrenameumlinstance.h"
// app includes
#include "instance.h"
......@@ -19,23 +19,23 @@
namespace Uml
{
CmdRenameUMLObjectInstance::CmdRenameUMLObjectInstance(UMLInstance* o, const QString& name)
CmdRenameUMLInstance::CmdRenameUMLInstance(UMLInstance* o, const QString& name)
: m_obj(o), m_name(name)
{
setText(i18n("Rename object : %1 to %2", o->instanceName(), name));
m_oldname = o->instanceName();
}
CmdRenameUMLObjectInstance::~CmdRenameUMLObjectInstance()
CmdRenameUMLInstance::~CmdRenameUMLInstance()
{
}
void CmdRenameUMLObjectInstance::redo()
void CmdRenameUMLInstance::redo()
{
m_obj->setInstanceNameCmd(m_name);
}
void CmdRenameUMLObjectInstance::undo()
void CmdRenameUMLInstance::undo()
{
m_obj->setInstanceName(m_oldname);
}
......
......@@ -8,8 +8,8 @@
* Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
***************************************************************************/
#ifndef CMD_RENAME_UMLOBJECTINSTANCE_H
#define CMD_RENAME_UMLOBJECTINSTANCE_H
#ifndef CMD_RENAME_UMLINSTANCE_H
#define CMD_RENAME_UMLNSTANCE_H
#include <QUndoCommand>
......@@ -17,11 +17,11 @@ class UMLInstance;
namespace Uml
{
class CmdRenameUMLObjectInstance : public QUndoCommand
class CmdRenameUMLInstance : public QUndoCommand
{
public:
CmdRenameUMLObjectInstance(UMLInstance *o, const QString& name);
~CmdRenameUMLObjectInstance();
CmdRenameUMLInstance(UMLInstance *o, const QString& name);
~CmdRenameUMLInstance();
void redo();
void undo();
......
......@@ -11,7 +11,7 @@
#include "instance.h"
//local includes
#include "cmds/generic/cmdrenameumlobjectinstance.h"
#include "cmds/generic/cmdrenameumlinstance.h"
#include "instanceattribute.h"
#include "umlinstanceattributedialog.h"
#include "umldoc.h"
......@@ -40,7 +40,7 @@ QString UMLInstance::instanceName() const
void UMLInstance::setInstanceName(const QString &strName)
{
if(instanceName() != strName)
UMLApp::app()->executeCommand(new Uml::CmdRenameUMLObjectInstance(this, strName));
UMLApp::app()->executeCommand(new Uml::CmdRenameUMLInstance(this, strName));
}
void UMLInstance::setInstanceNameCmd(const QString &strName)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment