| 116 | } |
| 117 | |
| 118 | void EnvironmentProfileListModel::removeProfile(int profileIndex) |
| 119 | { |
| 120 | const auto profileNames = this->profileNames(); |
| 121 | if (profileIndex < 0 || profileIndex >= profileNames.size()) { |
| 122 | return; |
| 123 | } |
| 124 | const auto profileName = profileNames.at(profileIndex); |
| 125 | if (defaultProfileName() == profileName) { |
| 126 | return; |
| 127 | } |
| 128 | |
| 129 | emit profileAboutToBeRemoved(profileName); |
| 130 | |
| 131 | beginRemoveRows(QModelIndex(), profileIndex, profileIndex); |
| 132 | |
| 133 | EnvironmentProfileList::removeProfile(profileName); |
| 134 | |
| 135 | endRemoveRows(); |
| 136 | } |
| 137 | |
| 138 | int EnvironmentProfileListModel::cloneProfile(const QString& newProfileName, const QString& sourceProfileName) |
| 139 | { |
no test coverage detected