Skip to content
Snippets Groups Projects
Commit f65315da authored by Joris Steyn's avatar Joris Steyn
Browse files

Fix broken icon on pasted folder

The stereotype of an object should be taken into account when determining the
baseType. Otherwise, a pasted folder will be a UMLPackage instead of UMLFolder.

CCBUG: 327577
parent d7bc74d3
No related branches found
No related tags found
No related merge requests found
......@@ -307,12 +307,13 @@ bool UMLDragData::decodeClip1(const QMimeData* mimeData, UMLObjectList& objects)
while (!element.isNull()) {
pObject = 0;
QString type = element.tagName();
QString stereotype = element.attribute("stereotype");
if (type == "UML:Association") {
objectElement = objectElement.nextSibling();
element = objectElement.toElement();
continue;
}
pObject = Object_Factory::makeObjectFromXMI(type);
pObject = Object_Factory::makeObjectFromXMI(type, stereotype);
if(!pObject) {
uWarning() << "Given wrong type of umlobject to create: " << type;
......@@ -394,8 +395,9 @@ bool UMLDragData::decodeClip2(const QMimeData* mimeData, UMLObjectList& objects,
while (!element.isNull()) {
pObject = 0;
QString type = element.tagName();
QString stereotype = element.attribute("stereotype");
if (type != "UML:Association") {
pObject = Object_Factory::makeObjectFromXMI(type);
pObject = Object_Factory::makeObjectFromXMI(type, stereotype);
if(!pObject) {
uWarning() << "Given wrong type of umlobject to create:" << type;
......@@ -646,10 +648,11 @@ bool UMLDragData::decodeClip4(const QMimeData* mimeData, UMLObjectList& objects,
UMLDoc* doc = UMLApp::app()->document();
Uml::ID::Type elmId = Uml::ID::fromString(element.attribute("xmi.id"));
QString stereotype = element.attribute("stereotype");
pObject = doc->findObjectById(elmId);
if (!pObject) {
pObject = Object_Factory::makeObjectFromXMI(type);
pObject = Object_Factory::makeObjectFromXMI(type, stereotype);
if (!pObject) {
uWarning() << "Given wrong type of umlobject to create: " << type;
return false;
......
......@@ -355,14 +355,6 @@ void UMLListViewItem::updateObject()
else
icon = Icon_Utils::it_Package;
break;
/*
case UMLObject::ot_Folder:
{
ListViewType lvt = Model_Utils::convert_OT_LVT(m_object);
icon = Model_Utils::convert_LVT_IT(lvt);
}
break;
*/
case UMLObject::ot_Operation:
if (scope == Uml::Visibility::Public)
icon = Icon_Utils::it_Public_Method;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment