MCPcopy Create free account
hub / github.com/MultiMC/Launcher / data

Method data

launcher/ui/dialogs/ExportInstanceDialog.cpp:107–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 }
106
107 virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
108 {
109 QModelIndex sourceIndex = mapToSource(index);
110
111 if (index.column() == 0 && role == Qt::CheckStateRole)
112 {
113 QFileSystemModel *fsm = qobject_cast<QFileSystemModel *>(sourceModel());
114 auto blockedPath = relPath(fsm->filePath(sourceIndex));
115 auto cover = blocked.cover(blockedPath);
116 if (!cover.isNull())
117 {
118 return QVariant(Qt::Unchecked);
119 }
120 else if (blocked.exists(blockedPath))
121 {
122 return QVariant(Qt::PartiallyChecked);
123 }
124 else
125 {
126 return QVariant(Qt::Checked);
127 }
128 }
129
130 return sourceIndex.data(role);
131 }
132
133 virtual bool setData(const QModelIndex &index, const QVariant &value,
134 int role = Qt::EditRole)

Callers 3

activatedMethod · 0.45
selectionChangedMethod · 0.45
on_buttonBox_acceptedMethod · 0.45

Calls 3

filePathMethod · 0.80
coverMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected