Update to 3.27.92

This commit is contained in:
Kalev Lember 2018-03-06 00:52:54 +01:00
parent 32ad618a8b
commit 4c997888a4
4 changed files with 12 additions and 139 deletions

1
.gitignore vendored
View File

@ -61,3 +61,4 @@
/gnome-calculator-3.25.91.tar.xz
/gnome-calculator-3.25.92.tar.xz
/gnome-calculator-3.26.0.tar.xz
/gnome-calculator-3.27.92.tar.xz

View File

@ -1,128 +0,0 @@
From ad694dba6d13633bb5a2ec6f41b3a3fe9758007d Mon Sep 17 00:00:00 2001
From: Robert Roth <robert.roth.off@gmail.com>
Date: Sun, 17 Sep 2017 00:35:46 +0300
Subject: [PATCH] Use _ instead of ans for last result (bgo#785107)
---
help/C/variables.page | 2 +-
lib/math-equation.vala | 18 +++++++++---------
src/math-variable-popover.vala | 6 +++---
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/help/C/variables.page b/help/C/variables.page
index 47c9f43d..9fdf71a1 100644
--- a/help/C/variables.page
+++ b/help/C/variables.page
@@ -37,7 +37,7 @@
</p>
<table>
<tr>
- <td><p>ans</p></td>
+ <td><p>_</p></td>
<td><p>Result of previous calculation</p></td>
</tr>
<tr>
diff --git a/lib/math-equation.vala b/lib/math-equation.vala
index cfd7b8ee..bb9c7718 100644
--- a/lib/math-equation.vala
+++ b/lib/math-equation.vala
@@ -661,11 +661,11 @@ public class MathEquation : Gtk.SourceBuffer
get
{
/* Check if the previous answer is before start of error token.
- * If so, subtract 3 (the length of string "ans") and add actual answer length (ans_end - ans_start) into it. */
+ * If so, subtract 1 (the length of string "_") and add actual answer length (ans_end - ans_start) into it. */
int ans_start, ans_end;
get_ans_offsets (out ans_start, out ans_end);
if (ans_start != -1 && ans_start < state.error_token_start)
- return state.error_token_start + ans_end - ans_start - 3;
+ return state.error_token_start + ans_end - ans_start - 1;
return state.error_token_start;
}
@@ -676,11 +676,11 @@ public class MathEquation : Gtk.SourceBuffer
get
{
/* Check if the previous answer is before end of error token.
- * If so, subtract 3 (the length of string "ans") and add actual answer length (ans_end - ans_start) into it. */
+ * If so, subtract 1 (the length of string "_") and add actual answer length (ans_end - ans_start) into it. */
int ans_start, ans_end;
get_ans_offsets (out ans_start, out ans_end);
if (ans_start != -1 && ans_start < state.error_token_end)
- return state.error_token_end + ans_end - ans_start - 3;
+ return state.error_token_end + ans_end - ans_start - 1;
return state.error_token_end;
}
@@ -693,7 +693,7 @@ public class MathEquation : Gtk.SourceBuffer
public bool is_result
{
- get { return equation == "ans"; }
+ get { return equation == "_"; }
}
public string equation
@@ -707,7 +707,7 @@ public class MathEquation : Gtk.SourceBuffer
if (ans_start_mark != null)
get_ans_offsets (out ans_start, out ans_end);
if (ans_start >= 0)
- text = text.splice (text.index_of_nth_char (ans_start), text.index_of_nth_char (ans_end), "ans");
+ text = text.splice (text.index_of_nth_char (ans_start), text.index_of_nth_char (ans_end), "_");
var last_is_digit = false;
var index = 0;
@@ -1063,7 +1063,7 @@ public class MathEquation : Gtk.SourceBuffer
return;
/* If showing a result return to the equation that caused it */
- // FIXME: Result may not be here due to solve (i.e. the user may have entered "ans")
+ // FIXME: Result may not be here due to solve (i.e. the user may have entered "_")
if (is_result)
{
undo ();
@@ -1388,7 +1388,7 @@ private class MEquation : Equation
{
var lower_name = name.down ();
- if (lower_name == "rand" || lower_name == "ans")
+ if (lower_name == "rand" || lower_name == "_")
return true;
return m_equation.variables.get (name) != null;
@@ -1400,7 +1400,7 @@ private class MEquation : Equation
if (lower_name == "rand")
return new Number.random ();
- else if (lower_name == "ans")
+ else if (lower_name == "_")
return m_equation.answer;
else
return m_equation.variables.get (name);
diff --git a/src/math-variable-popover.vala b/src/math-variable-popover.vala
index c9837e02..17c2f87b 100644
--- a/src/math-variable-popover.vala
+++ b/src/math-variable-popover.vala
@@ -11,7 +11,7 @@
[GtkTemplate (ui = "/org/gnome/calculator/math-variable-popover.ui")]
public class MathVariablePopover : Gtk.Popover
{
- private static string[] RESERVED_VARIABLE_NAMES = {"ans", "rand"};
+ private static string[] RESERVED_VARIABLE_NAMES = {"_", "rand"};
private MathEquation equation;
@@ -55,8 +55,8 @@ public class MathVariablePopover : Gtk.Popover
private void handler (string answer, Number number, int number_base, uint representation_base)
{
- variable_list.remove (find_row_for_variable ("ans"));
- variable_list.add (make_variable_row ("ans", number));
+ variable_list.remove (find_row_for_variable ("_"));
+ variable_list.add (make_variable_row ("_", number));
}
private Gtk.ListBoxRow? find_row_for_variable (string name)
--
2.14.3

View File

@ -1,19 +1,14 @@
Name: gnome-calculator
Version: 3.26.0
Release: 4%{?dist}
Version: 3.27.92
Release: 1%{?dist}
Summary: A desktop calculator
License: GPLv3+
URL: https://wiki.gnome.org/Apps/Calculator
Source0: https://download.gnome.org/sources/%{name}/3.26/%{name}-%{version}.tar.xz
Source0: https://download.gnome.org/sources/%{name}/3.27/%{name}-%{version}.tar.xz
# https://bugzilla.redhat.com/show_bug.cgi?id=1536368
Patch0: 0001-Use-_-instead-of-ans-for-last-result-bgo-785107.patch
BuildRequires: vala
BuildRequires: desktop-file-utils
BuildRequires: gettext
BuildRequires: intltool
BuildRequires: itstool
BuildRequires: libmpc-devel
BuildRequires: libsoup-devel
@ -50,7 +45,7 @@ find %{buildroot} -name '*.la' -delete
%check
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/org.gnome.Calculator.appdata.xml
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/org.gnome.Calculator.appdata.xml
desktop-file-validate %{buildroot}/%{_datadir}/applications/org.gnome.Calculator.desktop
@ -61,16 +56,21 @@ desktop-file-validate %{buildroot}/%{_datadir}/applications/org.gnome.Calculator
%{_bindir}/gnome-calculator
%{_libdir}/gnome-calculator/
%{_libexecdir}/gnome-calculator-search-provider
%{_datadir}/appdata/org.gnome.Calculator.appdata.xml
%{_datadir}/applications/org.gnome.Calculator.desktop
%{_datadir}/dbus-1/services/org.gnome.Calculator.SearchProvider.service
%{_datadir}/glib-2.0/schemas/org.gnome.calculator.gschema.xml
%{_datadir}/gnome-shell/
%{_datadir}/icons/hicolor/*/apps/gnome-calculator.png
%{_datadir}/icons/hicolor/scalable/apps/gnome-calculator-symbolic.svg
%{_datadir}/metainfo/org.gnome.Calculator.appdata.xml
%{_mandir}/man1/gnome-calculator.1*
%{_mandir}/man1/gcalccmd.1*
%changelog
* Mon Mar 05 2018 Kalev Lember <klember@redhat.com> - 3.27.92-1
- Update to 3.27.92
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.26.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (gnome-calculator-3.26.0.tar.xz) = fbcf387bfc2e1e33f2b52badd702d8a6701121f71eb10bb88f475d10673964fd6e780808ea41e1061f102be2ed05c79d2a65e898d8eba59432d3d88464719ebb
SHA512 (gnome-calculator-3.27.92.tar.xz) = bd3995bbe442f0fe2f0a386ea9d51fcc850da708b9524083c90e2766b13dbf972ef14ae37edb05e98fb5ecaf5b73f0aa872b1d3e32ea6ed6b9913ef350b8f6fd