[Uml-devel] [Bug 122188] crash when creating a datatype with the same name as a class
Oliver Kellogg
okellogg at users.sourceforge.net
Sat Feb 18 11:46:00 UTC 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=122188
okellogg users sourceforge net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From okellogg users sourceforge net 2006-02-18 20:44 -------
SVN commit 511082 by okellogg:
UMLListView::slotItemRenamed(): Rename to itemRenamed() because it's not used
as a slot. Move physical deletion of the item to UMLListViewItem::okRename().
BUG:122188
M +4 -1 ChangeLog
M +4 -6 umbrello/umllistview.cpp
M +5 -7 umbrello/umllistview.h
M +2 -2 umbrello/umllistviewitem.cpp
--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #511081:511082
@ -5,13 +5,16 @
* fixed problem with font size computation/word wrap in note widgets
http://sourceforge.net/mailarchive/forum.php?thread_id=9558795&forum_id=472
* Bugs/wishes from http://bugs.kde.org:
-* Umbrello doesnt allow some keywords for return types (115991)
+* Import Rose model files (81364)
+* Default data types not added for old Java generator (115991)
* Multiplicity labels positioned incorrectly when moving entities (120598)
* Types of entity's attributes are displayed instead of their names (120742)
* Unable to delete entity from entity list in "UML Model" frame (120750)
* Interface names not italicized in diagram view (120761)
* Cannot Resize Sequence Diagram Synchronous Messages (120910)
* Crash when importing Python files (121952)
+* "void" is imported as class and not datatypes (122184)
+* Crash when creating a datatype with the same name as a class (122188)
Version 1.5.1
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistview.cpp #511081:511082
@ -2231,7 +2231,7 @
// is called (automatically by QListViewItem.)
}
-bool UMLListView::slotItemRenamed( QListViewItem * item , int /*col*/ ) {
+bool UMLListView::itemRenamed( QListViewItem * item , int /*col*/ ) {
//if true the item was cancel before this message
if( m_bIgnoreCancelRename ) {
return true;
@ -2242,13 +2242,12 @
QString newText = renamedItem -> text( 0 );
renamedItem -> setCreating( false );
- //if the length of any type then delete it.
- if( newText.length() == 0 ) {
+ // If the type is empty then delete it.
+ if (newText.isEmpty() || newText.contains(QRegExp("^\\s+$"))) {
KMessageBox::error(
kapp -> mainWidget(),
i18n( "The name you entered was invalid.\nCreation process has been canceled." ),
i18n( "Name Not Valid" ) );
- delete item;
return false;
}
// No need to do anything for folders if the string length was > 0
@ -2271,7 +2270,6 @
kapp -> mainWidget(),
i18n( "The name you entered was not unique!\nCreation process has been canceled." ),
i18n( "Name Not Unique" ) );
- delete item;
return false;
}
}
@ -2291,7 +2289,7 @
{
Uml::Object_Type ot = convert_LVT_OT(type);
if (! ot) {
- kdError() << "UMLListView::slotItemRenamed() internal" << endl;
+ kdError() << "UMLListView::itemRenamed() internal" << endl;
return false;
}
createUMLObject( renamedItem, ot );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistview.h #511081:511082
@ -302,6 +302,11 @
UMLListViewItem * moveObject(Uml::IDType srcId, Uml::ListView_Type srcType,
UMLListViewItem *newParent);
+ /**
+ * Called for informing the list view that an item was renamed.
+ */
+ bool itemRenamed(QListViewItem* item , int col);
+
void closeDatatypesFolder();
UMLListViewItem *theRootView() { return m_rv; }
@ -529,13 +534,6 @
*/
void slotCutSuccessful();
- /**
- * When a user requests a new item we wait for the signal
- * to then verify the item. The class only connects to the
- * rename signal while needed.
- */
- bool slotItemRenamed(QListViewItem* item , int col);
-
signals:
/**
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umllistviewitem.cpp #511081:511082
@ -336,11 +336,11 @
m_bCreating = false;
QString savedLabel = m_Label;
m_Label = text(col);
- if ( s_pListView->slotItemRenamed( this, col ) ) {
+ if ( s_pListView->itemRenamed( this, col ) ) {
s_pListView->ensureItemVisible(this);
doc->setModified(true);
} else {
- m_Label = savedLabel;
+ delete this;
}
return;
}
More information about the umbrello-devel
mailing list