diff options
author | tv <tv@krebsco.de> | 2021-06-02 01:06:58 +0200 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-06-02 02:43:38 +0200 |
commit | c4c40afca5cd83917376804ae6e8259cbfc571d9 (patch) | |
tree | 82c9234d972417676972c1db978ee481e0140df4 /krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch | |
parent | 12dbb95b1b6d74addc0d9d70e599a56af60c3bea (diff) |
flameshot: add imgur patch for 0.9.0
For nixpkgs 21.05
Diffstat (limited to 'krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch')
-rw-r--r-- | krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch new file mode 100644 index 000000000..92023554a --- /dev/null +++ b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.6.0.patch @@ -0,0 +1,34 @@ +--- a/src/tools/imgur/imguruploader.cpp ++++ b/src/tools/imgur/imguruploader.cpp +@@ -40,6 +40,7 @@ + #include <QTimer> + #include <QJsonDocument> + #include <QJsonObject> ++#include <stdlib.h> + + ImgurUploader::ImgurUploader(const QPixmap &capture, QWidget *parent) : + QWidget(parent), m_pixmap(capture) +@@ -74,7 +75,10 @@ void ImgurUploader::handleReply(QNetworkReply *reply) { + QJsonObject json = response.object(); + QJsonObject data = json["data"].toObject(); + m_imageURL.setUrl(data["link"].toString()); +- m_deleteImageURL.setUrl(QString("https://imgur.com/delete/%1").arg( ++ char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL"); ++ if (deleteImageURLPattern == NULL) ++ deleteImageURLPattern = "https://imgur.com/delete/%1"; ++ m_deleteImageURL.setUrl(QString(deleteImageURLPattern).arg( + data["deletehash"].toString())); + onUploadOk(); + } else { +@@ -105,7 +109,10 @@ void ImgurUploader::upload() { + QString description = FileNameHandler().parsedPattern(); + urlQuery.addQueryItem("description", description); + +- QUrl url("https://api.imgur.com/3/image"); ++ char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL"); ++ if (createImageURLPattern == NULL) ++ createImageURLPattern = "https://api.imgur.com/3/image"; ++ QUrl url(createImageURLPattern); + url.setQuery(urlQuery); + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, |