public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gpick] f43: Cherry-pick upstream commit to fix crash on start
@ 2026-07-17  8:10 FeRD
  0 siblings, 0 replies; only message in thread
From: FeRD @ 2026-07-17  8:10 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gpick
            Branch : f43
            Commit : d41bb2608bd89ec3e814ab8b29306956fa687406
            Author : FeRD (Frank Dana) <ferdnyc@gmail.com>
            Date   : 2026-07-17T01:10:31-07:00
            Stats  : +80/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gpick/c/d41bb2608bd89ec3e814ab8b29306956fa687406?branch=f43

            Log:
            Cherry-pick upstream commit to fix crash on start

- Fixes rhbz#2483605

---
diff --git a/gpick-0.4-crash-on-start.patch b/gpick-0.4-crash-on-start.patch
new file mode 100644
index 0000000..058d76e
--- /dev/null
+++ b/gpick-0.4-crash-on-start.patch
@@ -0,0 +1,75 @@
+From 480f9ef15bb657aed0d320d67e30197fe02bcad4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Albertas=20Vy=C5=A1niauskas?= <thezbyg@gmail.com>
+Date: Sun, 30 Nov 2025 10:16:29 +0200
+Subject: [PATCH] Fix crash on startup when settings are empty.
+
+Issue #234.
+---
+ source/GlobalState.cpp |  2 +-
+ source/dynv/Map.cpp    | 11 +++++++----
+ source/dynv/Map.h      |  4 ++--
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/source/GlobalState.cpp b/source/GlobalState.cpp
+index 47b5a2f..1f130cb 100644
+--- a/source/GlobalState.cpp
++++ b/source/GlobalState.cpp
+@@ -48,7 +48,7 @@ struct ConverterOptions: public Converter::Options, public IEventHandler {
+ 		m_settings(settings) {
+ 	}
+ 	void update() {
+-		auto options = m_settings.getMap("gpick.options");
++		auto options = m_settings.getOrEmptyMap("gpick.options");
+ 		upperCaseHex = options->getString("hex_case", "upper") == "upper";
+ 		cssPercentages = options->getBool("css_percentages", false);
+ 		cssAlphaPercentage = options->getBool("css_alpha_percentage", false);
+diff --git a/source/dynv/Map.cpp b/source/dynv/Map.cpp
+index a895951..7d3c26b 100644
+--- a/source/dynv/Map.cpp
++++ b/source/dynv/Map.cpp
+@@ -118,9 +118,6 @@ std::vector<Color> Map::getColors(const std::string &name) const {
+ std::vector<std::string> Map::getStrings(const std::string &name) const {
+ 	return getVector<std::string>(*this, name);
+ }
+-Ref Map::getMap(const std::string &name) {
+-	return get<Ref>(*this, name);
+-}
+ Ref Map::getOrCreateMap(const std::string &name) {
+ 	bool valid;
+ 	std::string fieldName;
+@@ -141,9 +138,15 @@ Ref Map::getOrCreateMap(const std::string &name) {
+ 	}
+ 	return std::get<Ref>(data);
+ }
+-const Ref Map::getMap(const std::string &name) const {
++Ref Map::getMap(const std::string &name) const {
+ 	return get<Ref>(*this, name);
+ }
++Ref Map::getOrEmptyMap(const std::string &name) const {
++	auto result = get<Ref>(*this, name);
++	if (!result)
++		return create();
++	return result;
++}
+ std::vector<Ref> Map::getMaps(const std::string &name) {
+ 	bool valid;
+ 	std::string fieldName;
+diff --git a/source/dynv/Map.h b/source/dynv/Map.h
+index 832405a..d6910a7 100644
+--- a/source/dynv/Map.h
++++ b/source/dynv/Map.h
+@@ -56,9 +56,9 @@ struct Map: public common::Ref<Map>::Counter {
+ 	std::vector<int32_t> getInt32s(const std::string &name) const;
+ 	std::vector<Color> getColors(const std::string &name) const;
+ 	std::vector<std::string> getStrings(const std::string &name) const;
+-	Ref getMap(const std::string &name);
+ 	std::vector<Ref> getMaps(const std::string &name);
+-	const Ref getMap(const std::string &name) const;
++	Ref getMap(const std::string &name) const;
++	Ref getOrEmptyMap(const std::string &name) const;
+ 	std::vector<Ref> getMaps(const std::string &name) const;
+ 	Ref getOrCreateMap(const std::string &name);
+ 	std::vector<Ref> getOrCreateMaps(const std::string &name);
+-- 
+2.55.0
+

diff --git a/gpick.spec b/gpick.spec
index fdbf43a..9f71735 100644
--- a/gpick.spec
+++ b/gpick.spec
@@ -18,6 +18,10 @@ Source:		https://github.com/thezbyg/%{name}/releases/download/v%{version}/%{name
 # https://github.com/thezbyg/gpick/pull/238
 Patch0:		    gpick-0.4-lua-5.5.patch
 
+# Upstream commit 480f9ef15bb657aed0d320d67e30197fe02bcad4
+# https://github.com/thezbyg/gpick/commit/480f9ef15bb657aed0d320d67e30197fe02bcad4
+Patch1:		    gpick-0.4-crash-on-start.patch
+
 BuildRequires:	gcc-c++
 BuildRequires:	boost-devel
 BuildRequires:	cmake
@@ -42,7 +46,7 @@ Advanced color picker
 %{?shortcommit:
 %autosetup -p1 -n %{name}-%{commit}}
 %{!?shortcommit:
-%autosetup -n %{name}-%{version}}
+%autosetup -p1 -n %{name}-%{version}}
 mkdir .git
 
 # Delete external libraries and only use system dependencies to build GPick

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-17  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-17  8:10 [rpms/gpick] f43: Cherry-pick upstream commit to fix crash on start FeRD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox