MCPcopy Create free account
hub / github.com/KDE/kdevelop / data

Method data

kdevplatform/shell/settings/environmentprofilemodel.cpp:55–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55QVariant EnvironmentProfileModel::data(const QModelIndex& index, int role) const
56{
57 if (!index.isValid() ||
58 index.row() < 0 || index.row() >= rowCount() ||
59 index.column() < 0 || index.column() >= columnCount(QModelIndex()) ||
60 m_currentProfileName.isEmpty()) {
61 return {};
62 }
63
64 const auto variable = m_varsByIndex[index.row()];
65 if (role == VariableRole) {
66 return variable;
67 }
68 if (role == ValueRole) {
69 const auto& variables = m_profileListModel->variables(m_currentProfileName);
70 return variables.value(variable);
71 }
72 if (role == Qt::DisplayRole || role == Qt::EditRole) {
73 if (index.column() == VariableColumn) {
74 return variable;
75 }
76 const auto& variables = m_profileListModel->variables(m_currentProfileName);
77 return variables.value(variable);
78 }
79 return {};
80}
81
82QVariant EnvironmentProfileModel::headerData(int section, Qt::Orientation orientation, int role) const
83{

Callers 15

currentIndexChangedMethod · 0.45
extractTemplateMethod · 0.45
askNewProfileNameMethod · 0.45
testFindNodeMethod · 0.45
testSeverityMethod · 0.45
testSeveritiesMethod · 0.45
testScopeMethod · 0.45
testClosingMethod · 0.45
checkIsSameMethod · 0.45
checkDiagnosticsMethod · 0.45

Calls 7

QModelIndexClass · 0.70
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
isEmptyMethod · 0.45
variablesMethod · 0.45
valueMethod · 0.45

Tested by 15

testFindNodeMethod · 0.36
testSeverityMethod · 0.36
testSeveritiesMethod · 0.36
testScopeMethod · 0.36
testClosingMethod · 0.36
checkIsSameMethod · 0.36
checkDiagnosticsMethod · 0.36
checkDisplayMethod · 0.36
checkLabelMethod · 0.36
checkPathGroupMethod · 0.36
checkSeverityGroupMethod · 0.36
deleteSessionMethod · 0.36