appsettings can't be false

Also note the use of a default value as the second
argument to appsettings->value().
This commit is contained in:
Sean Rhea
2010-01-17 21:17:46 -08:00
parent 4d1783276c
commit 699cd73b6a

View File

@@ -320,13 +320,9 @@ ModelDataProvider::describeType(int type, bool longer)
ModelDataProvider::ModelDataProvider (BasicModelPlot &plot, ModelSettings *settings) : Function(plot)
{
// get application settings
cranklength = 0.0;
useMetricUnits = false; // the default for Non-Europeans ;-)
boost::shared_ptr<QSettings> appsettings = GetApplicationSettings();
if (appsettings) {
cranklength = appsettings->value(GC_CRANKLENGTH).toDouble() / 1000.0;
useMetricUnits = appsettings->value(GC_UNIT).toString() == "Metric";
}
cranklength = appsettings->value(GC_CRANKLENGTH, 0.0).toDouble() / 1000.0;
useMetricUnits = appsettings->value(GC_UNIT).toString() == "Metric";
// if there are no settings or incomplete settings
// create a null data plot