Commit 817726eb authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Properly expose PID list in CGroupDataModel as QVariantList

QAIM::data is used by QML, which cannot handle a QVector<pid_t>
properly, so make sure to expose a the list of PIDs as a proper
parent d4a235d4
......@@ -271,8 +271,10 @@ QVariant CGroupDataModel::data(const QModelIndex &index, int role) const
return attribute->unit();
case ProcessDataModel::PIDs: {
KSysGuard::CGroup *app = reinterpret_cast< KSysGuard::CGroup* > (index.internalPointer());
return QVariant::fromValue(app->pids());
const auto pids = static_cast<KSysGuard::CGroup*>(index.internalPointer())->pids();
QVariantList result;
std::transform(pids.begin(), pids.end(), std::back_inserter(result), [](pid_t pid) { return int(pid); } );
return result;
return QVariant();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment