Hello community, here is the log from the commit of package umbrello for openSUSE:Factory checked in at 2015-01-21 22:12:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2015-01-09 01:11:10.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.umbrello.new/umbrello.changes 2015-01-21 22:13:56.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Jan 12 20:15:50 UTC 2015 - tittiatc...@gmail.com + +- Update to KDE Applications 14.12.1 + * KDE Applications 14.12.1 + * See https://www.kde.org/announcements/announce-applications-14.12.1.php + +------------------------------------------------------------------- Old: ---- umbrello-14.12.0.tar.xz New: ---- umbrello-14.12.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ umbrello.spec ++++++ --- /var/tmp/diff_new_pack.7YZruX/_old 2015-01-21 22:13:57.000000000 +0100 +++ /var/tmp/diff_new_pack.7YZruX/_new 2015-01-21 22:13:57.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package umbrello # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ License: GPL-2.0 and GFDL-1.2 Group: Development/Tools/Other Url: http://www.kde.org/ -Version: 14.12.0 +Version: 14.12.1 Release: 0 Source0: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ umbrello-14.12.0.tar.xz -> umbrello-14.12.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/CMakeLists.txt new/umbrello-14.12.1/CMakeLists.txt --- old/umbrello-14.12.0/CMakeLists.txt 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/CMakeLists.txt 2014-12-30 11:47:35.000000000 +0100 @@ -8,7 +8,7 @@ set(VERSION_MAJOR "2") set(VERSION_MINOR "15") -set(VERSION_PATCH "0") +set(VERSION_PATCH "1") # set default umbrello version # umbrello version could be overridden by cmake command line using -DUMBRELLO_VERSION_STRING=major.minor.patch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/CMakeLists.txt new/umbrello-14.12.1/umbrello/CMakeLists.txt --- old/umbrello-14.12.0/umbrello/CMakeLists.txt 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/CMakeLists.txt 2014-12-30 11:47:35.000000000 +0100 @@ -51,6 +51,7 @@ ${CMAKE_CURRENT_SOURCE_DIR}/debug/ ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/ ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/pages/ + ${CMAKE_CURRENT_SOURCE_DIR}/dialogs/widgets/ ${CMAKE_CURRENT_SOURCE_DIR}/docgenerators/ ${CMAKE_CURRENT_SOURCE_DIR}/finder/ ${CMAKE_CURRENT_SOURCE_DIR}/refactoring/ @@ -222,6 +223,7 @@ dialogs/pages/diagramprintpage.cpp dialogs/pages/umlroleproperties.cpp dialogs/pages/umlwidgetstylepage.cpp + dialogs/widgets/documentationwidget.cpp ) kde4_add_ui_files( libdialogs_SRCS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/association.cpp new/umbrello-14.12.1/umbrello/association.cpp --- old/umbrello-14.12.0/umbrello/association.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/association.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -14,6 +14,7 @@ // app includes #include "debug_utils.h" #include "classifier.h" +#include "classpropertiesdialog.h" #include "folder.h" #include "uml.h" #include "umldoc.h" @@ -26,6 +27,7 @@ #include <klocale.h> // qt includes +#include <QPointer> #include <QRegExp> using namespace Uml; @@ -202,6 +204,18 @@ qElement.appendChild(associationElement); } +bool UMLAssociation::showPropertiesDialog(QWidget *parent) +{ + QPointer<ClassPropertiesDialog> dlg = new ClassPropertiesDialog(parent, this, true); + bool modified = false; + if (dlg->exec()) { + modified = true; + } + dlg->close(); + delete dlg; + return modified; +} + /** * Creates the <UML:Generalization> or <UML:Association> XMI element * including its role objects. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/association.h new/umbrello-14.12.1/umbrello/association.h --- old/umbrello-14.12.0/umbrello/association.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/association.h 2014-12-30 11:47:35.000000000 +0100 @@ -78,6 +78,8 @@ void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + virtual bool showPropertiesDialog(QWidget *parent = 0); + protected: bool load(QDomElement& element); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/attribute.h new/umbrello-14.12.1/umbrello/attribute.h --- old/umbrello-14.12.0/umbrello/attribute.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/attribute.h 2014-12-30 11:47:35.000000000 +0100 @@ -57,7 +57,7 @@ virtual void saveToXMI(QDomDocument & qDoc, QDomElement & qElement); - virtual bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); void setParmKind(Uml::ParameterDirection::Enum pk); Uml::ParameterDirection::Enum getParmKind() const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/checkconstraint.cpp new/umbrello-14.12.1/umbrello/checkconstraint.cpp --- old/umbrello-14.12.0/umbrello/checkconstraint.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/checkconstraint.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -142,9 +142,9 @@ QDomText checkConstraintText = node.toText(); if (checkConstraintText.isNull()) - return false; - - m_CheckCondition = checkConstraintText.data(); + m_CheckCondition = QString(); + else + m_CheckCondition = checkConstraintText.data(); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/checkconstraint.h new/umbrello-14.12.1/umbrello/checkconstraint.h --- old/umbrello-14.12.0/umbrello/checkconstraint.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/checkconstraint.h 2014-12-30 11:47:35.000000000 +0100 @@ -46,7 +46,7 @@ void saveToXMI(QDomDocument & qDoc, QDomElement & qElement); - virtual bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); QString getCheckCondition() const { return m_CheckCondition; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/classifierlistitem.h new/umbrello-14.12.1/umbrello/classifierlistitem.h --- old/umbrello-14.12.0/umbrello/classifierlistitem.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/classifierlistitem.h 2014-12-30 11:47:35.000000000 +0100 @@ -45,14 +45,6 @@ virtual QString toString(Uml::SignatureType::Enum sig = Uml::SignatureType::NoSig); - /** - * Display the properties configuration dialog for the list item. - * - * @param parent The parent widget. - * @return True for success of this operation. - */ - virtual bool showPropertiesDialog(QWidget* parent) = 0; - virtual void copyInto(UMLObject *lhs) const; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/codeimport/import_utils.cpp new/umbrello-14.12.1/umbrello/codeimport/import_utils.cpp --- old/umbrello-14.12.0/umbrello/codeimport/import_utils.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/codeimport/import_utils.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -220,7 +220,7 @@ // Find, or create, the scopes. QStringList components; if (typeName.contains(QLatin1String("::"))) { - components = typeName.split(QLatin1String("::")); + components = typeName.split(QLatin1String("::"), QString::SkipEmptyParts); } else if (typeName.contains(QLatin1String("..."))) { // Java variable length arguments type = UMLObject::ot_Datatype; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/codeeditor.cpp new/umbrello-14.12.1/umbrello/dialogs/codeeditor.cpp --- old/umbrello-14.12.0/umbrello/dialogs/codeeditor.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/codeeditor.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -163,41 +163,11 @@ if (info) { UMLObject *obj = info->parent(); if (obj) { - UMLAttribute * at = NULL; - UMLRole * role = NULL; - UMLOperation * op = NULL; - - if ((at = dynamic_cast<UMLAttribute*>(obj))) { - QPointer<UMLAttributeDialog> dlg = new UMLAttributeDialog(this, at); - if (dlg->exec() == KDialog::Accepted) { - rebuildView(para); - } - delete dlg; - } - else if ((dynamic_cast<UMLClassifier*>(obj))) { - if (obj->showPropertiesPagedDialog()) { - rebuildView(para); - } - } - else if ((role = dynamic_cast<UMLRole*>(obj))) { - QPointer<UMLRoleDialog> dlg = new UMLRoleDialog(this, role); - if (dlg->exec() == KDialog::Accepted) { - rebuildView(para); - } - delete dlg; - } - else if ((op = dynamic_cast<UMLOperation*>(obj))) - //else if((cop = dynamic_cast<CodeOperation*>(tBlock))) - { - QPointer<UMLOperationDialog> dlg = new UMLOperationDialog(this, op); - if (dlg->exec() == KDialog::Accepted) { - rebuildView(para); - } - delete dlg; - } - else { - uError() << "UNKNOWN parent for textBlock"; + if (obj->showPropertiesDialog(this)) { + rebuildView(para); } + } else { + uError() << "UNKNOWN parent for textBlock"; } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/dialogbase.cpp new/umbrello-14.12.1/umbrello/dialogs/dialogbase.cpp --- old/umbrello-14.12.0/umbrello/dialogs/dialogbase.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/dialogbase.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -36,7 +36,7 @@ : QWidget(parent), m_pageDialog(0), m_pageWidget(0), - m_useDialog(strcmp(parent->metaObject()->className(),"PropertiesWindow") != 0), + m_useDialog(!parent || strcmp(parent->metaObject()->className(),"PropertiesWindow") != 0), m_isModified(false) { if (m_useDialog) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/pages/classgeneralpage.cpp new/umbrello-14.12.1/umbrello/dialogs/pages/classgeneralpage.cpp --- old/umbrello-14.12.0/umbrello/dialogs/pages/classgeneralpage.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/pages/classgeneralpage.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -62,50 +62,8 @@ topLayout->setSpacing(6); // setup name - QString name; UMLObject::ObjectType t = m_pObject->baseType(); - switch (t) { - case UMLObject::ot_Class: - name = i18n("Class &name:"); - break; - case UMLObject::ot_Actor: - name = i18n("Actor &name:"); - break; - case UMLObject::ot_Package: - name = i18n("Package &name:"); - break; - case UMLObject::ot_UseCase: - name = i18n("Use case &name:"); - break; - case UMLObject::ot_Interface: - name = i18n("Interface &name:"); - break; - case UMLObject::ot_Component: - name = i18n("Component &name:"); - break; - case UMLObject::ot_Port: - name = i18n("Port &name:"); - break; - case UMLObject::ot_Node: - name = i18n("Node &name:"); - break; - case UMLObject::ot_Artifact: - name = i18n("Artifact &name:"); - break; - case UMLObject::ot_Enum: - name = i18n("Enum &name:"); - break; - case UMLObject::ot_Datatype: - name = i18n("Datatype &name:"); - break; - case UMLObject::ot_Entity: - name = i18n("Entity &name:"); - break; - default: - name = QLatin1String("<unknown> &name:"); - uWarning() << "creating class gen page for unknown widget type"; - break; - } + QString name = UMLObject::toI18nString(t); QGridLayout * m_pNameLayout = new QGridLayout(); m_pNameLayout->setSpacing(6); topLayout->addLayout(m_pNameLayout, 4); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umlattributedialog.cpp new/umbrello-14.12.1/umbrello/dialogs/umlattributedialog.cpp --- old/umbrello-14.12.0/umbrello/dialogs/umlattributedialog.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umlattributedialog.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -14,6 +14,7 @@ // app includes #include "attribute.h" #include "classifier.h" +#include "documentationwidget.h" #include "template.h" #include "umldoc.h" #include "uml.h" @@ -136,6 +137,9 @@ //now add the Concepts insertTypesSorted(m_pAttribute->getTypeName()); + m_docWidget = new DocumentationWidget(m_pAttribute, this); + mainLayout->addWidget(m_docWidget); + m_pNameLE->setFocus(); connect(m_pNameLE, SIGNAL(textChanged(QString)), SLOT(slotNameChanged(QString))); slotNameChanged(m_pNameLE->text()); @@ -229,6 +233,8 @@ classifier = static_cast<UMLClassifier*>(obj); } m_pAttribute->setType(classifier); + m_docWidget->apply(); + return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umlattributedialog.h new/umbrello-14.12.1/umbrello/dialogs/umlattributedialog.h --- old/umbrello-14.12.0/umbrello/dialogs/umlattributedialog.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umlattributedialog.h 2014-12-30 11:47:35.000000000 +0100 @@ -13,6 +13,7 @@ #include <kdialog.h> +class DocumentationWidget; class QCheckBox; class QGroupBox; class QRadioButton; @@ -53,6 +54,7 @@ KComboBox * m_pTypeCB; KLineEdit * m_pNameLE, * m_pInitialLE, * m_pStereoTypeLE; QCheckBox* m_pStaticCB; + DocumentationWidget *m_docWidget; public slots: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umloperationdialog.cpp new/umbrello-14.12.1/umbrello/dialogs/umloperationdialog.cpp --- old/umbrello-14.12.0/umbrello/dialogs/umloperationdialog.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umloperationdialog.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -21,6 +21,7 @@ #include "listpopupmenu.h" #include "umlattributelist.h" #include "classifierlistitem.h" +#include "documentationwidget.h" #include "umlclassifierlistitemlist.h" #include "dialog_utils.h" #include "parameterpropertiesdialog.h" @@ -137,6 +138,8 @@ m_pImplementationRB = new QRadioButton(i18n("I&mplementation"), m_pScopeGB); scopeLayout->addWidget(m_pImplementationRB); + m_docWidget = new DocumentationWidget(m_operation, this); + m_pParmsGB = new QGroupBox(i18n("Parameters"), frame); QVBoxLayout* parmsLayout = new QVBoxLayout(m_pParmsGB); parmsLayout->setMargin(margin); @@ -176,6 +179,7 @@ topLayout->addWidget(m_pGenGB); topLayout->addWidget(m_pScopeGB); + topLayout->addWidget(m_docWidget); topLayout->addWidget(m_pParmsGB); m_pDeleteButton->setEnabled(false); @@ -485,6 +489,7 @@ } m_operation->setStatic(m_pStaticCB->isChecked()); m_operation->setConst(m_pQueryCB->isChecked()); + m_docWidget->apply(); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umloperationdialog.h new/umbrello-14.12.1/umbrello/dialogs/umloperationdialog.h --- old/umbrello-14.12.0/umbrello/dialogs/umloperationdialog.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umloperationdialog.h 2014-12-30 11:47:35.000000000 +0100 @@ -17,6 +17,7 @@ //qt includes #include <QListWidgetItem> +class DocumentationWidget; class UMLOperation; class ListPopupMenu; class QGroupBox; @@ -77,6 +78,7 @@ QPushButton* m_pPropertiesButton; QToolButton* m_pUpButton; QToolButton* m_pDownButton; + DocumentationWidget* m_docWidget; public slots: void slotParmRightButtonPressed(const QPoint &p); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umltemplatedialog.cpp new/umbrello-14.12.1/umbrello/dialogs/umltemplatedialog.cpp --- old/umbrello-14.12.0/umbrello/dialogs/umltemplatedialog.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umltemplatedialog.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -14,6 +14,7 @@ // app includes #include "template.h" #include "classifier.h" +#include "documentationwidget.h" #include "umldoc.h" #include "uml.h" #include "dialog_utils.h" @@ -83,6 +84,9 @@ mainLayout->addWidget(m_pValuesGB); + m_docWidget = new DocumentationWidget(m_pTemplate, this); + mainLayout->addWidget(m_docWidget); + m_pTypeCB->setEditable(true); m_pTypeCB->setDuplicatesEnabled(false); // only allow one of each type in box m_pTypeCB->setCompletionMode(KGlobalSettings::CompletionPopup); @@ -164,6 +168,7 @@ m_pTemplate->setName(name); m_pTemplate->setStereotype(m_pStereoTypeLE->text()); + m_docWidget->apply(); return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/umltemplatedialog.h new/umbrello-14.12.1/umbrello/dialogs/umltemplatedialog.h --- old/umbrello-14.12.0/umbrello/dialogs/umltemplatedialog.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/umltemplatedialog.h 2014-12-30 11:47:35.000000000 +0100 @@ -13,6 +13,7 @@ #include <kdialog.h> +class DocumentationWidget; class KComboBox; class KLineEdit; class QGroupBox; @@ -48,6 +49,7 @@ QLabel *m_pTypeL, *m_pNameL, *m_pStereoTypeL; KComboBox *m_pTypeCB; KLineEdit *m_pNameLE, *m_pStereoTypeLE; + DocumentationWidget *m_docWidget; public slots: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/widgets/documentationwidget.cpp new/umbrello-14.12.1/umbrello/dialogs/widgets/documentationwidget.cpp --- old/umbrello-14.12.0/umbrello/dialogs/widgets/documentationwidget.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/widgets/documentationwidget.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -0,0 +1,51 @@ +/*************************************************************************** + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * copyright (C) 2002-2014 * + * Umbrello UML Modeller Authors <umbrello-de...@kde.org> * + ***************************************************************************/ + +#include "documentationwidget.h" + +#include "umlobject.h" + +#include <KTextEdit> +#include <KLocalizedString> + +#include <QGroupBox> +#include <QHBoxLayout> + +DocumentationWidget::DocumentationWidget(UMLObject *o, QWidget *parent) : + QWidget(parent), + m_object(o) +{ + Q_ASSERT(o); + + QVBoxLayout *l = new QVBoxLayout; + m_box = new QGroupBox; + m_box->setTitle(i18n("Documentation")); + m_editField = new KTextEdit(m_box); + m_editField->setText(o->doc()); + QVBoxLayout *layout = new QVBoxLayout(m_box); + layout->addWidget(m_editField); + l->addWidget(m_box); + setLayout(l); +} + +DocumentationWidget::~DocumentationWidget() +{ + delete m_editField; + delete m_box; +} + +/** + * Apply changes to the related UMLObject. + */ +void DocumentationWidget::apply() +{ + m_object->setDoc(m_editField->toPlainText()); +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/dialogs/widgets/documentationwidget.h new/umbrello-14.12.1/umbrello/dialogs/widgets/documentationwidget.h --- old/umbrello-14.12.0/umbrello/dialogs/widgets/documentationwidget.h 1970-01-01 01:00:00.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/dialogs/widgets/documentationwidget.h 2014-12-30 11:47:35.000000000 +0100 @@ -0,0 +1,38 @@ +/*************************************************************************** + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * copyright (C) 2002-2014 * + * Umbrello UML Modeller Authors <umbrello-de...@kde.org> * + ***************************************************************************/ + +#ifndef DOCUMENTATIONWIDGET_H +#define DOCUMENTATIONWIDGET_H + +#include <QWidget> + +class UMLObject; + +class KTextEdit; + +class QGridLayout; +class QGroupBox; + +class DocumentationWidget : public QWidget +{ + Q_OBJECT +public: + DocumentationWidget(UMLObject *o, QWidget *parent = 0); + ~DocumentationWidget(); + + void apply(); + +protected: + QGroupBox *m_box; + KTextEdit *m_editField; + UMLObject *m_object; +}; + +#endif // DOCUMENTATIONWIDGET_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/entityattribute.h new/umbrello-14.12.1/umbrello/entityattribute.h --- old/umbrello-14.12.0/umbrello/entityattribute.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/entityattribute.h 2014-12-30 11:47:35.000000000 +0100 @@ -67,7 +67,7 @@ virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); protected: void init(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/enumliteral.h new/umbrello-14.12.1/umbrello/enumliteral.h --- old/umbrello-14.12.0/umbrello/enumliteral.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/enumliteral.h 2014-12-30 11:47:35.000000000 +0100 @@ -39,7 +39,7 @@ virtual void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); protected: bool load(QDomElement& element); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/foreignkeyconstraint.h new/umbrello-14.12.1/umbrello/foreignkeyconstraint.h --- old/umbrello-14.12.0/umbrello/foreignkeyconstraint.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/foreignkeyconstraint.h 2014-12-30 11:47:35.000000000 +0100 @@ -64,7 +64,7 @@ void saveToXMI(QDomDocument & qDoc, QDomElement & qElement); - virtual bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); bool addEntityAttributePair(UMLEntityAttribute* pAttr, UMLEntityAttribute* rAttr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/model_utils.cpp new/umbrello-14.12.1/umbrello/model_utils.cpp --- old/umbrello-14.12.0/umbrello/model_utils.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/model_utils.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -199,6 +199,18 @@ break; } seenPkgs.append(pkg); + + // exclude non package type + // dynamic_cast<UMLPackage*>(pg) fails for unknown reason + // see https://bugs.kde.org/show_bug.cgi?id=341709 + UMLObject::ObjectType foundType = pkg->baseType(); + if (foundType != UMLObject::ot_Package && + foundType != UMLObject::ot_Folder && + foundType != UMLObject::ot_Class && + foundType != UMLObject::ot_Interface && + foundType != UMLObject::ot_Component) { + continue; + } UMLObjectList objectsInCurrentScope = pkg->containedObjects(); for (UMLObjectListIt oit(objectsInCurrentScope); oit.hasNext();) { UMLObject *obj = oit.next(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/operation.h new/umbrello-14.12.1/umbrello/operation.h --- old/umbrello-14.12.0/umbrello/operation.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/operation.h 2014-12-30 11:47:35.000000000 +0100 @@ -57,7 +57,7 @@ QString getUniqueParameterName(); - bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); bool isConstructorOperation(); bool isDestructorOperation(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/stereotype.h new/umbrello-14.12.1/umbrello/stereotype.h --- old/umbrello-14.12.0/umbrello/stereotype.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/stereotype.h 2014-12-30 11:47:35.000000000 +0100 @@ -58,7 +58,7 @@ void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); - bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent); protected: int m_refCount; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/template.h new/umbrello-14.12.1/umbrello/template.h --- old/umbrello-14.12.0/umbrello/template.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/template.h 2014-12-30 11:47:35.000000000 +0100 @@ -44,7 +44,7 @@ virtual QString getTypeName() const; - bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent); void saveToXMI(QDomDocument & qDoc, QDomElement & qElement); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/uml.cpp new/umbrello-14.12.1/umbrello/uml.cpp --- old/umbrello-14.12.0/umbrello/uml.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/uml.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -2547,7 +2547,7 @@ */ void UMLApp::slotCurrentViewProperties() { - currentView()->showPropDialog(); + currentView()->showPropertiesDialog(); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umllistview.cpp new/umbrello-14.12.1/umbrello/umllistview.cpp --- old/umbrello-14.12.0/umbrello/umllistview.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umllistview.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -319,9 +319,7 @@ return; } UMLListViewItem::ListViewType lvt = currItem->type(); - UMLObject::ObjectType umlType = UMLObject::ot_UMLObject; ListPopupMenu::MenuType menuType = ListPopupMenu::typeFromAction(action); - QString name; switch (menuType) { case ListPopupMenu::mt_Class: @@ -634,7 +632,7 @@ UMLView * pView = m_doc->findView(currItem->ID()); if (pView) { UMLApp::app()->docWindow()->updateDocumentation(false); - pView->showPropDialog(); + pView->showPropertiesDialog(); UMLApp::app()->docWindow()->showDocumentation(pView->umlScene(), true); } return; @@ -646,60 +644,7 @@ uError() << "UMLObject of ... is null! Doing nothing."; return; } - umlType = object->baseType(); - - if (Model_Utils::typeIsCanvasWidget(lvt)) { - object->showPropertiesPagedDialog(ClassPropertiesDialog::page_gen); - } else if (umlType == UMLObject::ot_EnumLiteral) { - // Show the Enum Literal Dialog - UMLEnumLiteral* selectedEnumLiteral = static_cast<UMLEnumLiteral*>(object); - selectedEnumLiteral->showPropertiesDialog(this); - - } else if (umlType == UMLObject::ot_Attribute) { - // show the attribute dialog - UMLAttribute* selectedAttribute = static_cast<UMLAttribute*>(object); - QPointer<UMLAttributeDialog> dialog = new UMLAttributeDialog(this, selectedAttribute); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_EntityAttribute) { - // show the attribute dialog - UMLEntityAttribute* selectedAttribute = static_cast<UMLEntityAttribute*>(object); - QPointer<UMLEntityAttributeDialog> dialog = new UMLEntityAttributeDialog(this, selectedAttribute); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_Operation) { - // show the operation dialog - UMLOperation* selectedOperation = static_cast<UMLOperation*>(object); - QPointer<UMLOperationDialog> dialog = new UMLOperationDialog(this, selectedOperation); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_Template) { - // show the template dialog - UMLTemplate* selectedTemplate = static_cast<UMLTemplate*>(object); - QPointer<UMLTemplateDialog> dialog = new UMLTemplateDialog(this, selectedTemplate); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_UniqueConstraint) { - // show the Unique Constraint dialog - UMLUniqueConstraint* selectedUniqueConstraint = static_cast<UMLUniqueConstraint*>(object); - QPointer<UMLUniqueConstraintDialog> dialog = new UMLUniqueConstraintDialog(this, selectedUniqueConstraint); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_ForeignKeyConstraint) { - // show the Unique Constraint dialog - UMLForeignKeyConstraint* selectedForeignKeyConstraint = static_cast<UMLForeignKeyConstraint*>(object); - QPointer<UMLForeignKeyConstraintDialog> dialog = new UMLForeignKeyConstraintDialog(this, selectedForeignKeyConstraint); - dialog->exec(); - delete dialog; - } else if (umlType == UMLObject::ot_CheckConstraint) { - // show the Check Constraint dialog - UMLCheckConstraint* selectedCheckConstraint = static_cast<UMLCheckConstraint*>(object); - QPointer<UMLCheckConstraintDialog> dialog = new UMLCheckConstraintDialog(this, selectedCheckConstraint); - dialog->exec(); - delete dialog; - } else { - uWarning() << "calling properties on unknown type"; - } + object->showPropertiesDialog(); } break; @@ -1447,7 +1392,7 @@ UMLView * pView = m_doc->findView(item->ID()); if (pView) { UMLApp::app()->docWindow()->updateDocumentation(false); - pView->showPropDialog(); + pView->showPropertiesDialog(); UMLApp::app()->docWindow()->showDocumentation(pView->umlScene(), true); } return; @@ -1459,36 +1404,7 @@ return; } - UMLObject::ObjectType type = object->baseType(); - int page = ClassPropertiesDialog::page_gen; - if (Model_Utils::isClassifierListitem(type)) { - object = (UMLObject *)object->parent(); - } - //set what page to show - switch (type) { - - case UMLObject::ot_Attribute: - page = ClassPropertiesDialog::page_att; - break; - case UMLObject::ot_Operation: - page = ClassPropertiesDialog::page_op; - break; - case UMLObject::ot_EntityAttribute: - page = ClassPropertiesDialog::page_entatt; - break; - case UMLObject::ot_UniqueConstraint: - case UMLObject::ot_ForeignKeyConstraint: - case UMLObject::ot_CheckConstraint: - page = ClassPropertiesDialog::page_constraint; - break; - default: - page = ClassPropertiesDialog::page_gen; - break; - } - - if (object) { - object->showPropertiesPagedDialog(page); - } + object->showPropertiesDialog(this); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlobject.cpp new/umbrello-14.12.1/umbrello/umlobject.cpp --- old/umbrello-14.12.0/umbrello/umlobject.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlobject.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -12,7 +12,9 @@ #include "umlobject.h" // app includes +#include "classpropertiesdialog.h" #include "debug_utils.h" +#include "enumliteral.h" #include "uniqueid.h" #include "uml.h" #include "umldoc.h" @@ -24,7 +26,6 @@ #include "model_utils.h" #include "import_utils.h" #include "docwindow.h" -#include "classpropertiesdialog.h" #include "cmds.h" // kde includes @@ -108,20 +109,16 @@ } /** - * This method is called if you wish to see the properties of a - * UMLObject. A dialog box will be displayed from which you - * can change the object's properties. + * Display the properties configuration dialog for the object. * - * @param page The page to show. - * @param assoc Whether to show association page. - * @return True if we modified the object. + * @param parent The parent widget. + * @return True for success of this operation. */ -bool UMLObject::showPropertiesPagedDialog(int page, bool assoc) +bool UMLObject::showPropertiesDialog(QWidget *parent) { - Q_UNUSED(page); DocWindow *docwindow = UMLApp::app()->docWindow(); docwindow->updateDocumentation(false); - QPointer<ClassPropertiesDialog> dlg = new ClassPropertiesDialog((QWidget*)UMLApp::app(), this, assoc); + QPointer<ClassPropertiesDialog> dlg = new ClassPropertiesDialog(parent, this, false); bool modified = false; if (dlg->exec()) { docwindow->showDocumentation(this, true); @@ -1082,6 +1079,66 @@ } /** + * Returns the given object type value as localized string. + * @param ot ObjectType of which a string representation is wanted + * @return the ObjectType as localized string + */ +QString UMLObject::toI18nString(ObjectType t) +{ + QString name; + + switch (t) { + case UMLObject::ot_Actor: + name = i18n("Actor &name:"); + break; + case UMLObject::ot_Artifact: + name = i18n("Artifact &name:"); + break; + case UMLObject::ot_Class: + name = i18n("Class &name:"); + break; + case UMLObject::ot_Component: + name = i18n("Component &name:"); + break; + case UMLObject::ot_Datatype: + name = i18n("Datatype &name:"); + break; + case UMLObject::ot_Entity: + name = i18n("Entity &name:"); + break; + case UMLObject::ot_Enum: + name = i18n("Enum &name:"); + break; + case UMLObject::ot_Folder: + name = i18n("Folder &name:"); + break; + case UMLObject::ot_Interface: + name = i18n("Interface &name:"); + break; + case UMLObject::ot_Node: + name = i18n("Node &name:"); + break; + case UMLObject::ot_Package: + name = i18n("Package &name:"); + break; + case UMLObject::ot_Port: + name = i18n("Port &name:"); + break; + case UMLObject::ot_Stereotype: + name = i18n("Stereotype &name:"); + break; + case UMLObject::ot_UseCase: + name = i18n("Use case &name:"); + break; + default: + name = QLatin1String("<unknown> &name:"); + uWarning() << "unknown object type"; + break; + } + return name; +} + +/** * Print UML Object to debug output stream, so it can be used like * uDebug() << "This object shouldn't be here: " << illegalObject; */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlobject.h new/umbrello-14.12.1/umbrello/umlobject.h --- old/umbrello-14.12.0/umbrello/umlobject.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlobject.h 2014-12-30 11:47:35.000000000 +0100 @@ -77,6 +77,7 @@ }; static QString toString(ObjectType ot); + static QString toI18nString(ObjectType t); explicit UMLObject(UMLObject* parent, const QString& name, Uml::ID::Type id = Uml::ID::None); explicit UMLObject(UMLObject* parent); @@ -130,8 +131,7 @@ void setAbstract(bool bAbstract); bool isAbstract() const; - // FIXME: merge with showPropertiesDialog() - virtual bool showPropertiesPagedDialog(int page = 0, bool assoc = false); + virtual bool showPropertiesDialog(QWidget* parent = 0); virtual bool resolveRef(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlrole.cpp new/umbrello-14.12.1/umbrello/umlrole.cpp --- old/umbrello-14.12.0/umbrello/umlrole.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlrole.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -15,9 +15,11 @@ #include "association.h" #include "debug_utils.h" #include "umldoc.h" +#include "umlroledialog.h" #include "uml.h" // qt includes +#include <QPointer> #include <QRegExp> /** @@ -213,6 +215,23 @@ } /** + * Display the properties configuration dialog for the object. + * + * @param parent The parent widget. + * @return True for success of this operation. + */ +bool UMLRole::showPropertiesDialog(QWidget *parent) +{ + QPointer<UMLRoleDialog> dlg = new UMLRoleDialog(parent, this); + bool modified = false; + if (dlg->exec() == KDialog::Accepted) { + modified = true; + } + delete dlg; + return modified; +} + +/** * Loads the <UML:AssociationEnd> XMI element. * Auxiliary to UMLObject::loadFromXMI. */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlrole.h new/umbrello-14.12.1/umbrello/umlrole.h --- old/umbrello-14.12.0/umbrello/umlrole.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlrole.h 2014-12-30 11:47:35.000000000 +0100 @@ -48,6 +48,8 @@ void saveToXMI(QDomDocument& qDoc, QDomElement& qElement); + virtual bool showPropertiesDialog(QWidget *parent = 0); + protected: bool load(QDomElement& element); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlscene.cpp new/umbrello-14.12.1/umbrello/umlscene.cpp --- old/umbrello-14.12.0/umbrello/umlscene.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlscene.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -921,7 +921,7 @@ m_pToolBarState->mouseDoubleClick(event); if (!event->isAccepted()) { // show properties dialog of the scene - if (m_view->showPropDialog() == true) { + if (m_view->showPropertiesDialog() == true) { m_doc->setModified(); } event->accept(); @@ -3102,7 +3102,7 @@ break; case ListPopupMenu::mt_Properties: - if (m_view->showPropDialog() == true) + if (m_view->showPropertiesDialog() == true) m_doc->setModified(); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlview.cpp new/umbrello-14.12.1/umbrello/umlview.cpp --- old/umbrello-14.12.0/umbrello/umlview.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlview.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -98,10 +98,10 @@ /** * Shows the properties dialog for the view. */ -bool UMLView::showPropDialog() +bool UMLView::showPropertiesDialog(QWidget *parent) { bool success = false; - QPointer<UMLViewDialog> dlg = new UMLViewDialog(this, umlScene()); + QPointer<UMLViewDialog> dlg = new UMLViewDialog(parent, umlScene()); if (dlg->exec() == QDialog::Accepted) { success = true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/umlview.h new/umbrello-14.12.1/umbrello/umlview.h --- old/umbrello-14.12.0/umbrello/umlview.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/umlview.h 2014-12-30 11:47:35.000000000 +0100 @@ -44,7 +44,7 @@ void setZoom(int zoom); int currentZoom(); - bool showPropDialog(); + virtual bool showPropertiesDialog(QWidget *parent = 0); public slots: void zoomIn(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/uniqueconstraint.h new/umbrello-14.12.1/umbrello/uniqueconstraint.h --- old/umbrello-14.12.0/umbrello/uniqueconstraint.h 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/uniqueconstraint.h 2014-12-30 11:47:35.000000000 +0100 @@ -47,7 +47,7 @@ void saveToXMI(QDomDocument & qDoc, QDomElement & qElement); - virtual bool showPropertiesDialog(QWidget* parent); + virtual bool showPropertiesDialog(QWidget* parent = 0); bool hasEntityAttribute(UMLEntityAttribute* attr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/umbrello/widgets/widgetbase.cpp new/umbrello-14.12.1/umbrello/widgets/widgetbase.cpp --- old/umbrello-14.12.0/umbrello/widgets/widgetbase.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/umbrello/widgets/widgetbase.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -781,7 +781,7 @@ showPropertiesDialog(); } else if (wt == WidgetBase::wt_Object) { - m_umlObject->showPropertiesPagedDialog(); + m_umlObject->showPropertiesDialog(); } else { uWarning() << "making properties dialog for unknown widget type"; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-14.12.0/unittests/TEST_basictypes.cpp new/umbrello-14.12.1/unittests/TEST_basictypes.cpp --- old/umbrello-14.12.0/unittests/TEST_basictypes.cpp 2014-12-10 08:26:28.000000000 +0100 +++ new/umbrello-14.12.1/unittests/TEST_basictypes.cpp 2014-12-30 11:47:35.000000000 +0100 @@ -26,6 +26,7 @@ { Q_OBJECT private slots: + void test_dynamic_cast(); void test_ModelType_toString(); void test_ModelType_fromString(); void test_ModelType_forLoop(); @@ -48,6 +49,26 @@ //----------------------------------------------------------------------------- +class A +{ +public: + virtual ~A () { } +}; + +class B : public A +{ +}; + +void TEST_basictypes::test_dynamic_cast() +{ + A *a1 = new A; + B* b1 = dynamic_cast<B*> (a1); + QVERIFY(!b1); + A *a2 = new B; + B* b2 = dynamic_cast<B*> (a2); + QVERIFY(b2); +} + void TEST_basictypes::test_ModelType_toString() { Uml::ModelType::Enum model0 = Uml::ModelType::Logical; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org