[Kst] branches/work/kst/portto4-sharedpointer/src
Peter Kümmel
syntheticpp at gmx.net
Sun Jan 2 17:36:16 CET 2011
SVN commit 1210903 by kuemmel:
remove int -> SharedPtr casts
M +1 -1 libkstapp/basicplugindialog.cpp
M +7 -7 libkstmath/basicplugin.cpp
M +5 -5 libkstmath/basicpluginfactory.cpp
M +1 -1 libkstmath/csd.cpp
M +5 -5 libkstmath/csdfactory.cpp
M +1 -1 libkstmath/curve.cpp
M +11 -11 libkstmath/curvefactory.cpp
M +1 -1 libkstmath/dataobject.cpp
M +4 -4 libkstmath/enodes.cpp
M +5 -5 libkstmath/equationfactory.cpp
M +3 -3 libkstmath/eventmonitorfactory.cpp
M +2 -2 libkstmath/histogram.cpp
M +5 -5 libkstmath/histogramfactory.cpp
M +2 -2 libkstmath/image.cpp
M +5 -5 libkstmath/imagefactory.cpp
M +2 -2 libkstmath/objectfactory.cpp
M +2 -2 libkstmath/psd.cpp
M +5 -5 libkstmath/psdfactory.cpp
M +2 -2 libkstmath/relationfactory.cpp
--- branches/work/kst/portto4-sharedpointer/src/libkstapp/basicplugindialog.cpp #1210902:1210903
@@ -87,7 +87,7 @@
msg += dataObject->errorMessage();
QMessageBox::warning(this, tr("Kst"), msg);
- return 0;
+ return ObjectPtr();
}
return dataObject;
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/basicplugin.cpp #1210902:1210903
@@ -94,7 +94,7 @@
return DataObjectPtr(plugin);
#endif
// FIXME: implement this
- return 0L;
+ return ObjectPtr();
}
void BasicPlugin::showNewDialog() {
@@ -112,7 +112,7 @@
if (i != _inputVectors.end())
return *i;
else
- return 0;
+ return VectorPtr();
}
@@ -121,7 +121,7 @@
if (i != _inputScalars.end())
return *i;
else
- return 0;
+ return ScalarPtr();
}
@@ -130,7 +130,7 @@
if (i != _inputStrings.end())
return *i;
else
- return 0;
+ return StringPtr();
}
@@ -139,7 +139,7 @@
if (i != _outputVectors.end())
return *i;
else
- return 0;
+ return VectorPtr();
}
@@ -148,7 +148,7 @@
if (i != _outputScalars.end())
return *i;
else
- return 0;
+ return ScalarPtr();
}
@@ -157,7 +157,7 @@
if (i != _outputStrings.end())
return *i;
else
- return 0;
+ return StringPtr();
}
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/basicpluginfactory.cpp #1210902:1210903
@@ -49,7 +49,7 @@
if (configWidget) {
if (!configWidget->configurePropertiesFromXml(store, attrs) ) {
Debug::self()->log(QObject::tr("Error unable to create data object from plugin"), Debug::Warning);
- return 0;
+ return DataObjectPtr();
} else {
if (xml.isEndElement() && n == BasicPlugin::staticTypeTag) {
break;
@@ -57,7 +57,7 @@
}
} else {
Debug::self()->log(QObject::tr("Error unable to find plugin for data object"), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
dataObject = kst_cast<BasicPlugin>(DataObject::createPlugin(pluginName, store, configWidget, false));
@@ -118,7 +118,7 @@
xml.readNext();
}
} else {
- return 0;
+ return DataObjectPtr();
}
}
if (xml.isEndElement()) {
@@ -126,14 +126,14 @@
break;
} else {
Debug::self()->log(QObject::tr("Error creating Plugin Object from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
dataObject->writeLock();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/csd.cpp #1210902:1210903
@@ -96,7 +96,7 @@
CSD::~CSD() {
- _outMatrix = 0L;
+ _outMatrix = MatrixPtr();
}
void CSD::internalUpdate() {
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/csdfactory.cpp #1210902:1210903
@@ -62,31 +62,31 @@
}
Object::processShortNameIndexAttributes(attrs);
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == CSD::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating CSD from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- VectorPtr vector = 0;
+ VectorPtr vector;
if (store && !vectorName.isEmpty()) {
vector = kst_cast<Vector>(store->retrieveObject(vectorName));
}
if (!vector) {
Debug::self()->log(QObject::tr("Error creating CSD from Kst file. Could not find Vector."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
CSDPtr csd = store->createObject<CSD>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/curve.cpp #1210902:1210903
@@ -1492,7 +1492,7 @@
DataObjectPtr Curve::providerDataObject() const {
- DataObjectPtr provider = 0L;
+ DataObjectPtr provider;
// FIXME: fix this.. I don't know what's going on here
#if 0
vectorList.lock().readLock();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/curvefactory.cpp #1210902:1210903
@@ -78,59 +78,59 @@
Object::processShortNameIndexAttributes(attrs);
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == Curve::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating Curve from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- VectorPtr xVector = 0;
+ VectorPtr xVector;
if (store && !xVectorName.isEmpty()) {
xVector = kst_cast<Vector>(store->retrieveObject(xVectorName));
}
if (!xVector) {
Debug::self()->log(QObject::tr("Error creating Curve from Kst file. Could not find xVector."), Debug::Warning);
- return 0;
+ return RelationPtr();
}
- VectorPtr yVector = 0;
+ VectorPtr yVector;
if (store && !yVectorName.isEmpty()) {
yVector = kst_cast<Vector>(store->retrieveObject(yVectorName));
}
if (!yVector) {
Debug::self()->log(QObject::tr("Error creating Curve from Kst file. Could not find yVector."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
- VectorPtr errorXVector = 0;
+ VectorPtr errorXVector;
if (store && !errorXVectorName.isEmpty()) {
errorXVector = kst_cast<Vector>(store->retrieveObject(errorXVectorName));
}
- VectorPtr errorYVector = 0;
+ VectorPtr errorYVector;
if (store && !errorYVectorName.isEmpty()) {
errorYVector = kst_cast<Vector>(store->retrieveObject(errorYVectorName));
}
- VectorPtr errorXMinusVector = 0;
+ VectorPtr errorXMinusVector;
if (store && !errorXMinusVectorName.isEmpty()) {
errorXMinusVector = kst_cast<Vector>(store->retrieveObject(errorXMinusVectorName));
}
- VectorPtr errorYMinusVector = 0;
+ VectorPtr errorYMinusVector;
if (store && !errorYMinusVectorName.isEmpty()) {
errorYMinusVector = kst_cast<Vector>(store->retrieveObject(errorYMinusVectorName));
}
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/dataobject.cpp #1210902:1210903
@@ -357,7 +357,7 @@
}
}
#endif
- return 0L;
+ return DataObjectPtr();
}
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/enodes.cpp #1210902:1210903
@@ -80,7 +80,7 @@
ctx.sampleCount = 2;
ctx.noPoint = Kst::NOPOINT;
ctx.x = 0.0;
- ctx.xVector = 0L;
+ ctx.xVector = VectorPtr();
Equations::FoldVisitor vis(&ctx, &eq);
double v = eq->value(&ctx);
delete eq;
@@ -687,7 +687,7 @@
ctx.sampleCount = 2;
ctx.noPoint = Kst::NOPOINT;
ctx.x = 0.0;
- ctx.xVector = 0L;
+ ctx.xVector = VectorPtr();
Equations::FoldVisitor vis(&ctx, &_equation);
} else {
ParsedEquation = 0L;
@@ -711,13 +711,13 @@
ctx.sampleCount = 2;
ctx.noPoint = Kst::NOPOINT;
ctx.x = 0.0;
- ctx.xVector = 0L;
+ ctx.xVector = VectorPtr();
Equations::FoldVisitor vis(&ctx, &_equation);
} else {
ParsedEquation = 0L;
mutex().unlock();
_vectorIndex.clear();
- _vector = 0L;
+ _vector = VectorPtr();
return ctx->noPoint;
}
}
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/equationfactory.cpp #1210902:1210903
@@ -51,31 +51,31 @@
//past the </equation> node to the </objects> node...
//eq = xml.readElementText();
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == "equation") {
break;
} else {
Debug::self()->log(QObject::tr("Error creating equation from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- VectorPtr vector = 0;
+ VectorPtr vector;
if (store && !xVector.isEmpty()) {
vector = kst_cast<Vector>(store->retrieveObject(xVector));
}
if (!vector) {
Debug::self()->log(QObject::tr("Error creating equation from Kst file. Could not find xVector."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
EquationPtr equation = store->createObject<Equation>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/eventmonitorfactory.cpp #1210902:1210903
@@ -51,21 +51,21 @@
logEmail = attrs.value("logemail").toString() == "true" ? true : false;
logELOG = attrs.value("logelog").toString() == "true" ? true : false;
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == EventMonitorEntry::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating EventMonitorEntry from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
EventMonitorEntryPtr eventMonitor = store->createObject<EventMonitorEntry>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/histogram.cpp #1210902:1210903
@@ -109,8 +109,8 @@
Histogram::~Histogram() {
- _bVector = 0L;
- _hVector = 0L;
+ _bVector = VectorPtr();
+ _hVector = VectorPtr();
delete[] _Bins;
_Bins = 0L;
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/histogramfactory.cpp #1210902:1210903
@@ -55,31 +55,31 @@
Object::processShortNameIndexAttributes(attrs);
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == Histogram::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating Histogram from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- VectorPtr vector = 0;
+ VectorPtr vector;
if (store && !VectorName.isEmpty()) {
vector = kst_cast<Vector>(store->retrieveObject(VectorName));
}
if (!vector) {
Debug::self()->log(QObject::tr("Error creating Histogram from Kst file. Could not find Vector."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
HistogramPtr histogram = store->createObject<Histogram>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/image.cpp #1210902:1210903
@@ -349,7 +349,7 @@
if (_inputMatrices.contains(THEMATRIX)) {
return _inputMatrices[THEMATRIX];
} else {
- return NULL;
+ return MatrixPtr();
}
}
@@ -397,7 +397,7 @@
DataObjectPtr Image::providerDataObject() const {
- DataObjectPtr provider = 0L;
+ DataObjectPtr provider;
// FIXME: fix this.. I don't know what's going on here
#if 0
matrixList.lock().readLock();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/imagefactory.cpp #1210902:1210903
@@ -64,31 +64,31 @@
Object::processShortNameIndexAttributes(attrs);
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == Image::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating Image from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- MatrixPtr matrix = 0;
+ MatrixPtr matrix;
if (store && !matrixName.isEmpty()) {
matrix = kst_cast<Matrix>(store->retrieveObject(matrixName));
}
if (!matrix) {
Debug::self()->log(QObject::tr("Error creating Image from Kst file. Could not find matrix."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
ImagePtr image = store->createObject<Image>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/objectfactory.cpp #1210902:1210903
@@ -54,12 +54,12 @@
DataObjectPtr ObjectFactory::parse(ObjectStore *store, QXmlStreamReader& stream) {
if (!factories) {
- return 0;
+ return DataObjectPtr();
}
ObjectFactory *f = factories->value(stream.name().toString());
if (!f) {
- return 0;
+ return DataObjectPtr();
}
return f->generateObject(store, stream);
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/psd.cpp #1210902:1210903
@@ -109,8 +109,8 @@
PSD::~PSD() {
- _sVector = 0L;
- _fVector = 0L;
+ _sVector = VectorPtr();
+ _fVector = VectorPtr();
}
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/psdfactory.cpp #1210902:1210903
@@ -63,31 +63,31 @@
Object::processShortNameIndexAttributes(attrs);
} else {
- return 0;
+ return DataObjectPtr();
}
} else if (xml.isEndElement()) {
if (n == PSD::staticTypeTag) {
break;
} else {
Debug::self()->log(QObject::tr("Error creating PSD from Kst file."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
}
xml.readNext();
}
if (xml.hasError()) {
- return 0;
+ return DataObjectPtr();
}
- VectorPtr vector = 0;
+ VectorPtr vector;
if (store && !vectorName.isEmpty()) {
vector = kst_cast<Vector>(store->retrieveObject(vectorName));
}
if (!vector) {
Debug::self()->log(QObject::tr("Error creating PSD from Kst file. Could not find Vector."), Debug::Warning);
- return 0;
+ return DataObjectPtr();
}
PSDPtr powerspectrum = store->createObject<PSD>();
--- branches/work/kst/portto4-sharedpointer/src/libkstmath/relationfactory.cpp #1210902:1210903
@@ -54,12 +54,12 @@
RelationPtr RelationFactory::parse(ObjectStore *store, QXmlStreamReader& stream) {
if (!relation_factories) {
- return 0;
+ return RelationPtr();
}
RelationFactory *f = relation_factories->value(stream.name().toString());
if (!f) {
- return 0;
+ return RelationPtr();
}
return f->generateRelation(store, stream);
More information about the Kst
mailing list