diff options
author | Kevin Smith <git@kismith.co.uk> | 2011-05-12 15:18:40 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2011-05-12 15:19:50 (GMT) |
commit | e8c0dfa8173b3e6bf1b8274d183f633585a0bec5 (patch) | |
tree | 9c30ebee003ac7803fcc1cb230ac4de44d945437 /Swift/QtUI | |
parent | f8bdaa778c1eaa5ebfbf9cede08863e923095989 (diff) | |
download | swift-e8c0dfa8173b3e6bf1b8274d183f633585a0bec5.zip swift-e8c0dfa8173b3e6bf1b8274d183f633585a0bec5.tar.bz2 |
Purge old code.
Resolves: #522
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/QtChatView.cpp | 15 | ||||
-rw-r--r-- | Swift/QtUI/QtChatView.h | 2 |
2 files changed, 3 insertions, 14 deletions
diff --git a/Swift/QtUI/QtChatView.cpp b/Swift/QtUI/QtChatView.cpp index eab6d91..d89f25f 100644 --- a/Swift/QtUI/QtChatView.cpp +++ b/Swift/QtUI/QtChatView.cpp @@ -77,13 +77,14 @@ void QtChatView::addMessage(boost::shared_ptr<ChatSnippet> snippet) { if (viewReady_) { addToDOM(snippet); } else { - queuedSnippets_.append(snippet); + /* If this asserts, the previous queuing code was necessary and should be reinstated */ + assert(false); } } QWebElement QtChatView::snippetToDOM(boost::shared_ptr<ChatSnippet> snippet) { QWebElement newElement = newInsertPoint_.clone(); - newElement.setInnerXml(snippet->getContent()); /* FIXME: Outer, surely? */ + newElement.setInnerXml(snippet->getContent()); Q_ASSERT(!newElement.isNull()); return newElement; } @@ -103,7 +104,6 @@ void QtChatView::addToDOM(boost::shared_ptr<ChatSnippet> snippet) { newInsertPoint_.prependOutside(newElement); } lastElement_ = newElement; - //qApp->processEvents(); } void QtChatView::addLastSeenLine() { @@ -121,7 +121,6 @@ void QtChatView::addLastSeenLine() { void QtChatView::replaceLastMessage(const QString& newMessage) { assert(viewReady_); - /* FIXME: must be queued? */ rememberScrolledToBottom(); assert(!lastElement_.isNull()); QWebElement replace = lastElement_.findFirst("span.swift_message"); @@ -192,17 +191,9 @@ void QtChatView::handleLinkClicked(const QUrl& url) { QDesktopServices::openUrl(url); } -void QtChatView::addQueuedSnippets() { - for (int i = 0; i < queuedSnippets_.count(); i++) { - addToDOM(queuedSnippets_[i]); - } - queuedSnippets_.clear(); -} - void QtChatView::handleViewLoadFinished(bool ok) { Q_ASSERT(ok); viewReady_ = true; - addQueuedSnippets(); } void QtChatView::resetView() { diff --git a/Swift/QtUI/QtChatView.h b/Swift/QtUI/QtChatView.h index 32741f4..8b8d330 100644 --- a/Swift/QtUI/QtChatView.h +++ b/Swift/QtUI/QtChatView.h @@ -53,7 +53,6 @@ namespace Swift { private: void headerEncode(); void messageEncode(); - void addQueuedSnippets(); void addToDOM(boost::shared_ptr<ChatSnippet> snippet); QWebElement snippetToDOM(boost::shared_ptr<ChatSnippet> snippet); @@ -61,7 +60,6 @@ namespace Swift { bool isAtBottom_; QtWebView* webView_; QWebPage* webPage_; - QList<boost::shared_ptr<ChatSnippet> > queuedSnippets_; QtChatTheme* theme_; QWebElement newInsertPoint_; |