From b9ef4566d31219d66a615b1eae042a01828c8b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Sun, 18 Nov 2012 13:51:22 +0100 Subject: Remove QString::fromStdString usage. Change-Id: I27e91b18e64385bc28a5eee816293c66e34bfbb0 diff --git a/Swift/QtUI/QtChatWindow.cpp b/Swift/QtUI/QtChatWindow.cpp index 0857455..237d78c 100644 --- a/Swift/QtUI/QtChatWindow.cpp +++ b/Swift/QtUI/QtChatWindow.cpp @@ -666,11 +666,11 @@ std::string QtChatWindow::addFileTransfer(const std::string& senderName, bool se } void QtChatWindow::setFileTransferProgress(std::string id, const int percentageDone) { - messageLog_->setFileTransferProgress(QString::fromStdString(id), percentageDone); + messageLog_->setFileTransferProgress(P2QSTRING(id), percentageDone); } void QtChatWindow::setFileTransferStatus(std::string id, const FileTransferState state, const std::string& msg) { - messageLog_->setFileTransferStatus(QString::fromStdString(id), state, QString::fromStdString(msg)); + messageLog_->setFileTransferStatus(P2QSTRING(id), state, P2QSTRING(msg)); } std::string QtChatWindow::addWhiteboardRequest(bool senderIsSelf) { @@ -703,7 +703,7 @@ std::string QtChatWindow::addWhiteboardRequest(bool senderIsSelf) { } void QtChatWindow::setWhiteboardSessionStatus(std::string id, const ChatWindow::WhiteboardSessionState state) { - messageLog_->setWhiteboardSessionStatus(QString::fromStdString(id), state); + messageLog_->setWhiteboardSessionStatus(P2QSTRING(id), state); } void QtChatWindow::handleHTMLButtonClicked(QString id, QString encodedArgument1, QString encodedArgument2, QString encodedArgument3) { @@ -740,12 +740,12 @@ void QtChatWindow::handleHTMLButtonClicked(QString id, QString encodedArgument1, } else if (id.startsWith(ButtonWhiteboardSessionAcceptRequest)) { QString id = arg1; - messageLog_->setWhiteboardSessionStatus(QString::fromStdString(Q2PSTRING(id)), ChatWindow::WhiteboardAccepted); + messageLog_->setWhiteboardSessionStatus(id, ChatWindow::WhiteboardAccepted); onWhiteboardSessionAccept(); } else if (id.startsWith(ButtonWhiteboardSessionCancel)) { QString id = arg1; - messageLog_->setWhiteboardSessionStatus(QString::fromStdString(Q2PSTRING(id)), ChatWindow::WhiteboardTerminated); + messageLog_->setWhiteboardSessionStatus(id, ChatWindow::WhiteboardTerminated); onWhiteboardSessionCancel(); } else if (id.startsWith(ButtonWhiteboardShowWindow)) { diff --git a/Swift/QtUI/QtFileTransferListItemModel.cpp b/Swift/QtUI/QtFileTransferListItemModel.cpp index fac0761..9f7ccdc 100644 --- a/Swift/QtUI/QtFileTransferListItemModel.cpp +++ b/Swift/QtUI/QtFileTransferListItemModel.cpp @@ -14,6 +14,7 @@ #include #include #include +#include "QtSwiftUtil.h" namespace Swift { @@ -65,7 +66,7 @@ QVariant QtFileTransferListItemModel::data(const QModelIndex &index, int role) c return controller->isIncoming() ? QVariant(QObject::tr("Incoming")) : QVariant(QObject::tr("Outgoing")); } if (index.column() == OtherParty) { - return QVariant(QString::fromStdString(controller->getOtherParty().toString())); + return QVariant(P2QSTRING(controller->getOtherParty().toString())); } if (index.column() == State) { FileTransfer::State state = controller->getState(); @@ -91,7 +92,7 @@ QVariant QtFileTransferListItemModel::data(const QModelIndex &index, int role) c return QVariant(QString::number(controller->getProgress())); } if (index.column() == OverallSize) { - return QVariant(QString::fromStdString(formatSize((controller->getSize())))); + return QVariant(P2QSTRING(formatSize((controller->getSize())))); } return QVariant(); } diff --git a/Swift/QtUI/QtFormResultItemModel.cpp b/Swift/QtUI/QtFormResultItemModel.cpp index 5461f05..b052334 100644 --- a/Swift/QtUI/QtFormResultItemModel.cpp +++ b/Swift/QtUI/QtFormResultItemModel.cpp @@ -35,7 +35,7 @@ QVariant QtFormResultItemModel::headerData(int section, Qt::Orientation /*orient if (!formResult_) return QVariant(); if (role != Qt::DisplayRole) return QVariant(); if (static_cast(section) >= formResult_->getReportedFields().size()) return QVariant(); - return QVariant(QString::fromStdString(formResult_->getReportedFields().at(section)->getLabel())); + return QVariant(P2QSTRING(formResult_->getReportedFields().at(section)->getLabel())); } int QtFormResultItemModel::rowCount(const QModelIndex &/*parent*/) const { -- cgit v0.10.2-6-g49f6