From 3e784fed0148c4ec24aa8b2b8ca53f2d9d9bc543 Mon Sep 17 00:00:00 2001 From: Arno Date: Sun, 18 Mar 2012 01:47:21 +0100 Subject: Fix some severe braindamage It started as a buxfix session, but the more I dug into some ancient code, the more I had to change. Well, first and foremost, this fixes a crash in PicturesWidget. Trying to display the mappings of the selected picture in a different color never was a good idea. Show them in the statusbar instead. While looking at the statusBar code, make PictureWidget emit signals to show the total size and number of selected items. Then I noticed some really, really braindamaged connection madness in the Shemov constructor. Instead of doing all the work in SheMov itself, have the widgets emit signals. This should have been several commits, but one lead to another... --- mappingtreemodel.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'mappingtreemodel.cpp') diff --git a/mappingtreemodel.cpp b/mappingtreemodel.cpp index 5ab6068..9b849d9 100644 --- a/mappingtreemodel.cpp +++ b/mappingtreemodel.cpp @@ -291,28 +291,6 @@ MappingData MappingTreeModel::mappingDataFromId(int mappingId) const{ return retval; } -void MappingTreeModel::setSelectedMappings(const QList &mappingIds){ - //we can't change the list we're iterating over... that would wreak havoc - QList iterateList = mSelectedMappings; - foreach(SmTreeItem *item, iterateList){ - mSelectedMappings.removeAll(item); - QModelIndex idxStart = createIndex(item->parent()->row(), 0, item); - QModelIndex idxEnd = createIndex(item->parent()->row(), NumFields - 1, item); - emit dataChanged(idxStart, idxEnd); - } - mSelectedMappings.clear(); - foreach(int id, mappingIds){ - QModelIndex idx = findRecursive(id, Id); - if(idx.isValid()){ - SmTreeItem *item = static_cast(idx.internalPointer()); - mSelectedMappings << item; - QModelIndex idxStart = createIndex(item->parent()->row(), 0, item); - QModelIndex idxEnd = createIndex(item->parent()->row(), NumFields - 1, item); - emit dataChanged(idxStart, idxEnd); - } - } -} - QStringList MappingTreeModel::paths() const{ return getPathsRecursive(root()); } -- cgit v1.2.3-70-g09d2