[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:02 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=491b940
The following commit has been merged in the master branch:
commit 491b940359bd02bbd615157c68057a3d8ae6937e
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed Jan 7 15:04:40 2015 +0100
[image-sharer] Port from KUrl to QUrl
---
image-sharer/abstractsharer.cpp | 2 +-
image-sharer/abstractsharer.h | 10 +++++-----
image-sharer/imagebinsharer.cpp | 8 +++-----
image-sharer/imagebinsharer.h | 2 +-
image-sharer/imgursharer.cpp | 14 ++++++++------
image-sharer/imgursharer.h | 2 +-
image-sharer/shareprovider.cpp | 4 ++--
image-sharer/simplestimagehostingsharer.cpp | 5 ++---
image-sharer/simplestimagehostingsharer.h | 2 +-
9 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/image-sharer/abstractsharer.cpp b/image-sharer/abstractsharer.cpp
index dac4fc2..62a9472 100644
--- a/image-sharer/abstractsharer.cpp
+++ b/image-sharer/abstractsharer.cpp
@@ -45,7 +45,7 @@ bool AbstractSharer::hasError() const
}
-KUrl AbstractSharer::imageUrl() const
+QUrl AbstractSharer::imageUrl() const
{
return m_imageUrl;
}
diff --git a/image-sharer/abstractsharer.h b/image-sharer/abstractsharer.h
index 682403e..4b44d3c 100644
--- a/image-sharer/abstractsharer.h
+++ b/image-sharer/abstractsharer.h
@@ -22,8 +22,8 @@
#include <QByteArray>
#include <QString>
-
-#include <KUrl>
+#include <QMap>
+#include <QUrl>
#include "mpform.h"
@@ -42,7 +42,7 @@ public:
/**
* @return A KUrl that points to the uploading endpoint of the Share Service
*/
- virtual KUrl url() const = 0;
+ virtual QUrl url() const = 0;
/**
* @param imageData The image bytes that needs to be put inside the post body.
@@ -72,7 +72,7 @@ public:
/**
* @return A URL that contains the image url from the service if the response is success.
*/
- virtual KUrl imageUrl() const;
+ virtual QUrl imageUrl() const;
/**
* You should override this if you want to customize the headers sent to the server.
@@ -84,7 +84,7 @@ protected:
QString m_contentPath;
QString m_errorMessage;
MPForm m_form;
- KUrl m_imageUrl;
+ QUrl m_imageUrl;
bool m_hasError;
};
diff --git a/image-sharer/imagebinsharer.cpp b/image-sharer/imagebinsharer.cpp
index a23c72e..e899e69 100644
--- a/image-sharer/imagebinsharer.cpp
+++ b/image-sharer/imagebinsharer.cpp
@@ -19,15 +19,13 @@
#include "imagebinsharer.h"
-#include <QDebug>
-
ImageBinSharer::ImageBinSharer(const QString& contentPath) : AbstractSharer(contentPath)
{
}
-KUrl ImageBinSharer::url() const
+QUrl ImageBinSharer::url() const
{
- return KUrl("http://imagebin.ca/upload.php");
+ return QUrl("http://imagebin.ca/upload.php");
}
void ImageBinSharer::parseResponse(const QByteArray& responseData)
@@ -41,7 +39,7 @@ void ImageBinSharer::parseResponse(const QByteArray& responseData)
int urlPrefixIndex = responseString.indexOf(urlPrefix);
if (urlPrefixIndex != -1) {
QString imageUrl = responseString.mid(urlPrefixIndex + urlPrefix.length()).trimmed();
- m_imageUrl = KUrl(imageUrl);
+ m_imageUrl = QUrl(imageUrl);
} else {
m_hasError = true;
m_errorMessage = responseString.replace(QLatin1String("status:error:"), QLatin1String(""));
diff --git a/image-sharer/imagebinsharer.h b/image-sharer/imagebinsharer.h
index 5b099c3..c4cca82 100644
--- a/image-sharer/imagebinsharer.h
+++ b/image-sharer/imagebinsharer.h
@@ -27,7 +27,7 @@ class ImageBinSharer : public AbstractSharer
public:
ImageBinSharer(const QString& contentPath);
- KUrl url() const;
+ QUrl url() const;
void parseResponse(const QByteArray& responseData);
QByteArray postBody(const QByteArray& imageData);
};
diff --git a/image-sharer/imgursharer.cpp b/image-sharer/imgursharer.cpp
index 5549c60..670af3f 100644
--- a/image-sharer/imgursharer.cpp
+++ b/image-sharer/imgursharer.cpp
@@ -22,22 +22,24 @@
#include <QString>
#include <QtCore/qjsondocument.h>
#include <QtCore/qjsonobject.h>
-#include <KUrl>
+#include <QUrl>
+#include <QUrlQuery>
// Taken from "share" Data Engine
// key associated with plasma-devel at kde.org
// thanks to Alan Schaaf of Imgur (alan at imgur.com)
-static const QString apiKey = QLatin1String("d0757bc2e94a0d4652f28079a0be9379");
+static const QString apiKey = QStringLiteral("d0757bc2e94a0d4652f28079a0be9379");
ImgurSharer::ImgurSharer(const QString& contentPath): AbstractSharer(contentPath)
{
}
-KUrl ImgurSharer::url() const
+QUrl ImgurSharer::url() const
{
- KUrl url(QLatin1String("https://api.imgur.com/2/upload.json"));
- url.addQueryItem(QLatin1String("key"), apiKey);
+ QUrl url(QStringLiteral("https://api.imgur.com/2/upload.json"));
+ QUrlQuery query(url);
+ query.addQueryItem(QStringLiteral("key"), apiKey);
return url;
}
@@ -64,6 +66,6 @@ void ImgurSharer::parseResponse(const QByteArray& responseData)
} else {
QJsonObject uploadMap = resultMap[QLatin1String("upload")].toObject();
QJsonObject linksMap = uploadMap[QLatin1String("links")].toObject();
- m_imageUrl = KUrl(linksMap[QLatin1String("original")].toString());
+ m_imageUrl = QUrl::fromUserInput(linksMap[QLatin1String("original")].toString());
}
}
diff --git a/image-sharer/imgursharer.h b/image-sharer/imgursharer.h
index 008db4b..e6121ff 100644
--- a/image-sharer/imgursharer.h
+++ b/image-sharer/imgursharer.h
@@ -27,7 +27,7 @@ class ImgurSharer : public AbstractSharer
public:
ImgurSharer(const QString& contentPath);
- KUrl url() const;
+ QUrl url() const;
QByteArray postBody(const QByteArray &imageData);
virtual void parseResponse(const QByteArray& responseData);
};
diff --git a/image-sharer/shareprovider.cpp b/image-sharer/shareprovider.cpp
index d47e0be..9e03d2f 100644
--- a/image-sharer/shareprovider.cpp
+++ b/image-sharer/shareprovider.cpp
@@ -110,7 +110,7 @@ ShareProvider::ShareService ShareProvider::shareServiceType() const
void ShareProvider::publish(const QString& filePath)
{
d->m_filePath = filePath;
- KUrl fileUrl(filePath);
+ QUrl fileUrl = QUrl::fromLocalFile(filePath);
KIO::MimetypeJob *mimetypeJob = KIO::mimetype(fileUrl, KIO::HideProgressInfo);
connect(mimetypeJob, SIGNAL(finished(KJob*)), this, SLOT(onMimetypeJobFinished(KJob*)));
@@ -168,7 +168,7 @@ void ShareProvider::onFinishedReadingFile(KIO::Job* job, const QByteArray& data)
AbstractSharer *sharer = d->getSharer();
if (sharer) {
- KUrl sharerUrl = sharer->url();
+ QUrl sharerUrl = sharer->url();
if (!sharerUrl.isValid()) {
Q_EMIT finishedError(this, i18n("Service Url is not valid"));
return;
diff --git a/image-sharer/simplestimagehostingsharer.cpp b/image-sharer/simplestimagehostingsharer.cpp
index 1253b3d..a1b34d6 100644
--- a/image-sharer/simplestimagehostingsharer.cpp
+++ b/image-sharer/simplestimagehostingsharer.cpp
@@ -26,10 +26,9 @@ SimplestImageHostingSharer::SimplestImageHostingSharer(const QString& contentPat
{
}
-KUrl SimplestImageHostingSharer::url() const
+QUrl SimplestImageHostingSharer::url() const
{
- KUrl url("http://api.simplest-image-hosting.net/upload:image,default");
- return url;
+ return QUrl("http://api.simplest-image-hosting.net/upload:image,default");
}
void SimplestImageHostingSharer::parseResponse(const QByteArray& responseData)
diff --git a/image-sharer/simplestimagehostingsharer.h b/image-sharer/simplestimagehostingsharer.h
index 9760232..bf1bd87 100644
--- a/image-sharer/simplestimagehostingsharer.h
+++ b/image-sharer/simplestimagehostingsharer.h
@@ -28,7 +28,7 @@ class SimplestImageHostingSharer : public AbstractSharer
public:
SimplestImageHostingSharer(const QString& contentPath);
- KUrl url() const;
+ QUrl url() const;
void parseResponse(const QByteArray& responseData);
QByteArray postBody(const QByteArray& imageData);
};
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list