Apply a fix for Qlist error message

Originally by Vasiliy Glazov, Fedora bug #1970658

Resolves: RHEL-5368
This commit is contained in:
Pavel Cahyna 2026-05-27 11:07:42 +02:00
parent 3466c0f3a3
commit dce82ef421
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,27 @@
--- a/src/qtterminal/QtGnuplotScene.cpp
+++ b/src/qtterminal/QtGnuplotScene.cpp
@@ -167,9 +167,7 @@
void QtGnuplotScene::update_key_box(const QRectF rect)
{
if (m_currentPlotNumber > m_key_boxes.count()) {
- // DEBUG Feb 2018 should no longer trigger
- // because m_key_box insertion is done in layer code for GEAfterPlot
- m_key_boxes.insert(m_currentPlotNumber, QtGnuplotKeybox(rect));
+ m_key_boxes.insert(m_currentPlotNumber-1, QtGnuplotKeybox(rect));
} else if (m_key_boxes[m_currentPlotNumber-1].isEmpty()) {
// Retain the visible/hidden flag when re-initializing the Keybox
bool tmp = m_key_boxes[m_currentPlotNumber-1].ishidden();
@@ -515,12 +513,12 @@
if (0 < m_currentPlotNumber && m_currentPlotNumber <= m_key_boxes.count())
newgroup->setVisible( !(m_key_boxes[m_currentPlotNumber-1].ishidden()) );
// Store it in an ordered list so we can toggle it by index
- m_plot_group.insert(m_currentPlotNumber, newgroup);
+ m_plot_group.insert(m_currentPlotNumber-1, newgroup);
}
if (m_currentPlotNumber >= m_key_boxes.count()) {
QRectF empty( QPointF(0,0), QPointF(0,0));
- m_key_boxes.insert(m_currentPlotNumber, empty);
+ m_key_boxes.append(empty);
m_key_boxes[m_currentPlotNumber-1].resetStatus();
}

View File

@ -13,7 +13,7 @@
Summary: A program for plotting mathematical expressions and data
Name: gnuplot
Version: %{major}.%{minor}.%{patchlevel}
Release: 3%{?dist}
Release: 4%{?dist}
# MIT .. term/PostScript/aglfn.txt
License: gnuplot and MIT
Group: Applications/Engineering
@ -34,6 +34,9 @@ Patch5: gnuplot-5.0.0-lua_checkint.patch
Patch6: gnuplot-5.2.4-no-lena.patch
Patch7: gnuplot-5.2.2-doc.patch
patch8: gnuplot-5.2.4-cmd-opts.patch
# Suppress error messages "QList index out of range"
# Patch from upstream https://sourceforge.net/p/gnuplot/support-requests/269/
Patch20: gnuplot-qlist-message.patch
Requires: %{name}-common = %{version}-%{release}
Requires: dejavu-sans-fonts
@ -173,6 +176,7 @@ plotting tool.
%patch6 -p1 -b .nolena
%patch7 -p1 -b .doc
%patch8 -p1 -b .cmd-opts
%patch20 -p1 -b .qlist-index
sed -i -e 's:"/usr/lib/X11/app-defaults":"%{x11_app_defaults_dir}":' src/gplt_x11.c
iconv -f windows-1252 -t utf-8 ChangeLog > ChangeLog.aux
mv ChangeLog.aux ChangeLog
@ -378,6 +382,9 @@ fi
%{_datadir}/texlive/texmf-dist/tex/latex/gnuplot/
%changelog
* Wed May 27 2026 Pavel Cahyna <pcahyna@redhat.com> - 5.2.4-4
- Fix Qlist error message (Fedora bug #1970658)
* Wed Oct 5 2022 Pavel Cahyna <pcahyna@redhat.com> - 5.2.4-3
- Rebuild with added gating configuration