[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Mon Apr 23 17:47:48 UTC 2012
SVN commit 1291285 by fischer:
Differences to gsoc-branch reduced.
M +9 -9 toolbarstate.cpp
M +1 -1 toolbarstateassociation.cpp
M +8 -7 toolbarstatemessages.cpp
M +11 -5 uml.cpp
M +3 -0 umllistviewitem.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstate.cpp #1291284:1291285
@@ -84,7 +84,7 @@
m_pUMLScene->emitRemovePopupMenu();
// TODO: Check who needs this.
- m_pUMLScene->setPos(m_pMouseEvent->pos());
+ m_pUMLScene->setPos(m_pMouseEvent->scenePos());
//TODO check why
m_pUMLScene->setPaste(false);
@@ -115,7 +115,7 @@
// Set the position of the mouse
// TODO, should only be available in this state?
- m_pUMLScene->setPos(m_pMouseEvent->pos());
+ m_pUMLScene->setPos(m_pMouseEvent->scenePos());
m_pUMLScene->view()->viewport()->setMouseTracking(false);
@@ -146,8 +146,8 @@
{
setMouseEvent(ome, QEvent::MouseButtonDblClick);
- UMLWidget* currentWidget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
- AssociationWidget* currentAssociation = getAssociationAt(m_pMouseEvent->pos());
+ UMLWidget* currentWidget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
+ AssociationWidget* currentAssociation = getAssociationAt(m_pMouseEvent->scenePos());
if (currentWidget) {
setCurrentWidget(currentWidget);
mouseDoubleClickWidget();
@@ -256,7 +256,7 @@
void ToolBarState::setCurrentElement()
{
// Check associations.
- AssociationWidget* association = getAssociationAt(m_pMouseEvent->pos());
+ AssociationWidget* association = getAssociationAt(m_pMouseEvent->scenePos());
if (association) {
setCurrentAssociation(association);
return;
@@ -264,27 +264,27 @@
// Check messages.
//TODO check why message widgets are treated different
- MessageWidget* message = getMessageAt(m_pMouseEvent->pos());
+ MessageWidget* message = getMessageAt(m_pMouseEvent->scenePos());
if (message) {
setCurrentWidget(message);
return;
}
//TODO check why message widgets are treated different
- FloatingDashLineWidget* floatingline = getFloatingLineAt(m_pMouseEvent->pos());
+ FloatingDashLineWidget* floatingline = getFloatingLineAt(m_pMouseEvent->scenePos());
if (floatingline) {
setCurrentWidget(floatingline);
return;
}
- ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetDestructionBox(m_pMouseEvent->pos());
+ ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetDestructionBox(m_pMouseEvent->scenePos());
if (objectWidgetLine) {
setCurrentWidget(objectWidgetLine);
return;
}
// Check widgets.
- UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
+ UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
if (widget) {
setCurrentWidget(widget);
return;
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstateassociation.cpp #1291284:1291285
@@ -306,7 +306,7 @@
Uml::ModelType m = Model_Utils::convert_DT_MT(m_pUMLScene->type());
UMLDoc *umldoc = UMLApp::app()->document();
umla->setUMLPackage(umldoc->rootFolder(m));
- UMLApp::app()->document()->addAssociation(umla);
+ umldoc->addAssociation(umla);
}
return true;
} else {
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstatemessages.cpp #1291284:1291285
@@ -109,18 +109,19 @@
{
m_isObjectWidgetLine = false;
- ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->pos());
+ ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos());
if (objectWidgetLine) {
+ qDebug() << Q_FUNC_INFO << "Object detected";
setCurrentWidget(objectWidgetLine);
m_isObjectWidgetLine = true;
return;
}
-
+ qDebug() << Q_FUNC_INFO << "Object NOT detected";
//commit 515177 fixed a setting creation messages only working properly at 100% zoom
//However, the applied patch doesn't seem to be necessary no more, so it was removed
//The widgets weren't got from UMLView, but from a method in this class similarto the
//one in UMLView but containing special code to handle the zoom
- UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->pos());
+ UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos());
if (widget) {
setCurrentWidget(widget);
return;
@@ -174,8 +175,8 @@
Uml::Sequence_Message_Type msgType = getMessageType();
if (m_firstObject && msgType == Uml::sequence_message_lost) {
- xclick = m_pMouseEvent->x();
- yclick = m_pMouseEvent->y();
+ xclick = m_pMouseEvent->scenePos().x();
+ yclick = m_pMouseEvent->scenePos().y();
MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject,xclick, yclick, msgType);
@@ -195,8 +196,8 @@
}
else if (!m_firstObject && msgType == Uml::sequence_message_found && xclick == 0 && yclick == 0) {
- xclick = m_pMouseEvent->x();
- yclick = m_pMouseEvent->y();
+ xclick = m_pMouseEvent->scenePos().x();
+ yclick = m_pMouseEvent->scenePos().y();
m_messageLine = new UMLSceneLineItem;
m_messageLine->setCanvas(m_pUMLScene->canvas());
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #1291284:1291285
@@ -1655,9 +1655,15 @@
}
if (m_loading == false) {
+ if (m_doc) {
+ DEBUG(DBG_SRC) << m_doc->url().fileName();
setCaption(m_doc->url().fileName(), modified); //add disk icon to taskbar if modified
}
+ else {
+ DEBUG(DBG_SRC) << "m_doc is NULL!";
}
+ }
+}
/**
* Set whether to allow printing.
@@ -1833,7 +1839,7 @@
}
/**
- * Returns the undo state.
+ * Returns the undo state. Is used for popupmenu of a view.
*
* @return True if Undo is enabled.
*/
@@ -1845,7 +1851,7 @@
/**
* Returns the redo state.
*
- * @return True if Redo is enabled.
+ * @return True if Redo is enabled. Is used for popupmenu of a view.
*/
bool UMLApp::isRedoEnabled() const
{
@@ -2262,7 +2268,7 @@
*/
void UMLApp::setActiveLanguage(Uml::ProgrammingLanguage pl)
{
- updateLangSelectMenu(pl);
+ //updateLangSelectMenu(pl); //:TODO:checkit - is already called in setGenerator
setGenerator(pl);
}
@@ -2921,7 +2927,7 @@
}
/**
- * Undo last command
+ * Undo last command. Is called from popupmenu of a view.
*/
void UMLApp::undo()
{
@@ -2939,7 +2945,7 @@
}
/**
- * Redo last 'undoed' command
+ * Redo last 'undoed' command. Is called from popupmenu of a view.
*/
void UMLApp::redo()
{
--- trunk/KDE/kdesdk/umbrello/umbrello/umllistviewitem.cpp #1291284:1291285
@@ -57,6 +57,9 @@
: QTreeWidgetItem(parent)
{
init();
+ if (parent == 0) {
+ DEBUG(DBG_LVI) << "UMLListViewItem constructor called with a null listview parent";
+ }
m_type = t;
m_object = o;
if (o) {
More information about the umbrello-devel
mailing list