From 57f5c7c722ff5606d5d360094a016a37ff819b63 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Dec 2026 02:33:50 +0000 Subject: flameshot-once: name flameshot's patches for 15 Renames only, so that history follows them into the bump to flameshot 15. --- pkgs/simple/flameshot-once/flameshot/default.nix | 6 +-- .../flameshot/flameshot-13.applauncher.patch | 27 -------------- .../flameshot/flameshot-13.history.patch | 28 -------------- .../flameshot/flameshot-13.imgur.patch | 43 ---------------------- .../flameshot/flameshot-15.applauncher.patch | 27 ++++++++++++++ .../flameshot/flameshot-15.history.patch | 28 ++++++++++++++ .../flameshot/flameshot-15.imgur.patch | 43 ++++++++++++++++++++++ 7 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch delete mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch delete mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch create mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-15.applauncher.patch create mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-15.history.patch create mode 100644 pkgs/simple/flameshot-once/flameshot/flameshot-15.imgur.patch (limited to 'pkgs/simple') diff --git a/pkgs/simple/flameshot-once/flameshot/default.nix b/pkgs/simple/flameshot-once/flameshot/default.nix index 7b9ccbf0..57d9e378 100644 --- a/pkgs/simple/flameshot-once/flameshot/default.nix +++ b/pkgs/simple/flameshot-once/flameshot/default.nix @@ -10,8 +10,8 @@ super.flameshot.overrideAttrs (old: rec { hash = "sha256-RyoLniRmJRinLUwgmaA4RprYAVHnoPxCP9LyhHfUPe0="; }; patches = old.patches or [] ++ [ - ./flameshot-13.imgur.patch - ./flameshot-13.history.patch - ./flameshot-13.applauncher.patch + ./flameshot-15.imgur.patch + ./flameshot-15.history.patch + ./flameshot-15.applauncher.patch ]; }) diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch deleted file mode 100644 index c43096dd..00000000 --- a/pkgs/simple/flameshot-once/flameshot/flameshot-13.applauncher.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/src/tools/launcher/applauncherwidget.cpp b/src/tools/launcher/applauncherwidget.cpp -index 4ec68f29..3a0fa9ad 100644 ---- a/src/tools/launcher/applauncherwidget.cpp -+++ b/src/tools/launcher/applauncherwidget.cpp -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - - namespace { - #if defined(Q_OS_WIN) -@@ -72,6 +73,14 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap& p, QWidget* parent) - m_parser.processDirectory(QDir(appsDir)); - } - -+ const char *USER = secure_getenv("USER"); -+ QString dirUser = "/etc/profiles/per-user/" + QString::fromUtf8(USER) + "/share/applications/"; -+ QDir appsDirUser(dirUser); -+ m_parser.processDirectory(appsDirUser); -+ -+ QString dir = QStringLiteral("/run/current-system/sw/share/applications/"); -+ QDir appsDir(dir); -+ m_parser.processDirectory(appsDir); - #endif - - initAppMap(); diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch deleted file mode 100644 index 3626f5c7..00000000 --- a/pkgs/simple/flameshot-once/flameshot/flameshot-13.history.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/utils/history.cpp b/src/utils/history.cpp -index 877e6195..7e46f168 100644 ---- a/src/utils/history.cpp -+++ b/src/utils/history.cpp -@@ -76,9 +76,9 @@ const HistoryFileName& History::unpackFileName(const QString& fileNamePacked) - int nPathIndex = fileNamePacked.lastIndexOf("/"); - QStringList unpackedFileName; - if (nPathIndex == -1) { -- unpackedFileName = fileNamePacked.split("-"); -+ unpackedFileName = fileNamePacked.split("|"); - } else { -- unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("-"); -+ unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("|"); - } - - switch (unpackedFileName.length()) { -@@ -109,9 +109,9 @@ const QString& History::packFileName(const QString& storageType, - if (storageType.length() > 0) { - if (deleteToken.length() > 0) { - m_packedFileName = -- storageType + "-" + deleteToken + "-" + m_packedFileName; -+ storageType + "|" + deleteToken + "|" + m_packedFileName; - } else { -- m_packedFileName = storageType + "-" + m_packedFileName; -+ m_packedFileName = storageType + "|" + m_packedFileName; - } - } - return m_packedFileName; diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch deleted file mode 100644 index bc9537c1..00000000 --- a/pkgs/simple/flameshot-once/flameshot/flameshot-13.imgur.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/src/tools/imgupload/storages/imgur/imguruploader.cpp b/src/tools/imgupload/storages/imgur/imguruploader.cpp -index 1021dc6b..909c5633 100644 ---- a/src/tools/imgupload/storages/imgur/imguruploader.cpp -+++ b/src/tools/imgupload/storages/imgur/imguruploader.cpp -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - - ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) - : ImgUploaderBase(capture, parent) -@@ -84,7 +85,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, -@@ -101,8 +108,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.")); - } diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-15.applauncher.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-15.applauncher.patch new file mode 100644 index 00000000..c43096dd --- /dev/null +++ b/pkgs/simple/flameshot-once/flameshot/flameshot-15.applauncher.patch @@ -0,0 +1,27 @@ +diff --git a/src/tools/launcher/applauncherwidget.cpp b/src/tools/launcher/applauncherwidget.cpp +index 4ec68f29..3a0fa9ad 100644 +--- a/src/tools/launcher/applauncherwidget.cpp ++++ b/src/tools/launcher/applauncherwidget.cpp +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + + namespace { + #if defined(Q_OS_WIN) +@@ -72,6 +73,14 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap& p, QWidget* parent) + m_parser.processDirectory(QDir(appsDir)); + } + ++ const char *USER = secure_getenv("USER"); ++ QString dirUser = "/etc/profiles/per-user/" + QString::fromUtf8(USER) + "/share/applications/"; ++ QDir appsDirUser(dirUser); ++ m_parser.processDirectory(appsDirUser); ++ ++ QString dir = QStringLiteral("/run/current-system/sw/share/applications/"); ++ QDir appsDir(dir); ++ m_parser.processDirectory(appsDir); + #endif + + initAppMap(); diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-15.history.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-15.history.patch new file mode 100644 index 00000000..3626f5c7 --- /dev/null +++ b/pkgs/simple/flameshot-once/flameshot/flameshot-15.history.patch @@ -0,0 +1,28 @@ +diff --git a/src/utils/history.cpp b/src/utils/history.cpp +index 877e6195..7e46f168 100644 +--- a/src/utils/history.cpp ++++ b/src/utils/history.cpp +@@ -76,9 +76,9 @@ const HistoryFileName& History::unpackFileName(const QString& fileNamePacked) + int nPathIndex = fileNamePacked.lastIndexOf("/"); + QStringList unpackedFileName; + if (nPathIndex == -1) { +- unpackedFileName = fileNamePacked.split("-"); ++ unpackedFileName = fileNamePacked.split("|"); + } else { +- unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("-"); ++ unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("|"); + } + + switch (unpackedFileName.length()) { +@@ -109,9 +109,9 @@ const QString& History::packFileName(const QString& storageType, + if (storageType.length() > 0) { + if (deleteToken.length() > 0) { + m_packedFileName = +- storageType + "-" + deleteToken + "-" + m_packedFileName; ++ storageType + "|" + deleteToken + "|" + m_packedFileName; + } else { +- m_packedFileName = storageType + "-" + m_packedFileName; ++ m_packedFileName = storageType + "|" + m_packedFileName; + } + } + return m_packedFileName; diff --git a/pkgs/simple/flameshot-once/flameshot/flameshot-15.imgur.patch b/pkgs/simple/flameshot-once/flameshot/flameshot-15.imgur.patch new file mode 100644 index 00000000..bc9537c1 --- /dev/null +++ b/pkgs/simple/flameshot-once/flameshot/flameshot-15.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 1021dc6b..909c5633 100644 +--- a/src/tools/imgupload/storages/imgur/imguruploader.cpp ++++ b/src/tools/imgupload/storages/imgur/imguruploader.cpp +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) + : ImgUploaderBase(capture, parent) +@@ -84,7 +85,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, +@@ -101,8 +108,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.")); + } -- cgit v1.3.1