diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-02 12:21:41 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-01-15 11:05:41 (GMT) |
commit | 09108f5ac3c1a6567730b5bbd0c847f8422ff4a2 (patch) | |
tree | b7054e421da9dd8227b3bbe11b2ea20575b760df /Swift/QtUI/QtWebKitChatView.cpp | |
parent | 9cf1fe4ec5d3729ceb53385aeb245a4a688823e0 (diff) | |
download | swift-09108f5ac3c1a6567730b5bbd0c847f8422ff4a2.zip swift-09108f5ac3c1a6567730b5bbd0c847f8422ff4a2.tar.bz2 |
Improved plaintext chat view for screen-reader support.
Change-Id: Ib7c10350b56683db95f4c6be49f79f8a9d9e80ec
Diffstat (limited to 'Swift/QtUI/QtWebKitChatView.cpp')
-rw-r--r-- | Swift/QtUI/QtWebKitChatView.cpp | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index af21609..d1e250c 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -1,13 +1,11 @@ /* - * Copyright (c) 2010-2013 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include "QtWebKitChatView.h" -#include <boost/format.hpp> - #include <QtDebug> #include <QEventLoop> #include <QFile> @@ -23,6 +21,7 @@ #include <QFileDialog> #include <Swiften/Base/Log.h> +#include <Swiften/Base/FileSize.h> #include <Swiften/StringCodecs/Base64.h> #include <Swift/Controllers/UIEvents/UIEventStream.h> @@ -621,18 +620,6 @@ std::string QtWebKitChatView::addAction(const ChatWindow::ChatMessage& message, return addMessage(" *" + chatMessageToHTML(message) + "*", senderName, senderIsSelf, label, avatarPath, "font-style:italic ", time, highlight, ChatSnippet::getDirection(message)); } -// FIXME: Move this to a different file -std::string formatSize(const boost::uintmax_t bytes) { - static const char *siPrefix[] = {"k", "M", "G", "T", "P", "E", "Z", "Y", NULL}; - int power = 0; - double engBytes = bytes; - while (engBytes >= 1000) { - ++power; - engBytes = engBytes / 1000.0; - } - return str( boost::format("%.1lf %sB") % engBytes % (power > 0 ? siPrefix[power-1] : "") ); -} - static QString encodeButtonArgument(const QString& str) { return QtUtilities::htmlEscape(P2QSTRING(Base64::encode(createByteArray(Q2PSTRING(str))))); } |