| 964 | } |
| 965 | |
| 966 | void InputEditorModel::addUniqueInputs(const AllInputs &ai) |
| 967 | { |
| 968 | std::set<SingleInput> new_input_set; |
| 969 | ai.extractInputs(new_input_set); |
| 970 | |
| 971 | /* Check if added inputs are already in the list */ |
| 972 | bool any_new_input = false; |
| 973 | for (SingleInput si : new_input_set) { |
| 974 | |
| 975 | bool new_input = true; |
| 976 | for (SingleInput ti : movie->editor->input_set) { |
| 977 | if (si == ti) { |
| 978 | new_input = false; |
| 979 | break; |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | /* Insert input if new */ |
| 984 | if (new_input) { |
| 985 | any_new_input = true; |
| 986 | |
| 987 | /* Gather input description */ |
| 988 | for (int i=0; i<KeyMapping::INPUTLIST_SIZE; i++) { |
| 989 | for (SingleInput ti : context->config.km->input_list[i]) { |
| 990 | if (si == ti) { |
| 991 | si.description = ti.description; |
| 992 | break; |
| 993 | } |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | beginInsertColumns(QModelIndex(), columnCount(), columnCount()); |
| 998 | movie->editor->input_set.push_back(si); |
| 999 | endInsertColumns(); |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | if (any_new_input) |
| 1004 | emit inputSetChanged(); |
| 1005 | } |
| 1006 | |
| 1007 | void InputEditorModel::addUniqueInputs(int minRow, int maxRow) |
| 1008 | { |
nothing calls this directly
no test coverage detected