diff options
author | Tobias Markmann <tm@ayena.de> | 2013-10-16 08:22:10 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-10-26 15:27:52 (GMT) |
commit | 60c5c9f13b97c25e3b73f57fc107622d483d5160 (patch) | |
tree | 98acae70585a5129dda48f60def8f0573458d407 | |
parent | 5f0eeca41f0559c5b416c78fd51445fd93cf61ff (diff) | |
download | swift-60c5c9f13b97c25e3b73f57fc107622d483d5160.zip swift-60c5c9f13b97c25e3b73f57fc107622d483d5160.tar.bz2 |
VCard: Removing whitespace due to empty fields in the full name.
Change-Id: Ib97d7bff7fcd0364924e6266c4d20d7d71e9ad09
License: This patch is BSD-licensed, see Documentation/Licenses/BSD-simplified.txt for details.
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp index 3ddc86b..4ad12c8 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.cpp @@ -4,8 +4,9 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#include "QtVCardPhotoAndNameFields.h" -#include "ui_QtVCardPhotoAndNameFields.h" +#include <Swift/QtUI/QtVCardWidget/QtVCardPhotoAndNameFields.h> + +#include <Swift/QtUI/QtVCardWidget/ui_QtVCardPhotoAndNameFields.h> #include <QMenu> @@ -68,8 +69,12 @@ void QtVCardPhotoAndNameFields::setEditable(bool editable) { ui->lineEditFAMILY->setVisible(editable); ui->lineEditSUFFIX->setVisible(editable); ui->labelFULLNAME->setVisible(!editable); - ui->labelFULLNAME->setText( ui->lineEditPREFIX->text() + " " + ui->lineEditGIVEN->text() + " " + - ui->lineEditMIDDLE->text() + " " + ui->lineEditFAMILY->text() + " " + ui->lineEditSUFFIX->text()); + + QStringList fullname; + fullname << ui->lineEditPREFIX->text() << ui->lineEditGIVEN->text() << ui->lineEditMIDDLE->text(); + fullname << ui->lineEditFAMILY->text() << ui->lineEditSUFFIX->text(); + fullname = fullname.filter(".*\\S.*"); + ui->labelFULLNAME->setText(fullname.join(" ")); prepareAddFieldMenu(); } |