[qet] [3833] Bug fix : element was not integrate into the xml project. |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3833
Author: blacksun
Date: 2015-03-18 15:10:25 +0100 (Wed, 18 Mar 2015)
Log Message:
-----------
Bug fix : element was not integrate into the xml project.
Modified Paths:
--------------
trunk/sources/diagramevent/diagrameventaddelement.cpp
trunk/sources/diagramevent/diagrameventaddelement.h
Modified: trunk/sources/diagramevent/diagrameventaddelement.cpp
===================================================================
--- trunk/sources/diagramevent/diagrameventaddelement.cpp 2015-03-17 19:54:11 UTC (rev 3832)
+++ trunk/sources/diagramevent/diagrameventaddelement.cpp 2015-03-18 14:10:25 UTC (rev 3833)
@@ -175,9 +175,9 @@
{
QString error_msg;
IntegrationMoveElementsHandler *integ_handler = new IntegrationMoveElementsHandler();
- QString integ_path = m_diagram -> project() -> integrateElement(m_location.toString(), integ_handler, error_msg);
+ m_integrate_path = m_diagram -> project() -> integrateElement(m_location.toString(), integ_handler, error_msg);
delete integ_handler;
- if (integ_path.isEmpty())
+ if (m_integrate_path.isEmpty())
{
qDebug() << "DiagramView::addDroppedElement : Impossible d'ajouter l'element. Motif : " << qPrintable(error_msg);
return false;
@@ -204,7 +204,12 @@
void DiagramEventAddElement::addElement()
{
int state;
- Element *element = ElementFactory::Instance() -> createElement(m_location, 0, &state);
+ Element *element;
+ if (m_integrate_path.isEmpty())
+ element = ElementFactory::Instance() -> createElement(m_location, 0, &state);
+ else
+ element = ElementFactory::Instance() -> createElement(ElementsLocation::locationFromString(m_integrate_path), 0, &state);
+
//Build failed
if (state)
{
Modified: trunk/sources/diagramevent/diagrameventaddelement.h
===================================================================
--- trunk/sources/diagramevent/diagrameventaddelement.h 2015-03-17 19:54:11 UTC (rev 3832)
+++ trunk/sources/diagramevent/diagrameventaddelement.h 2015-03-18 14:10:25 UTC (rev 3833)
@@ -48,6 +48,7 @@
private:
ElementsLocation m_location;
Element *m_element;
+ QString m_integrate_path;
};
#endif // DIAGRAMEVENTADDELEMENT_H