summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/text/qtexthtmlparser.cpp8
-rw-r--r--src/network/access/qftp.cpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 103a208c26..50df8daa5e 100644
--- a/src/gui/text/qtexthtmlparser.cpp
+++ b/src/gui/text/qtexthtmlparser.cpp
@@ -1418,16 +1418,16 @@ static bool setFloatAttribute(qreal *destination, const QString &value)
return ok;
}
-static void setWidthAttribute(QTextLength *width, QString value)
+static void setWidthAttribute(QTextLength *width, const QString &valueStr)
{
bool ok = false;
- qreal realVal = value.toDouble(&ok);
+ qreal realVal = valueStr.toDouble(&ok);
if (ok) {
*width = QTextLength(QTextLength::FixedLength, realVal);
} else {
- value = value.trimmed();
+ QStringRef value = QStringRef(&valueStr).trimmed();
if (!value.isEmpty() && value.endsWith(QLatin1Char('%'))) {
- value.chop(1);
+ value.truncate(value.size() - 1);
realVal = value.toDouble(&ok);
if (ok)
*width = QTextLength(QTextLength::PercentageLength, realVal);
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp
index 19b519243c..7b6f830333 100644
--- a/src/network/access/qftp.cpp
+++ b/src/network/access/qftp.cpp
@@ -2034,7 +2034,7 @@ int QFtp::rename(const QString &oldname, const QString &newname)
*/
int QFtp::rawCommand(const QString &command)
{
- QString cmd = command.trimmed() + QLatin1String("\r\n");
+ const QString cmd = QStringRef(&command).trimmed() + QLatin1String("\r\n");
return d_func()->addCommand(new QFtpCommand(RawCommand, QStringList(cmd)));
}
@@ -2253,8 +2253,8 @@ void QFtpPrivate::_q_startNextCommand()
// Proxy support, replace the Login argument in place, then fall
// through.
if (c->command == QFtp::Login && !proxyHost.isEmpty()) {
- QString loginString = c->rawCmds.constFirst().trimmed();
- loginString += QLatin1Char('@') + host;
+ QString loginString;
+ loginString += QStringRef(&c->rawCmds.constFirst()).trimmed() + QLatin1Char('@') + host;
if (port && port != 21)
loginString += QLatin1Char(':') + QString::number(port);
loginString += QLatin1String("\r\n");