Skip to content
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ext/pim.contacts/native/pim_contacts_qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ std::string PimContactsQt::replaceAll(const std::string& s, const std::string& s
return temp;
}
std::string PimContactsQt::replaceString(const std::string& s) {
std::string temp = replaceAll(replaceAll(replaceAll(replaceAll(s), "\n", "\\\\n"), "\r", ""), "\t", "\\\\t");
std::string temp = replaceAll(replaceAll(replaceAll(replaceAll(replaceAll(s), "\n", "\\\\n"), "\r", ""), "\t", "\\\\t"), "\"", "\"");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this make more sense as a regexp? This seems ugly.

return temp;
}

Expand Down Expand Up @@ -804,7 +804,9 @@ void PimContactsQt::populateField(const bbpim::Contact& contact, bbpim::Attribut
QString format = "yyyy-MM-dd";
contactItem[typeIter->second] = Json::Value(currentAttr.valueAsDateTime().date().toString(format).toStdString());
} else {
contactItem[typeIter->second] = Json::Value(currentAttr.value().toStdString());
std::string value = currentAttr.value().toStdString();
value = replaceString(value);
contactItem[typeIter->second] = Json::Value(value);
}
}
}
Expand Down