[Kst] branches/work/kst/portto4/kst/src
Adam Treat
treat at kde.org
Wed Jul 18 16:59:31 CEST 2007
SVN commit 689553 by treat:
* Equations now load
A libkst/builtinprimitives.cpp [License: GPL (v2+)]
A libkst/builtinprimitives.h [License: GPL (v2+)]
M +4 -2 libkst/libkst.pro
M +8 -2 libkstapp/document.cpp
M +8 -0 libkstapp/kstapplication.cpp
M +1 -1 libkstmath/builtinobjects.cpp
M +7 -2 libkstmath/kstequation.cpp
--- branches/work/kst/portto4/kst/src/libkst/libkst.pro #689552:689553
@@ -48,7 +48,8 @@
kstobjectcollection.cpp \
kstobjectlist.cpp \
kstobjectmap.cpp \
- kstobjecttag.cpp
+ kstobjecttag.cpp \
+ builtinprimitives.cpp
HEADERS += \
datasourcefactory.h \
@@ -93,4 +94,5 @@
kstobjectcollection.h \
kstobjectlist.h \
kstobjectmap.h \
- kstobjecttag.h
+ kstobjecttag.h \
+ builtinprimitives.h
--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #689552:689553
@@ -174,8 +174,14 @@
} else {
switch (state) {
case Objects:
- ObjectFactory::parse(xml);
- break;
+ {
+ KstDataObjectPtr object = ObjectFactory::parse(xml);
+ if (object)
+ KST::addDataObjectToList(object);
+ else
+ malformed();
+ break;
+ }
case Graphics:
{
if (n == "view") {
--- branches/work/kst/portto4/kst/src/libkstapp/kstapplication.cpp #689552:689553
@@ -12,11 +12,19 @@
#include "kstapplication.h"
#include "qgetoptions.h"
+#include "builtinprimitives.h"
+#include "builtinobjects.h"
+#include "builtingraphics.h"
+
KstApplication::KstApplication(int &argc, char **argv)
: QApplication(argc, argv) {
QCoreApplication::setApplicationName("Kst");
+ Kst::Builtins::initPrimitives(); //libkst
+ Kst::Builtins::initObjects(); //libkstmath
+ Kst::Builtins::initGraphics(); //libkstapp
+
_mainWindow = new Kst::MainWindow;
connect(this, SIGNAL(aboutToQuit()), _mainWindow, SLOT(aboutToQuit()));
--- branches/work/kst/portto4/kst/src/libkstmath/builtinobjects.cpp #689552:689553
@@ -15,7 +15,7 @@
namespace Kst {
namespace Builtins {
void initObjects() {
- new Kst::EquationObjectFactory;
+ new EquationObjectFactory;
}
}
}
--- branches/work/kst/portto4/kst/src/libkstmath/kstequation.cpp #689552:689553
@@ -585,7 +585,9 @@
interpolate = attrs.value("interpolate").toString().toLower() == "true";
xVector = attrs.value("xvector").toString();
output = attrs.value("output").toString();
- eq = xml.readElementText();
+ //FIXME Don't know if this is a bug in QXmlStreamReader or what, but readElementNext takes us
+ //past the </equation> node to the </objects> node...
+ //eq = xml.readElementText();
} else {
return 0;
}
@@ -604,7 +606,10 @@
return 0;
}
- KstEquationPtr ep = 0; //new KstEquation(name, eq, xVector, interpolate);
+ //FIXME verify this works when we get real vectors loading
+ KstVectorPtr vector = KST::vectorList.retrieveObject(QStringList(xVector));
+
+ KstEquationPtr ep = new KstEquation(name, eq, vector, interpolate);
return ep.data();
}
More information about the Kst
mailing list