Git commit 221f8445d664939c804d17542cd8046c60f4fbf6 by Stefan Gerlach.
Committed on 01/11/2016 at 16:15.
Pushed by sgerlach into branch 'frameworks'.

merge conflicts resolved

M  +1    -0    CMakeLists.txt
M  +16   -7    doc/index.docbook
M  +135  -126  src/backend/gsl/ExpressionParser.cpp
M  +34   -7    src/backend/worksheet/TextLabel.cpp
M  +81   -52   src/backend/worksheet/plots/cartesian/XYFitCurve.cpp
M  +1    -0    src/commonfrontend/widgets/TreeViewComboBox.cpp
M  +15   -3    src/commonfrontend/worksheet/WorksheetView.cpp
M  +3    -1    src/kdefrontend/MainWin.cpp
M  +1    -1    src/kdefrontend/SettingsGeneralPage.cpp
M  +0    -1    src/kdefrontend/datasources/ImportFileDialog.cpp
M  +9    -4    src/kdefrontend/dockwidgets/XYFitCurveDock.cpp
M  +104  -25   src/kdefrontend/matrix/MatrixFunctionDialog.cpp
M  +6    -0    src/kdefrontend/widgets/FitOptionsWidget.cpp
M  +104  -54   src/kdefrontend/widgets/LabelWidget.cpp
M  +8    -6    src/kdefrontend/widgets/LabelWidget.h
M  +24   -12   src/tools/TeXRenderer.cpp

http://commits.kde.org/labplot/221f8445d664939c804d17542cd8046c60f4fbf6

diff --cc CMakeLists.txt
index 07b8d48,ad859bd..9dc90f7
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@@ -4,19 -4,18 +4,20 @@@ cmake_minimum_required(VERSION 2.8.12
  find_package(ECM 1.3.0 REQUIRED NO_MODULE)
  set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
  
 -find_package(Qt4 REQUIRED)
 -find_package(KDE4 REQUIRED)
 +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Widgets Svg 
Concurrent)
 +find_package(KF5 REQUIRED COMPONENTS I18n KDELibs4Support NewStuff)
  
 +include(FeatureSummary)
  include(ECMInstallIcons)
  include(KDEInstallDirs)
 -include(KDE4Defaults)
 +include(KDECompilerSettings)
 +include(KDECMakeSettings)
  
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra -Wundef -Wpointer-arith 
-Wcast-align -Wunreachable-code -Wunused -fno-omit-frame-pointer 
-fstack-protector -fno-exceptions")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -Wundef 
-Wpointer-arith -Wcast-align -Wunreachable-code -Wunused 
-fno-omit-frame-pointer -fstack-protector -fno-exceptions")
  
 -add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} 
${KDE4_DEFINITIONS})
 -include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} 
${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
 +add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
 +include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} 
${CMAKE_BINARY_DIR})
  set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
  add_definitions (-DLVERSION=\"2.3.0\")
  # add_definitions (-DLDEBUG='1')
diff --cc src/backend/gsl/ExpressionParser.cpp
index 49f5df9,adaab19..0522cb7
--- a/src/backend/gsl/ExpressionParser.cpp
+++ b/src/backend/gsl/ExpressionParser.cpp
@@@ -38,13 -36,13 +36,15 @@@ extern "C" 
  #include <gsl/gsl_math.h>
  #include <gsl/gsl_const_mksa.h>
  #include <gsl/gsl_const_num.h>
+ #include "backend/gsl/parser.h"
  }
+ #include <cmath>
  
 +#include <cmath>
 +
  ExpressionParser* ExpressionParser::instance = NULL;
  
- ExpressionParser::ExpressionParser(){
+ ExpressionParser::ExpressionParser() {
        init_table();
        initFunctions();
        initConstants();
diff --cc src/backend/worksheet/TextLabel.cpp
index 8183205,24881a3..f44ffbd
--- a/src/backend/worksheet/TextLabel.cpp
+++ b/src/backend/worksheet/TextLabel.cpp
@@@ -33,7 -33,8 +33,8 @@@
  #include "backend/lib/XmlStreamReader.h"
  
  #include <QApplication>
+ #include <QBuffer>
 -#include <QtConcurrentRun>
 +#include <QtConcurrent/QtConcurrentRun>
  #include <QDesktopWidget>
  #include <QPainter>
  #include <QGraphicsScene>
diff --cc src/kdefrontend/matrix/MatrixFunctionDialog.cpp
index 3e4afd1,47bd645..6ed45d8
--- a/src/kdefrontend/matrix/MatrixFunctionDialog.cpp
+++ b/src/kdefrontend/matrix/MatrixFunctionDialog.cpp
@@@ -31,11 -32,18 +32,19 @@@
  #include "kdefrontend/widgets/ConstantsWidget.h"
  #include "kdefrontend/widgets/FunctionsWidget.h"
  
+ extern "C" {
+ #include "backend/gsl/parser.h"
+ }
+ #include <cmath>
+ 
  #include <QMenu>
  #include <QWidgetAction>
- 
 +#include <KLocalizedString>
+ #include <QThreadPool>
+ #ifndef NDEBUG
+ #include <QDebug>
+ #include <QElapsedTimer>
+ #endif
  
  /*!
        \class MatrixFunctionDialog
@@@ -52,11 -60,11 +61,11 @@@ MatrixFunctionDialog::MatrixFunctionDia
        ui.setupUi(mainWidget);
        setMainWidget( mainWidget );
  
 -      ui.tbConstants->setIcon( KIcon("labplot-format-text-symbol") );
 -      ui.tbFunctions->setIcon( KIcon("preferences-desktop-font") );
 +      ui.tbConstants->setIcon( QIcon::fromTheme("labplot-format-text-symbol") 
);
 +      ui.tbFunctions->setIcon( QIcon::fromTheme("preferences-desktop-font") );
  
        QStringList vars;
-       vars<<"x"<<"y";
+       vars << "x" << "y";
        ui.teEquation->setVariables(vars);
        ui.teEquation->setFocus();
        ui.teEquation->setMaximumHeight(QLineEdit().sizeHint().height()*2);
diff --cc src/kdefrontend/widgets/LabelWidget.cpp
index e20982d,b27ec24..0bcb01c
--- a/src/kdefrontend/widgets/LabelWidget.cpp
+++ b/src/kdefrontend/widgets/LabelWidget.cpp
@@@ -33,22 -33,31 +33,33 @@@
  
  #include <QWidgetAction>
  
+ #include <KConfigGroup>
++#include <KSharedConfig>
  #include <KCharSelect>
 -#include <KGlobal>
 -#include <KMenu>
 +#include <KLocalizedString>
 +#include <QMenu>
  
+ #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
+ #include <QStandardPaths>
+ #else
+ #include <KStandardDirs>
+ #endif
+ 
  /*!
        \class LabelWidget
 -      \brief Widget for editing the properties of a TextLabel object, mostly 
used in an an appropriate dock widget.
 +      \brief Widget for editing the properties of a TextLabel object, mostly 
used in an an appropriate dock widget.
  
 -      In order the properties of the label to be shown, \c loadConfig() has 
to be called with the correspondig KConfigGroup
 -      (settings for a label in *Plot, Axis etc. or for an independent label 
on the worksheet).
 +      In order the properties of the label to be shown, \c loadConfig() has 
to be called with the correspondig KConfigGroup
 +      (settings for a label in *Plot, Axis etc. or for an independent label 
on the worksheet).
  
 -      \ingroup kdefrontend
 +      \ingroup kdefrontend
   */
+ LabelWidget::LabelWidget(QWidget* parent) : QWidget(parent),
+       m_initializing(false),
 -      m_dateTimeMenu(new KMenu(this)),
++      m_dateTimeMenu(new QMenu(this)),
+       m_teXAvailable(false) {
  
 +// see legacy/LabelWidget.cpp
- LabelWidget::LabelWidget(QWidget *parent): QWidget(parent), 
m_initializing(false), m_dateTimeMenu(new QMenu(this)) {
        ui.setupUi(this);
  
        m_dateTimeMenu->setSeparatorsCollapsible(false); //we don't want the 
first separator to be removed
@@@ -90,6 -99,21 +101,21 @@@
        ui.cbVerticalAlignment->addItem(i18n("center"));
        ui.cbVerticalAlignment->addItem(i18n("bottom"));
  
+       //check whether the used latex compiler is available.
+       //Following logic is implemented (s.a. LabelWidget::teXUsedChanged()):
+       //1. in case latex was used to generate the text label in the stored 
project
+       //and no latex is available on the target system, latex button is 
toggled and
+       //the user still can switch to the non-latex mode.
+       //2. in case the label was in the non-latex mode and no latex is 
available,
+       //deactivate the latex button so the user cannot switch to this mode.
 -      KConfigGroup group = KGlobal::config()->group("General");
++      KConfigGroup group = KSharedConfig::openConfig()->group( "General" );
+       QString engine = group.readEntry("LaTeXEngine", "");
+ #if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
 -      m_teXAvailable = !QStandardPaths::findExecutable(engine).isEmpty());
++      m_teXAvailable = !QStandardPaths::findExecutable(engine).isEmpty();
+ #else
+       m_teXAvailable = !KStandardDirs::findExe(engine).isEmpty();
+ #endif
+ 
        //SLOTS
        // text properties
        connect(ui.tbTexUsed, SIGNAL(clicked(bool)), this, 
SLOT(teXUsedChanged(bool)) );
@@@ -439,9 -476,9 +478,9 @@@ void LabelWidget::insertDateTime(QActio
  // geometry slots
  
  /*!
 -      called when label's current horizontal position relative to its parent 
(left, center, right, custom ) is changed.
 +    called when label's current horizontal position relative to its parent 
(left, center, right, custom ) is changed.
  */
- void LabelWidget::positionXChanged(int index){
+ void LabelWidget::positionXChanged(int index) {
        //Enable/disable the spinbox for the x- oordinates if the "custom 
position"-item is selected/deselected
        if (index == ui.cbPositionX->count()-1 )
                ui.sbPositionX->setEnabled(true);
@@@ -458,15 -495,14 +497,14 @@@
  }
  
  /*!
 -      called when label's current horizontal position relative to its parent 
(top, center, bottom, custom ) is changed.
 +    called when label's current horizontal position relative to its parent 
(top, center, bottom, custom ) is changed.
  */
- void LabelWidget::positionYChanged(int index){
+ void LabelWidget::positionYChanged(int index) {
        //Enable/disable the spinbox for the y-coordinates if the "custom 
position"-item is selected/deselected
-       if (index == ui.cbPositionY->count()-1 ){
+       if (index == ui.cbPositionY->count()-1 )
                ui.sbPositionY->setEnabled(true);
-       }else{
+       else
                ui.sbPositionY->setEnabled(false);
-       }
  
        if (m_initializing)
                return;
diff --cc src/kdefrontend/widgets/LabelWidget.h
index f8dae6f,36578d6..f23c520
--- a/src/kdefrontend/widgets/LabelWidget.h
+++ b/src/kdefrontend/widgets/LabelWidget.h
@@@ -35,9 -34,9 +35,9 @@@
  
  class Label;
  class Axis;
 -class KMenu;
 +class QMenu;
  
- class LabelWidget: public QWidget{
+ class LabelWidget : public QWidget {
        Q_OBJECT
  
  public:
@@@ -59,9 -58,10 +59,10 @@@ private
        QList<TextLabel*> m_labelsList;
        QList<Axis*> m_axesList;
        bool m_initializing;
 -      KMenu* m_dateTimeMenu;
 +      QMenu* m_dateTimeMenu;
+       bool m_teXAvailable;
  
-       void initConnections();
+       void initConnections() const;
  
  signals:
        void dataChanged(bool);

Reply via email to