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

Method data

kdevplatform/shell/settings/environmentprofilelistmodel.cpp:37–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37QVariant EnvironmentProfileListModel::data(const QModelIndex& index, int role) const
38{
39 if (!index.isValid() ||
40 index.row() < 0 || index.row() >= rowCount() ||
41 index.column() != 0) {
42 return {};
43 }
44
45 if (role == Qt::DisplayRole) {
46 auto profileName = profileNames().at(index.row());
47 if (profileName == defaultProfileName()) {
48 profileName = i18n("%1 (default profile)", profileName);
49 }
50 return profileName;
51 }
52
53 return {};
54}
55
56QModelIndex EnvironmentProfileListModel::index(int row, int column, const QModelIndex& parent) const
57{

Callers

nothing calls this directly

Calls 5

defaultProfileNameFunction · 0.85
isValidMethod · 0.45
rowMethod · 0.45
columnMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected