Properly auto-type line breaks and tabs in text.

This commit is contained in:
Felix Geyer 2015-03-13 22:24:29 +01:00
parent 2631277184
commit 940a5026c1

View File

@ -477,9 +477,17 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
QString resolved = entry->resolvePlaceholders(placeholder); QString resolved = entry->resolvePlaceholders(placeholder);
if (placeholder != resolved) { if (placeholder != resolved) {
Q_FOREACH (const QChar& ch, resolved) { Q_FOREACH (const QChar& ch, resolved) {
if (ch == '\n') {
list.append(new AutoTypeKey(Qt::Key_Enter));
}
else if (ch == '\t') {
list.append(new AutoTypeKey(Qt::Key_Tab));
}
else {
list.append(new AutoTypeChar(ch)); list.append(new AutoTypeChar(ch));
} }
} }
}
return list; return list;
} }