SlewDialog.cpp   SlewDialog.cpp 
skipping to change at line 335 skipping to change at line 335
storedPoint sp = var.value<storedPoint>(); storedPoint sp = var.value<storedPoint>();
QVariantMap point; QVariantMap point;
point.insert("number", sp.number); point.insert("number", sp.number);
point.insert("name", sp.name); point.insert("name", sp.name);
point.insert("radiansRA", sp.radiansRA); point.insert("radiansRA", sp.radiansRA);
point.insert("radiansDec", sp.radiansDec); point.insert("radiansDec", sp.radiansDec);
storedPointsDescriptions.insert(QString::number(sp.number),p oint); storedPointsDescriptions.insert(QString::number(sp.number),p oint);
} }
//Add the version: //Add the version:
storedPointsDescriptions.insert("version", QString(TELESCOPE_CONTROL _VERSION)); storedPointsDescriptions.insert("version", QString(TELESCOPE_CONTROL _PLUGIN_VERSION));
//Convert the tree to JSON //Convert the tree to JSON
StelJsonParser::write(storedPointsDescriptions, &pointsJsonFile); StelJsonParser::write(storedPointsDescriptions, &pointsJsonFile);
pointsJsonFile.flush();//Is this necessary? pointsJsonFile.flush();//Is this necessary?
pointsJsonFile.close(); pointsJsonFile.close();
} }
void SlewDialog::loadPointsFromFile() void SlewDialog::loadPointsFromFile()
{ {
QVariantMap result; QVariantMap result;
QString pointsJsonPath = StelFileMgr::findFile("modules/TelescopeCon trol", (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable)) + "/points.json"; QString pointsJsonPath = StelFileMgr::findFile("modules/TelescopeCon trol", (StelFileMgr::Flags)(StelFileMgr::Directory|StelFileMgr::Writable)) + "/points.json";
skipping to change at line 385 skipping to change at line 385
} }
//File contains any points? //File contains any points?
if(map.isEmpty()) if(map.isEmpty())
{ {
storedPointsDescriptions = result; storedPointsDescriptions = result;
return; return;
} }
QString version = map.value("version", "0.0.0").toString(); QString version = map.value("version", "0.0.0").toString();
if(version < QString(TELESCOPE_CONTROL_VERSION)) if(version < QString(TELESCOPE_CONTROL_PLUGIN_VERSION))
{ {
QString newName = pointsJsonPath + ".backup." + QDateTime::c urrentDateTime().toString("yyyy-MM-dd-hh-mm-ss"); QString newName = pointsJsonPath + ".backup." + QDateTime::c urrentDateTime().toString("yyyy-MM-dd-hh-mm-ss");
if(pointsJsonFile.rename(newName)) if(pointsJsonFile.rename(newName))
{ {
qWarning() << "SlewDialog: The existing version of p oints.json is obsolete. Backing it up as " qWarning() << "SlewDialog: The existing version of p oints.json is obsolete. Backing it up as "
<< QDir::toNativeSeparators(newName); << QDir::toNativeSeparators(newName);
qWarning() << "SlewDialog: A blank points.json file will have to be created."; qWarning() << "SlewDialog: A blank points.json file will have to be created.";
storedPointsDescriptions = result; storedPointsDescriptions = result;
return; return;
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/