[Kst] branches/work/kst/portto4/kst
Peter Kümmel
syntheticpp at gmx.net
Wed Nov 2 23:08:08 UTC 2011
SVN commit 1262360 by kuemmel:
- msvc fixes
- also build unmerged
M +1 -1 cmake/CMakeLists.txt
M +9 -0 src/libkst/debug.h
M +5 -0 src/libkst/math_kst.h
M +2 -0 src/libkstapp/changedatasampledialog.cpp
M +8 -5 src/libkstapp/dialogscriptinterface.cpp
M +2 -0 src/libkstapp/dialogscriptinterface.h
M +3 -1 src/libkstapp/labelscriptinterface.cpp
M +1 -1 src/libkstapp/labelscriptinterface.h
M +3 -2 src/libkstapp/matrixdialog.cpp
M +3 -1 src/libkstapp/plotscriptinterface.cpp
M +1 -1 src/libkstapp/rangetab.cpp
M +1 -0 src/libkstapp/scriptserver.cpp
M +3 -1 src/libkstapp/stringscriptinterface.cpp
M +2 -1 src/libkstapp/vectordialog.cpp
M +3 -1 src/libkstapp/viewitemscriptinterface.cpp
M +3 -0 src/libkstmath/plottickcalculator.cpp
M +4 -2 src/libkstmath/plottickcalculator.h
--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1262359:1262360
@@ -160,7 +160,7 @@
if(MSVC)
- add_definitions(-D_USE_MATH_DEFINES)
+ add_definitions(-D_USE_MATH_DEFINES -DNOMINMAX)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
--- branches/work/kst/portto4/kst/src/libkst/debug.h #1262359:1262360
@@ -20,6 +20,8 @@
#include <qobject.h>
#include <qmutex.h>
+#include <QThread>
+
#include "kst_export.h"
namespace Kst {
@@ -79,6 +81,13 @@
QString _kstRevision;
};
+
+struct Sleep : QThread
+{
+ static void ms(int t) { QThread::msleep(t); }
+};
+
+
}
#endif
--- branches/work/kst/portto4/kst/src/libkst/math_kst.h #1262359:1262360
@@ -26,6 +26,11 @@
#include "kst_export.h"
+#ifdef _MSC_VER
+inline double pow(float a, double b) { return pow((double)a, b); }
+inline double pow(int a, qreal b) { return pow((double)a, (double)b); }
+#endif
+
namespace Kst {
/*
** For systems without NAN, this is a NAN in IEEE double format.
--- branches/work/kst/portto4/kst/src/libkstapp/changedatasampledialog.cpp #1262359:1262360
@@ -21,6 +21,8 @@
#include "dialogdefaults.h"
#include "updatemanager.h"
+#include <QMessageBox>
+
namespace Kst {
ChangeDataSampleDialog::ChangeDataSampleDialog(QWidget *parent)
--- branches/work/kst/portto4/kst/src/libkstapp/dialogscriptinterface.cpp #1262359:1262360
@@ -81,6 +81,9 @@
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
+#include <QStringBuilder>
+
+
using namespace std;
#define TEXT(T) (T->property("si").isValid()?T->property("si").toString().toAscii():T->text().toAscii())
@@ -165,7 +168,7 @@
}
ScriptInterface* DialogLauncherSI::newPicture(QByteArray picf) {
- PictureItem* bi=new PictureItem(kstApp->mainWindow()->tabWidget()->currentView(),QImage((QString)picf));
+ PictureItem* bi=new PictureItem(kstApp->mainWindow()->tabWidget()->currentView(),QImage(QString::fromLocal8Bit(picf)));
kstApp->mainWindow()->tabWidget()->currentView()->scene()->addItem(bi);
bi->setViewRect(0.9,0.9,1.0,1.0,true);
bi->setVisible(1);
@@ -235,7 +238,7 @@
ScriptInterface* DialogLauncherSI::showStringGenDialog(QByteArray &, ObjectPtr objectPtr,ObjectStore*store) {
if(!objectPtr) {
- objectPtr=store->createObject<String>();
+ objectPtr=ObjectPtr(store->createObject<String>());
}
return new StringGenSI(kst_cast<String>(objectPtr));
@@ -655,16 +658,16 @@
QByteArray DialogSI::getHandle() {
QByteArray x;
if(qobject_cast<DataDialog*>(_dialog)&&qobject_cast<DataDialog*>(_dialog)->dataObject()) {
- return ((QString)("Finished editing "%qobject_cast<DataDialog*>(_dialog)->dataObject()->Name())).toAscii();
+ return ("Finished editing "%qobject_cast<DataDialog*>(_dialog)->dataObject()->Name()).toLatin1();
} else if(qobject_cast<ViewItemDialog*>(_dialog)&&
qobject_cast<ViewItemDialog*>(_dialog)->_item) {
- return ((QString)("Finished editing "%qobject_cast<ViewItemDialog*>(_dialog)->_item->Name())).toAscii();
+ return ("Finished editing "%qobject_cast<ViewItemDialog*>(_dialog)->_item->Name()).toLatin1();
} else {
if(qobject_cast<DataDialog*>(_dialog)) {
ObjectPtr z=qobject_cast<DataDialog*>(_dialog)->createNewDataObject();
if(z.isPtrValid()) {
qobject_cast<DataDialog*>(_dialog)->setDataObject(z);
- return ((QString)("(created) Finished editing "%z->Name())).toAscii();
+ return ("(created) Finished editing "%z->Name()).toLatin1();
} else {
return "No handle returned.";
}
--- branches/work/kst/portto4/kst/src/libkstapp/dialogscriptinterface.h #1262359:1262360
@@ -27,6 +27,8 @@
class QLocalSocket;
class QComboBox;
class QGroupBox;
+class QAbstractButton;
+
typedef QList<QByteArray> QByteArrayList;
namespace Kst{
--- branches/work/kst/portto4/kst/src/libkstapp/labelscriptinterface.cpp #1262359:1262360
@@ -13,6 +13,8 @@
#include "labelscriptinterface.h"
#include "labelitem.h"
+#include <QStringBuilder>
+
namespace Kst {
struct LabelTabSI {
@@ -82,7 +84,7 @@
}
QByteArray LabelSI::getHandle() {
- return ((QString)("Finished editing "%dim->item->Name())).toAscii();
+ return ("Finished editing "%dim->item->Name()).toLatin1();
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/labelscriptinterface.h #1262359:1262360
@@ -23,7 +23,7 @@
namespace Kst {
-class LabelTabSI;
+struct LabelTabSI;
class LabelItem;
class LabelSI : public ScriptInterface
--- branches/work/kst/portto4/kst/src/libkstapp/matrixdialog.cpp #1262359:1262360
@@ -28,8 +28,9 @@
#include "objectstore.h"
#include "datasourcepluginmanager.h"
#include "dialogdefaults.h"
+#include "debug.h"
+
#include <QTimer>
-
#include <QDir>
#include <QThreadPool>
@@ -752,7 +753,7 @@
void MatrixDialog::waitForValidation() {
while (_matrixTab->validating) {
- usleep(10000);
+ Sleep::ms(10);
QApplication::processEvents();
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/plotscriptinterface.cpp #1262359:1262360
@@ -1,6 +1,8 @@
#include "plotscriptinterface.h"
#include "plotitem.h"
+#include <QStringBuilder>
+
namespace Kst {
PlotSI::PlotSI(PlotItem *it) : _layout(new LayoutTabSI), _dim(new DimensionTabSI), _fill(new FillTabSI), _stroke(new StrokeTabSI) {
@@ -72,7 +74,7 @@
}
QByteArray PlotSI::getHandle() {
- return ((QString)("Finished editing "%_dim->item->Name())).toAscii();
+ return ("Finished editing " % _dim->item->Name()).toLatin1();
}
QStringList PlotSI::getArgs(const QString &command) {
--- branches/work/kst/portto4/kst/src/libkstapp/rangetab.cpp #1262359:1262360
@@ -15,8 +15,8 @@
* *
***************************************************************************/
#include "rangetab.h"
+#include "math_kst.h"
-#include <math.h>
#include <QDebug>
namespace Kst {
--- branches/work/kst/portto4/kst/src/libkstapp/scriptserver.cpp #1262359:1262360
@@ -59,6 +59,7 @@
#include <QLocalSocket>
#include <iostream>
#include <QFile>
+#include <QStringBuilder>
namespace Kst {
--- branches/work/kst/portto4/kst/src/libkstapp/stringscriptinterface.cpp #1262359:1262360
@@ -12,6 +12,8 @@
#include "stringscriptinterface.h"
+#include <QStringBuilder>
+
namespace Kst {
StringGenSI::StringGenSI(StringPtr it) {
@@ -47,7 +49,7 @@
}
QByteArray StringGenSI::getHandle() {
- return ((QString)("Finished editing "%str->Name())).toAscii();
+ return ("Finished editing "%str->Name()).toLatin1();
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.cpp #1262359:1262360
@@ -23,6 +23,7 @@
#include "objectstore.h"
#include "datasourcepluginmanager.h"
#include "dialogdefaults.h"
+#include "debug.h"
#include <QDir>
#include <QThreadPool>
@@ -563,7 +564,7 @@
void VectorDialog::waitForValidation() {
while (_vectorTab->validating) {
- usleep(10000);
+ Sleep::ms(10);
QApplication::processEvents();
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/viewitemscriptinterface.cpp #1262359:1262360
@@ -15,6 +15,8 @@
#include "lineedititem.h"
#include "buttonitem.h"
+#include <QStringBuilder>
+
namespace Kst {
QByteArrayList LayoutTabSI::commands() {
@@ -283,7 +285,7 @@
}
QByteArray ViewItemSI::getHandle() {
- return ((QString)("Finished editing "%dim->item->Name())).toAscii();
+ return ("Finished editing "%dim->item->Name()).toLatin1();
}
}
--- branches/work/kst/portto4/kst/src/libkstmath/plottickcalculator.cpp #1262359:1262360
@@ -12,6 +12,9 @@
#include "plottickcalculator.h"
+#include <QtGlobal>
+#include <cmath>
+
namespace Kst {
/*
--- branches/work/kst/portto4/kst/src/libkstmath/plottickcalculator.h #1262359:1262360
@@ -13,6 +13,8 @@
#ifndef PLOTTICKCALCULATOR_H
#define PLOTTICKCALCULATOR_H
+#include "kstmath_export.h"
+
namespace Kst {
enum MajorTickMode {
@@ -25,8 +27,8 @@
enum timeUnits {Hour, Minute, Second};
-void computeMajorTickSpacing(double *major_spacing, int *minor_count, MajorTickMode majorTickCount, double range);
-void computeMajorTickSpacing(double *major_spacing, int *minor_count, MajorTickMode majorTickCount, double range, timeUnits time_units);
+KSTMATH_EXPORT void computeMajorTickSpacing(double *major_spacing, int *minor_count, MajorTickMode majorTickCount, double range);
+KSTMATH_EXPORT void computeMajorTickSpacing(double *major_spacing, int *minor_count, MajorTickMode majorTickCount, double range, timeUnits time_units);
}
More information about the Kst
mailing list