[neon/extras/labplot/Neon/release-lts] debian/patches: patch from branch for new cantor
Jonathan Riddell
null at kde.org
Mon Nov 9 13:22:16 GMT 2020
Git commit e1dbdc1cb89218c46df63cab92d582e419c1aaa0 by Jonathan Riddell.
Committed on 09/11/2020 at 13:22.
Pushed by jriddell into branch 'Neon/release-lts'.
patch from branch for new cantor
A +86 -0 debian/patches/cantor-20.08.diff
M +1 -0 debian/patches/series
https://invent.kde.org/neon/extras/labplot/commit/e1dbdc1cb89218c46df63cab92d582e419c1aaa0
diff --git a/debian/patches/cantor-20.08.diff b/debian/patches/cantor-20.08.diff
new file mode 100644
index 0000000..74d0a4c
--- /dev/null
+++ b/debian/patches/cantor-20.08.diff
@@ -0,0 +1,86 @@
+commit ad2d74e7b4fd11af119159161cbb9cb3d59000a6
+Author: Stefan Gerlach <stefan.gerlach at uni-konstanz.de>
+Date: Sun Aug 30 21:31:50 2020 +0200
+
+ [cantor] Fix problem with version 20.08
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 90c00f7c7..b0c342c85 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -223,10 +223,6 @@ SET_PACKAGE_PROPERTIES(Cantor PROPERTIES
+ IF (Cantor_FOUND)
+ MESSAGE (STATUS "Found Cantor Library")
+
+- # can be removed with code using it
+- IF (NOT ${Cantor_VERSION} VERSION_GREATER "0")
+- add_definitions (-DOLD_CANTORLIBS_VERSION)
+- ENDIF ()
+ IF (${Cantor_VERSION} VERSION_GREATER "19.11")
+ add_definitions (-DHAVE_CANTOR_LIBS)
+ set(RECENT_CANTOR TRUE)
+@@ -234,6 +230,9 @@ IF (Cantor_FOUND)
+ ELSE ()
+ MESSAGE (STATUS "Cantor Library ${Cantor_VERSION} TOO OLD. Minimum usable version is 19.12")
+ ENDIF ()
++ IF (${Cantor_VERSION} VERSION_GREATER "20.08")
++ add_definitions (-DHAVE_NEW_CANTOR_LIBS)
++ ENDIF ()
+ ELSE ()
+ MESSAGE (STATUS "Cantor Library NOT FOUND")
+ ENDIF ()
+diff --git a/src/backend/cantorWorksheet/CantorWorksheet.cpp b/src/backend/cantorWorksheet/CantorWorksheet.cpp
+index a2fdbd11e..f2684a09d 100644
+--- a/src/backend/cantorWorksheet/CantorWorksheet.cpp
++++ b/src/backend/cantorWorksheet/CantorWorksheet.cpp
+@@ -37,7 +37,7 @@
+ #include "3rdparty/cantor/cantor_part.h"
+ #include <cantor/worksheetaccess.h>
+
+-#if CANTOR_VERSION > QT_VERSION_CHECK(20,8,0)
++#ifdef HAVE_NEW_CANTOR_LIBS
+ #include <cantor/panelpluginhandler.h>
+ #include <cantor/panelplugin.h>
+ #else
+@@ -92,18 +92,14 @@ bool CantorWorksheet::init(QByteArray* content) {
+ connect(m_session, SIGNAL(statusChanged(Cantor::Session::Status)), this, SIGNAL(statusChanged(Cantor::Session::Status)));
+
+ //variable model
+-#ifndef OLD_CANTORLIBS_VERSION
+ m_variableModel = m_session->variableDataModel();
+-#else
+- m_variableModel = m_session->variableModel();
+-#endif
+ connect(m_variableModel, &QAbstractItemModel::dataChanged, this, &CantorWorksheet::dataChanged);
+ connect(m_variableModel, &QAbstractItemModel::rowsInserted, this, &CantorWorksheet::rowsInserted);
+ connect(m_variableModel, &QAbstractItemModel::rowsAboutToBeRemoved, this, &CantorWorksheet::rowsAboutToBeRemoved);
+ connect(m_variableModel, &QAbstractItemModel::modelReset, this, &CantorWorksheet::modelReset);
+
+ //available plugins
+-#if CANTOR_VERSION > QT_VERSION_CHECK(20,8,0)
++#ifdef HAVE_NEW_CANTOR_LIBS
+ auto* handler = new Cantor::PanelPluginHandler(this);
+ handler->loadPlugins();
+ m_plugins = handler->activePluginsForSession(m_session, Cantor::PanelPluginHandler::PanelStates());
+@@ -184,20 +180,13 @@ void CantorWorksheet::modelReset() {
+
+ void CantorWorksheet::rowsAboutToBeRemoved(const QModelIndex & parent, int first, int last) {
+ Q_UNUSED(parent);
+-#ifndef OLD_CANTORLIBS_VERSION
++
+ for (int i = first; i <= last; ++i) {
+ const QString& name = m_variableModel->data(m_variableModel->index(first, 0)).toString();
+ Column* column = child<Column>(name);
+ if (column)
+ column->remove();
+ }
+-#else
+- Q_UNUSED(first);
+- Q_UNUSED(last);
+- //TODO: Old Cantor removes rows from the model even when the variable was changed only.
+- //We don't want this behaviour since this removes the columns from the datasource in the curve.
+- return;
+-#endif
+ }
+
+ QList<Cantor::PanelPlugin*> CantorWorksheet::getPlugins() {
diff --git a/debian/patches/series b/debian/patches/series
index 513a3be..735d3b5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0001-cantor-20.08.1-still-uses-old-code-minor-formating-f.patch
+cantor-20.08.diff
More information about the Neon-commits
mailing list