Changeset View
Changeset View
Standalone View
Standalone View
korganizer/views/collectionview/controller.cpp
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | if (enabled) { | ||||
mCheckState = Qt::Unchecked; | mCheckState = Qt::Unchecked; | ||||
} | } | ||||
} | } | ||||
QVariant PersonNode::data(int role) const | QVariant PersonNode::data(int role) const | ||||
{ | { | ||||
if (role == Qt::DisplayRole) { | if (role == Qt::DisplayRole) { | ||||
QString name = mPerson.name; | QString name = mPerson.name; | ||||
if (!mPerson.group.isEmpty()) { | |||||
name = mPerson.group + QLatin1String(" - ") + name; | |||||
} | |||||
if (!mPerson.ou.isEmpty()) { | if (!mPerson.ou.isEmpty()) { | ||||
name += QLatin1String(" (") + mPerson.ou + QLatin1String(")"); | name += QLatin1String(" (") + mPerson.ou + QLatin1String(")"); | ||||
} | } | ||||
return name; | return name; | ||||
} | } | ||||
if (role == Qt::DecorationRole) { | if (role == Qt::DecorationRole) { | ||||
return KIcon(QLatin1String("meeting-participant")); | return KIcon(QLatin1String("meeting-participant")); | ||||
} | } | ||||
if (role == Qt::CheckStateRole) { | if (role == Qt::CheckStateRole) { | ||||
if (isSearchNode) { | if (isSearchNode) { | ||||
return QVariant(); | return QVariant(); | ||||
} | } | ||||
return mCheckState; | return mCheckState; | ||||
} | } | ||||
if (role == Qt::ToolTipRole) { | if (role == Qt::ToolTipRole) { | ||||
QString tooltip = i18n("Person: ") + mPerson.name; | QString tooltip = i18n("Person: ") + mPerson.name; | ||||
if (!mPerson.group.isEmpty()) { | |||||
tooltip += QLatin1String("\n") + i18n("Group: ") + mPerson.group; | |||||
} | |||||
if (!mPerson.mail.isEmpty()) { | if (!mPerson.mail.isEmpty()) { | ||||
tooltip += QLatin1String("\n") + i18n("Mail: ") + mPerson.mail; | tooltip += QLatin1String("\n") + i18n("Mail: ") + mPerson.mail; | ||||
} | } | ||||
if (!mPerson.ou.isEmpty()) { | if (!mPerson.ou.isEmpty()) { | ||||
tooltip += QLatin1String("\n") + i18n("Organization Unit: ") + mPerson.ou; | tooltip += QLatin1String("\n") + i18n("Organization Unit: ") + mPerson.ou; | ||||
} | } | ||||
return tooltip; | return tooltip; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |