4#include "identitytreeview.h"
5#include "identitytreedelegate.h"
6#include "identitytreemodel.h"
7#include "identitytreesortproxymodel.h"
11using namespace KIdentityManagementWidgets;
12IdentityTreeView::IdentityTreeView(
QWidget *parent)
14 , mIdentityProxyModel(new KIdentityManagementCore::IdentityTreeSortProxyModel(this))
16 setAlternatingRowColors(
true);
17 setSelectionMode(ExtendedSelection);
20 setRootIsDecorated(
false);
21 setSortingEnabled(
true);
22 setAllColumnsShowFocus(
true);
24 header()->setSectionsMovable(
false);
28 mIdentityModel->setShowDefault(
true);
30 mIdentityProxyModel->setSourceModel(mIdentityModel);
31 setModel(mIdentityProxyModel);
33 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::DefaultRole,
true);
34 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::UoidRole,
true);
35 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::EmailRole,
true);
36 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::IdentityNameRole,
true);
37 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::ActivitiesRole,
true);
38 setColumnHidden(KIdentityManagementCore::IdentityTreeModel::EnabledActivitiesRole,
true);
39 setItemDelegateForColumn(KIdentityManagementCore::IdentityTreeModel::DisplayIdentityNameRole,
new IdentityTreeDelegate(
this));
42IdentityTreeView::~IdentityTreeView() =
default;
44KIdentityManagementCore::IdentityActivitiesAbstract *IdentityTreeView::identityActivitiesAbstract()
const
46 return mIdentityProxyModel->identityActivitiesAbstract();
49bool IdentityTreeView::enablePlasmaActivities()
const
51 return mIdentityProxyModel->enablePlasmaActivities();
54void IdentityTreeView::setEnablePlasmaActivities(
bool newEnablePlasmaActivities)
56 mIdentityProxyModel->setEnablePlasmaActivities(newEnablePlasmaActivities);
59KIdentityManagementCore::IdentityTreeSortProxyModel *IdentityTreeView::identityProxyModel()
const
61 return mIdentityProxyModel;
64void IdentityTreeView::setIdentityActivitiesAbstract(KIdentityManagementCore::IdentityActivitiesAbstract *newIdentityActivitiesAbstract)
66 mIdentityProxyModel->setIdentityActivitiesAbstract(newIdentityActivitiesAbstract);
74KIdentityManagementCore::IdentityTreeModel *IdentityTreeView::identityTreeModel()
const
76 return mIdentityModel;
79#include "moc_identitytreeview.cpp"
static IdentityManager * self()
Creates or reuses the identity manager instance for this process.
Identity & modifyIdentityForUoid(uint uoid)
User identity information.