# # # patch "src/model/Inventory.cpp" # from [0ea3c180af066fa870dd0d1fb24b15f524682b58] # to [9f53528da894fe102df63a9aa6b9bdffd1f60e91] # # patch "src/model/Inventory.h" # from [c45f6b4c627eae8b928f76d14c5e5cdd56c1e4ba] # to [eacc1e32020afe3568a697edec2bfc6ca59c1dbf] # ============================================================ --- src/model/Inventory.cpp 0ea3c180af066fa870dd0d1fb24b15f524682b58 +++ src/model/Inventory.cpp 9f53528da894fe102df63a9aa6b9bdffd1f60e91 @@ -190,7 +190,19 @@ void Inventory::processTaskResult(const ModelItem * parentItem = rootItem; if (itemMap.contains(queriedPath)) { - parentItem = itemMap.value(queriedPath)->parent(); + // if we just queried one item we replace it directly underknees + // the appropriate parent record, if not, we re-use the original + // parent (i.e. skip new data we get from inventory here) and just + // include the data _underknees_ this node + if (stanzas.size() == 1) + { + parentItem = itemMap.value(queriedPath)->parent(); + } + else + { + stanzas.removeFirst(); + parentItem = itemMap.value(queriedPath); + } } // @@ -239,20 +251,6 @@ void Inventory::processTaskResult(const insertRowsRecursive(parentItem, parentChildRelations); - // - // This is a bit of a hack: Since we replace the original item each - // time we query new data, the view looses the viewport and indexes - // for it. So what we need to do here is to notify the view that it - // should set the viewport to the correct item again _after_ we've - // read it (now) and we need to do this through an already existing - // signal since this model is not directly connected to the view, but - // through a proxy model, so we need to ensure that the proxy model - // transports a known signal to the view. - // The dataChanged signal is normally used for in-place editable - // actions, so I really hope it has - // a) no side effects - // b) I never need it for its original purpose - // if (queriedPath.isEmpty()) { // we need to call reset() before we emit dataChanged, @@ -260,11 +258,6 @@ void Inventory::processTaskResult(const // index we're going to present her afterwards reset(); } - - I(itemMap.contains(queriedPath)); - QModelIndex index = indexFromItem(itemMap.value(queriedPath), 0); - I(index.isValid()); - emit dataChanged(index, index); } QModelIndex Inventory::indexFromItem(ModelItem * item, int col) const ============================================================ --- src/model/Inventory.h c45f6b4c627eae8b928f76d14c5e5cdd56c1e4ba +++ src/model/Inventory.h eacc1e32020afe3568a697edec2bfc6ca59c1dbf @@ -49,9 +49,6 @@ public slots: void setWorkspacePath(const WorkspacePath &); void refresh(); -signals: - void nodeLoaded(const QModelIndex &); - private: void processTaskResult(const MonotoneTask &); QModelIndex indexFromItem(ModelItem *, int) const;