Skip to content

Commit

Permalink
Merge pull request #11915 from lb90/gnome-calculator-add-patches
Browse files Browse the repository at this point in the history
gnome-calculator: Add patches
  • Loading branch information
lazka committed Jun 26, 2022
2 parents 4253ffa + e7f2c32 commit 5e4c100
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
From 5b387d03f434922e1811919aedb2d475cc874da4 Mon Sep 17 00:00:00 2001
From: Robert Roth <robert.roth.off@gmail.com>
Date: Tue, 14 Jun 2022 10:01:52 +0300
Subject: [PATCH] Fixed crash on variable name entry (fixes #282)

---
src/math-variable-popover.vala | 6 +++++-
src/ui/math-variable-popover.ui | 1 -
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/math-variable-popover.vala b/src/math-variable-popover.vala
index 2318934d..76b17eea 100644
--- a/src/math-variable-popover.vala
+++ b/src/math-variable-popover.vala
@@ -42,11 +42,14 @@ public class MathVariablePopover : MathPopover<MathVariable>
[GtkChild]
private unowned Gtk.Button store_variable_button;

+ private ulong changed_handler;
+
public MathVariablePopover (MathEquation equation, ListStore model, CompareDataFunc compare_func)
{
base(equation, model, (a,b) => MathVariable.name_compare_func(a as MathVariable,b as MathVariable));

variable_list.bind_model (model, (variable) => make_item_row (variable as MathVariable));
+ changed_handler = variable_name_entry.changed.connect (variable_name_changed_cb);
equation.history_signal.connect (this.handler);
item_deleted.connect (delete_variable_cb);
}
@@ -72,11 +75,12 @@ public class MathVariablePopover : MathPopover<MathVariable>
equation.insert (variable.name);
}

- [GtkCallback]
private void variable_name_changed_cb (Gtk.Editable editable)
{
var entry = editable as Gtk.Entry;
+ SignalHandler.block (entry, changed_handler);
entry.text = entry.text.replace (" ", "_");
+ SignalHandler.unblock (entry, changed_handler);
store_variable_button.sensitive = (entry.text != "");
}

diff --git a/src/ui/math-variable-popover.ui b/src/ui/math-variable-popover.ui
index cb98fc49..17ed4c8a 100644
--- a/src/ui/math-variable-popover.ui
+++ b/src/ui/math-variable-popover.ui
@@ -30,7 +30,6 @@
<object class="GtkEntry" id="variable_name_entry">
<property name="placeholder_text" translatable="yes">Variable name</property>
<property name="receives_default">True</property>
- <signal name="changed" handler="variable_name_changed_cb" swapped="no"/>
<signal name="activate" handler="store_variable_cb" swapped="no"/>
</object>
</child>
--
GitLab

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 84ea10dc61fb156341bc7eba4d0b2025db801e9b Mon Sep 17 00:00:00 2001
From: Robert Roth <robert.roth.off@gmail.com>
Date: Wed, 15 Jun 2022 18:40:03 +0300
Subject: [PATCH] Remove unnecessary problematic XML parser cleanup call (fixes
#283)

---
lib/currency-provider.vala | 1 -
1 file changed, 1 deletion(-)

diff --git a/lib/currency-provider.vala b/lib/currency-provider.vala
index bd471598..bcef3630 100644
--- a/lib/currency-provider.vala
+++ b/lib/currency-provider.vala
@@ -428,7 +428,6 @@ public class EcbCurrencyProvider : AbstractCurrencyProvider {
node = null;
}

- Xml.Parser.cleanup ();
base.do_load_rates ();
}

--
GitLab

13 changes: 11 additions & 2 deletions mingw-w64-gnome-calculator/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _realname=gnome-calculator
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=42.1
pkgrel=1
pkgrel=2
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
pkgdesc="GNOME desktop calculator (mingw-w64)"
Expand All @@ -33,9 +33,13 @@ url="https://wiki.gnome.org/Apps/Calculator"
install=${_realname}-${MSYSTEM}.install
source=(https://download.gnome.org/sources/${_realname}/${pkgver%.*}/${_realname}-${pkgver}.tar.xz
001-win.patch
5b387d03f434922e1811919aedb2d475cc874da4.patch
84ea10dc61fb156341bc7eba4d0b2025db801e9b.patch
)
sha256sums=('ef4d24e42a65dc860e6206f3b470b7d233c2ae2a4d4965d8859aa9ea8a395acd'
'4cf4eefa6cfef044ec4f068daa8d427f58d65acc3b6d854eb4a1dea1bb4ad6f2')
'4cf4eefa6cfef044ec4f068daa8d427f58d65acc3b6d854eb4a1dea1bb4ad6f2'
'eab07acf04de697b3c381b22b05464588b92f2ea0357ed4d6b68a03c54a6c411'
'1834f771ed0177798302eb3b807c96a8bba980509d22e5dbfa2b7b1d44b43d99')

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
Expand All @@ -60,6 +64,11 @@ prepare() {
cd "${srcdir}"/${_realname}-${pkgver}
del_file_exists "${srcdir}/${_realname}-${pkgver}/lib/windows.c"
apply_patch_with_msg 001-win.patch

# https://gitlab.gnome.org/GNOME/gnome-calculator/-/commit/5b387d03f434922e1811919aedb2d475cc874da4
apply_patch_with_msg 5b387d03f434922e1811919aedb2d475cc874da4.patch
# https://gitlab.gnome.org/GNOME/gnome-calculator/-/commit/84ea10dc61fb156341bc7eba4d0b2025db801e9b
apply_patch_with_msg 84ea10dc61fb156341bc7eba4d0b2025db801e9b.patch
}

build() {
Expand Down

0 comments on commit 5e4c100

Please sign in to comment.