Hello community, here is the log from the commit of package umbrello for openSUSE:Factory checked in at 2014-01-27 11:19:04 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2013-12-19 13:19:58.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.umbrello.new/umbrello.changes 2014-01-27 11:19:05.000000000 +0100 @@ -1,0 +2,7 @@ +Sat Jan 11 16:06:40 UTC 2014 - tittiatc...@gmail.com + +- Update to 4.12.1 + * KDE 4.12.1 release + * See http://www.kde.org/announcements/announce-4.12.1.php + +------------------------------------------------------------------- Old: ---- umbrello-4.12.0.tar.xz New: ---- umbrello-4.12.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ umbrello.spec ++++++ --- /var/tmp/diff_new_pack.csneQF/_old 2014-01-27 11:19:05.000000000 +0100 +++ /var/tmp/diff_new_pack.csneQF/_new 2014-01-27 11:19:05.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package umbrello # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 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: 4.12.0 +Version: 4.12.1 Release: 0 Source0: %{name}-%{version}.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ umbrello-4.12.0.tar.xz -> umbrello-4.12.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/CMakeLists.txt new/umbrello-4.12.1/CMakeLists.txt --- old/umbrello-4.12.0/CMakeLists.txt 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/CMakeLists.txt 2014-01-09 13:48:53.000000000 +0100 @@ -8,7 +8,7 @@ set(VERSION_MAJOR "2") set(VERSION_MINOR "12") -set(VERSION_PATCH "0") +set(VERSION_PATCH "1") # set default umbrello version # umbrello version could be overriden by cmake command line using -DUMBRELLO_VERSION_STRING=major.minor.patch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/activitypage.cpp new/umbrello-4.12.1/umbrello/dialogs/activitypage.cpp --- old/umbrello-4.12.0/umbrello/dialogs/activitypage.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/activitypage.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -34,7 +34,6 @@ ActivityPage::ActivityPage(QWidget * pParent, StateWidget * pWidget) : QWidget(pParent) { m_pStateWidget = pWidget; - m_pMenu = 0; setupPage(); } @@ -150,7 +149,7 @@ */ void ActivityPage::slotMenuSelection(QAction* action) { - ListPopupMenu::MenuType sel = m_pMenu->getMenuType(action); + ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(action); switch(sel) { case ListPopupMenu::mt_New_Activity: slotNewActivity(); @@ -214,15 +213,9 @@ type = ListPopupMenu::mt_New_Activity; } - if (m_pMenu) { - m_pMenu->hide(); - disconnect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotMenuSelection(QAction*))); - delete m_pMenu; - m_pMenu = 0; - } - m_pMenu = new ListPopupMenu(this, type); - connect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotMenuSelection(QAction*))); - m_pMenu->exec(m_pActivityLW->mapToGlobal(p)); + ListPopupMenu popup(this, type); + QAction *triggered = popup.exec(m_pActivityLW->mapToGlobal(p)); + slotMenuSelection(triggered); } void ActivityPage::slotTopClicked() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/activitypage.h new/umbrello-4.12.1/umbrello/dialogs/activitypage.h --- old/umbrello-4.12.0/umbrello/dialogs/activitypage.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/activitypage.h 2014-01-09 13:48:53.000000000 +0100 @@ -48,11 +48,6 @@ StateWidget * m_pStateWidget; /** - * Popup menu used. - */ - ListPopupMenu * m_pMenu; - - /** * GUI widgets */ QListWidget* m_pActivityLW; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/assocpage.cpp new/umbrello-4.12.1/umbrello/dialogs/assocpage.cpp --- old/umbrello-4.12.0/umbrello/dialogs/assocpage.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/assocpage.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -52,7 +52,6 @@ layout->addWidget(m_pAssocLW); setMinimumSize(310, 330); fillListBox(); - m_pMenu = 0; connect(m_pAssocLW, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(slotDoubleClick(QListWidgetItem*))); @@ -106,29 +105,19 @@ void AssocPage::slotRightButtonPressed(const QPoint &p) { - QListWidgetItem* item = m_pAssocLW->itemAt(p); - if (!item) { - return; - } - if (m_pMenu) { - m_pMenu->hide(); - disconnect(m_pMenu, SIGNAL(activated(int)), this, SLOT(slotPopupMenuSel(int))); - delete m_pMenu; - m_pMenu = 0; - } - m_pMenu = new ListPopupMenu(this, ListPopupMenu::mt_Association_Selected); - connect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotPopupMenuSel(QAction*))); - m_pMenu->exec(m_pAssocLW->mapToGlobal(p)); + ListPopupMenu popup(this, ListPopupMenu::mt_Association_Selected); + QAction *triggered = popup.exec(m_pAssocLW->mapToGlobal(p)); + slotMenuSelection(triggered); } -void AssocPage::slotPopupMenuSel(QAction* action) +void AssocPage::slotMenuSelection(QAction* action) { int currentItemIndex = m_pAssocLW->currentRow(); if (currentItemIndex == -1) { return; } AssociationWidget * a = m_List.at(currentItemIndex); - ListPopupMenu::MenuType id = m_pMenu->getMenuType(action); + ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action); switch (id) { case ListPopupMenu::mt_Delete: m_pScene->removeAssocInViewAndDoc(a); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/assocpage.h new/umbrello-4.12.1/umbrello/dialogs/assocpage.h --- old/umbrello-4.12.0/umbrello/dialogs/assocpage.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/assocpage.h 2014-01-09 13:48:53.000000000 +0100 @@ -44,14 +44,13 @@ QListWidget *m_pAssocLW; QGroupBox *m_pAssocGB; AssociationWidgetList m_List; - ListPopupMenu *m_pMenu; void fillListBox(); public slots: void slotDoubleClick(QListWidgetItem *item); void slotRightButtonPressed(const QPoint &p); - void slotPopupMenuSel(QAction* action); + void slotMenuSelection(QAction* action); }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/classifierlistpage.cpp new/umbrello-4.12.1/umbrello/dialogs/classifierlistpage.cpp --- old/umbrello-4.12.0/umbrello/dialogs/classifierlistpage.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/classifierlistpage.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -418,19 +418,6 @@ } } -/** - * Hide menu and free all its resources. - */ -void ClassifierListPage::deleteMenu() -{ - if (m_pMenu) { - m_pMenu->hide(); - disconnect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotPopupMenuSel(QAction*))); - delete m_pMenu; - m_pMenu = 0; - } -} - void ClassifierListPage::slotRightButtonPressed(const QPoint& pos) { ListPopupMenu::MenuType type = ListPopupMenu::mt_Undefined; @@ -463,19 +450,18 @@ uWarning() << "unknown type in ClassifierListPage"; } } - deleteMenu(); - m_pMenu = new ListPopupMenu(this, type); - m_pMenu->popup(mapToGlobal(pos) + QPoint(0, 40)); - connect(m_pMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotPopupMenuSel(QAction*))); + ListPopupMenu popup(this, type); + QAction *triggered = popup.exec(mapToGlobal(pos) + QPoint(0, 40)); + slotMenuSelection(triggered); } /** * Called when an item is selected in a right click menu. */ -void ClassifierListPage::slotPopupMenuSel(QAction* action) +void ClassifierListPage::slotMenuSelection(QAction* action) { - ListPopupMenu::MenuType id = m_pMenu->getMenuType(action); + ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action); switch (id) { case ListPopupMenu::mt_New_Attribute: case ListPopupMenu::mt_New_Operation: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/classifierlistpage.h new/umbrello-4.12.1/umbrello/dialogs/classifierlistpage.h --- old/umbrello-4.12.0/umbrello/dialogs/classifierlistpage.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/classifierlistpage.h 2014-01-09 13:48:53.000000000 +0100 @@ -109,7 +109,7 @@ void slotActivateItem(QListWidgetItem* item); - void slotPopupMenuSel(QAction* action); + void slotMenuSelection(QAction* action); void slotListItemCreated(UMLObject* object); void slotListItemModified(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/pkgcontentspage.cpp new/umbrello-4.12.1/umbrello/dialogs/pkgcontentspage.cpp --- old/umbrello-4.12.0/umbrello/dialogs/pkgcontentspage.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/pkgcontentspage.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -52,7 +52,6 @@ layout->addWidget(m_contentLW); setMinimumSize(310, 330); fillListBox(); - m_menu = 0; connect(m_contentLW, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(slotDoubleClick(QListWidgetItem*))); @@ -108,23 +107,14 @@ */ void PkgContentsPage::slotShowContextMenu(const QPoint &p) { - QListWidgetItem *item = m_contentLW->itemAt(p); - if (item) { - if (m_menu) { - m_menu->hide(); - disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotPopupMenuSel(QAction*))); - delete m_menu; - m_menu = 0; - } - m_menu = new ListPopupMenu(this, ListPopupMenu::mt_Association_Selected); - connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotPopupMenuSel(QAction*))); - m_menu->exec(mapToGlobal(p) + QPoint(0, 20)); - } + ListPopupMenu popup(this, ListPopupMenu::mt_Association_Selected); + QAction *triggered = popup.exec(mapToGlobal(p) + QPoint(0, 20)); + slotMenuSelection(triggered); } -void PkgContentsPage::slotPopupMenuSel(QAction* action) +void PkgContentsPage::slotMenuSelection(QAction* action) { - ListPopupMenu::MenuType id = m_menu->getMenuType(action); + ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action); switch(id) { case ListPopupMenu::mt_Delete: { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/pkgcontentspage.h new/umbrello-4.12.1/umbrello/dialogs/pkgcontentspage.h --- old/umbrello-4.12.0/umbrello/dialogs/pkgcontentspage.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/pkgcontentspage.h 2014-01-09 13:48:53.000000000 +0100 @@ -34,14 +34,13 @@ UMLPackage * m_package; QListWidget * m_contentLW; QGroupBox * m_contentGB; - ListPopupMenu * m_menu; void fillListBox(); public slots: void slotDoubleClick(QListWidgetItem * item); void slotShowContextMenu(const QPoint&); - void slotPopupMenuSel(QAction* action); + void slotMenuSelection(QAction* action); }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/umlattributedialog.cpp new/umbrello-4.12.1/umbrello/dialogs/umlattributedialog.cpp --- old/umbrello-4.12.0/umbrello/dialogs/umlattributedialog.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/umlattributedialog.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -195,11 +195,22 @@ return true; } UMLDoc * pDoc = UMLApp::app()->document(); - UMLObject *obj = pDoc->findUMLObject(typeName); + + UMLObject *obj = 0; + if (!typeName.isEmpty()) { + obj = pDoc->findUMLObject(typeName); + } + UMLClassifier *classifier = dynamic_cast<UMLClassifier*>(obj); if (classifier == NULL) { Uml::ProgrammingLanguage::Enum pl = UMLApp::app()->activeLanguage(); - if (pl == Uml::ProgrammingLanguage::Cpp || pl == Uml::ProgrammingLanguage::Java) { + // Import_Utils does not handle creating a new object with empty name + // string well. Use Object_Factory in those cases. + if ( + (!typeName.isEmpty()) && + ((pl == Uml::ProgrammingLanguage::Cpp) || + (pl == Uml::ProgrammingLanguage::Java)) + ) { // Import_Utils::createUMLObject works better for C++ namespace // and java package than Object_Factory::createUMLObject Import_Utils::setRelatedClassifier(pConcept); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/umloperationdialog.cpp new/umbrello-4.12.1/umbrello/dialogs/umloperationdialog.cpp --- old/umbrello-4.12.0/umbrello/dialogs/umloperationdialog.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/umloperationdialog.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -251,13 +251,13 @@ } if (m_menu) { m_menu->hide(); - disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotParmPopupMenuSel(QAction*))); + disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotMenuSelection(QAction*))); delete m_menu; m_menu = 0; } - m_menu = new ListPopupMenu(this, type); - connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(slotParmPopupMenuSel(QAction*))); - m_menu->exec(m_pParmsLW->mapToGlobal(p)); + ListPopupMenu popup(this, type); + QAction *triggered = popup.exec(m_pParmsLW->mapToGlobal(p)); + slotMenuSelection(triggered); } void UMLOperationDialog::slotParmDoubleClick(QListWidgetItem *item) @@ -265,16 +265,15 @@ if (!item) { return; } - if (!m_menu) { // this happens, when there was no right click in the list widget - m_menu = new ListPopupMenu(this, ListPopupMenu::mt_Parameter_Selected); - } - QAction* action = m_menu->getAction(ListPopupMenu::mt_Properties); - slotParmPopupMenuSel(action); + // this happens, when there was no right click in the list widget + ListPopupMenu popup(this, ListPopupMenu::mt_Parameter_Selected); + QAction* action = popup.getAction(ListPopupMenu::mt_Properties); + slotMenuSelection(action); } -void UMLOperationDialog::slotParmPopupMenuSel(QAction* action) +void UMLOperationDialog::slotMenuSelection(QAction* action) { - ListPopupMenu::MenuType id = m_menu->getMenuType(action); + ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action); if(id == ListPopupMenu::mt_Rename || id == ListPopupMenu::mt_Properties) { slotParameterProperties(); } else if(id == ListPopupMenu::mt_New_Parameter) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/dialogs/umloperationdialog.h new/umbrello-4.12.1/umbrello/dialogs/umloperationdialog.h --- old/umbrello-4.12.0/umbrello/dialogs/umloperationdialog.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/dialogs/umloperationdialog.h 2014-01-09 13:48:53.000000000 +0100 @@ -81,7 +81,7 @@ public slots: void slotParmRightButtonPressed(const QPoint &p); void slotParmDoubleClick(QListWidgetItem *item); - void slotParmPopupMenuSel(QAction* action); + void slotMenuSelection(QAction* action); void slotNewParameter(); void slotDeleteParameter(); void slotParameterProperties(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/uml.cpp new/umbrello-4.12.1/umbrello/uml.cpp --- old/umbrello-4.12.0/umbrello/uml.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/uml.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -352,7 +352,7 @@ deleteSelectedWidget->setIcon(Icon_Utils::SmallIcon(Icon_Utils::it_Delete)); deleteSelectedWidget->setText(i18nc("delete selected widget", "Delete &Selected")); deleteSelectedWidget->setShortcut(QKeySequence(Qt::Key_Delete)); - connect(deleteSelectedWidget, SIGNAL(triggered(bool)), this, SLOT(slotDeleteSelectedWidget())); + connect(deleteSelectedWidget, SIGNAL(triggered(bool)), this, SLOT(slotDeleteSelected())); // The different views newDiagram = actionCollection()->add<KActionMenu>("new_view"); @@ -1447,7 +1447,7 @@ if (editCutCopy(fromview)) { emit sigCutSuccessful(); - slotDeleteSelectedWidget(); + slotDeleteSelected(); m_doc->setModified(true); } resetStatusMsg(); @@ -2552,10 +2552,21 @@ } /** - * Deletes the selected widget. + * Deletes selected widgets or list view items. */ -void UMLApp::slotDeleteSelectedWidget() +void UMLApp::slotDeleteSelected() { + // deleteSelectedWidget grabs DEL key as shortcut, + // which prevents routing DEL key through the regular + // key press event handler + QWidget *f = focusWidget(); + if (f == m_listView) { + QWidgetAction *o = static_cast<QWidgetAction *>(sender()); + if (o->objectName() == "delete_selected") { + m_listView->slotDeleteSelectedItems(); + } + return; + } if (currentView()) { currentView()->umlScene()->deleteSelection(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/uml.h new/umbrello-4.12.1/umbrello/uml.h --- old/umbrello-4.12.0/umbrello/uml.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/uml.h 2014-01-09 13:48:53.000000000 +0100 @@ -243,7 +243,7 @@ void slotSnapToGridToggled(bool gridOn); void slotShowGridToggled(bool gridOn); void slotSelectAll(); - void slotDeleteSelectedWidget(); + void slotDeleteSelected(); void slotDeleteDiagram(); void slotCloseDiagram(QWidget* tab); void slotGenerateAllCode(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umldoc.cpp new/umbrello-4.12.1/umbrello/umldoc.cpp --- old/umbrello-4.12.0/umbrello/umldoc.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umldoc.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -88,7 +88,6 @@ m_pAutoSaveTimer(0), m_nViewID(Uml::ID::None), m_bTypesAreResolved(false), - m_pTabPopupMenu(0), m_pCurrentRoot(0), m_bClosing(false) { @@ -2947,11 +2946,6 @@ void UMLDoc::slotDiagramPopupMenu(QWidget* umlview, const QPoint& point) { UMLView* view = (UMLView*) umlview; - if (m_pTabPopupMenu != 0) { - m_pTabPopupMenu->hide(); - delete m_pTabPopupMenu; - m_pTabPopupMenu = 0; - } UMLListViewItem::ListViewType type = UMLListViewItem::lvt_Unknown; switch (view->umlScene()->type()) { @@ -2996,25 +2990,9 @@ return; }//end switch - m_pTabPopupMenu = new ListPopupMenu(UMLApp::app()->mainViewWidget(), type, 0); - m_pTabPopupMenu->popup(point); - connect(m_pTabPopupMenu, SIGNAL(triggered(QAction*)), view->umlScene(), SLOT(slotMenuSelection(QAction*))); -} - -/** - * Find and return the user selected type of the popup menu. - * See also m_pTabPopupMenu and slotDiagramPopupMenu. - * @param action the selected action - * @return the selected menu type - */ -ListPopupMenu::MenuType UMLDoc::popupMenuSelection(QAction* action) -{ - if (m_pTabPopupMenu) { - return m_pTabPopupMenu->getMenuType(action); - } - else { - return ListPopupMenu::mt_Undefined; - } + ListPopupMenu popup(UMLApp::app()->mainViewWidget(), type, 0); + QAction *triggered = popup.exec(point); + view->umlScene()->slotMenuSelection(triggered); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umldoc.h new/umbrello-4.12.1/umbrello/umldoc.h --- old/umbrello-4.12.0/umbrello/umldoc.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umldoc.h 2014-01-09 13:48:53.000000000 +0100 @@ -218,8 +218,6 @@ void resolveTypes(); - ListPopupMenu::MenuType popupMenuSelection(QAction* action); - private: void initSaveTimer(); void createDatatypeFolder(); @@ -281,12 +279,6 @@ bool m_bTypesAreResolved; /** - * the context menu on the tabs, - * plugs into umlview::slotMenuSelection() - */ - ListPopupMenu* m_pTabPopupMenu; - - /** * Auxiliary variable for currentRoot(): * m_pCurrentRoot is only used if UMLApp::app()->currentView() * returns 0. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umllistview.cpp new/umbrello-4.12.1/umbrello/umllistview.cpp --- old/umbrello-4.12.0/umbrello/umllistview.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umllistview.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -85,14 +85,11 @@ : QTreeWidget(parent), m_rv(0), m_datatypeFolder(0), - m_menu(0), m_doc(UMLApp::app()->document()), m_bStartedCut(false), m_bStartedCopy(false), m_bCreatingChildObject(false), - m_bRenameInProgress(false), - m_dragStartPosition(QPoint()), - m_editItem(0) + m_dragStartPosition(QPoint()) { // setup list view setAcceptDrops(true); @@ -121,7 +118,6 @@ connect(this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(slotCollapsed(QTreeWidgetItem*))); connect(this, SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(slotExpanded(QTreeWidgetItem*))); connect(UMLApp::app(), SIGNAL(sigCutSuccessful()), this, SLOT(slotCutSuccessful())); - connect(this, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotItemChanged(QTreeWidgetItem*,int))); connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(slotItemSelectionChanged())); } @@ -144,21 +140,6 @@ } /** - * Handler for item changed signals. - */ -void UMLListView::slotItemChanged(QTreeWidgetItem * item, int column) -{ - UMLListViewItem *lvitem = dynamic_cast<UMLListViewItem*>(item); - if (lvitem == NULL || m_editItem == NULL) - return; - QString text = item->text(column); - if (m_bRenameInProgress) { - DEBUG(DBG_SRC) << "text: " << text; - endRename(lvitem); - } -} - -/** * Handler for item selection changed signals. */ void UMLListView::slotItemSelectionChanged() @@ -166,19 +147,6 @@ UMLListViewItem* currItem = static_cast<UMLListViewItem*>(currentItem()); if (currItem && currItem->isSelected()) { DEBUG(DBG_SRC) << currItem->text(0); - if (m_editItem && m_bRenameInProgress) { - if (m_editItem == currItem) { - // clicked on the item which is just edited - DEBUG(DBG_SRC) << "performing endRename"; - endRename(currItem); - } - else { - // other item was selected during editing - cancelRename(m_editItem); - DEBUG(DBG_SRC) << "performing cancelRename"; - } - } - // Update current view to selected object's view if (Model_Utils::typeIsDiagram(currItem->type())) { // If the user navigates to a diagram, load the diagram just like what @@ -213,30 +181,6 @@ } /** - * Event filter. - */ -bool UMLListView::eventFilter(QObject *o, QEvent *e) -{ - if (e->type() != QEvent::MouseButtonPress || qstrcmp("QHeader", metaObject()->className()) != 0) - return QTreeWidget::eventFilter(o, e); - QMouseEvent *me = static_cast<QMouseEvent*>(e); - if (me->button() == Qt::RightButton) { - if (m_menu) { - m_menu->hide(); - disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); - delete m_menu; - m_menu = 0; - } - UMLListViewItem * currItem = static_cast<UMLListViewItem*>(currentItem()); - m_menu = new ListPopupMenu(this, UMLListViewItem::lvt_Model, currItem->umlObject()); - m_menu->popup(me->globalPos()); - connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); - return true; - } - return QTreeWidget::eventFilter(o, e); -} - -/** * Handler for mouse press events. * @param me the mouse event */ @@ -276,19 +220,6 @@ m_dragStartPosition = me->pos(); } - if (button == Qt::RightButton) { - if (m_menu != 0) { - m_menu->hide(); - disconnect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); - delete m_menu; - m_menu = 0; - } - const UMLListViewItem::ListViewType type = item->type(); - m_menu = new ListPopupMenu(this, type, item->umlObject()); - m_menu->popup(me->globalPos()); - connect(m_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuSel(QAction*))); - }//end if right button - QTreeWidget::mousePressEvent(me); } @@ -344,32 +275,16 @@ */ void UMLListView::keyPressEvent(QKeyEvent *ke) { - UMLView *view = UMLApp::app()->currentView(); - if (view && view->umlScene()->selectedCount()) { - // Widgets have been selected in the diagram area, - // assume they handle the keypress. - ke->accept(); // munge and do nothing - } - else { - const int k = ke->key(); - if (k == Qt::Key_F2) { - UMLListViewItem * currItem = static_cast<UMLListViewItem*>(currentItem()); - startRename(currItem); - } else if (k == Qt::Key_Delete || k == Qt::Key_Backspace) { - // delete every selected item - UMLListViewItemList itemsSelected = selectedItemsRoot(); - foreach(UMLListViewItem *item, itemsSelected) { - deleteItem(item); - } - } else if (k == Qt::Key_F3) { - // prelimary support for layout generator - LayoutGenerator r; - if (!r.generate(UMLApp::app()->currentView()->umlScene())) - return; - r.apply(UMLApp::app()->currentView()->umlScene()); - } else { - QTreeWidget::keyPressEvent(ke); // let parent handle it - } + QTreeWidget::keyPressEvent(ke); // let parent handle it + const int k = ke->key(); + if (k == Qt::Key_Delete || k == Qt::Key_Backspace) { + slotDeleteSelectedItems(); + } else if (k == Qt::Key_F3) { + // prelimary support for layout generator + LayoutGenerator r; + if (!r.generate(UMLApp::app()->currentView()->umlScene())) + return; + r.apply(UMLApp::app()->currentView()->umlScene()); } } @@ -377,7 +292,7 @@ * Called when a right mouse button menu has an item selected. * @param action the selected action */ -void UMLListView::popupMenuSel(QAction* action) +void UMLListView::slotMenuSelection(QAction* action) { UMLListViewItem * currItem = static_cast<UMLListViewItem*>(currentItem()); if (!currItem) { @@ -386,7 +301,7 @@ } UMLListViewItem::ListViewType lvt = currItem->type(); UMLObject::ObjectType umlType = UMLObject::ot_UMLObject; - ListPopupMenu::MenuType menuType = m_menu->getMenuType(action); + ListPopupMenu::MenuType menuType = ListPopupMenu::typeFromAction(action); QString name; switch (menuType) { @@ -604,7 +519,7 @@ } case ListPopupMenu::mt_Rename: - startRename(currItem); + edit(currentIndex()); break; case ListPopupMenu::mt_Delete: @@ -1357,11 +1272,8 @@ m_datatypeFolder->setOpen(false); //setup misc. - delete m_menu; - m_menu = 0; m_bStartedCut = m_bStartedCopy = false; m_bCreatingChildObject = false; - m_bRenameInProgress = false; headerItem()->setHidden(true); } @@ -2053,6 +1965,21 @@ QTreeWidget::focusOutEvent(fe); } +void UMLListView::contextMenuEvent(QContextMenuEvent *me) +{ + // Get the UMLListViewItem at the point where the mouse pointer was pressed + UMLListViewItem * item = static_cast<UMLListViewItem*>(itemAt(me->pos())); + if (item) { + const UMLListViewItem::ListViewType type = item->type(); + ListPopupMenu popup(this, type, item->umlObject()); + QAction *triggered = popup.exec(me->globalPos()); + slotMenuSelection(triggered); + me->accept(); + } + + QTreeWidget::contextMenuEvent(me); +} + /** * Determines the root listview type of the given UMLListViewItem. * Starts at the given item, compares it against each of the @@ -2138,6 +2065,17 @@ } /** + * Delete every selected item + */ +void UMLListView::slotDeleteSelectedItems() +{ + UMLListViewItemList itemsSelected = selectedItemsRoot(); + foreach(UMLListViewItem *item, itemsSelected) { + deleteItem(item); + } +} + +/** * Adds a new item to the tree of the given type under the given parent. * Method will take care of signalling anyone needed on creation of new item. * e.g. UMLDoc if an UMLObject is created. @@ -2192,7 +2130,6 @@ bool UMLListView::itemRenamed(UMLListViewItem * item, int col) { DEBUG(DBG_SRC) << item->text(col); - m_bRenameInProgress = false; UMLListViewItem * renamedItem = static_cast< UMLListViewItem *>(item) ; UMLListViewItem::ListViewType type = renamedItem->type(); QString newText = renamedItem->text(col); @@ -2688,63 +2625,6 @@ } /** - * Renaming of an item has started. - * @param item the item which will be renamed - */ -void UMLListView::startRename(UMLListViewItem* item) -{ - if (item) { - DEBUG(DBG_SRC) << item->text(0); - if (m_editItem) { - cancelRename(m_editItem); - } - m_bRenameInProgress = true; - item->startRename(0); - openPersistentEditor(item, 0); - m_editItem = item; - } - else { - uError() << "Called without an item!"; - } -} - -/** - * Cancel rename event has occurred for the given item. - */ -void UMLListView::cancelRename(UMLListViewItem* item) -{ - m_bRenameInProgress = false; - if (item) { - DEBUG(DBG_SRC) << item->text(0); - // delete pointer first to lock slotItemChanged - m_editItem = 0; - closePersistentEditor(item, 0); - } - else { - uError() << "Called without an item!"; - } -} - -/** - * Renaming of an item has ended. - * @param item the item which was renamed or not - */ -void UMLListView::endRename(UMLListViewItem* item) -{ - m_bRenameInProgress = false; - if (item) { - DEBUG(DBG_SRC) << item->text(0); - // delete pointer first to lock slotItemChanged - m_editItem = 0; - closePersistentEditor(item, 0); - item->okRename(0); - } - else { - uError() << "Called without an item!"; - } -} - -/** * */ void UMLListView::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) @@ -3211,6 +3091,34 @@ QTreeWidget::dropEvent(event); } +void UMLListView::commitData(QWidget *editor) +{ + if (!editor) + return; + + QModelIndex index = currentIndex(); + if (!index.isValid()) + return; + + QAbstractItemDelegate *delegate = itemDelegate(index); + editor->removeEventFilter(delegate); + QByteArray n = editor->metaObject()->userProperty().name(); + if (n.isEmpty()) { + DEBUG(DBG_SRC) << "no name property found in list view item editor"; + return; + } + + QString newText = editor->property(n).toString(); + + UMLListViewItem *item = dynamic_cast<UMLListViewItem *>(currentItem()); + if (!item) { + DEBUG(DBG_SRC) << "no item found after editing model index" << index; + return; + } + item->slotEditFinished(newText); + editor->installEventFilter(delegate); +} + /** * Set the background color. * @param color the new background color diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umllistview.h new/umbrello-4.12.1/umbrello/umllistview.h --- old/umbrello-4.12.0/umbrello/umllistview.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umllistview.h 2014-01-09 13:48:53.000000000 +0100 @@ -95,10 +95,6 @@ bool isUnique(UMLListViewItem * item, const QString &name); - void startRename(UMLListViewItem * item); - void cancelRename(UMLListViewItem * item); - void endRename(UMLListViewItem * item); - void setSelected(UMLListViewItem * item, bool state) { setItemSelected((QTreeWidgetItem*)item, state); } void setStartedCut(bool startedCut); void setStartedCopy(bool startedCopy); @@ -128,13 +124,12 @@ protected: bool event(QEvent *e); - bool eventFilter(QObject *o, QEvent *e); void mouseReleaseEvent(QMouseEvent *me); void mousePressEvent(QMouseEvent *me); void mouseMoveEvent(QMouseEvent *me); void mouseDoubleClickEvent(QMouseEvent *me); void focusOutEvent (QFocusEvent *fe); - + void contextMenuEvent(QContextMenuEvent *me); UMLDragData* getDragData(); bool acceptDrag(QDropEvent* event) const; @@ -142,6 +137,7 @@ void dragEnterEvent(QDragEnterEvent* event); void dragMoveEvent(QDragMoveEvent* event); void dropEvent(QDropEvent* event); + void commitData(QWidget *editor); UMLListViewItem * findUMLObjectInFolder(UMLListViewItem *folder, UMLObject *obj); @@ -169,7 +165,7 @@ void slotObjectChanged(); - void popupMenuSel(QAction* action); + void slotMenuSelection(QAction* action); void slotDropped(QDropEvent* de, UMLListViewItem* parent, UMLListViewItem* item); @@ -177,9 +173,9 @@ void collapseAll(UMLListViewItem *item); void slotCutSuccessful(); + void slotDeleteSelectedItems(); protected slots: - void slotItemChanged(QTreeWidgetItem *, int); void slotItemSelectionChanged(); void slotExpanded(QTreeWidgetItem* item); void slotCollapsed(QTreeWidgetItem* item); @@ -193,14 +189,11 @@ UMLListViewItem* m_rv; ///< root view (home) UMLListViewItem* m_lv[Uml::ModelType::N_MODELTYPES]; ///< predefined list view roots UMLListViewItem* m_datatypeFolder; - ListPopupMenu* m_menu; UMLDoc* m_doc; bool m_bStartedCut; bool m_bStartedCopy; bool m_bCreatingChildObject; ///< when creating an attribute or an operation to stop it adding a second listViewItem - bool m_bRenameInProgress; QPoint m_dragStartPosition; - UMLListViewItem* m_editItem; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umllistviewitem.cpp new/umbrello-4.12.1/umbrello/umllistviewitem.cpp --- old/umbrello-4.12.0/umbrello/umllistviewitem.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umllistviewitem.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -456,24 +456,15 @@ } /** - * Start the rename process. + * This slot is called to finish item editing */ -void UMLListViewItem::startRename(int col) +void UMLListViewItem::slotEditFinished(const QString &newText) { - DEBUG(DBG_LVI) << this << " - column=" << col << ", text=" << text(col); - m_label = text(col); // keep the old text -} + m_label = text(0); -/** - * This function is called if the user presses Enter during in-place renaming - * of the item in column col. - */ -void UMLListViewItem::okRename(int col) -{ - DEBUG(DBG_LVI) << this << " - column=" << col << ", text=" << text(col); + DEBUG(DBG_LVI) << this << "text=" << newText; UMLListView* listView = static_cast<UMLListView*>(treeWidget()); UMLDoc* doc = listView->document(); - QString newText = text(col); if (newText == m_label) { return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umllistviewitem.h new/umbrello-4.12.1/umbrello/umllistviewitem.h --- old/umbrello-4.12.0/umbrello/umllistviewitem.h 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umllistviewitem.h 2014-01-09 13:48:53.000000000 +0100 @@ -121,9 +121,6 @@ void setIcon(Icon_Utils::IconType iconType); - void startRename(int col); - void okRename(int col); - void addClassifierListItem(UMLClassifierListItem *child, UMLListViewItem *childItem); void deleteChildItem(UMLClassifierListItem *child); @@ -144,6 +141,9 @@ bool isOpen() { return isExpanded(); } void setOpen(bool state); +public slots: + void slotEditFinished(const QString &newText); + protected: void init(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/umlscene.cpp new/umbrello-4.12.1/umbrello/umlscene.cpp --- old/umbrello-4.12.0/umbrello/umlscene.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/umlscene.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -3019,8 +3019,8 @@ }//end switch if (menu != ListPopupMenu::mt_Undefined) { // DEBUG(DBG_SRC) << "create popup for MenuType " << ListPopupMenu::toString(menu); - ListPopupMenu* popup = new ListPopupMenu(activeView(), menu, activeView()); - QAction *triggered = popup->exec(pos); + ListPopupMenu popup(activeView(), menu, activeView()); + QAction *triggered = popup.exec(pos); slotMenuSelection(triggered); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/widgets/associationwidget.cpp new/umbrello-4.12.1/umbrello/widgets/associationwidget.cpp --- old/umbrello-4.12.0/umbrello/widgets/associationwidget.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/widgets/associationwidget.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -3940,8 +3940,8 @@ } setSelected(true); m_eventScenePos = event->scenePos(); - QPointer<ListPopupMenu> menu = new ListPopupMenu(parent, menuType, this); - QAction *triggered = menu->exec(event->screenPos()); + ListPopupMenu popup(parent, menuType, this); + QAction *triggered = popup.exec(event->screenPos()); ListPopupMenu *parentMenu = ListPopupMenu::menuFromAction(triggered); if (!parentMenu) { @@ -3957,8 +3957,6 @@ " or UMLObject is the one triggered in ListPopupMenu"); ownerWidget->slotMenuSelection(triggered); - - delete menu.data(); } /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/widgets/umlwidget.cpp new/umbrello-4.12.1/umbrello/widgets/umlwidget.cpp --- old/umbrello-4.12.0/umbrello/widgets/umlwidget.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/widgets/umlwidget.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -905,8 +905,6 @@ QPointF point = m_scene->getPastePoint(); int x = point.x() + this->x(); int y = point.y() + this->y(); - x = x < 0 ? 0 : x; - y = y < 0 ? 0 : y; if (m_scene->type() == Uml::DiagramType::Sequence) { switch (baseType()) { case WidgetBase::wt_Object: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/umbrello-4.12.0/umbrello/widgets/widgetbase.cpp new/umbrello-4.12.1/umbrello/widgets/widgetbase.cpp --- old/umbrello-4.12.0/umbrello/widgets/widgetbase.cpp 2013-12-11 17:54:40.000000000 +0100 +++ new/umbrello-4.12.1/umbrello/widgets/widgetbase.cpp 2014-01-09 13:48:53.000000000 +0100 @@ -661,9 +661,9 @@ } } setSelected(true); - QPointer<ListPopupMenu> menu = new ListPopupMenu(0, this, false, false); - setupContextMenuActions(*(menu.data())); - QAction *triggered = menu->exec(event->screenPos()); + ListPopupMenu popup(0, this, false, false); + setupContextMenuActions(popup); + QAction *triggered = popup.exec(event->screenPos()); ListPopupMenu *parentMenu = ListPopupMenu::menuFromAction(triggered); if (!parentMenu) { @@ -679,8 +679,6 @@ " or UMLObject is the one triggered in ListPopupMenu"); ownerWidget->slotMenuSelection(triggered); - - delete menu.data(); } /** -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org