| 35 | } |
| 36 | |
| 37 | void CommandLineWidget::updateCommandLine() |
| 38 | { |
| 39 | auto commandLine = m_text; |
| 40 | if (m_ui->cmdBreak->isChecked()) { |
| 41 | commandLine.replace(QLatin1String(" -"), QLatin1String("\n-")); |
| 42 | commandLine.replace(QLatin1String(","), QLatin1String("\n,")); |
| 43 | } |
| 44 | |
| 45 | auto filterText = m_ui->cmdFilter->text(); |
| 46 | if (!filterText.isEmpty()) { |
| 47 | QStringList lines = commandLine.split(QLatin1Char('\n')); |
| 48 | QMutableStringListIterator i(lines); |
| 49 | |
| 50 | while (i.hasNext()) { |
| 51 | if (!i.next().contains(filterText)) { |
| 52 | i.remove(); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | commandLine = lines.join(QLatin1Char('\n')); |
| 57 | } |
| 58 | |
| 59 | m_ui->cmdEdit->setPlainText(commandLine); |
| 60 | } |
| 61 | |
| 62 | } |
| 63 | |