-void NickView::rowsInserted(const QModelIndex &index, int start, int end) {
- QTreeView::rowsInserted(index, start, end);
- expandAll(); // FIXME We need to do this more intelligently. Maybe a pimped TreeView?
-}
-
-QString NickView::nickFromModelIndex(const QModelIndex & index) {
- QString nick = index.sibling(index.row(), 0).data().toString();
- return nick;
+void NickView::rowsInserted(const QModelIndex &parent, int start, int end) {
+ QTreeView::rowsInserted(parent, start, end);
+ if(model()->data(parent, NetworkModel::ItemTypeRole) == NetworkModel::UserCategoryItemType && !isExpanded(parent)) {
+ QCoreApplication::postEvent(this, new ExpandAllEvent);
+ }