Skip to content

Commit

Permalink
Trimming and adding sapce after : when using templates, fixes #182
Browse files Browse the repository at this point in the history
  • Loading branch information
annejan committed Jun 1, 2016
1 parent fc0a7ab commit 7de1362
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions passworddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 7de1362

Please sign in to comment.