From b475c619df383adddabb770ec6d97eb69991804e75791bc68c70fc12120de577 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 22 Jun 2020 08:41:24 +0000 Subject: [PATCH] Add real fix for boo#1172565 OBS-URL: https://build.opensuse.org/package/show/Publishing/gnuplot?expand=0&rev=112 --- gnuplot-QtIndexedList.dif | 47 +++++++++++++++++++++++++++++++++++++++ gnuplot-QtWarningMsg.dif | 25 --------------------- gnuplot.changes | 6 +++++ gnuplot.spec | 6 ++--- 4 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 gnuplot-QtIndexedList.dif delete mode 100644 gnuplot-QtWarningMsg.dif diff --git a/gnuplot-QtIndexedList.dif b/gnuplot-QtIndexedList.dif new file mode 100644 index 0000000..25f5933 --- /dev/null +++ b/gnuplot-QtIndexedList.dif @@ -0,0 +1,47 @@ +From a0f2b0f820c9eb734029984887e7bab5fb0b9aea Mon Sep 17 00:00:00 2001 +From: Werner Fink +Date: Sat, 20 Jun 2020 10:02:40 -0700 +Subject: [PATCH] qt: Suppress error messages "QList index out of range" + +In three places gnuplot_qt was appending an element to an existing +list by insertiong using an index greater than the current list size. +This works but starting with Qt 5.15 an error message is given. +Replace with append() or insert(list_size, ...) +Bug #2280 +--- + src/qtterminal/QtGnuplotScene.cpp | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +diff --git src/qtterminal/QtGnuplotScene.cpp src/qtterminal/QtGnuplotScene.cpp +index f98151b63..a72e6aa8f 100644 +--- src/qtterminal/QtGnuplotScene.cpp ++++ src/qtterminal/QtGnuplotScene.cpp +@@ -167,9 +167,7 @@ void QtGnuplotScene::flushCurrentPointsItem() + 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 @@ void QtGnuplotScene::processEvent(QtGnuplotEventType type, QDataStream& in) + 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(); + } + +-- +2.26.2 + diff --git a/gnuplot-QtWarningMsg.dif b/gnuplot-QtWarningMsg.dif deleted file mode 100644 index 4e71ab3..0000000 --- a/gnuplot-QtWarningMsg.dif +++ /dev/null @@ -1,25 +0,0 @@ -boo#1172565 - ---- - src/qtterminal/gnuplot_qt.cpp | 3 +++ - 1 file changed, 3 insertions(+) - ---- src/qtterminal/gnuplot_qt.cpp -+++ src/qtterminal/gnuplot_qt.cpp 2020-06-16 08:54:36.486821163 +0000 -@@ -43,6 +43,7 @@ - - #include "QtGnuplotApplication.h" - #include -+#include - #include - #ifdef _WIN32 - # include -@@ -53,6 +54,8 @@ int main(int argc, char* argv[]) - signal(SIGINT, SIG_IGN); // Do not listen to SIGINT signals anymore - const char * qt_gnuplot_data_dir = QTGNUPLOT_DATA_DIR; - -+ QLoggingCategory::defaultCategory()->setEnabled(QtWarningMsg, false); -+ - #if defined(_WIN32) - /* On Windows, QTGNUPLOT_DATA_DIR is relative to installation dir. */ - char buf[MAX_PATH]; diff --git a/gnuplot.changes b/gnuplot.changes index b6a84ee..c96dd36 100644 --- a/gnuplot.changes +++ b/gnuplot.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 22 07:49:19 UTC 2020 - Werner Fink + +- Add patch gnuplot-QtIndexedList.dif to avoid warnings reported + with boo#1172565 + ------------------------------------------------------------------- Tue Jun 16 09:13:13 UTC 2020 - Dr. Werner Fink diff --git a/gnuplot.spec b/gnuplot.spec index d5267e4..8b4290c 100644 --- a/gnuplot.spec +++ b/gnuplot.spec @@ -75,7 +75,7 @@ Release: 0 %if "%{flavor}" == "" Summary: Function Plotting Utility and more License: SUSE-Gnuplot AND GPL-2.0-or-later -Group: Productivity/Graphics/Visualization/Graph +Group: Documentation/Other %else Summary: Documentation of GNUplot License: SUSE-Gnuplot AND GPL-2.0-or-later @@ -96,7 +96,7 @@ Patch4: gnuplot-4.6.0-demo.diff Patch5: gnuplot-wx3.diff Patch6: gnuplot-QtCore-PIC.dif Patch7: gnuplot-gd.patch -Patch8: gnuplot-QtWarningMsg.dif +Patch8: gnuplot-QtIndexedList.dif %define _x11lib %{_libdir} %define _x11data %{_datadir}/X11 %define _libx11 %{_exec_prefix}/lib/X11 @@ -131,7 +131,7 @@ cp %{_sourcedir}/picins.sty docs %patch5 -p1 -b .w3x %patch6 -p0 -b .pic %patch7 -p1 -b .gd -%patch8 -p0 -b .qt +%patch8 -p0 -b .qtlist %build autoreconf -fi