[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Wed May 2 19:40:54 UTC 2012
SVN commit 1292613 by fischer:
Differences to gsoc-branch reduced.
M +2 -0 folder.h
M +2 -2 listpopupmenu.cpp
M +28 -31 umlscene.cpp
M +0 -1 widgets/floatingtextwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/folder.h #1292612:1292613
@@ -28,6 +28,8 @@
* @short Non-graphical management of objects and diagrams of a Folder
* @author Oliver Kellogg
* Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
+ *
+ * TODO: This whole class needs a relook regarding view/scene.
*/
class UMLFolder : public UMLPackage
{
--- trunk/KDE/kdesdk/umbrello/umbrello/listpopupmenu.cpp #1292612:1292613
@@ -382,10 +382,10 @@
case WidgetBase::wt_Object:
{
- UMLView * pView = static_cast<UMLView *>(parent);
//Used for sequence diagram and collaboration diagram widgets
insertSubMenuColor( object->useFillColor() );
- if( pView->umlScene()->type() == Uml::DiagramType::Sequence ) {
+ if (object->umlScene() &&
+ object->umlScene()->type() == Uml::DiagramType::Sequence) {
addSeparator();
MenuType tabUp = mt_Up;
insert(mt_Up, Icon_Utils::SmallIcon(Icon_Utils::it_Arrow_Up), i18n("Move Up"));
--- trunk/KDE/kdesdk/umbrello/umbrello/umlscene.cpp #1292612:1292613
@@ -90,11 +90,10 @@
#include <QtGui/QShowEvent>
#include <QtGui/QDragEnterEvent>
#include <QtGui/QMouseEvent>
-#include <QtDebug>
// system includes
#include <climits>
-#include <math.h>
+#include <cmath>
// control the manual DoubleBuffering of QCanvas
// with a define, so that this memory X11 effect can
@@ -115,34 +114,31 @@
m_Type(Uml::DiagramType::Undefined),
m_Name(QString()),
m_Documentation(QString()),
- m_view(view)
+ m_bUseSnapToGrid(false),
+ m_bUseSnapComponentSizeToGrid(false),
+ m_isOpen(true),
+ m_nSnapX(10),
+ m_nSnapY(10),
+ m_bShowSnapGrid(false),
+ m_nCollaborationId(0),
+ m_bPaste(false),
+ m_pMenu(0),
+ m_view(view),
+ m_pFolder(parentFolder),
+ m_pIDChangesLog(0),
+ m_isActivated(false),
+ m_bPopupShowing(false)
{
- // Initialize loaded/saved data
- m_bUseSnapToGrid = false;
- m_bUseSnapComponentSizeToGrid = false;
- m_bShowSnapGrid = false;
- m_isOpen = true;
- m_nSnapX = 10;
- m_nSnapY = 10;
- setSize(UMLScene::defaultCanvasSize, UMLScene::defaultCanvasSize);
- m_nCollaborationId = 0;
-
- // Initialize other data
//m_AssociationList.setAutoDelete( true );
//m_WidgetList.setAutoDelete( true );
//m_MessageList.setAutoDelete( true );
- //Setup up booleans
- m_bPaste = false;
- m_isActivated = false;
+ setSize(UMLScene::defaultCanvasSize, UMLScene::defaultCanvasSize);
+
m_bCreateObject = false;
m_bDrawSelectedOnly = false;
- m_bPopupShowing = false;
m_bStartedCut = false;
- //clear pointers
m_PastePoint = UMLScenePoint(0, 0);
- m_pIDChangesLog = 0;
- m_pMenu = 0;
m_pImageExporter = new UMLViewImageExporter(this);
@@ -168,7 +164,6 @@
this, SLOT(slotCutSuccessful()));
m_doc = UMLApp::app()->document();
- m_pFolder = parentFolder;
DEBUG_REGISTER(DBG_SRC);
}
@@ -748,8 +743,9 @@
UMLWidget* newWidget = Widget_Factory::createWidget(this, o);
- if (newWidget == NULL)
+ if (!newWidget) {
return;
+ }
newWidget->setVisible(true);
newWidget->setActivated();
@@ -1045,18 +1041,18 @@
UMLWidget *UMLScene::widgetAt(const UMLScenePoint& p)
{
int relativeSize = 10000; // start with an arbitrary large number
- UMLWidget *retObj = NULL;
+ UMLWidget *retWid = 0;
UMLWidgetListIt it(m_WidgetList);
- foreach(UMLWidget* obj, m_WidgetList) {
- const int s = obj->onWidget(p);
+ foreach(UMLWidget* wid, m_WidgetList) {
+ const int s = wid->onWidget(p);
if (!s)
continue;
if (s < relativeSize) {
relativeSize = s;
- retObj = obj;
+ retWid = wid;
}
}
- return retObj;
+ return retWid;
}
/**
@@ -1071,8 +1067,9 @@
MessageWidgetListIt it(m_MessageList);
foreach(MessageWidget *obj , m_MessageList) {
- if (! obj->contains(w))
+ if (! obj->contains(w)) {
continue;
+ }
//make sure message doesn't have any associations
removeAssociations(obj);
obj->cleanup();
@@ -1634,12 +1631,12 @@
*/
void UMLScene::makeSelected(UMLWidget * uw)
{
- if (uw == NULL)
- return;
+ if (uw) {
uw->setSelected(true);
m_selectedList.removeAll(uw); // make sure not in there
m_selectedList.append(uw);
}
+}
/**
* Selects all the widgets of the given association widget.
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/floatingtextwidget.h #1292612:1292613
@@ -30,7 +30,6 @@
* The differences between all these different uses will be the popup menu
* that is associated with it.
*
- * @short Displays a line of text or an operation.
* @author Paul Hensgen <phensgen at techie.com>
* @see UMLWidget
* Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
More information about the umbrello-devel
mailing list