From 94b4fe49bb1eb190ceca76971882146f76cc85c0 Mon Sep 17 00:00:00 2001 From: Alexander Ploumistos Date: Mar 16 2019 10:31:16 +0000 Subject: Backport fix for plot colors reverting to black --- diff --git a/scidavis-fix_plot_colors.patch b/scidavis-fix_plot_colors.patch new file mode 100644 index 0000000..9d951fa --- /dev/null +++ b/scidavis-fix_plot_colors.patch @@ -0,0 +1,73 @@ +diff -Naur scidavis-1.25/libscidavis/src/ApplicationWindow.cpp scidavis-master/libscidavis/src/ApplicationWindow.cpp +--- scidavis-1.25/libscidavis/src/ApplicationWindow.cpp 2019-03-05 00:49:55.000000000 +0100 ++++ scidavis-master/libscidavis/src/ApplicationWindow.cpp 2019-03-14 22:27:01.000000000 +0100 +@@ -9611,7 +9611,7 @@ + + CurveLayout cl; + cl.connectType=curve[4].toInt(); +- cl.lCol=curve[5].toUInt(); ++ cl.lCol=COLORUINT(curve[5]); + if (d_file_version <= 89) + cl.lCol = convertOldToNewColorIndex(cl.lCol); + cl.lStyle=curve[6].toInt(); +@@ -9622,7 +9622,7 @@ + else + cl.sType=curve[9].toInt(); + +- cl.symCol=curve[10].toUInt(); ++ cl.symCol=COLORUINT(curve[10]); + if (d_file_version <= 89) + cl.symCol = convertOldToNewColorIndex(cl.symCol); + if (curve[11]=="-1") +@@ -9630,12 +9630,12 @@ + else + { + cl.symbolFill = true; +- cl.fillCol=curve[11].toUInt(); ++ cl.fillCol=COLORUINT(curve[11]); + } + if (d_file_version <= 89) + cl.fillCol = convertOldToNewColorIndex(cl.fillCol); + cl.filledArea=curve[12].toInt(); +- cl.aCol=curve[13].toUInt(); ++ cl.aCol=COLORUINT(curve[13]); + if (d_file_version <= 89) + cl.aCol = convertOldToNewColorIndex(cl.aCol); + cl.aStyle=curve[14].toInt(); +@@ -9755,21 +9755,21 @@ + QStringList curve = s.split("\t"); + CurveLayout cl; + cl.connectType=curve[6].toInt(); +- cl.lCol=curve[7].toUInt(); ++ cl.lCol=COLORUINT(curve[7]); + cl.lStyle=curve[8].toInt(); + cl.lWidth=curve[9].toInt(); + cl.sSize=curve[10].toInt(); + cl.sType=curve[11].toInt(); +- cl.symCol=curve[12].toUInt(); ++ cl.symCol=COLORUINT(curve[12]); + if (curve[13]=="-1") + cl.symbolFill = false; + else + { + cl.symbolFill = true; +- cl.fillCol=curve[13].toUInt(); ++ cl.fillCol=COLORUINT(curve[13]); + } + cl.filledArea=curve[14].toInt(); +- cl.aCol=curve[15].toUInt(); ++ cl.aCol=COLORUINT(curve[15]); + cl.aStyle=curve[16].toInt(); + int current_index = 17; + if(curve.count() < 16) +diff -Naur scidavis-1.25/libscidavis/src/ColorButton.h scidavis-master/libscidavis/src/ColorButton.h +--- scidavis-1.25/libscidavis/src/ColorButton.h 2019-03-05 00:49:55.000000000 +0100 ++++ scidavis-master/libscidavis/src/ColorButton.h 2019-03-14 22:27:01.000000000 +0100 +@@ -42,6 +42,7 @@ + static inline QString COLORNAME( QColor c ) { return ('#'+QString::number(c.rgba(),16)); } + static inline QString COLORVALUE( QString s ) { if ((s[0]=='#') && (s.size()==9)) return s.remove(1,2); else return s; } + #endif ++static inline uint COLORUINT( QString s ) { if (s[0]=='#') return s.remove(0,1).toUInt(nullptr,16); else return s.toUInt(); } + + //! A button used for color selection + /** diff --git a/scidavis.spec b/scidavis.spec index 2413ea1..132f383 100644 --- a/scidavis.spec +++ b/scidavis.spec @@ -3,7 +3,7 @@ Name: scidavis Version: 1.25 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Application for Scientific Data Analysis and Visualization License: GPLv3+ @@ -12,6 +12,8 @@ URL: http://scidavis.sourceforge.net/ # Main upstream development repository (master, snapshots, minor versions not in sf) #Source0: https://github.com/%%{owner}/%%{name}/archive/master/%%{name}-master.tar.gz Source0: https://github.com/%{owner}/%{name}/archive/%{version}/%{name}-%{version}.tar.gz +# Fix for sf bug #377, remove on next release +Patch0: scidavis-fix_plot_colors.patch BuildRequires: gcc-c++ BuildRequires: python3 @@ -67,6 +69,7 @@ This module provides SciDAVis bindings to the Python3 programming language. %setup -q -n %{name}-%{version} # Development builds #%%setup -q -n %%{name}-master +%patch0 -p1 # Set the correct python paths sed -i 's+pythonconfig.path = "$$INSTALLBASE/../etc"+pythonconfig.path = "$$INSTALLBASE/..%{python3_sitearch}/scidavis"+g' config.pri sed -i 's+pythonutils.path = "$$INSTALLBASE/share/scidavis"+pythonutils.path = "$$INSTALLBASE/..%{python3_sitearch}/scidavis"+g' config.pri @@ -134,6 +137,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/appdata/*.appdata. %changelog +* Sat Mar 16 2019 Alexander Ploumistos - 1.25-2 +- Backport fix for plot colors reverting to black + * Tue Mar 05 2019 Alexander Ploumistos - 1.25-1 - Update to 1.25 (bugfixes, updated translations)