summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp10
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);
}