summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtContactEditWidget.cpp')
-rw-r--r--Swift/QtUI/QtContactEditWidget.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Swift/QtUI/QtContactEditWidget.cpp b/Swift/QtUI/QtContactEditWidget.cpp
index 9d071b9..a347a00 100644
--- a/Swift/QtUI/QtContactEditWidget.cpp
+++ b/Swift/QtUI/QtContactEditWidget.cpp
@@ -53,6 +53,7 @@ QtContactEditWidget::QtContactEditWidget(const std::set<std::string>& allGroups,
foreach (std::string group, allGroups) {
+ QString groupName = doubleAmpersand(group);
QCheckBox* check = new QCheckBox(groups);
- check->setText(P2QSTRING(group));
+ check->setText(groupName);
check->setCheckState(Qt::Unchecked);
checkBoxes_[group] = check;
@@ -84,5 +85,5 @@ std::string QtContactEditWidget::getName() const {
name = Q2PSTRING(name_->text());
} else {
- name = Q2PSTRING(button->text());
+ name = singleAmpersand(button->text());
}
break;
@@ -116,5 +117,5 @@ void QtContactEditWidget::setNameSuggestions(const std::vector<std::string>& sug
foreach(const std::string& name, suggestions) {
- suggestionsLayout_->insertWidget(nameLayout_->count() - 2, new QRadioButton(P2QSTRING(name), this));
+ suggestionsLayout_->insertWidget(nameLayout_->count() - 2, new QRadioButton(doubleAmpersand(name), this));
}
@@ -136,4 +137,13 @@ void QtContactEditWidget::setNameSuggestions(const std::vector<std::string>& sug
}
}
+QString QtContactEditWidget::doubleAmpersand(const std::string& name) const {
+ return P2QSTRING(name).replace("&", "&&");
+
+}
+
+std::string QtContactEditWidget::singleAmpersand(const QString& name) const {
+ return Q2PSTRING(QString(name).replace("&&", "&"));
+}
+
void QtContactEditWidget::clear() {