-/* Plugin *plugin = qobject_cast<Plugin*>(sender());
- auto it = pluginOrder.find(plugin);
- int pluginIdx;
- int resultIdx;
- int oldResultCount;
- int newResultCount;
-
- if (it == resultMap.end())
- {
- if (!plugin->latestResult().results.count())
- return;
-
- pluginOrder.append(plugin);
-
- pluginIdx = pluginOrder.count();
-
- PluginResult *pr = new PluginResult;
- pr->plugin = plugin;
-
- results.append(pr);
- resultMap.insert(plugin, pr);
-
- pluginIdx = results.count() - 1;
- resultIdx = rowCount();
- oldResultCount = 0;
- }
-
- if (it != resultMap.end())
- {
- pluginIdx = results.indexOf(it.value());
- resultIdx = 0;
- for (int i = 0; i < pluginIdx; ++i)
- resultIdx += results[i]->count();
-
- oldResultCount = plugin->previousResult().results.count();
- }
-
- newResultCount = plugin->latestResult().results.count();
-
- results[pluginIdx]->isCurrent = plugin->isCurrentResult();
-
- if (oldResultCount == newResultCount)
- {
-qDebug() << "Updating rows" << newResultCount;
-
- if (newResultCount)
- updateResultsForRange(resultIdx, newResultCount);
- }
- else if(oldResultCount < newResultCount)
- {
-qDebug() << "Adding rows";
- if (oldResultCount)
- updateResultsForRange(resultIdx, oldResultCount);
-// rowCountDelta = -(newResultCount - oldResultCount);
- beginInsertRows(QModelIndex(), resultIdx + oldResultCount, resultIdx + newResultCount - 1);
- rowCountDelta = 0;
- endInsertRows();
- }
- else
- {
-qDebug() << "Removing rows";
-// rowCountDelta = oldResultCount - newResultCount;
- beginRemoveRows(QModelIndex(), resultIdx + newResultCount, resultIdx + oldResultCount - 1);
- rowCountDelta = 0;
- endRemoveRows();
- if (newResultCount)
- updateResultsForRange(resultIdx, newResultCount);
- }
-*/