diff --git a/app/config/config.cpp b/app/config/config.cpp index f3da4d484..6be80212c 100644 --- a/app/config/config.cpp +++ b/app/config/config.cpp @@ -96,6 +96,9 @@ void Config::Load() current_config_.SetDefaults(); QXmlStreamReader reader(&config_file); + + QString config_version; + while (!reader.atEnd()) { reader.readNext(); @@ -111,9 +114,35 @@ void Config::Load() if (key == "Configuration") { // First element, ignore } else if (key == "Version") { + config_version = value; + if (!value.contains(".")) { - qDebug() << "This is a 0.1.x config file, upconvert"; + qDebug() << "CONFIG: This is a 0.1.x config file, upconvert"; } + } else if (key == "DefaultSequenceFrameRate" && !config_version.contains(".")) { + // 0.1.x stored this value as a float while we now use rationals, we'll use a heuristic to find the closest + // supported rational + qDebug() << " CONFIG: Finding closest match to" << value; + + double config_fr = value.toDouble(); + + QList supported_frame_rates = Core::SupportedFrameRates(); + + rational match = supported_frame_rates.first(); + double match_diff = qAbs(match.toDouble() - config_fr); + + for (int i=1;i