From 47d30d5f4838a1980545c36308858efc7d5bde0d Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 22 May 2011 05:54:07 +0200 Subject: Update IsLocal when setting DVD no. The field IsLocal in the SeriesTreeModel is now properly updated when the DVD no. changes. It still doesn't propagate to the file view, though. --- seriestreemodel.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'seriestreemodel.cpp') diff --git a/seriestreemodel.cpp b/seriestreemodel.cpp index a0dfebf..b850b9c 100644 --- a/seriestreemodel.cpp +++ b/seriestreemodel.cpp @@ -181,11 +181,13 @@ bool SeriesTreeModel::setData(const QModelIndex &index, const QVariant &value, i } } } - }else if(index.data(TypeRole).toInt() == NewSeries){ - return setNewSeries(index, value); - }else{ - return updateGeneric(index, value); + }else if(index.column() == IsLocal){ + setLocal(index, value); } + }else if(index.data(TypeRole).toInt() == NewSeries){ + return setNewSeries(index, value); + }else{ + return updateGeneric(index, value); } return false; } @@ -671,3 +673,11 @@ bool SeriesTreeModel::updateGeneric(const QModelIndex &source, const QVariant &v mDb.rollback(); return false; } + +bool SeriesTreeModel::setLocal(const QModelIndex &source, const QVariant &value){ + SmTreeItem *item = static_cast(source.internalPointer()); + item->setData(IsLocal, value); + emit dataChanged(source, source); + emit localsChanged(); + return true; +} -- cgit v1.2.3-70-g09d2