[Kst] branches/work/kst/portto4/kst/src/plugins/fits

Peter Kümmel syntheticpp at gmx.net
Sun Mar 20 11:37:37 CET 2011


SVN commit 1225368 by kuemmel:

Seems the idea was to use parameter = parameter.arg(index);
But why only for 0?
Simply return a valid string for all indexes.


 M  +1 -9      polynomial_unweighted/fitpolynomial_unweighted.cpp  
 M  +1 -9      polynomial_weighted/fitpolynomial_weighted.cpp  


--- branches/work/kst/portto4/kst/src/plugins/fits/polynomial_unweighted/fitpolynomial_unweighted.cpp #1225367:1225368
@@ -274,18 +274,10 @@
 
 
 QString FitPolynomialUnweightedSource::parameterName(int index) const {
-  QString parameter;
-  switch (index) {
-    case 0:
-      parameter = "x^%1";
-      parameter.arg(index);
-      break;
+  return QString("x^%1").arg(index);
   }
 
-  return parameter;
-}
 
-
 // Name used to identify the plugin.  Used when loading the plugin.
 QString FitPolynomialUnweightedPlugin::pluginName() const { return "Polynomial Fit"; }
 QString FitPolynomialUnweightedPlugin::pluginDescription() const { return "Generates a polynomial fit for a set of data."; }
--- branches/work/kst/portto4/kst/src/plugins/fits/polynomial_weighted/fitpolynomial_weighted.cpp #1225367:1225368
@@ -296,18 +296,10 @@
 
 
 QString FitPolynomialWeightedSource::parameterName(int index) const {
-  QString parameter;
-  switch (index) {
-    case 0:
-      parameter = "x^%1";
-      parameter.arg(index);
-      break;
+  return QString("x^%1").arg(index);
   }
 
-  return parameter;
-}
 
-
 // Name used to identify the plugin.  Used when loading the plugin.
 QString FitPolynomialWeightedPlugin::pluginName() const { return "Polynomial Weighted Fit"; }
 QString FitPolynomialWeightedPlugin::pluginDescription() const { return "Generates a polynomial weighted fit for a set of data."; }


More information about the Kst mailing list