* @brief Sanitise a label into a filename-safe token. */
| 59 | * @brief Sanitise a label into a filename-safe token. |
| 60 | */ |
| 61 | static QString sanitiseLabel(const QString& label) |
| 62 | { |
| 63 | QString out; |
| 64 | out.reserve(label.size()); |
| 65 | for (const auto& ch : label) |
| 66 | if (ch.isLetterOrNumber() || ch == QLatin1Char('-') || ch == QLatin1Char('_')) |
| 67 | out.append(ch); |
| 68 | else if (ch == QLatin1Char(' ') || ch == QLatin1Char('.')) |
| 69 | out.append(QLatin1Char('-')); |
| 70 | |
| 71 | return out.left(32); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * @brief Construct the singleton. Debounce timer + initial state. |