| 174 | } |
| 175 | |
| 176 | void LaunchConfiguration::setLauncherForMode(const QString& mode, const QString& id) |
| 177 | { |
| 178 | Q_D(LaunchConfiguration); |
| 179 | |
| 180 | QStringList modes = d->baseGroup.readEntry("Configured Launch Modes", QStringList()); |
| 181 | int idx = modes.indexOf( mode ); |
| 182 | if( idx == -1 ) |
| 183 | { |
| 184 | idx = modes.count(); |
| 185 | modes << mode; |
| 186 | d->baseGroup.writeEntry("Configured Launch Modes", modes); |
| 187 | } |
| 188 | QStringList launchers = d->baseGroup.readEntry("Configured Launchers", QStringList()); |
| 189 | if( launchers.count() > idx ) |
| 190 | { |
| 191 | launchers.replace(idx, id); |
| 192 | } else |
| 193 | { |
| 194 | launchers.append( id ); |
| 195 | } |
| 196 | d->baseGroup.writeEntry("Configured Launchers", launchers); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | } |
no test coverage detected