diff options
author | tv <tv@krebsco.de> | 2023-02-04 21:52:14 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2023-02-05 02:21:10 +0100 |
commit | 23b63bfdfb5ed2700441f13429cbd1cd0c2ea870 (patch) | |
tree | e9d9321157c4d12888e89897d7ea3f5ee34526a0 /krebs/5pkgs/simple/flameshot-once/flameshot | |
parent | f802eaf7847eb7bd1b8a735dac5166fa8999ea06 (diff) |
flameshot-once: reinit with flameshot 12.1.0-pre
Diffstat (limited to 'krebs/5pkgs/simple/flameshot-once/flameshot')
-rw-r--r-- | krebs/5pkgs/simple/flameshot-once/flameshot/default.nix | 15 | ||||
-rw-r--r-- | krebs/5pkgs/simple/flameshot-once/flameshot/flameshot-12.imgur.patch | 43 |
2 files changed, 58 insertions, 0 deletions
diff --git a/krebs/5pkgs/simple/flameshot-once/flameshot/default.nix b/krebs/5pkgs/simple/flameshot-once/flameshot/default.nix new file mode 100644 index 000000000..b129270eb --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once/flameshot/default.nix @@ -0,0 +1,15 @@ +{ pkgs }: + +pkgs.flameshot.overrideAttrs (old: rec { + name = "flameshot-${version}"; + version = "12.1.0-pre"; + src = pkgs.fetchFromGitHub { + owner = "flameshot-org"; + repo = "flameshot"; + rev = "f7e41f4d708e50eeaec892408069da25a28e04a2"; + hash = "sha256-fZquXY0xSaN1hJgCh16MocIlvxHe1c2Nt+fGF2NIOVw="; + }; + patches = old.patches or [] ++ [ + ./flameshot-12.imgur.patch + ]; +}) diff --git a/krebs/5pkgs/simple/flameshot-once/flameshot/flameshot-12.imgur.patch b/krebs/5pkgs/simple/flameshot-once/flameshot/flameshot-12.imgur.patch new file mode 100644 index 000000000..b6c3f497a --- /dev/null +++ b/krebs/5pkgs/simple/flameshot-once/flameshot/flameshot-12.imgur.patch @@ -0,0 +1,43 @@ +diff --git a/src/tools/imgupload/storages/imgur/imguruploader.cpp b/src/tools/imgupload/storages/imgur/imguruploader.cpp +index d6748b5a..5bb8d7de 100644 +--- a/src/tools/imgupload/storages/imgur/imguruploader.cpp ++++ b/src/tools/imgupload/storages/imgur/imguruploader.cpp +@@ -16,6 +16,7 @@ + #include <QNetworkRequest> + #include <QShortcut> + #include <QUrlQuery> ++#include <stdlib.h> + + ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) + : ImgUploaderBase(capture, parent) +@@ -70,7 +71,13 @@ void ImgurUploader::upload() + QString description = FileNameHandler().parsedPattern(); + urlQuery.addQueryItem(QStringLiteral("description"), description); + +- QUrl url(QStringLiteral("https://api.imgur.com/3/image")); ++ const char *IMGUR_CREATE_URL = secure_getenv("IMGUR_CREATE_URL"); ++ QString createUrlPattern = ++ IMGUR_CREATE_URL != NULL ++ ? QString::fromUtf8(IMGUR_CREATE_URL) ++ : QStringLiteral("https://api.imgur.com/3/image") ++ ; ++ QUrl url(createUrlPattern); + url.setQuery(urlQuery); + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, +@@ -87,8 +94,14 @@ void ImgurUploader::deleteImage(const QString& fileName, + const QString& deleteToken) + { + Q_UNUSED(fileName) ++ const char *IMGUR_DELETE_URL = secure_getenv("IMGUR_DELETE_URL"); ++ QString deleteImageURLPattern = ++ IMGUR_DELETE_URL != NULL ++ ? QString::fromUtf8(IMGUR_DELETE_URL) ++ : QStringLiteral("https://imgur.com/delete/%1") ++ ; + bool successful = QDesktopServices::openUrl( +- QUrl(QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken))); ++ QUrl(deleteImageURLPattern.arg(deleteToken))); + if (!successful) { + notification()->showMessage(tr("Unable to open the URL.")); + } |