SHA256
1
0
forked from pool/labplot
Christophe Marin
2025-01-15 14:04:10 +00:00
committed by Git OBS Bridge
parent 54a0b7d28c
commit 74d51d9785
11 changed files with 69 additions and 844 deletions
+7 -3
View File
@@ -1,7 +1,11 @@
-------------------------------------------------------------------
Wed Jan 15 13:28:06 UTC 2025 - Christophe Marin <christophe@krop.fr>
- Use a git snapshot for proper cantor support
- Add patch:
* 0001-Fix-finding-liborigin-on-openSUSE.patch
-------------------------------------------------------------------
Mon Jan 13 23:04:46 UTC 2025 - Christophe Marin <christophe@krop.fr>
- Init labplot. Qt 6 port of labplot-kf5
- Add patches:
* 0001-Minor-qt6-related-fixes.patch
* 0001-Reenable-cantor-backend.patch
+18 -17
View File
@@ -20,19 +20,20 @@
%define qt6_version 6.2.2
Name: labplot
Version: 2.11.1
Version: 2.11.1git.20250114T013234~18418c36
Release: 0
Summary: Data Visualization and Analysis software
License: GPL-2.0-or-later
URL: https://apps.kde.org/labplot/
Source0: https://download.kde.org/stable/labplot/%{name}-%{version}.tar.xz
Source1: https://download.kde.org/stable/labplot/%{name}-%{version}.tar.xz.sig
# SECTION TODO
# TODO: Uncomment when a new release with cantor fixes is available
# Source1: https://download.kde.org/stable/labplot/%%{name}-%%{version}.tar.xz.sig
# https://invent.kde.org/sysadmin/release-keyring/-/blob/master/keys/sgerlach@key1.asc?ref_type=heads
Source2: labplot.keyring
# PATCH-FIX-UPSTREAM
Patch0: 0001-Minor-qt6-related-fixes.patch
# PATCH-FEATURE-UPSTREAM
Patch1: 0001-Reenable-cantor-backend.patch
# Source2: labplot.keyring
# /SECTION
# PATCH-FIX-OPENSUSE
Patch0: 0001-Fix-finding-liborigin-on-openSUSE.patch
BuildRequires: bison
BuildRequires: hdf5-devel
BuildRequires: kf6-extra-cmake-modules >= %{kf6_version}
@@ -123,7 +124,7 @@ sed -i 's#-pedantic#-pedantic -Wno-error=undef#' CMakeLists.txt
%kf6_install
# Remove exotic resolutions
for res in 16 32 44 150 310; do
for res in 44 150 310; do
rm -r %{buildroot}%{_kf6_iconsdir}/hicolor/${res}x${res}
done
@@ -134,16 +135,16 @@ done
%files
%license LICENSES/*
%doc ChangeLog README.md
%doc %lang(en) %{_kf6_htmldir}/en/labplot2/
%{_kf6_applicationsdir}/org.kde.labplot2.desktop
%{_kf6_appstreamdir}/org.kde.labplot2.appdata.xml
%{_kf6_bindir}/labplot2
%{_kf6_iconsdir}/hicolor/*/apps/labplot*
%{_kf6_mandir}/man1/labplot2.1%{?ext_man}
%{_kf6_sharedir}/labplot2/
%{_kf6_sharedir}/mime/packages/labplot2.xml
%doc %lang(en) %{_kf6_htmldir}/en/labplot/
%{_kf6_applicationsdir}/org.kde.labplot.desktop
%{_kf6_appstreamdir}/org.kde.labplot.appdata.xml
%{_kf6_bindir}/labplot
%{_kf6_iconsdir}/hicolor/*/apps/*labplot*
%{_kf6_mandir}/man1/labplot.1%{?ext_man}
%{_kf6_sharedir}/labplot/
%{_kf6_sharedir}/mime/packages/labplot.xml
%files lang -f %{name}.lang
%exclude %{_kf6_htmldir}/en/labplot2
%exclude %{_kf6_htmldir}/en/labplot
%changelog
+13
View File
@@ -0,0 +1,13 @@
<services>
<service name="obs_scm">
<param name="url">https://invent.kde.org/education/labplot.git</param>
<param name="scm">git</param>
<param name="versionformat">2.11.1git.%ci~%h</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="buildtime" name="set_version" />
</services>
@@ -0,0 +1,24 @@
From 898674c557199b3beb4cde1f356c18ec8f6187e4 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Wed, 15 Jan 2025 14:49:59 +0100
Subject: [PATCH] Fix finding liborigin on openSUSE
---
cmake/FindLibOrigin.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmake/FindLibOrigin.cmake b/cmake/FindLibOrigin.cmake
index f9819925f..c5aa209ad 100644
--- a/cmake/FindLibOrigin.cmake
+++ b/cmake/FindLibOrigin.cmake
@@ -16,6 +16,7 @@ find_library(LIBORIGIN_LIBRARIES
find_path(LIBORIGIN_INCLUDE_DIR
NAMES OriginFile.h
+ PATH_SUFFIXES liborigin
HINTS ${PC_LIBORIGIN_INCLUDE_DIRS}
)
--
2.47.1
-38
View File
@@ -1,38 +0,0 @@
From 0aacdca748bdb473c3900a5b105ff51a166bd3e1 Mon Sep 17 00:00:00 2001
From: Alexander Semke <alexander.semke@web.de>
Date: Mon, 15 Jul 2024 09:56:40 +0200
Subject: [PATCH] Minor qt6 related fixes.
---
src/kdefrontend/datasources/OdsOptionsWidget.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/kdefrontend/datasources/OdsOptionsWidget.cpp b/src/kdefrontend/datasources/OdsOptionsWidget.cpp
index 6424032..c909436 100644
--- a/src/kdefrontend/datasources/OdsOptionsWidget.cpp
+++ b/src/kdefrontend/datasources/OdsOptionsWidget.cpp
@@ -67,9 +67,9 @@ void OdsOptionsWidget::sheetSelectionChanged() {
}
if (selectedItems.size() > 1)
- emit enableDataPortionSelection(false);
+ Q_EMIT enableDataPortionSelection(false);
else // one selected item
- emit enableDataPortionSelection(true);
+ Q_EMIT enableDataPortionSelection(true);
auto* item = selectedItems.last();
auto* const filter = static_cast<OdsFilter*>(m_fileWidget->currentFileFilter());
@@ -98,7 +98,8 @@ void OdsOptionsWidget::sheetSelectionChanged() {
const int maxColumns = 100;
for (int row = 0; row < rowCount; ++row) {
auto lineString = importedStrings.at(row);
- colCount = std::min(maxColumns, lineString.size());
+ const int size = lineString.size();
+ colCount = std::min(maxColumns, size);
if (row == 0) {
ui.twPreview->setColumnCount(colCount);
--
2.47.1
-769
View File
@@ -1,769 +0,0 @@
From 02f2663de79881771398a32cbbf0db4e975d8bea Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Tue, 14 Jan 2025 03:19:46 +0100
Subject: [PATCH] Reenable cantor backend
Based on upstream changes 5fc1459b, b7ffb09, 47adbd22
---
CMakeLists.txt | 35 ++--
lib/CMakeLists.txt | 7 +-
src/3rdparty/cantor/cantor_part.h | 163 ------------------
src/3rdparty/cantor/panelplugin.h | 103 -----------
src/3rdparty/cantor/panelpluginhandler.h | 51 ------
src/CMakeLists.txt | 6 +-
.../cantorWorksheet/CantorWorksheet.cpp | 61 ++-----
.../cantorWorksheet/CantorWorksheetView.cpp | 35 ++--
src/kdefrontend/SettingsNotebookPage.cpp | 3 +-
.../dockwidgets/CantorWorksheetDock.cpp | 2 +-
10 files changed, 52 insertions(+), 414 deletions(-)
delete mode 100644 src/3rdparty/cantor/cantor_part.h
delete mode 100644 src/3rdparty/cantor/panelplugin.h
delete mode 100644 src/3rdparty/cantor/panelpluginhandler.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index abcf076..1198d49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -351,28 +351,19 @@ ELSE ()
ENDIF ()
### Cantorlibs (optional) ###############################
-IF (ENABLE_CANTOR)
- FIND_PACKAGE (Cantor)
-
- IF (Cantor_FOUND)
- MESSAGE (STATUS "Found Cantor Library ${Cantor_VERSION}")
-
- IF (${Cantor_VERSION} VERSION_GREATER "19.11")
- add_definitions (-DHAVE_CANTOR_LIBS)
- set(RECENT_CANTOR TRUE)
- ELSE ()
- MESSAGE (STATUS "Cantor Library ${Cantor_VERSION} TOO OLD. Minimum usable version is 19.12")
- ENDIF ()
- IF (${Cantor_VERSION} VERSION_GREATER "20.08.9")
- add_definitions (-DHAVE_NEW_CANTOR_LIBS)
- ENDIF ()
- ELSE ()
- MESSAGE (STATUS "Cantor Library NOT FOUND")
- ENDIF ()
-ELSE ()
- add_definitions (-DCANTOR_DISABLED)
- MESSAGE (STATUS "Cantor Library DISABLED")
-ENDIF ()
+if(ENABLE_CANTOR)
+ find_package(Cantor "24.11.70")
+ if(Cantor_FOUND)
+ message(STATUS "Found Cantor: ${Cantor_LIBRARIES}, ${Cantor_INCLUDE_DIR} (version \"${Cantor_VERSION}\")")
+ add_definitions(-DHAVE_CANTOR_LIBS)
+ add_definitions(-DCANTOR_VERSION_STRING=\"${Cantor_VERSION}\")
+ else()
+ message(STATUS "Cantor Library NOT FOUND")
+ endif()
+else()
+ add_definitions(-DCANTOR_DISABLED)
+ message(STATUS "Cantor Library DISABLED")
+endif()
### FFTW (optional) #####################################
IF (ENABLE_FFTW)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 26cb438..41f9304 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -142,7 +142,7 @@ set(BACKEND_SOURCES
IF (ENABLE_LIBORIGIN)
list(APPEND BACKEND_SOURCES ${BACKEND_DIR}/datasources/projects/OriginProjectParser.cpp)
ENDIF ()
-IF (RECENT_CANTOR)
+IF (Cantor_FOUND)
list(APPEND BACKEND_SOURCES ${BACKEND_DIR}/cantorWorksheet/CantorWorksheet.cpp ${BACKEND_DIR}/cantorWorksheet/VariableParser.cpp)
ENDIF ()
@@ -240,7 +240,8 @@ target_link_libraries( labplot
${FFTW3_LIBRARIES}
${Poppler_LIBRARIES}
# ads::qt${QT_VERSION_MAJOR}advanceddocking
- ${LIBCERF_LIBRARIES} )
+ ${LIBCERF_LIBRARIES}
+ )
IF (Discount_FOUND)
target_link_libraries( labplot Discount::Lib )
@@ -254,7 +255,7 @@ IF (ENABLE_LIBORIGIN)
ENDIF ()
ENDIF ()
-IF (RECENT_CANTOR)
+IF (Cantor_FOUND)
# KFX::Service, KFX::Parts is optional but probably required by Cantor
target_link_libraries( labplot Cantor::cantorlibs KF${KF_MAJOR_VERSION}::Service KF${KF_MAJOR_VERSION}::Parts )
ENDIF ()
diff --git a/src/3rdparty/cantor/cantor_part.h b/src/3rdparty/cantor/cantor_part.h
deleted file mode 100644
index 8fb018e..0000000
--- a/src/3rdparty/cantor/cantor_part.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- SPDX-License-Identifier: GPL-2.0-or-later
-
- SPDX-FileCopyrightText: 2009 Alexander Rieder <alexanderrieder@gmail.com>
-*/
-
-#ifndef CANTORPART_H
-#define CANTORPART_H
-
-#include <QPointer>
-
-#include <KParts/ReadWritePart>
-#include <cantor/session.h>
-
-class QWidget;
-class Worksheet;
-class WorksheetView;
-class SarchBar;
-class SearchBar;
-class ScriptEditorWidget;
-class KAboutData;
-class QAction;
-class KToggleAction;
-class KProgressDialog;
-
-namespace Cantor {
- class PanelPluginHandler;
-}
-
-/**
- * This is a "Part". It that does all the real work in a KPart
- * application.
- *
- * @short Main Part
- * @author Alexander Rieder <alexanderrieder@gmail.com>
- */
-class CantorPart : public KParts::ReadWritePart
-{
- Q_OBJECT
-public:
- /**
- * Default constructor
- */
- CantorPart(QWidget *parentWidget,QObject *parent, const QVariantList &args);
-
- /**
- * Destructor
- */
- ~CantorPart() override;
-
- /**
- * This is a virtual function inherited from KParts::ReadWritePart.
- * A shell will use this to inform this Part if it should act
- * read-only
- */
- void setReadWrite(bool rw) override;
-
- /**
- * Reimplemented to disable and enable Save action
- */
- void setModified(bool modified) override;
-
- KAboutData& createAboutData();
-
- Worksheet* worksheet();
-
-Q_SIGNALS:
- void setCaption(const QString& caption);
- void showHelp(const QString& help);
-
-protected:
- /**
- * This must be implemented by each part
- */
- bool openFile() override;
-
- /**
- * This must be implemented by each read-write part
- */
- bool saveFile() override;
-
- /**
- * Called when this part becomes the active one,
- * or if it looses activity
- **/
- void guiActivateEvent( KParts::GUIActivateEvent * event ) override;
-
-
- void loadAssistants();
- void adjustGuiToSession();
-
-protected Q_SLOTS:
- void fileSaveAs();
- void fileSavePlain();
- void exportToLatex();
- void evaluateOrInterrupt();
- void restartBackend();
- void enableTypesetting(bool enable);
- void showBackendHelp();
- void print();
- void printPreview();
-
- void worksheetStatusChanged(Cantor::Session::Status stauts);
- void showSessionError(const QString& error);
- void worksheetSessionChanged();
- void initialized();
- void updateCaption();
-
- void pluginsChanged();
- void runCommand(const QString& value);
-
- void runAssistant();
- void publishWorksheet();
-
- void showScriptEditor(bool show);
- void scriptEditorClosed();
- void runScript(const QString& file);
-
- void showSearchBar();
- void showExtendedSearchBar();
- void findNext();
- void findPrev();
- void searchBarDeleted();
-
- /** sets the status message, or cached it, if the StatusBar is blocked.
- * Use this method instead of "emit setStatusBarText"
- */
- void setStatusMessage(const QString& message);
- /** Shows an important status message. It makes sure the message is displayed,
- * by blocking the statusbarText for 3 seconds
- */
- void showImportantStatusMessage(const QString& message);
- /** Blocks the StatusBar for new messages, so the currently shown one won't be overridden
- */
- void blockStatusBar();
- /** Removes the block from the StatusBar, and shows the last one of the StatusMessages that
- where set during the block
- **/
- void unblockStatusBar();
-private:
- Worksheet *m_worksheet;
- WorksheetView *m_worksheetview;
- SearchBar *m_searchBar;
- QPointer<ScriptEditorWidget> m_scriptEditor;
- Cantor::PanelPluginHandler* m_panelHandler;
-
- KProgressDialog* m_initProgressDlg;
- QAction * m_evaluate;
- QAction * m_save;
- QAction * m_findNext;
- QAction * m_findPrev;
- KToggleAction* m_typeset;
- KToggleAction* m_highlight;
- KToggleAction* m_completion;
- KToggleAction* m_exprNumbering;
- KToggleAction* m_animateWorksheet;
- QAction * m_showBackendHelp;
-
- QString m_cachedStatusMessage;
- bool m_statusBarBlocked;
-};
-
-#endif // CANTORPART_H
diff --git a/src/3rdparty/cantor/panelplugin.h b/src/3rdparty/cantor/panelplugin.h
deleted file mode 100644
index ffc67fd..0000000
--- a/src/3rdparty/cantor/panelplugin.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- SPDX-License-Identifier: GPL-2.0-or-later
-
- SPDX-FileCopyrightText: 2010 Alexander Rieder <alexanderrieder@gmail.com>
-*/
-
-#ifndef _PANEL_PLUGIN_H
-#define _PANEL_PLUGIN_H
-
-#include <KXMLGUIClient>
-#include <QObject>
-#include <KService/KPluginInfo>
-
-#include <cantor/backend.h>
-
-#include <cantor/cantor_export.h>
-
-namespace Cantor
-{
-class Session;
-class PanelPluginPrivate;
-
-/**
- * A plugin provides some additional features for the worksheet
- */
-class CANTOR_EXPORT PanelPlugin : public QObject /*, public KXMLGUIClient*/
-{
- Q_OBJECT
- public:
- /**
- * Create a new PanelPlugin
- * @param parent the parent Object @see QObject
- **/
- explicit PanelPlugin( QObject* parent );
- /**
- * Destructor
- */
- ~PanelPlugin() override;
-
- /**
- * Sets the properties of this PanelPlugin
- * according to KPluginInfo
- * @param info KPluginInfo
- */
- void setPluginInfo(KPluginInfo info);
-
- /**
- * Returns a list of all extensions, the current backend
- * must provide to make this PanelPlugin work. If it doesn't
- * this PanelPlugin won't be enabled
- * @return list of required extensions
- */
- QStringList requiredExtensions();
-
-
- /**
- * Returns the capabilities, the current backend
- * must provide to make this PanelPlugin work. If it doesn't
- * this PanelPlugin won't be enabled
- * @return the required capabilities
- */
- virtual Backend::Capabilities requiredCapabilities();
-
-
- /**
- * Returns the name of the plugin
- * @return name of the plugin
- */
- QString name();
-
- /**
- * returns the widget, provided by this plugin
- * @return the widget, provided by this plugin
- **/
- virtual QWidget* widget() = 0;
-
- void setParentWidget(QWidget* widget);
- QWidget* parentWidget();
-
- /**
- * sets the session this plugin operates on
- **/
- void setSession(Session* session);
-
- /**
- * returns the session
- */
- Session* session();
-
- Q_SIGNALS:
- void requestRunCommand(const QString& cmd);
- void visibilityRequested();
-
- protected:
- virtual void onSessionChanged();
-
- private:
- PanelPluginPrivate* d;
-};
-
-}
-
-#endif /* _PANEL_PLUGIN_H */
diff --git a/src/3rdparty/cantor/panelpluginhandler.h b/src/3rdparty/cantor/panelpluginhandler.h
deleted file mode 100644
index 82c2e7c..0000000
--- a/src/3rdparty/cantor/panelpluginhandler.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- SPDX-License-Identifier: GPL-2.0-or-later
-
- SPDX-FileCopyrightText: 2010 Alexander Rieder <alexanderrieder@gmail.com>
-*/
-
-#ifndef _PANELPLUGINHANDLER_H
-#define _PANELPLUGINHANDLER_H
-
-#include <QObject>
-#include <cantor/cantor_export.h>
-
-namespace Cantor
-{
-class PanelPluginHandlerPrivate;
-class PanelPlugin;
-class Session;
-
-/**
- * Simple interface that exports a list of known PanelPlugins.
- * Needed as the Panel must be handled by the Shell while plugins
- * belong to the Part.
- */
-
-class CANTOR_EXPORT PanelPluginHandler : public QObject
-{
- Q_OBJECT
- public:
- explicit PanelPluginHandler(QObject* parent);
- ~PanelPluginHandler() override;
-
- QList<PanelPlugin*> plugins();
-
- void addPlugin(PanelPlugin* plugin);
-
- void setSession(Session* session);
-
- Q_SIGNALS:
- void pluginsChanged();
-
- private:
- void loadPlugins();
-
- private:
- PanelPluginHandlerPrivate* d;
-
-};
-
-}
-
-#endif /* _PANELPLUGINHANDLER_H */
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 606e331..dccc13d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -503,7 +503,7 @@ set(COMMONFRONTEND_SOURCES
${COMMONFRONTEND_DIR}/datapicker/DatapickerImageView.cpp
)
-IF (RECENT_CANTOR)
+IF (Cantor_FOUND)
set(CANTOR_SOURCES
${KDEFRONTEND_DIR}/dockwidgets/CantorWorksheetDock.cpp
${BACKEND_DIR}/cantorWorksheet/VariableParser.cpp
@@ -512,8 +512,6 @@ IF (RECENT_CANTOR)
)
set(CANTOR_UI_SOURCES ${KDEFRONTEND_DIR}/ui/dockwidgets/cantorworksheetdock.ui)
set(UI_SOURCES ${UI_SOURCES} ${CANTOR_UI_SOURCES})
-ELSE ()
- set(CANTOR_SOURCES "")
ENDIF ()
set(BACKEND_TOOLS_SOURCES
@@ -645,7 +643,7 @@ IF (KF${KF_MAJOR_VERSION}Purpose_FOUND)
target_link_libraries( labplot2lib KF${KF_MAJOR_VERSION}::PurposeWidgets )
ENDIF ()
-IF (RECENT_CANTOR)
+IF (Cantor_FOUND)
# KFX::Service, KFX::Parts is optional but probably required by Cantor
target_link_libraries( labplot2backendlib Cantor::cantorlibs KF${KF_MAJOR_VERSION}::Service KF${KF_MAJOR_VERSION}::Parts )
target_link_libraries( labplot2lib Cantor::cantorlibs KF${KF_MAJOR_VERSION}::Service KF${KF_MAJOR_VERSION}::Parts )
diff --git a/src/backend/cantorWorksheet/CantorWorksheet.cpp b/src/backend/cantorWorksheet/CantorWorksheet.cpp
index f12c46b..4ec9264 100644
--- a/src/backend/cantorWorksheet/CantorWorksheet.cpp
+++ b/src/backend/cantorWorksheet/CantorWorksheet.cpp
@@ -20,17 +20,10 @@
#include "commonfrontend/cantorWorksheet/CantorWorksheetView.h"
#endif
-#include "3rdparty/cantor/cantor_part.h"
-#include <cantor/cantorlibs_version.h>
#include <cantor/worksheetaccess.h>
-#ifdef HAVE_NEW_CANTOR_LIBS
#include <cantor/panelplugin.h>
#include <cantor/panelpluginhandler.h>
-#else
-#include "3rdparty/cantor/panelplugin.h"
-#include "3rdparty/cantor/panelpluginhandler.h"
-#endif
#include <KConfigGroup>
#include <KLocalizedString>
@@ -56,28 +49,7 @@ CantorWorksheet::CantorWorksheet(const QString& name, bool loading)
bool CantorWorksheet::init(QByteArray* content) {
DEBUG(Q_FUNC_INFO)
-#if KCOREADDONS_VERSION < QT_VERSION_CHECK(5, 86, 0)
- KPluginLoader loader(QLatin1String("kf5/parts/cantorpart"));
- KPluginLoader oldLoader(QLatin1String("cantorpart")); // old path
- KPluginFactory* factory = loader.factory();
-
- if (!factory) { // try old path
- WARN("Failed to load Cantor plugins; file name: " << STDSTRING(loader.fileName()))
- WARN("Error message: " << STDSTRING(loader.errorString()))
- factory = oldLoader.factory();
- }
- if (!factory) {
- // we can only get to this here if we open a project having Cantor content and Cantor plugins were not found.
- // return false here, a proper error message will be created in load() and propagated further.
- WARN("Failed to load Cantor plugins; file name: " << STDSTRING(oldLoader.fileName()))
- WARN("Error message: " << STDSTRING(oldLoader.errorString()))
- m_error = i18n("Couldn't find the dynamic library 'cantorpart'. Please check your installation.");
- return false;
- } else {
- m_part = factory->create<KParts::ReadWritePart>(this, QVariantList() << m_backendName << QLatin1String("--noprogress"));
-
-#else
- const auto result = KPluginFactory::instantiatePlugin<KParts::ReadWritePart>(KPluginMetaData(QStringLiteral("kf5/parts/cantorpart")),
+ const auto result = KPluginFactory::instantiatePlugin<KParts::ReadWritePart>(KPluginMetaData(QStringLiteral("kf6/parts/cantorpart")),
this,
QVariantList() << m_backendName << QLatin1String("--noprogress"));
@@ -86,7 +58,7 @@ bool CantorWorksheet::init(QByteArray* content) {
return false;
} else {
m_part = result.plugin;
-#endif
+
if (!m_part) {
WARN("Could not create the Cantor Part for backend " << STDSTRING(m_backendName))
m_error = i18n("Couldn't find the plugin for %1. Please check your installation.", m_backendName);
@@ -127,31 +99,31 @@ bool CantorWorksheet::init(QByteArray* content) {
// TODO: right now we don't have the direct accces to Cantor's worksheet and to all its public methods
// and we need to go through the actions provided in cantor_part.
//-> redesign this! expose Cantor's Worksheet directly and add more settings here.
- auto* action = m_part->action("enable_highlighting");
+ auto* action = m_part->action(QStringLiteral("enable_highlighting"));
if (action) {
bool value = group.readEntry(QLatin1String("SyntaxHighlighting"), false);
action->setChecked(value);
}
- action = m_part->action("enable_completion");
+ action = m_part->action(QStringLiteral("enable_completion"));
if (action) {
bool value = group.readEntry(QLatin1String("SyntaxCompletion"), false);
action->setChecked(value);
}
- action = m_part->action("enable_expression_numbers");
+ action = m_part->action(QStringLiteral("enable_expression_numbers"));
if (action) {
bool value = group.readEntry(QLatin1String("LineNumbers"), false);
action->setChecked(value);
}
- action = m_part->action("enable_typesetting");
+ action = m_part->action(QStringLiteral("enable_typesetting"));
if (action) {
bool value = group.readEntry(QLatin1String("LatexTypesetting"), false);
action->setChecked(value);
}
- action = m_part->action("enable_animations");
+ action = m_part->action(QStringLiteral("enable_animations"));
if (action) {
bool value = group.readEntry(QLatin1String("Animations"), false);
action->setChecked(value);
@@ -277,20 +249,11 @@ void CantorWorksheet::rowsAboutToBeRemoved(const QModelIndex& /*parent*/, int fi
QList<Cantor::PanelPlugin*> CantorWorksheet::getPlugins() {
if (!m_pluginsLoaded) {
-#ifdef HAVE_NEW_CANTOR_LIBS
auto* handler = new Cantor::PanelPluginHandler(this);
handler->loadPlugins();
m_plugins = handler->activePluginsForSession(m_session, Cantor::PanelPluginHandler::PanelStates());
for (auto* plugin : m_plugins)
plugin->connectToShell(m_part);
-#else
- auto* handler = m_part->findChild<Cantor::PanelPluginHandler*>(QLatin1String("PanelPluginHandler"));
- if (!handler) {
- m_error = i18n("Couldn't find panel plugins. Please check your installation.");
- return false;
- }
- m_plugins = handler->plugins();
-#endif
m_pluginsLoaded = true;
}
@@ -363,7 +326,7 @@ bool CantorWorksheet::exportView() const {
// TODO: file_export_pdf exists starting with Cantor 23.12,
// remove this check later once 23.12 is the minimal
// supported version of Cantor.
- auto* action = m_part->action("file_export_pdf");
+ auto* action = m_part->action(QStringLiteral("file_export_pdf"));
if (action) {
action->trigger();
return true;
@@ -372,21 +335,21 @@ bool CantorWorksheet::exportView() const {
}
bool CantorWorksheet::printView() {
- m_part->action("file_print")->trigger();
+ m_part->action(QStringLiteral("file_print"))->trigger();
return true;
}
bool CantorWorksheet::printPreview() const {
- m_part->action("file_print_preview")->trigger();
+ m_part->action(QStringLiteral("file_print_preview"))->trigger();
return true;
}
void CantorWorksheet::evaluate() {
- m_part->action("evaluate_worksheet")->trigger();
+ m_part->action(QStringLiteral("evaluate_worksheet"))->trigger();
}
void CantorWorksheet::restart() {
- m_part->action("restart_backend")->trigger();
+ m_part->action(QStringLiteral("restart_backend"))->trigger();
}
// ##############################################################################
diff --git a/src/commonfrontend/cantorWorksheet/CantorWorksheetView.cpp b/src/commonfrontend/cantorWorksheet/CantorWorksheetView.cpp
index 52ca61e..f371c8c 100644
--- a/src/commonfrontend/cantorWorksheet/CantorWorksheetView.cpp
+++ b/src/commonfrontend/cantorWorksheet/CantorWorksheetView.cpp
@@ -14,6 +14,7 @@
#include "kdefrontend/spreadsheet/PlotDataDialog.h"
#include "kdefrontend/spreadsheet/StatisticsDialog.h"
+#include <QActionGroup>
#include <QHBoxLayout>
#include <QLabel>
#include <QMenu>
@@ -97,7 +98,7 @@ void CantorWorksheetView::initMenus() {
// markdown entry is only available if cantor was compiled with libdiscovery (cantor 18.12 and later)
QAction* insertMarkdownEntryAction = nullptr;
- if (m_part->action("insert_markdown_entry")) {
+ if (m_part->action(QStringLiteral("insert_markdown_entry"))) {
insertMarkdownEntryAction = new QAction(QIcon::fromTheme(QLatin1String("text-x-markdown")), i18n("Markdown"), m_actionGroup);
insertMarkdownEntryAction->setData(QStringLiteral("insert_markdown_entry"));
}
@@ -119,43 +120,43 @@ void CantorWorksheetView::initMenus() {
// actions for "assistants", that are backend specific and not always available
QAction* computeEigenvectorsAction = nullptr;
- if (m_part->action("eigenvectors_assistant")) {
+ if (m_part->action(QStringLiteral("eigenvectors_assistant"))) {
computeEigenvectorsAction = new QAction(i18n("Compute Eigenvectors"), m_actionGroup);
computeEigenvectorsAction->setData(QStringLiteral("eigenvectors_assistant"));
}
QAction* createMatrixAction = nullptr;
- if (m_part->action("creatematrix_assistant")) {
+ if (m_part->action(QStringLiteral("creatematrix_assistant"))) {
createMatrixAction = new QAction(i18n("Create Matrix"), m_actionGroup);
createMatrixAction->setData(QStringLiteral("creatematrix_assistant"));
}
QAction* computeEigenvaluesAction = nullptr;
- if (m_part->action("eigenvalues_assistant")) {
+ if (m_part->action(QStringLiteral("eigenvalues_assistant"))) {
computeEigenvaluesAction = new QAction(i18n("Compute Eigenvalues"), m_actionGroup);
computeEigenvaluesAction->setData(QStringLiteral("eigenvalues_assistant"));
}
QAction* invertMatrixAction = nullptr;
- if (m_part->action("invertmatrix_assistant")) {
+ if (m_part->action(QStringLiteral("invertmatrix_assistant"))) {
invertMatrixAction = new QAction(i18n("Invert Matrix"), m_actionGroup);
invertMatrixAction->setData(QStringLiteral("invertmatrix_assistant"));
}
QAction* differentiationAction = nullptr;
- if (m_part->action("differentiate_assistant")) {
+ if (m_part->action(QStringLiteral("differentiate_assistant"))) {
differentiationAction = new QAction(i18n("Differentiation"), m_actionGroup);
differentiationAction->setData(QStringLiteral("differentiate_assistant"));
}
QAction* integrationAction = nullptr;
- if (m_part->action("integrate_assistant")) {
+ if (m_part->action(QStringLiteral("integrate_assistant"))) {
integrationAction = new QAction(i18n("Integration"), m_actionGroup);
integrationAction->setData(QStringLiteral("integrate_assistant"));
}
QAction* solveEquationsAction = nullptr;
- if (m_part->action("solve_assistant")) {
+ if (m_part->action(QStringLiteral("solve_assistant"))) {
solveEquationsAction = new QAction(i18n("Solve Equations"), m_actionGroup);
solveEquationsAction->setData(QStringLiteral("solve_assistant"));
}
@@ -203,12 +204,12 @@ void CantorWorksheetView::initMenus() {
//"Notebook Settings"
m_settingsMenu = new QMenu(i18n("Settings"), m_part->widget());
m_settingsMenu->setIcon(QIcon::fromTheme(QLatin1String("settings-configure")));
- m_settingsMenu->addAction(m_part->action("enable_expression_numbers"));
- m_settingsMenu->addAction(m_part->action("enable_highlighting"));
- m_settingsMenu->addAction(m_part->action("enable_completion"));
- m_settingsMenu->addAction(m_part->action("enable_animations"));
+ m_settingsMenu->addAction(m_part->action(QStringLiteral("enable_expression_numbers")));
+ m_settingsMenu->addAction(m_part->action(QStringLiteral("enable_highlighting")));
+ m_settingsMenu->addAction(m_part->action(QStringLiteral("enable_completion")));
+ m_settingsMenu->addAction(m_part->action(QStringLiteral("enable_animations")));
m_settingsMenu->addSeparator();
- m_settingsMenu->addAction(m_part->action("enable_typesetting"));
+ m_settingsMenu->addAction(m_part->action(QStringLiteral("enable_typesetting")));
}
/*!
@@ -243,9 +244,9 @@ void CantorWorksheetView::createContextMenu(QMenu* menu) {
// results related actions
menu->insertSeparator(firstAction);
- menu->addAction(m_part->action("all_entries_collapse_results"));
- menu->addAction(m_part->action("all_entries_uncollapse_results"));
- menu->addAction(m_part->action("all_entries_remove_all_results"));
+ menu->addAction(m_part->action(QStringLiteral("all_entries_collapse_results")));
+ menu->addAction(m_part->action(QStringLiteral("all_entries_uncollapse_results")));
+ menu->addAction(m_part->action(QStringLiteral("all_entries_remove_all_results")));
// assistants, if available
if (m_linearAlgebraMenu || m_calculateMenu) {
@@ -322,7 +323,7 @@ void CantorWorksheetView::fillToolBar(QToolBar* toolbar) {
void CantorWorksheetView::triggerAction(QAction* action) {
const auto& name = action->data().toString();
if (!name.isEmpty()) {
- auto* action = m_part->action(name.toStdString().c_str());
+ auto* action = m_part->action(name);
if (action)
action->trigger();
}
diff --git a/src/kdefrontend/SettingsNotebookPage.cpp b/src/kdefrontend/SettingsNotebookPage.cpp
index dcd9a09..1113134 100644
--- a/src/kdefrontend/SettingsNotebookPage.cpp
+++ b/src/kdefrontend/SettingsNotebookPage.cpp
@@ -3,7 +3,7 @@
Project : LabPlot
Description : Settings page for Notebook
--------------------------------------------------------------------
- SPDX-FileCopyrightText: 2021 Alexander Semke <alexander.semke@web.de>
+ SPDX-FileCopyrightText: 2021-2024 Alexander Semke <alexander.semke@web.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
@@ -12,6 +12,7 @@
#include <KConfigGroup>
#include <KLocalizedString>
+#include <cantor/backend.h>
/**
* \brief Page for Notebook settings of the Labplot settings dialog.
diff --git a/src/kdefrontend/dockwidgets/CantorWorksheetDock.cpp b/src/kdefrontend/dockwidgets/CantorWorksheetDock.cpp
index a44c670..03b9363 100644
--- a/src/kdefrontend/dockwidgets/CantorWorksheetDock.cpp
+++ b/src/kdefrontend/dockwidgets/CantorWorksheetDock.cpp
@@ -12,7 +12,7 @@
#include "CantorWorksheetDock.h"
#include "backend/cantorWorksheet/CantorWorksheet.h"
-#include <3rdparty/cantor/panelplugin.h>
+#include <cantor/panelplugin.h>
#include <QAction>
--
2.47.1
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:53aa6ac8df39324d99463e60d88de25346b3928da5bb0f210b0563489046679d
size 24180904
-14
View File
@@ -1,14 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQGzBAABCAAdFiEEaNnx1kZwSOfQ63Uz5+r6MJZR4dAFAmaVi8sACgkQ5+r6MJZR
4dA32QwApSaOU2WVxCqEJM7caEgMEg43e9HvoK7MZfKCkaxEPBT1J3Qhw6k5Mdkf
Ee1d7Mz54eH6xF+JGRWt9TKVPLDyCy1Utc30enAWtnWFeis1jf6pok+tJfy5/UDB
Jo3NzGQOAuXtro+RRjSx72UQAhdB3muqto6hjCnftugMbKn0W0BmacRaIainyXaW
qZHwE4ZBuqHzYaaAMwM3mhKgE7VJ136KAKSHMxFzYw/tl6CC9w6d6tPXw4Owg8Hf
FHySNulpI6on5LQdqsiTG3Av/SS/Y+WPq6nYR8qUhVRi1u/Kg/CCnmpH4675bfjZ
D7VH9oRE4TcRm36f6C9EE3YgVXYDaPxKUHoIT7AoxNjNhiKTA3UJwaSBHwwYvi0L
Qn+QuA53OrOOvo9SOXeWu+bm1NReljYBw6XnEo226aij5uR86L0giT0i3qh4WIOV
ekN58MZSS6iMVMorCJ4ANY9bhHV/aGkx5wfVumgFqXTG30rnlvrQg7+M9q/GdIdJ
TFw32zMC
=bxe+
-----END PGP SIGNATURE-----
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a20aebda0522b67fb5849cba4a33081ee0479be7a645069d08b06b412f391da6
size 87623182
BIN
View File
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
name: labplot
version: 2.11.1git.20250114T013234~18418c36
mtime: 1736818354
commit: 18418c3668e6bbeacade05a192741a4995d874c1