diff options
author | Anne Jan Brouwer <brouwer@annejan.com> | 2016-06-01 13:58:23 +0200 |
---|---|---|
committer | Anne Jan Brouwer <brouwer@annejan.com> | 2016-06-01 13:58:23 +0200 |
commit | 7de136291216cb5800a6d04ea7a4ef43f3f64732 (patch) | |
tree | 3eb50956de26e793b05b57ed03b4b90fb763439a | |
parent | fc0a7ab72670ccad7568b87afe085097a38f365f (diff) |
Trimming and adding sapce after : when using templates, fixes #182
-rw-r--r-- | passworddialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/passworddialog.cpp b/passworddialog.cpp index ac5230de..5db795d5 100644 --- a/passworddialog.cpp +++ b/passworddialog.cpp @@ -43,7 +43,7 @@ void PasswordDialog::setPassword(QString password) { if (token.startsWith(widget->objectName() + ':')) { tokens.removeAt(j); QString value = token.remove(0, widget->objectName().length() + 1); - reinterpret_cast<QLineEdit *>(widget)->setText(value); + reinterpret_cast<QLineEdit *>(widget)->setText(value.trimmed()); } } previous = widget; @@ -58,8 +58,8 @@ void PasswordDialog::setPassword(QString password) { if (!passTemplate.contains(field) && value.startsWith("//")) continue; // colon is probably from a url QLineEdit *line = new QLineEdit(); - line->setObjectName(field); - line->setText(value); + line->setObjectName(field.trimmed()); + line->setText(value.trimmed()); ui->formLayout->addRow(new QLabel(field), line); setTabOrder(previous, line); previous = line; @@ -82,7 +82,7 @@ QString PasswordDialog::getPassword() { QString text = reinterpret_cast<QLineEdit *>(widget)->text(); if (text.isEmpty()) continue; - passFile += widget->objectName() + ":" + text + "\n"; + passFile += widget->objectName() + ": " + text + "\n"; } passFile += ui->plainTextEdit->toPlainText(); return passFile; |