From b6b7edd187fd72291fee09de4acdcbee85448631 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 9 Oct 2015 20:42:25 +0200 Subject: [PATCH] Use shorter code for QString().arg(int) --- src/lib/network/schemehandlers/qupzillaschemehandler.cpp | 2 +- src/lib/tools/scripts.cpp | 9 +++------ src/lib/webengine/webhittestresult.cpp | 2 +- src/lib/webengine/webpage.cpp | 2 +- src/plugins/PIM/PIM_handler.cpp | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 60c470e35..e8d8d017e 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -453,7 +453,7 @@ QString QupZillaSchemeReply::configPage() case QVariant::Point: { const QPoint point = keyValue.toPoint(); - keyString = QString("QPoint(%1, %2)").arg(QString::number(point.x()), QString::number(point.y())); + keyString = QString("QPoint(%1, %2)").arg(point.x()).arg(point.y()); break; } diff --git a/src/lib/tools/scripts.cpp b/src/lib/tools/scripts.cpp index 1422f4101..09b80bf20 100644 --- a/src/lib/tools/scripts.cpp +++ b/src/lib/tools/scripts.cpp @@ -275,8 +275,7 @@ QString Scripts::getFormData(const QPoint &pos) "return res;" "})()"); - return source.arg(QString::number(pos.x()), QString::number(pos.y())); - + return source.arg(pos.x()).arg(pos.y()); } QString Scripts::toggleMediaPause(const QPoint &pos) @@ -291,8 +290,7 @@ QString Scripts::toggleMediaPause(const QPoint &pos) " e.pause();" "})()"); - return source.arg(QString::number(pos.x()), QString::number(pos.y())); - + return source.arg(pos.x()).arg(pos.y()); } QString Scripts::toggleMediaMute(const QPoint &pos) @@ -304,6 +302,5 @@ QString Scripts::toggleMediaMute(const QPoint &pos) "e.muted = !e.muted;" "})()"); - return source.arg(QString::number(pos.x()), QString::number(pos.y())); - + return source.arg(pos.x()).arg(pos.y()); } diff --git a/src/lib/webengine/webhittestresult.cpp b/src/lib/webengine/webhittestresult.cpp index 1097ad489..d726f5d85 100644 --- a/src/lib/webengine/webhittestresult.cpp +++ b/src/lib/webengine/webhittestresult.cpp @@ -81,7 +81,7 @@ WebHitTestResult::WebHitTestResult(const WebPage *page, const QPoint &pos) "})()"); WebPage *p = const_cast(page); - const QString &js = source.arg(QString::number(pos.x()), QString::number(pos.y())); + const QString &js = source.arg(pos.x()).arg(pos.y()); init(page->url(), p->execJavaScript(js).toMap()); } diff --git a/src/lib/webengine/webpage.cpp b/src/lib/webengine/webpage.cpp index 7d0b7b0af..a15ef5203 100644 --- a/src/lib/webengine/webpage.cpp +++ b/src/lib/webengine/webpage.cpp @@ -132,7 +132,7 @@ WebHitTestResult WebPage::hitTestContent(const QPoint &pos) const void WebPage::scroll(int x, int y) { - runJavaScript(QSL("window.scrollTo(window.scrollX + %1, window.scrollY + %2)").arg(QString::number(x), QString::number(y))); + runJavaScript(QSL("window.scrollTo(window.scrollX + %1, window.scrollY + %2)").arg(x).arg(y)); } void WebPage::scheduleAdjustPage() diff --git a/src/plugins/PIM/PIM_handler.cpp b/src/plugins/PIM/PIM_handler.cpp index 9dbdbc226..56cb16ef1 100644 --- a/src/plugins/PIM/PIM_handler.cpp +++ b/src/plugins/PIM/PIM_handler.cpp @@ -200,7 +200,7 @@ void PIM_Handler::pimInsert() " v += \"%3\" + e.value.substring(e.selectionEnd);" " e.value = v;" "}"); - source = source.arg(QString::number(m_clickedPos.x()), QString::number(m_clickedPos.y()), info); + source = source.arg(m_clickedPos.x()).arg(m_clickedPos.y()).arg(info); m_view->page()->runJavaScript(source); }