| 399 | } |
| 400 | |
| 401 | void ExternalScriptPlugin::setupKeys(int start, int end) |
| 402 | { |
| 403 | QStringList keys = getConfig().groupList(); |
| 404 | |
| 405 | for (int row = start; row <= end; ++row) { |
| 406 | auto* const item = static_cast<ExternalScriptItem*>(m_model->item(row)); |
| 407 | |
| 408 | int nextSuffix = 2; |
| 409 | QString keyCandidate = item->text(); |
| 410 | for (; keys.contains(keyCandidate); ++nextSuffix) { |
| 411 | keyCandidate = item->text() + QString::number(nextSuffix); |
| 412 | } |
| 413 | |
| 414 | qCDebug(PLUGIN_EXTERNALSCRIPT) << "set key" << keyCandidate << "for" << item << item->command(); |
| 415 | item->setKey(keyCandidate); |
| 416 | keys.push_back(keyCandidate); |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | #include "externalscriptplugin.moc" |
| 421 | #include "moc_externalscriptplugin.cpp" |