From 9c2ffa8c6a9b1683ea21ed43f2b44f62fda7964e Mon Sep 17 00:00:00 2001 From: Arno Date: Tue, 17 Aug 2010 19:26:56 +0200 Subject: Fixed various bugs in NewMovieWizard SmTreeModel had a serious bug: SmTreeItem would accept rows > mChildren.count() in SmTreeItem::child(int row). Do some sanity checks. This only happened when trying to edit the type of the last file in NewMovieWizard::MovieInfoPage, strangely enough. But this should fix it. While working on the Wizard I tried to figure out why mItemEdit->clear only sometimes worked. I guess it's because mItemEdit and the QCompleter were connected to the same QKeyEvent, the latter winning and doing the completion. "Fixed" this by removing the connection to the returnPressed() slot of mItemEdit and giving the "Add Item" button a shortcut. Don't really know if this is more annoying than pressing CTRL- Also fixed a small logic error in MappingTableItemModel::lowerBound(). Revert the logic if the sort order should be ascending. --- smtreeitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'smtreeitem.cpp') diff --git a/smtreeitem.cpp b/smtreeitem.cpp index a13e76a..5584319 100644 --- a/smtreeitem.cpp +++ b/smtreeitem.cpp @@ -36,7 +36,10 @@ void SmTreeItem::appendChild(SmTreeItem *child){ } SmTreeItem *SmTreeItem::child(int row) const{ - return mChildren.at(row); + if(row > -1 && row < mChildren.count()){ + return mChildren.at(row); + } + return 0; } int SmTreeItem::childCount() const{ -- cgit v1.2.3-70-g09d2