From 9e12957c363a68543456dfe95ab88a11a69ae610 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 5 Aug 2010 20:39:09 +0200 Subject: Fixed edit trigger in SeriesTreeView Until now doubleclicking an item with children in SeriesTreeWidget did 3 things: 1. Expand or collapse the item 2. Trigger editing 3. Start playing all child movies in the default player This is not really expected behavior. So I disabled all EditTriggers on SeriesTreeView and set expandsOnDoubleClick to false. To still retain the ability to edit series a new slot was introduced to SeriesTreeWidget triggering the edit event. It's available from the SeriesTreeWidget context menu. Now doubleclicking an item in SeriesTreeView just plays all child movies. Child items also have their name changed when changing the parent item. This bug was long present in renameSeries. mergeSeries always did the right thing (tm). --- seriestreemodel.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'seriestreemodel.cpp') diff --git a/seriestreemodel.cpp b/seriestreemodel.cpp index 0f20f3a..8de3d01 100644 --- a/seriestreemodel.cpp +++ b/seriestreemodel.cpp @@ -492,6 +492,15 @@ bool SeriesTreeModel::renameSeries(const QModelIndex &source, const QVariant &va SmTreeItem *curItem = static_cast(source.internalPointer()); curItem->setData(Name, value); emit dataChanged(source, source); + for(int i = 0; i < curItem->childCount(); ++i){ + SmTreeItem *child = curItem->child(i); + child->setData(Name, value); + } + if(curItem->childCount()){ + QModelIndex start = source.child(0, 0); + QModelIndex end = source.child(curItem->childCount() - 1, 0); + emit dataChanged(start, end); + } emit needResort(); return true; } -- cgit v1.2.3-70-g09d2