Hello community, here is the log from the commit of package umbrello for openSUSE:Factory checked in at 2016-09-24 15:27:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/umbrello (Old) and /work/SRC/openSUSE:Factory/.umbrello.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "umbrello" Changes: -------- --- /work/SRC/openSUSE:Factory/umbrello/umbrello.changes 2016-08-31 00:09:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.umbrello.new/umbrello.changes 2016-09-24 15:27:40.000000000 +0200 @@ -1,0 +2,8 @@ +Fri Sep 9 08:44:50 UTC 2016 - [email protected] + +- Update to KDE Applications 16.08.1 + * KDE Applications 16.08.1 + * https://www.kde.org/announcements/announce-applications-16.08.1.php + + +------------------------------------------------------------------- Old: ---- umbrello-16.08.0.tar.xz New: ---- umbrello-16.08.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ umbrello.spec ++++++ --- /var/tmp/diff_new_pack.bWBPV7/_old 2016-09-24 15:27:41.000000000 +0200 +++ /var/tmp/diff_new_pack.bWBPV7/_new 2016-09-24 15:27:41.000000000 +0200 @@ -24,7 +24,7 @@ License: GPL-2.0 and GFDL-1.2 Group: Development/Tools/Other Url: http://www.kde.org/ -Version: 16.08.0 +Version: 16.08.1 Release: 0 Source0: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ umbrello-16.08.0.tar.xz -> umbrello-16.08.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/CMakeLists.txt new/umbrello-16.08.1/CMakeLists.txt --- old/umbrello-16.08.0/CMakeLists.txt 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/CMakeLists.txt 2016-09-05 10:35:13.000000000 +0200 @@ -3,7 +3,7 @@ # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "16") set (KDE_APPLICATIONS_VERSION_MINOR "08") -set (KDE_APPLICATIONS_VERSION_MICRO "0") +set (KDE_APPLICATIONS_VERSION_MICRO "1") set(UMBRELLO_VERSION_MAJOR "2") MATH(EXPR UMBRELLO_VERSION_MINOR "12+${KDE_APPLICATIONS_VERSION_MINOR}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/doc/xml/umbrello-diagrams.dtd new/umbrello-16.08.1/doc/xml/umbrello-diagrams.dtd --- old/umbrello-16.08.0/doc/xml/umbrello-diagrams.dtd 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/doc/xml/umbrello-diagrams.dtd 2016-09-05 10:35:13.000000000 +0200 @@ -121,7 +121,9 @@ changeabilityB CDATA #IMPLIED roleBdoc CDATA #IMPLIED roleAdoc CDATA #IMPLIED - documentation CDATA #IMPLIED + documentation CDATA #IMPLIED + font CDATA #IMPLIED + seqnum CDATA #IMPLIED > <!ELEMENT linepath ANY > <!ATTLIST linepath diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/test/import/cxx/abstract-class.h new/umbrello-16.08.1/test/import/cxx/abstract-class.h --- old/umbrello-16.08.0/test/import/cxx/abstract-class.h 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-16.08.1/test/import/cxx/abstract-class.h 2016-09-05 10:35:13.000000000 +0200 @@ -0,0 +1,12 @@ + +class AbstractClass { +public: + virtual void test() = 0; + virtual void test1(); +}; + +class NoAbstractClass { +public: + virtual void test(); + virtual void test1(); +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/test/import/cxx/interface.h new/umbrello-16.08.1/test/import/cxx/interface.h --- old/umbrello-16.08.0/test/import/cxx/interface.h 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-16.08.1/test/import/cxx/interface.h 2016-09-05 10:35:13.000000000 +0200 @@ -0,0 +1,24 @@ +class Interface { +public: + static const int member; + virtual ~Interface(); + virtual void test() = 0; + virtual void test1() = 0; + virtual void test2() = 0; +}; + +class NoInterfaceWrongMember { +public: + const int member; + virtual void test() = 0; + virtual void test1() = 0; + virtual void test2() = 0; +}; + +class NoInterfaceNotAllMethodsPureVirtual { +public: + static const int member; + virtual void test(); + virtual void test1() = 0; + virtual void test2() = 0; +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/test/import/python/types.py new/umbrello-16.08.1/test/import/python/types.py --- old/umbrello-16.08.0/test/import/python/types.py 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-16.08.1/test/import/python/types.py 2016-09-05 10:35:13.000000000 +0200 @@ -0,0 +1,32 @@ +# coding=UTF-8 + +# see https://docs.python.org/3/tutorial/classes.html#class-and-instance-variables + +class Types(): + class_variable_bool_true=True + class_variable_bool_false=False + class_variable_int=3 + class_variable_negative_int=-54341 + class_variable_float=3.12334 + class_variable_negative_float=-1.0876544 + class_variable_string="1234" + class_variable_list=[] + class_variable_dict={} + class_variable_object=bpy.types.render + + # We import instance variables only from __init__() + def __init__(): + self.instance_variable_bool_true=True + self.instance_variable_bool_false=False + self.instance_variable_int=3 + self.instance_variable_negative_int=-54341 + self.instance_variable_float=3.12334 + self.instance_variable_negative_float=-1.9876 + self.test() # should be ignored + self.instance_variable_string="1234" + self.instance_variable_list=[] + self.instance_variable_dict={} + self.instance_variable_object=bpy.types.render + + def test(): + pass \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/test/import/python/visibility.py new/umbrello-16.08.1/test/import/python/visibility.py --- old/umbrello-16.08.0/test/import/python/visibility.py 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-16.08.1/test/import/python/visibility.py 2016-09-05 10:35:13.000000000 +0200 @@ -0,0 +1,19 @@ +# coding=UTF-8 + +class Visibility(): + __private=0 + _protected=0 + public=0 + + def public(self): + pass + + def _protected(self): + pass + + def __private(self): + pass + + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/CMakeLists.txt new/umbrello-16.08.1/umbrello/CMakeLists.txt --- old/umbrello-16.08.0/umbrello/CMakeLists.txt 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/CMakeLists.txt 2016-09-05 10:35:13.000000000 +0200 @@ -471,7 +471,6 @@ umlviewimageexportermodel.cpp uniqueid.cpp worktoolbar.cpp - icons.qrc ) set(umbrellomodels_SRCS @@ -508,6 +507,11 @@ set(LIB_BUILD_MODE STATIC) if(NOT BUILD_KF5) + if(CMAKE_MAJOR_VERSION LESS 3) + qt4_add_resources(libumbrello_SRCS icons.qrc) + else() + list(APPEND libumbrello_SRCS icons.qrc) + endif() kde4_add_library(libumbrello ${LIB_BUILD_MODE} ${libumbrello_SRCS}) set_target_properties(libumbrello PROPERTIES OUTPUT_NAME umbrello) target_link_libraries(libumbrello @@ -523,6 +527,11 @@ kde4_add_executable(umbrello ${umbrello_SRCS}) target_link_libraries(umbrello ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${KDE4_KTEXTEDITOR_LIBS} ${KDE4_KFILE_LIBS} libumbrello) else() + if(CMAKE_MAJOR_VERSION LESS 3) + qt5_add_resources(libumbrello_SRCS icons.qrc) + else() + list(APPEND libumbrello_SRCS icons.qrc) + endif() add_library(libumbrello ${LIB_BUILD_MODE} ${libumbrello_SRCS}) set_target_properties(libumbrello PROPERTIES OUTPUT_NAME umbrello) target_link_libraries(libumbrello diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/assocrules.cpp new/umbrello-16.08.1/umbrello/assocrules.cpp --- old/umbrello-16.08.0/umbrello/assocrules.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/assocrules.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -409,6 +409,7 @@ { Uml::AssociationType::Generalization, WidgetBase::wt_Class, WidgetBase::wt_Datatype, false, false, false, false }, { Uml::AssociationType::Generalization, WidgetBase::wt_Class, WidgetBase::wt_Class, false, false, false, false }, { Uml::AssociationType::Generalization, WidgetBase::wt_Interface, WidgetBase::wt_Interface, false, false, false, false }, + { Uml::AssociationType::Generalization, WidgetBase::wt_Interface, WidgetBase::wt_Class, false, false, false, false }, { Uml::AssociationType::Generalization, WidgetBase::wt_UseCase, WidgetBase::wt_UseCase, false, false, false, false }, { Uml::AssociationType::Generalization, WidgetBase::wt_Actor, WidgetBase::wt_Actor, false, false, false, false }, { Uml::AssociationType::Generalization, WidgetBase::wt_Component, WidgetBase::wt_Interface, false, false, false, false }, @@ -441,6 +442,7 @@ { Uml::AssociationType::Realization, WidgetBase::wt_Component, WidgetBase::wt_Interface, false, false, false, false }, { Uml::AssociationType::Realization, WidgetBase::wt_Package, WidgetBase::wt_Interface, false, false, false, false }, { Uml::AssociationType::Composition, WidgetBase::wt_Class, WidgetBase::wt_Class, true, true, false, true }, + { Uml::AssociationType::Composition, WidgetBase::wt_Interface, WidgetBase::wt_Interface, true, true, false, false }, { Uml::AssociationType::Composition, WidgetBase::wt_Class, WidgetBase::wt_Interface, true, true, false, false }, { Uml::AssociationType::Composition, WidgetBase::wt_Class, WidgetBase::wt_Enum, true, true, false, false }, { Uml::AssociationType::Composition, WidgetBase::wt_Class, WidgetBase::wt_Datatype, false, false, false, false }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/cmds/cmd_createDiagram.cpp new/umbrello-16.08.1/umbrello/cmds/cmd_createDiagram.cpp --- old/umbrello-16.08.0/umbrello/cmds/cmd_createDiagram.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/cmds/cmd_createDiagram.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -20,12 +20,13 @@ namespace Uml { - CmdCreateDiagram::CmdCreateDiagram(UMLDoc* doc, Uml::DiagramType::Enum type, const QString& name) + CmdCreateDiagram::CmdCreateDiagram(UMLDoc* doc, Uml::DiagramType::Enum type, const QString& name, UMLFolder *parent) : QUndoCommand(), m_name(name), m_type(type), m_pUMLDoc(doc), - m_pUMLView(0) + m_pUMLView(0), + m_parent(parent) { QString msg = i18n("Create diagram %1: %2", DiagramType::toString(type), name); setText(msg); @@ -41,7 +42,7 @@ { if (!m_pUMLDoc->findView(m_type, m_name, true)) { Uml::ModelType::Enum modelType = Model_Utils::convert_DT_MT(m_type); - UMLFolder* folder = m_pUMLDoc->rootFolder(modelType); + UMLFolder* folder = m_parent ? m_parent : m_pUMLDoc->rootFolder(modelType); m_pUMLView = m_pUMLDoc->createDiagram(folder, m_type, m_name, m_sceneId); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/cmds/cmd_createDiagram.h new/umbrello-16.08.1/umbrello/cmds/cmd_createDiagram.h --- old/umbrello-16.08.0/umbrello/cmds/cmd_createDiagram.h 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/cmds/cmd_createDiagram.h 2016-09-05 10:35:13.000000000 +0200 @@ -17,13 +17,14 @@ class UMLDoc; class UMLView; +class UMLFolder; namespace Uml { class CmdCreateDiagram : public QUndoCommand { public: - explicit CmdCreateDiagram(UMLDoc* doc, Uml::DiagramType::Enum type, const QString& name); + explicit CmdCreateDiagram(UMLDoc* doc, Uml::DiagramType::Enum type, const QString& name, UMLFolder *parent=0); ~CmdCreateDiagram(); void redo(); @@ -35,6 +36,7 @@ UMLDoc* m_pUMLDoc; UMLView* m_pUMLView; Uml::ID::Type m_sceneId; + UMLFolder* m_parent; }; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codegenerators/python/pythonwriter.cpp new/umbrello-16.08.1/umbrello/codegenerators/python/pythonwriter.cpp --- old/umbrello-16.08.0/umbrello/codegenerators/python/pythonwriter.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codegenerators/python/pythonwriter.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -453,6 +453,7 @@ l.append(QLatin1String("tuple")); l.append(QLatin1String("float")); l.append(QLatin1String("int")); + l.append(QLatin1String("list")); l.append(QLatin1String("long")); l.append(QLatin1String("dict")); l.append(QLatin1String("object")); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/csharp/csharpimport.cpp new/umbrello-16.08.1/umbrello/codeimport/csharp/csharpimport.cpp --- old/umbrello-16.08.0/umbrello/codeimport/csharp/csharpimport.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/csharp/csharpimport.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -692,13 +692,14 @@ log(keyword + QLatin1Char(' ') + name); UMLObject *ns = Import_Utils::createUMLObject(ot, name, currentScope(), m_comment); pushScope(m_klass = static_cast<UMLClassifier*>(ns)); - m_klass->setAbstract(m_isAbstract); m_klass->setStatic(m_isStatic); m_klass->setVisibilityCmd(m_currentAccess); // The UMLObject found by createUMLObject might originally have been created as a // placeholder with a type of class but if is really an interface, then we need to // change it. m_klass->setBaseType(ot); + // TODO: UMLClassifier::setBaseType() resets abstract flag + m_klass->setAbstract(m_isAbstract); m_isAbstract = m_isStatic = false; // if no modifier is specified in an interface, then it means public if (m_klass->isInterface()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/javaimport.cpp new/umbrello-16.08.1/umbrello/codeimport/javaimport.cpp --- old/umbrello-16.08.0/umbrello/codeimport/javaimport.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/javaimport.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -301,13 +301,14 @@ UMLObject *ns = Import_Utils::createUMLObject(ot, name, currentScope(), m_comment); m_klass = static_cast<UMLClassifier*>(ns); pushScope(m_klass); - m_klass->setAbstract(m_isAbstract); m_klass->setStatic(m_isStatic); m_klass->setVisibilityCmd(m_currentAccess); // The UMLObject found by createUMLObject might originally have been created as a // placeholder with a type of class but if is really an interface, then we need to // change it. m_klass->setBaseType(ot); + // TODO: UMLClassifier::setBaseType() resets abstract flag + m_klass->setAbstract(m_isAbstract); m_isAbstract = m_isStatic = false; // if no modifier is specified in an interface, then it means public if (m_klass->isInterface()) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp new/umbrello-16.08.1/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp --- old/umbrello-16.08.0/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/kdevcppparser/cpptree2uml.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -401,6 +401,21 @@ m_currentScope.pop_back(); + // check is class is an interface + bool isInterface = true; + foreach(UMLOperation *op, klass->getOpList()) { + if (!op->isDestructorOperation() && op->isAbstract() == false) + isInterface = false; + } + + foreach(UMLAttribute *attr, klass->getAttributeList()) { + if (!(attr->isStatic() && attr->getTypeName().contains(QLatin1String("const")))) + isInterface = false; + } + + if (isInterface) + klass->setBaseType(UMLObject::ot_Interface); + m_currentAccess = oldAccess; m_inSlots = oldInSlots; m_inSignals = oldInSignals; @@ -573,6 +588,8 @@ parseFunctionArguments(d, m); Import_Utils::insertMethod(c, m, m_currentAccess, returnType, isStatic, isPure, isFriend, isConstructor, m_comment); + if (isPure) + c->setAbstract(true); m_comment = QString(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/nativeimportbase.cpp new/umbrello-16.08.1/umbrello/codeimport/nativeimportbase.cpp --- old/umbrello-16.08.0/umbrello/codeimport/nativeimportbase.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/nativeimportbase.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -179,6 +179,17 @@ } /** + * Get the next lexeme without advancing. + * @return the next lexeme or an empty string + */ +QString NativeImportBase::lookAhead() +{ + if (m_srcIndex < m_source.count() - 1) + return m_source[m_srcIndex+1]; + return QString(); +} + +/** * Advance m_srcIndex until m_source[m_srcIndex] contains a non-comment. * Comments encountered during advancement are accumulated in `m_comment'. * If m_srcIndex hits the end of m_source then QString() is returned. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/nativeimportbase.h new/umbrello-16.08.1/umbrello/codeimport/nativeimportbase.h --- old/umbrello-16.08.0/umbrello/codeimport/nativeimportbase.h 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/nativeimportbase.h 2016-09-05 10:35:13.000000000 +0200 @@ -83,6 +83,7 @@ void skipStmt(const QString& until = QLatin1String(";")); bool skipToClosing(QChar opener); + QString lookAhead(); virtual QString advance(); void pushScope(UMLPackage *p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/pythonimport.cpp new/umbrello-16.08.1/umbrello/codeimport/pythonimport.cpp --- old/umbrello-16.08.0/umbrello/codeimport/pythonimport.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/pythonimport.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -208,13 +208,72 @@ } /** + * Parse assignments in the form <identifier> '=' <value> + * Instance variables are identified by a prefixed 'self.'. + * @return success status of parsing + */ +bool PythonImport::parseAssignmentStmt(const QString keyword) +{ + QString variable = keyword; + advance(); + QString value = advance(); + if (value == QLatin1String("-")) + value.append(advance()); + + bool isStatic = true; + if (variable.startsWith(QLatin1String("self."))) { + variable.remove(0,5); + isStatic = false; + } + Uml::Visibility::Enum visibility = Uml::Visibility::Public; + if (variable.startsWith(QLatin1String("__"))) { + visibility = Uml::Visibility::Private; + variable.remove(0, 2); + } else if (variable.startsWith(QLatin1String("_"))) { + visibility = Uml::Visibility::Protected; + variable.remove(0, 1); + } + QString type; + if (value == QLatin1String("[")) { + if (lookAhead() == QLatin1String("]")) { + advance(); + type = QLatin1String("list"); + value = QLatin1String(""); + } + } else if (value == QLatin1String("{")) { + if (lookAhead() == QLatin1String("}")) { + advance(); + type = QLatin1String("dict"); + value = QLatin1String(""); + } + } else if (value.startsWith(QLatin1String("\""))) { + type = QLatin1String("string"); + } else if (value == QLatin1String("True") || value == QLatin1String("False")) { + type = QLatin1String("bool"); + } else if (value.contains(QRegExp(QLatin1String("-?\\d+\\.\\d*")))) { + type = QLatin1String("float"); + } else if (value.contains(QRegExp(QLatin1String("-?\\d+")))) { + type = QLatin1String("int"); + } else if (!value.isEmpty()) { + type = QLatin1String("object"); + } + + UMLObject* o = Import_Utils::insertAttribute(m_klass, visibility, variable, + type, m_comment, false); + UMLAttribute* a = dynamic_cast<UMLAttribute*>(o); + a->setInitialValue(value); + a->setStatic(isStatic); + return true; +} + +/** * Implement abstract operation from NativeImportBase. * @return success status of operation */ bool PythonImport::parseStmt() { const int srcLength = m_source.count(); - const QString& keyword = m_source[m_srcIndex]; + QString keyword = m_source[m_srcIndex]; if (keyword == QLatin1String("class")) { const QString& name = advance(); UMLObject *ns = Import_Utils::createUMLObject(UMLObject::ot_Class, name, @@ -281,16 +340,47 @@ m_isStatic, false /*isAbstract*/, false /*isFriend*/, false /*isConstructor*/, m_comment); m_isStatic = false; + int srcIndex = m_srcIndex; op->setSourceCode(skipBody()); if (!op->hasDoc() && !m_comment.isEmpty()) { op->setDoc(m_comment); m_comment = QString(); } + + // parse instance variables from __init__ method + if (name == QLatin1String("__init__")) { + int indexSave = m_srcIndex; + m_srcIndex = srcIndex; + advance(); + keyword = advance(); + while (m_srcIndex < indexSave) { + if (lookAhead() == QLatin1String("=")) { + parseAssignmentStmt(keyword); + // skip ; inserted by lexer + if (lookAhead() == QLatin1String(";")) { + advance(); + keyword = advance(); + } + } else { + skipStmt(QLatin1String(";")); + keyword = advance(); + } + } + m_srcIndex = indexSave; + } log(QLatin1String("def ") + name); return true; } + + // parse class variables + if (m_klass && lookAhead() == QLatin1String("=")) { + bool result = parseAssignmentStmt(keyword); + log(QLatin1String("class attribute ") + keyword); + return result; + } + if (keyword == QLatin1String("}")) { if (scopeIndex()) { m_klass = dynamic_cast<UMLClassifier*>(popScope()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/codeimport/pythonimport.h new/umbrello-16.08.1/umbrello/codeimport/pythonimport.h --- old/umbrello-16.08.0/umbrello/codeimport/pythonimport.h 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/codeimport/pythonimport.h 2016-09-05 10:35:13.000000000 +0200 @@ -27,6 +27,8 @@ protected: void initVars(); + bool parseAssignmentStmt(const QString keyword); + bool parseStmt(); void fillSource(const QString& line); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/dialogs/pages/classifierlistpage.cpp new/umbrello-16.08.1/umbrello/dialogs/pages/classifierlistpage.cpp --- old/umbrello-16.08.0/umbrello/dialogs/pages/classifierlistpage.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/dialogs/pages/classifierlistpage.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -371,7 +371,12 @@ // now update screen m_docTE->setText(listItem->doc()); if (m_itemType == UMLObject::ot_Operation) { - m_pCodeTE->setPlainText(dynamic_cast<UMLOperation*>(listItem)->getSourceCode()); + UMLOperation* o = dynamic_cast<UMLOperation*>(listItem); + if (!o) { + uError() << "Dynamic cast to UMLOperation failed for" << listItem->name(); + return; + } + m_pCodeTE->setPlainText(o->getSourceCode()); } enableWidgets(true); m_pOldListItem = listItem; @@ -787,28 +792,54 @@ switch (m_itemType) { case UMLObject::ot_Attribute: { UMLAttribute *att = dynamic_cast<UMLAttribute*>(listitem); + if (!att) { + uError() << "Dynamic cast to UMLAttribute failed for" << listitem->name(); + return false; + } return m_pClassifier->addAttribute(att, NULL, position); } case UMLObject::ot_Operation: { UMLOperation *op = dynamic_cast<UMLOperation*>(listitem); + if (!op) { + uError() << "Dynamic cast to UMLOperation failed for" << listitem->name(); + return false; + } return m_pClassifier->addOperation(op, position); } case UMLObject::ot_Template: { UMLTemplate* t = dynamic_cast<UMLTemplate*>(listitem); + if (!t) { + uError() << "Dynamic cast to UMLTemplate failed for" << listitem->name(); + return false; + } return m_pClassifier->addTemplate(t, position); } case UMLObject::ot_EnumLiteral: { UMLEnum* c = dynamic_cast<UMLEnum*>(m_pClassifier); - if (c) { - return c->addEnumLiteral(dynamic_cast<UMLEnumLiteral*>(listitem), position); + if (!c) { + uError() << "Dynamic cast to UMLEnum failed for" << m_pClassifier->name(); + return false; + } + UMLEnumLiteral *l = dynamic_cast<UMLEnumLiteral*>(listitem); + if (!l) { + uError() << "Dynamic cast to UMLEnumLiteral failed for" << listitem->name(); + return false; } + return c->addEnumLiteral(l, position); break; } case UMLObject::ot_EntityAttribute: { UMLEntity* c = dynamic_cast<UMLEntity*>(m_pClassifier); - if (c) { - return c->addEntityAttribute(dynamic_cast<UMLEntityAttribute*>(listitem), position); + if (!c) { + uError() << "Dynamic cast to UMLEntity failed for" << m_pClassifier->name(); + return false; + } + UMLEntityAttribute *a = dynamic_cast<UMLEntityAttribute*>(listitem); + if (!a) { + uError() << "Dynamic cast to UMLEntityAttribute failed for" << listitem->name(); + return false; } + return c->addEntityAttribute(a, position); break; } default: { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/dialogs/umlenumliteraldialog.cpp new/umbrello-16.08.1/umbrello/dialogs/umlenumliteraldialog.cpp --- old/umbrello-16.08.0/umbrello/dialogs/umlenumliteraldialog.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/dialogs/umlenumliteraldialog.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -15,6 +15,7 @@ // app includes #include "enumliteral.h" #include "classifier.h" +#include "debug_utils.h" #include "dialog_utils.h" // kde includes @@ -89,6 +90,10 @@ return false; } UMLClassifier * pConcept = dynamic_cast<UMLClassifier *>(m_pEnumLiteral->parent()); + if (!pConcept) { + uError() << "Could not get parent of enum literal '" << m_pEnumLiteral->name() << "'"; + return false; + } UMLObject *o = pConcept->findChildObject(name); if (o && o != m_pEnumLiteral) { KMessageBox::error(this, i18n("The attribute name you have chosen is already being used in this operation."), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/activity-export.desktop new/umbrello-16.08.1/umbrello/layouts/activity-export.desktop --- old/umbrello-16.08.0/umbrello/layouts/activity-export.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/activity-export.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਲੇਆਉਟ ਐਕਸਪੋਰਟ Name[pl]=Eksportuj układ Name[pt]=Exportar a Disposição -Name[pt_BR]=Exportar leiaute +Name[pt_BR]=Exportar layout Name[ru]=Шаблон экспорта Name[sk]=Exportovať rozloženie Name[sl]=Izvozi postavitev @@ -61,7 +61,7 @@ Comment[nl]=Indeling voor activiteitsdiagrammen exporteren Comment[pl]=Eksportuj układ dla diagramów działań Comment[pt]=Exportar a Disposição dos Diagramas de Actividades -Comment[pt_BR]=Exportar leiaute para diagramas de atividades +Comment[pt_BR]=Exportar layout para diagramas de atividades Comment[ru]=Шаблон экспорта для диаграмм деятельности Comment[sk]=Exportovať rozloženie pre diagramy aktivít Comment[sl]=Izvozi postavitev za diagrame dejavnosti diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/activity-vertical.desktop new/umbrello-16.08.1/umbrello/layouts/activity-vertical.desktop --- old/umbrello-16.08.0/umbrello/layouts/activity-vertical.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/activity-vertical.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਵਰਟੀਕਲ ਲੇਆਉਟ Name[pl]=Układ pionowy Name[pt]=Disposição Vertical -Name[pt_BR]=Leiaute vertical +Name[pt_BR]=Layout vertical Name[ru]=Вертикальный шаблон Name[sk]=Zvislé rozloženie Name[sl]=Navpična postavitev @@ -60,7 +60,7 @@ Comment[nl]=Indeling die zich verticaal laat weergeven Comment[pl]=Układ, który wyświetla pionowo Comment[pt]=Uma disposição que representa os itens na vertical -Comment[pt_BR]=Leiaute que representa os itens na vertical +Comment[pt_BR]=Layout que representa os itens na vertical Comment[ru]=Шаблон с расположением по вертикали Comment[sk]=Rozloženie, ktoré renderuje zvislo Comment[sl]=Postavitev, ki se izriše navpično diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/class-export.desktop new/umbrello-16.08.1/umbrello/layouts/class-export.desktop --- old/umbrello-16.08.0/umbrello/layouts/class-export.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/class-export.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਲੇਆਉਟ ਐਕਸਪੋਰਟ Name[pl]=Eksportuj układ Name[pt]=Exportar a Disposição -Name[pt_BR]=Exportar leiaute +Name[pt_BR]=Exportar layout Name[ru]=Шаблон экспорта Name[sk]=Exportovať rozloženie Name[sl]=Izvozi postavitev @@ -61,7 +61,7 @@ Comment[nl]=Indeling voor klassediagrammen exporteren Comment[pl]=Eksportuj układ dla diagramów klas Comment[pt]=Exportar a Disposição dos Diagramas de Classes -Comment[pt_BR]=Exportar leiaute para diagramas de classe +Comment[pt_BR]=Exportar layout para diagramas de classe Comment[ru]=Шаблон экспорта для диаграмм классов Comment[sk]=Exportovať rozloženie pre diagramy tried Comment[sl]=Izvozi postavitev za diagrame razredov diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/class-horizontal.desktop new/umbrello-16.08.1/umbrello/layouts/class-horizontal.desktop --- old/umbrello-16.08.0/umbrello/layouts/class-horizontal.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/class-horizontal.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -24,7 +24,7 @@ Name[pa]=ਹਰੀਜੱਟਲ ਲੇਆਉਟ Name[pl]=Układ poziomy Name[pt]=Disposição Horizontal -Name[pt_BR]=Leiaute horizontal +Name[pt_BR]=Layout horizontal Name[ru]=Горизонтальный шаблон Name[sk]=Vodorovné rozloženie Name[sl]=Vodoravna postavitev @@ -59,7 +59,7 @@ Comment[nl]=Indeling die zich horizontaal laat weergeven Comment[pl]=Układ, który wyświetla poziomo Comment[pt]=Uma disposição que representa os itens na horizontal -Comment[pt_BR]=Leiaute que representa os itens na horizontal +Comment[pt_BR]=Layout que representa os itens na horizontal Comment[ru]=Шаблон с расположением по горизонтали Comment[sk]=Rozloženie, ktoré renderuje vodorovne Comment[sl]=Postavitev, ki se izriše vodoravno diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/class-vertical.desktop new/umbrello-16.08.1/umbrello/layouts/class-vertical.desktop --- old/umbrello-16.08.0/umbrello/layouts/class-vertical.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/class-vertical.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਵਰਟੀਕਲ ਲੇਆਉਟ Name[pl]=Układ pionowy Name[pt]=Disposição Vertical -Name[pt_BR]=Leiaute vertical +Name[pt_BR]=Layout vertical Name[ru]=Вертикальный шаблон Name[sk]=Zvislé rozloženie Name[sl]=Navpična postavitev @@ -60,7 +60,7 @@ Comment[nl]=Indeling die zich verticaal laat weergeven Comment[pl]=Układ, który wyświetla pionowo Comment[pt]=Uma disposição que representa os itens na vertical -Comment[pt_BR]=Leiaute que representa os itens na vertical +Comment[pt_BR]=Layout que representa os itens na vertical Comment[ru]=Шаблон с расположением по вертикали Comment[sk]=Rozloženie, ktoré renderuje zvislo Comment[sl]=Postavitev, ki se izriše navpično diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/state-export.desktop new/umbrello-16.08.1/umbrello/layouts/state-export.desktop --- old/umbrello-16.08.0/umbrello/layouts/state-export.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/state-export.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਲੇਆਉਟ ਐਕਸਪੋਰਟ Name[pl]=Eksportuj układ Name[pt]=Exportar a Disposição -Name[pt_BR]=Exportar leiaute +Name[pt_BR]=Exportar layout Name[ru]=Шаблон экспорта Name[sk]=Exportovať rozloženie Name[sl]=Izvozi postavitev @@ -60,7 +60,7 @@ Comment[nl]=Indeling voor statusdiagrammen exporteren Comment[pl]=Eksportuj układ dla diagramów stanu Comment[pt]=Exportar a Disposição dos Diagramas de Estados -Comment[pt_BR]=Exportar leiaute para diagramas de estado +Comment[pt_BR]=Exportar layout para diagramas de estado Comment[ru]=Шаблон экспорта для диаграмм состояний Comment[sk]=Exportovať rozloženie pre stavové diagramy Comment[sl]=Izvozi postavitev za diagrame stanja diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/state-vertical.desktop new/umbrello-16.08.1/umbrello/layouts/state-vertical.desktop --- old/umbrello-16.08.0/umbrello/layouts/state-vertical.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/state-vertical.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -25,7 +25,7 @@ Name[pa]=ਵਰਟੀਕਲ ਲੇਆਉਟ Name[pl]=Układ pionowy Name[pt]=Disposição Vertical -Name[pt_BR]=Leiaute vertical +Name[pt_BR]=Layout vertical Name[ru]=Вертикальный шаблон Name[sk]=Zvislé rozloženie Name[sl]=Navpična postavitev @@ -60,7 +60,7 @@ Comment[nl]=Indeling die zich verticaal laat weergeven Comment[pl]=Układ, który wyświetla pionowo Comment[pt]=Uma disposição que representa os itens na vertical -Comment[pt_BR]=Leiaute que representa os itens na vertical +Comment[pt_BR]=Layout que representa os itens na vertical Comment[ru]=Шаблон с расположением по вертикали Comment[sk]=Rozloženie, ktoré renderuje zvislo Comment[sl]=Postavitev, ki se izriše navpično diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/layouts/usecase-default.desktop new/umbrello-16.08.1/umbrello/layouts/usecase-default.desktop --- old/umbrello-16.08.0/umbrello/layouts/usecase-default.desktop 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/layouts/usecase-default.desktop 2016-09-05 10:35:13.000000000 +0200 @@ -21,7 +21,7 @@ Name[nl]=Standaard indeling van gebruiksgeval Name[pl]=Domyślny układ UseCase Name[pt]=Disposição de Casos de Uso -Name[pt_BR]=Leiaute padrão de casos de uso +Name[pt_BR]=Layout padrão de casos de uso Name[ru]=Стандартный шаблон диаграммы прецедентов Name[sk]=Predvolené rozloženie Usecase Name[sl]=Privzeta postavitev primera uporabe @@ -57,7 +57,7 @@ Comment[nl]=Standaard indeling van gebruiksgeval Comment[pl]=Domyślny układ UseCase Comment[pt]=Disposição Predefinida de Casos de Uso -Comment[pt_BR]=Leiaute padrão de casos de uso +Comment[pt_BR]=Layout padrão de casos de uso Comment[ru]=Стандартный шаблон диаграммы прецедентов Comment[sk]=Predvolené rozloženie Usecase Comment[sl]=Privzeta postavitev primera uporabe diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/listpopupmenu.cpp new/umbrello-16.08.1/umbrello/listpopupmenu.cpp --- old/umbrello-16.08.0/umbrello/listpopupmenu.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/listpopupmenu.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -834,10 +834,8 @@ break; case mt_Component_Diagram: { - QAction* act = UMLApp::app()->actionCollection()->action(QLatin1String("new_component_diagram")); - //don't keep a local copy of pointer which resides somewhere else (in this case - in actionCollection()) - //m_actions[m] = act; - menu->addAction(act); + QAction* action = UMLApp::app()->actionCollection()->action(QLatin1String("new_component_diagram")); + insert(mt_Component_Diagram, menu, action->icon(), action->text()); } break; case mt_Node: @@ -845,9 +843,8 @@ break; case mt_Deployment_Diagram: { - QAction* act = UMLApp::app()->actionCollection()->action(QLatin1String("new_deployment_diagram")); - //m_actions[m] = act; - menu->addAction(act); + QAction* action = UMLApp::app()->actionCollection()->action(QLatin1String("new_deployment_diagram")); + insert(mt_Deployment_Diagram, menu, action->icon(), action->text()); } break; case mt_Deployment_Folder: @@ -861,9 +858,8 @@ break; case mt_EntityRelationship_Diagram: { - QAction* act = UMLApp::app()->actionCollection()->action(QLatin1String("new_entityrelationship_diagram")); - //m_actions[m] = act; - menu->addAction(act); + QAction* action = UMLApp::app()->actionCollection()->action(QLatin1String("new_entityrelationship_diagram")); + insert(mt_EntityRelationship_Diagram, menu, action->icon(), action->text()); } break; case mt_Category: @@ -877,9 +873,8 @@ break; case mt_UseCase_Diagram: { - QAction* act = UMLApp::app()->actionCollection()->action(QLatin1String("new_use_case_diagram")); - //m_actions[m] = act; - menu->addAction(act); + QAction* action = UMLApp::app()->actionCollection()->action(QLatin1String("new_use_case_diagram")); + insert(mt_UseCase_Diagram, menu, action->icon(), action->text()); } break; case mt_FloatText: @@ -1009,11 +1004,16 @@ insert(mt_Enum, menu, Icon_Utils::SmallIcon(Icon_Utils::it_Enum), i18n("Enum")); insert(mt_Package, menu, Icon_Utils::SmallIcon(Icon_Utils::it_Package), i18n("Package")); if (folderAndDiagrams) { - menu->addAction(UMLApp::app()->actionCollection()->action(QLatin1String("new_class_diagram"))); - menu->addAction(UMLApp::app()->actionCollection()->action(QLatin1String("new_sequence_diagram"))); - menu->addAction(UMLApp::app()->actionCollection()->action(QLatin1String("new_collaboration_diagram"))); - menu->addAction(UMLApp::app()->actionCollection()->action(QLatin1String("new_state_diagram"))); - menu->addAction(UMLApp::app()->actionCollection()->action(QLatin1String("new_activity_diagram"))); + QAction *action = UMLApp::app()->actionCollection()->action(QLatin1String("new_class_diagram")); + insert(mt_Class_Diagram, menu, action->icon(), action->text()); + action = UMLApp::app()->actionCollection()->action(QLatin1String("new_sequence_diagram")); + insert(mt_Sequence_Diagram, menu, action->icon(), action->text()); + action = UMLApp::app()->actionCollection()->action(QLatin1String("new_collaboration_diagram")); + insert(mt_Collaboration_Diagram, menu, action->icon(), action->text()); + action = UMLApp::app()->actionCollection()->action(QLatin1String("new_state_diagram")); + insert(mt_State_Diagram, menu, action->icon(), action->text()); + action = UMLApp::app()->actionCollection()->action(QLatin1String("new_activity_diagram")); + insert(mt_Activity_Diagram, menu, action->icon(), action->text()); } addMenu(menu); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/models/diagramsmodel.cpp new/umbrello-16.08.1/umbrello/models/diagramsmodel.cpp --- old/umbrello-16.08.0/umbrello/models/diagramsmodel.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/models/diagramsmodel.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -15,6 +15,7 @@ #include "umlview.h" #include "uml.h" #include "umldoc.h" +#include "folder.h" // kde includes #include <KLocalizedString> @@ -23,6 +24,7 @@ #include <QtDebug> DiagramsModel::DiagramsModel() + : m_count(0) { } @@ -38,7 +40,7 @@ { Q_UNUSED(parent); - return 3; + return 4; } QVariant DiagramsModel::headerData(int section, Qt::Orientation orientation, int role) const @@ -56,6 +58,8 @@ else if (section == 1) return QVariant(i18n("Type")); else if (section == 2) + return QVariant(i18n("Folder")); + else if (section == 3) return QVariant(i18n("Widgets/Associations")); else return QVariant(); } @@ -83,6 +87,8 @@ return v->umlScene()->name(); else if (index.column() == 1) return Uml::DiagramType::toStringI18n(v->umlScene()->type()); + else if (index.column() == 2) + return v->umlScene()->folder()->name(); else return QVariant(QString::number(v->umlScene()->widgetList().size()) + QLatin1String("/") @@ -124,6 +130,12 @@ void DiagramsModel::emitDataChanged(UMLView *view) { - int index = m_views.indexOf(view); - emitDataChanged(index); +#if QT_VERSION < 0x050000 + emit layoutAboutToBeChanged(); +#endif + int index = m_views.indexOf(view); + emitDataChanged(index); +#if QT_VERSION < 0x050000 + emit layoutChanged(); +#endif } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/uml.h new/umbrello-16.08.1/umbrello/uml.h --- old/umbrello-16.08.0/umbrello/uml.h 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/uml.h 2016-09-05 10:35:13.000000000 +0200 @@ -391,7 +391,7 @@ * It is kept empty so you can create your view according to your * application's needs by changing the view class. */ - UMLView* m_view; + QPointer<UMLView> m_view; /** * Doc represents your actual document and is created only once. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umldoc.cpp new/umbrello-16.08.1/umbrello/umldoc.cpp --- old/umbrello-16.08.0/umbrello/umldoc.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umldoc.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -285,6 +285,7 @@ UMLApp::app()->setDiagramMenuItemsState(true); } } + delete view; } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umllistview.cpp new/umbrello-16.08.1/umbrello/umllistview.cpp --- old/umbrello-16.08.0/umbrello/umllistview.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umllistview.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -45,6 +45,7 @@ #include "umlviewimageexporter.h" #include "usecase.h" #include "model_utils.h" +#include "models/diagramsmodel.h" #include "optionstate.h" #include "uniqueid.h" #include "idchangelog.h" @@ -335,6 +336,42 @@ ListPopupMenu::MenuType menuType = ListPopupMenu::typeFromAction(action); switch (menuType) { + case ListPopupMenu::mt_Activity_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Activity_Diagram); + break; + + case ListPopupMenu::mt_Class_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Class_Diagram); + break; + + case ListPopupMenu::mt_Collaboration_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Collaboration_Diagram); + break; + + case ListPopupMenu::mt_Component_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Component_Diagram); + break; + + case ListPopupMenu::mt_Deployment_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Deployment_Diagram); + break; + + case ListPopupMenu::mt_EntityRelationship_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_EntityRelationship_Diagram); + break; + + case ListPopupMenu::mt_Sequence_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_Sequence_Diagram); + break; + + case ListPopupMenu::mt_State_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_State_Diagram); + break; + + case ListPopupMenu::mt_UseCase_Diagram: + addNewItem(currItem, UMLListViewItem::lvt_UseCase_Diagram); + break; + case ListPopupMenu::mt_Class: addNewItem(currItem, UMLListViewItem::lvt_Class); break; @@ -1600,6 +1637,23 @@ srcPkg->removeObject(srcObj); } } + else if (Model_Utils::typeIsDiagram(srcType)) { + UMLView *v = m_doc->findView(srcId); + UMLFolder *newParentObj = dynamic_cast<UMLFolder*>(newParent->umlObject()); + if (v) { + UMLFolder *srcPkg = v->umlScene()->folder(); + if (srcPkg) { + if (srcPkg == newParentObj) { + uError() << v->umlScene()->name() << ": Object is already in target package"; + return 0; + } + srcPkg->removeView(v); + newParentObj->addView(v); + v->umlScene()->setFolder(newParentObj); + UMLApp::app()->document()->diagramsModel()->emitDataChanged(v); + } + } + } UMLListViewItem::ListViewType newParentType = newParent->type(); DEBUG(DBG_SRC) << "newParentType is " << UMLListViewItem::toString(newParentType); @@ -2153,6 +2207,18 @@ return; } + if (Model_Utils::typeIsDiagram(type)) { + Uml::DiagramType::Enum diagramType = Model_Utils::convert_LVT_DT(type); + QString diagramName = m_doc->createDiagramName(diagramType); + if (diagramName.isEmpty()) { + // creation was cancelled by the user + return; + } + UMLFolder* parent = dynamic_cast<UMLFolder*>(parentItem->umlObject()); + UMLApp::app()->executeCommand(new Uml::CmdCreateDiagram(m_doc, diagramType, diagramName, parent)); + return; + } + // Determine the ObjectType of the new object UMLObject::ObjectType objectType = Model_Utils::convert_LVT_OT(type); if (objectType == UMLObject::ot_UMLObject) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umllistviewitem.cpp new/umbrello-16.08.1/umbrello/umllistviewitem.cpp --- old/umbrello-16.08.0/umbrello/umllistviewitem.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umllistviewitem.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -409,7 +409,7 @@ if (Model_Utils::typeIsFolder(m_type)) { icon = (Icon_Utils::IconType)((int)icon + (int)isExpanded()); } -//FIXME KF5 setIcon(icon); + setIcon(icon); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlmodel/folder.cpp new/umbrello-16.08.1/umbrello/umlmodel/folder.cpp --- old/umbrello-16.08.0/umbrello/umlmodel/folder.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlmodel/folder.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -94,7 +94,6 @@ void UMLFolder::removeView(UMLView *view) { m_diagrams.removeAll(view); - delete view; } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/artifactwidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/artifactwidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/artifactwidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/artifactwidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -53,7 +53,7 @@ } if (umlObject()) { - UMLArtifact *umlart = static_cast<UMLArtifact*>(m_umlObject); + UMLArtifact *umlart = dynamic_cast<UMLArtifact*>(m_umlObject.data()); UMLArtifact::Draw_Type drawType = umlart->getDrawAsType(); switch (drawType) { case UMLArtifact::defaultDraw: @@ -97,7 +97,7 @@ if (!m_umlObject) { return UMLWidget::minimumSize(); } - UMLArtifact *umlart = static_cast<UMLArtifact*>(m_umlObject); + UMLArtifact *umlart = dynamic_cast<UMLArtifact*>(m_umlObject.data()); if (umlart->getDrawAsType() == UMLArtifact::defaultDraw) { return calculateNormalSize(); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/associationwidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/associationwidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/associationwidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/associationwidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -324,7 +324,7 @@ */ UMLOperation *AssociationWidget::operation() { - return dynamic_cast<UMLOperation*>(m_umlObject); + return dynamic_cast<UMLOperation*>(m_umlObject.data()); } /** @@ -567,7 +567,7 @@ { if (m_umlObject == NULL || m_umlObject->baseType() != UMLObject::ot_Association) return NULL; - return static_cast<UMLAssociation*>(m_umlObject); + return dynamic_cast<UMLAssociation*>(m_umlObject.data()); } /** @@ -583,7 +583,7 @@ UMLObject::ObjectType ot = m_umlObject->baseType(); if (ot != UMLObject::ot_Attribute && ot != UMLObject::ot_EntityAttribute) return NULL; - return static_cast<UMLAttribute*>(m_umlObject); + return dynamic_cast<UMLAttribute*>(m_umlObject.data()); } #if 0 //:TODO: @@ -1039,7 +1039,7 @@ { if (m_umlObject == NULL || m_umlObject->baseType() != UMLObject::ot_Association) return QString(); - UMLAssociation *umla = static_cast<UMLAssociation*>(m_umlObject); + UMLAssociation *umla = dynamic_cast<UMLAssociation*>(m_umlObject.data()); return umla->getRoleDoc(role); } @@ -1157,7 +1157,7 @@ { if (m_umlObject == NULL || m_umlObject->baseType() != UMLObject::ot_Association) return m_role[role].changeability; - UMLAssociation *umla = static_cast<UMLAssociation*>(m_umlObject); + UMLAssociation *umla = dynamic_cast<UMLAssociation*>(m_umlObject.data()); return umla->changeability(role); } @@ -1462,7 +1462,7 @@ { if (m_umlObject == NULL || m_umlObject->baseType() != UMLObject::ot_Association) return m_associationType; - UMLAssociation *umla = static_cast<UMLAssociation*>(m_umlObject); + UMLAssociation *umla = dynamic_cast<UMLAssociation*>(m_umlObject.data()); return umla->getAssocType(); } @@ -1511,7 +1511,7 @@ { if (m_role[role].umlWidget == NULL) { if (m_umlObject && m_umlObject->baseType() == UMLObject::ot_Association) { - UMLAssociation *umla = static_cast<UMLAssociation*>(m_umlObject); + UMLAssociation *umla = dynamic_cast<UMLAssociation*>(m_umlObject.data()); return umla->getObjectId(role); } uError() << "umlWidget is NULL"; @@ -1530,7 +1530,7 @@ { if (m_role[role].umlWidget == NULL) { if (m_umlObject && m_umlObject->baseType() == UMLObject::ot_Association) { - UMLAssociation *umla = static_cast<UMLAssociation*>(m_umlObject); + UMLAssociation *umla = dynamic_cast<UMLAssociation*>(m_umlObject.data()); return umla->getObjectId(role); } uError() << "umlWidget is NULL"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/categorywidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/categorywidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/categorywidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/categorywidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -70,7 +70,7 @@ painter->setPen(textColor()); QString letterType(QLatin1Char('D')); - switch(static_cast<UMLCategory*>(m_umlObject)->getType()) { + switch(dynamic_cast<UMLCategory*>(m_umlObject.data())->getType()) { case UMLCategory::ct_Disjoint_Specialisation: letterType = QLatin1Char('D'); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/classifierwidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/classifierwidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/classifierwidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/classifierwidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -137,7 +137,7 @@ */ UMLClassifier *ClassifierWidget::classifier() const { - return dynamic_cast<UMLClassifier*>(m_umlObject); + return dynamic_cast<UMLClassifier*>(m_umlObject.data()); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/componentwidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/componentwidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/componentwidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/componentwidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -55,7 +55,7 @@ Q_UNUSED(option); Q_UNUSED(widget); - UMLComponent *umlcomp = static_cast<UMLComponent*>(m_umlObject); + UMLComponent *umlcomp = dynamic_cast<UMLComponent*>(m_umlObject.data()); if (umlcomp == NULL) return; setPenFromSettings(painter); @@ -146,7 +146,7 @@ return; } UMLWidget::adjustAssocs(dx, dy); - UMLPackage *comp = static_cast<UMLPackage*>(m_umlObject); + UMLPackage *comp = dynamic_cast<UMLPackage*>(m_umlObject.data()); foreach (UMLObject *o, comp->containedObjects()) { uIgnoreZeroPointer(o); if (o->baseType() != UMLObject::ot_Port) @@ -196,7 +196,7 @@ int height = (2*fontHeight) + (COMPONENT_MARGIN * 3); - UMLComponent *umlcomp = static_cast<UMLComponent*>(m_umlObject); + UMLComponent *umlcomp = dynamic_cast<UMLComponent*>(m_umlObject.data()); if (umlcomp && umlcomp->getExecutable()) { width += 2; height += 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/entitywidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/entitywidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/entitywidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/entitywidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -103,7 +103,7 @@ painter->drawLine(0, y, w, y); QFontMetrics fontMetrics(font); - UMLClassifier *classifier = (UMLClassifier*)m_umlObject; + UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_umlObject.data()); UMLClassifierListItem* entityattribute = 0; UMLClassifierListItemList list = classifier->getFilteredList(UMLObject::ot_EntityAttribute); foreach (entityattribute, list) { @@ -146,7 +146,7 @@ ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(action); switch(sel) { case ListPopupMenu::mt_EntityAttribute: - if (Object_Factory::createChildObject(static_cast<UMLClassifier*>(m_umlObject), + if (Object_Factory::createChildObject(dynamic_cast<UMLClassifier*>(m_umlObject.data()), UMLObject::ot_EntityAttribute)) { UMLApp::app()->document()->setModified(); } @@ -154,19 +154,19 @@ case ListPopupMenu::mt_PrimaryKeyConstraint: case ListPopupMenu::mt_UniqueConstraint: - if (UMLObject* obj = Object_Factory::createChildObject(static_cast<UMLEntity*>(m_umlObject), + if (UMLObject* obj = Object_Factory::createChildObject(dynamic_cast<UMLEntity*>(m_umlObject.data()), UMLObject::ot_UniqueConstraint)) { UMLApp::app()->document()->setModified(); if (sel == ListPopupMenu::mt_PrimaryKeyConstraint) { UMLUniqueConstraint* uc = static_cast<UMLUniqueConstraint*>(obj); - static_cast<UMLEntity*>(m_umlObject)->setAsPrimaryKey(uc); + dynamic_cast<UMLEntity*>(m_umlObject.data())->setAsPrimaryKey(uc); } } break; case ListPopupMenu::mt_ForeignKeyConstraint: - if (Object_Factory::createChildObject(static_cast<UMLEntity*>(m_umlObject), + if (Object_Factory::createChildObject(dynamic_cast<UMLEntity*>(m_umlObject.data()), UMLObject::ot_ForeignKeyConstraint)) { UMLApp::app()->document()->setModified(); @@ -174,7 +174,7 @@ break; case ListPopupMenu::mt_CheckConstraint: - if (Object_Factory::createChildObject(static_cast<UMLEntity*>(m_umlObject), + if (Object_Factory::createChildObject(dynamic_cast<UMLEntity*>(m_umlObject.data()), UMLObject::ot_CheckConstraint)) { UMLApp::app()->document()->setModified(); @@ -209,7 +209,7 @@ lines++; } - const int numberOfEntityAttributes = ((UMLEntity*)m_umlObject)->entityAttributes(); + const int numberOfEntityAttributes = dynamic_cast<UMLEntity*>(m_umlObject.data())->entityAttributes(); height = width = 0; //set the height of the entity @@ -231,7 +231,7 @@ width = w > width ? w : width; - UMLClassifier* classifier = (UMLClassifier*)m_umlObject; + UMLClassifier* classifier = dynamic_cast<UMLClassifier*>(m_umlObject.data()); UMLClassifierListItemList list = classifier->getFilteredList(UMLObject::ot_EntityAttribute); UMLClassifierListItem* listItem = 0; foreach (listItem, list) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/enumwidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/enumwidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/enumwidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/enumwidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -138,7 +138,7 @@ painter->drawLine(0, y, w, y); QFontMetrics fontMetrics(font); - UMLClassifier *classifier = (UMLClassifier*)m_umlObject; + UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_umlObject.data()); UMLClassifierListItem* enumLiteral = 0; UMLClassifierListItemList list = classifier->getFilteredList(UMLObject::ot_EnumLiteral); foreach (enumLiteral, list) { @@ -189,7 +189,7 @@ { ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(action); if (sel == ListPopupMenu::mt_EnumLiteral) { - if (Object_Factory::createChildObject(static_cast<UMLClassifier*>(m_umlObject), + if (Object_Factory::createChildObject(dynamic_cast<UMLClassifier*>(m_umlObject.data()), UMLObject::ot_EnumLiteral)) { /* I don't know why it works without these calls: updateComponentSize(); @@ -223,7 +223,7 @@ int lines = 1;//always have one line - for name lines++; //for the stereotype - const int numberOfEnumLiterals = ((UMLEnum*)m_umlObject)->enumLiterals(); + const int numberOfEnumLiterals = dynamic_cast<UMLEnum*>(m_umlObject.data())->enumLiterals(); height = width = 0; //set the height of the enum @@ -247,7 +247,7 @@ width = w > width?w:width; - UMLClassifier *classifier = (UMLClassifier*)m_umlObject; + UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(m_umlObject.data()); UMLClassifierListItemList list = classifier->getFilteredList(UMLObject::ot_EnumLiteral); UMLClassifierListItem* listItem = 0; foreach (listItem, list) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/messagewidget.cpp new/umbrello-16.08.1/umbrello/umlwidgets/messagewidget.cpp --- old/umbrello-16.08.0/umbrello/umlwidgets/messagewidget.cpp 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/messagewidget.cpp 2016-09-05 10:35:13.000000000 +0200 @@ -936,7 +936,7 @@ */ UMLOperation *MessageWidget::operation() { - return static_cast<UMLOperation*>(m_umlObject); + return dynamic_cast<UMLOperation*>(m_umlObject.data()); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-16.08.0/umbrello/umlwidgets/widgetbase.h new/umbrello-16.08.1/umbrello/umlwidgets/widgetbase.h --- old/umbrello-16.08.0/umbrello/umlwidgets/widgetbase.h 2016-08-10 01:21:45.000000000 +0200 +++ new/umbrello-16.08.1/umbrello/umlwidgets/widgetbase.h 2016-09-05 10:35:13.000000000 +0200 @@ -19,6 +19,7 @@ #include <QGraphicsObject> #include <QObject> #include <QPainter> +#include <QPointer> // forward declarations class QAction; @@ -157,7 +158,7 @@ WidgetType m_baseType; ///< Type of widget. UMLScene *m_scene; - UMLObject *m_umlObject; + QPointer<UMLObject> m_umlObject; QString m_Doc; ///< Only used if m_umlObject is not set. QString m_Text; QRectF m_rect; ///< widget size
