summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2013-06-01 08:26:46 (GMT)
committerKevin Smith <git@kismith.co.uk>2013-08-01 09:22:45 (GMT)
commitdb698bbb6d8c7e878e2cb997e18e572f3646e11d (patch)
tree61aa3ff72c64dd8f309a2fe4b31b5b2d3f22f04b /Swift/QtUI/QtChatView.cpp
parentb45602bcd36fb9d2e7a22998434e31014f072d33 (diff)
downloadswift-db698bbb6d8c7e878e2cb997e18e572f3646e11d.zip
swift-db698bbb6d8c7e878e2cb997e18e572f3646e11d.tar.bz2
Refactor chat messages so parsing of links/emoticons happens in controllers.
Change-Id: I07256f23ffbb6520f5063bdfbed9111946c46746
Diffstat (limited to 'Swift/QtUI/QtChatView.cpp')
-rw-r--r--Swift/QtUI/QtChatView.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp
index 18c6e91..2536d39 100644
--- a/Swift/QtUI/QtChatView.cpp
+++ b/Swift/QtUI/QtChatView.cpp
@@ -128,7 +128,7 @@ void QtChatView::addMessageTop(boost::shared_ptr<ChatSnippet> snippet) {
double size = 1.0 + 0.2 * fontSizeSteps_;
QString sizeString(QString().setNum(size, 'g', 3) + "em");
const QWebElementCollection spans = firstElement_.findAll("span.swift_resizable");
- foreach (QWebElement span, spans) {
+ Q_FOREACH (QWebElement span, spans) {
span.setStyleProperty("font-size", sizeString);
}
}
@@ -161,7 +161,7 @@ void QtChatView::addToDOM(boost::shared_ptr<ChatSnippet> snippet) {
double size = 1.0 + 0.2 * fontSizeSteps_;
QString sizeString(QString().setNum(size, 'g', 3) + "em");
const QWebElementCollection spans = lastElement_.findAll("span.swift_resizable");
- foreach (QWebElement span, spans) {
+ Q_FOREACH (QWebElement span, spans) {
span.setStyleProperty("font-size", sizeString);
}
}
@@ -229,13 +229,13 @@ void QtChatView::replaceMessage(const QString& newMessage, const QString& id, co
void QtChatView::showEmoticons(bool show) {
{
const QWebElementCollection spans = document_.findAll("span.swift_emoticon_image");
- foreach (QWebElement span, spans) {
+ Q_FOREACH (QWebElement span, spans) {
span.setStyleProperty("display", show ? "inline" : "none");
}
}
{
const QWebElementCollection spans = document_.findAll("span.swift_emoticon_text");
- foreach (QWebElement span, spans) {
+ Q_FOREACH (QWebElement span, spans) {
span.setStyleProperty("display", show ? "none" : "inline");
}
}
@@ -324,7 +324,7 @@ void QtChatView::resizeFont(int fontSizeSteps) {
QString sizeString(QString().setNum(size, 'g', 3) + "em");
//qDebug() << "Setting to " << sizeString;
const QWebElementCollection spans = document_.findAll("span.swift_resizable");
- foreach (QWebElement span, spans) {
+ Q_FOREACH (QWebElement span, spans) {
span.setStyleProperty("font-size", sizeString);
}
webView_->setFontSizeIsMinimal(size == 1.0);
@@ -370,7 +370,7 @@ void QtChatView::resetView() {
static QWebElement findElementWithID(QWebElement document, QString elementName, QString id) {
QWebElementCollection elements = document.findAll(elementName);
- foreach(QWebElement element, elements) {
+ Q_FOREACH(QWebElement element, elements) {
if (element.attribute("id") == id) {
return element;
}