From e8c0dfa8173b3e6bf1b8274d183f633585a0bec5 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Thu, 12 May 2011 16:18:40 +0100
Subject: Purge old code.

Resolves: #522

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_;
-- 
cgit v0.10.2-6-g49f6