diff options
author | Lakshman <acrlakshman@gmail.com> | 2014-03-26 15:09:01 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-03-27 10:58:23 -0700 |
commit | df7d7d498118c85b2bee40af5242852770c11e43 (patch) | |
tree | 11c79f2eb749c877547636fb6ef813581fcdf145 /qt-ui/maintab.cpp | |
parent | d2f1a0252310cdb1976d12b49d1077977101ff61 (diff) | |
download | subsurface-df7d7d498118c85b2bee40af5242852770c11e43.tar.gz |
Fix redundant spaces in info panel
Remove redundant spaces from dive master and buddy list fields.
Ticket also mentions about similar space behaviour in tag field, which I
couldn't reproduce.
Fixes #476
Signed-off-by: Lakshman Anumolu <acrlakshman@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index aea676de2..9ff5e9f31 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -853,14 +853,20 @@ void markChangedWidget(QWidget *w) void MainTab::on_buddy_textChanged() { - QString text = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts).join(", "); + QStringList text_list = ui.buddy->toPlainText().split(",", QString::SkipEmptyParts); + for (int i = 0; i < text_list.size(); i++) + text_list[i] = text_list[i].trimmed(); + QString text = text_list.join(", "); EDIT_SELECTED_DIVES(EDIT_TEXT(mydive->buddy, text)); markChangedWidget(ui.buddy); } void MainTab::on_divemaster_textChanged() { - QString text = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts).join(", "); + QStringList text_list = ui.divemaster->toPlainText().split(",", QString::SkipEmptyParts); + for (int i = 0; i < text_list.size(); i++) + text_list[i] = text_list[i].trimmed(); + QString text = text_list.join(", "); EDIT_SELECTED_DIVES(EDIT_TEXT(mydive->divemaster, text)); markChangedWidget(ui.divemaster); } |