[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:25:01 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=f63bb51
The following commit has been merged in the master branch:
commit f63bb511e7ad8b9b69433f7aa9a0bd2e7e830407
Author: Aleix Pol <aleixpol at kde.org>
Date: Fri Dec 5 19:05:33 2014 +0100
Remove superfluous QByteArray -> QString -> QByteArray conversion
In most cases we can just use QByteArray anyway
---
image-sharer/mpform.cpp | 24 ++++++++++++------------
image-sharer/mpform.h | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/image-sharer/mpform.cpp b/image-sharer/mpform.cpp
index 0fc2f15..48eb60b 100644
--- a/image-sharer/mpform.cpp
+++ b/image-sharer/mpform.cpp
@@ -68,7 +68,7 @@ void MPForm::finish()
bool MPForm::addPair(const QString& name, const QString& value, const QString& contentType)
{
QByteArray str;
- QString content_length = QString(QLatin1String("%1")).arg(value.length());
+ QByteArray content_length = QByteArray::number(value.length());
str += "--";
str += m_boundary;
@@ -83,14 +83,14 @@ bool MPForm::addPair(const QString& name, const QString& value, const QString& c
if (!contentType.isEmpty())
{
- str += "Content-Type: " + QByteArray(contentType.toLatin1());
+ str += "Content-Type: " + contentType.toLatin1();
str += "
";
str += "Mime-version: 1.0 ";
str += "
";
}
str += "Content-Length: ";
- str += content_length.toLatin1();
+ str += content_length;
str += "
";
str += value.toUtf8();
@@ -123,7 +123,7 @@ bool MPForm::addFile(const QString& name, const QString& path)
QByteArray imageData = imageFile.readAll();
QByteArray str;
- QString file_size = QString(QLatin1String("%1")).arg(imageFile.size());
+ QByteArray file_size = QByteArray::number(imageFile.size());
imageFile.close();
str += "--";
@@ -136,7 +136,7 @@ bool MPForm::addFile(const QString& name, const QString& path)
str += QFile::encodeName(imageFile.fileName());
str += "\"
";
str += "Content-Length: ";
- str += file_size.toLatin1();
+ str += file_size;
str += "
";
str += "Content-Type: ";
str += mime.toLatin1();
@@ -164,7 +164,7 @@ bool MPForm::addFile(const QString& name, const QString& filePath, const QByteAr
}
QByteArray str;
- QString file_size = QString(QLatin1String("%1")).arg(fileData.size());
+ QByteArray file_size = QByteArray::number(fileData.size());
str += "--";
str += m_boundary;
@@ -173,10 +173,10 @@ bool MPForm::addFile(const QString& name, const QString& filePath, const QByteAr
str += name.toLatin1();
str += "\"; ";
str += "filename=\"";
- str += QFile::encodeName(QFileInfo(filePath).fileName());
+ str += QFile::encodeName(fileUrl.fileName());
str += "\"
";
str += "Content-Length: ";
- str += file_size.toLatin1();
+ str += file_size;
str += "
";
str += "Content-Type: ";
str += mime.toLatin1();
@@ -190,14 +190,14 @@ bool MPForm::addFile(const QString& name, const QString& filePath, const QByteAr
return true;
}
-QString MPForm::contentType() const
+QByteArray MPForm::contentType() const
{
- return QString(QLatin1String("Content-Type: multipart/form-data; boundary=" + m_boundary));
+ return "Content-Type: multipart/form-data; boundary=" + m_boundary;
}
-QString MPForm::boundary() const
+QByteArray MPForm::boundary() const
{
- return QLatin1String(m_boundary);
+ return m_boundary;
}
QByteArray MPForm::formData() const
diff --git a/image-sharer/mpform.h b/image-sharer/mpform.h
index 002b886..de019b8 100644
--- a/image-sharer/mpform.h
+++ b/image-sharer/mpform.h
@@ -45,9 +45,9 @@ public:
bool addFile(const QString& name, const QString& path);
bool addFile(const QString& name, const QString& filePath, const QByteArray& fileData);
- QString contentType() const;
+ QByteArray contentType() const;
QByteArray formData() const;
- QString boundary() const;
+ QByteArray boundary() const;
private:
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list