| 63 | } |
| 64 | |
| 65 | QVariant LuaConsoleModel::data(const QModelIndex &index, int role) const |
| 66 | { |
| 67 | const Lua::LuaFunctionList& lfl = Lua::Callbacks::getList(); |
| 68 | |
| 69 | if (index.column() == 0 && role == Qt::CheckStateRole) { |
| 70 | if (lfl.activeState(index.row())) |
| 71 | return Qt::Checked; |
| 72 | return Qt::Unchecked; |
| 73 | } |
| 74 | |
| 75 | if (role == Qt::DisplayRole) { |
| 76 | switch(index.column()) { |
| 77 | case 0: |
| 78 | return QString(""); |
| 79 | case 1: |
| 80 | return QString(lfl.fileList[index.row()].filename.c_str()); |
| 81 | case 2: |
| 82 | return QString(lfl.fileList[index.row()].file.c_str()); |
| 83 | default: |
| 84 | return QString(); |
| 85 | } |
| 86 | } |
| 87 | return QVariant(); |
| 88 | } |
| 89 | |
| 90 | bool LuaConsoleModel::setData(const QModelIndex &index, const QVariant &value, int role) |
| 91 | { |
nothing calls this directly
no test coverage detected