Skip to content

Commit

Permalink
Refs #1579. Handling Windows registry copying.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed May 17, 2013
1 parent b6cedca commit 0083e40
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@ m_exitCode(0), g_log(Mantid::Kernel::Logger::get("ApplicationWindow")),

void ApplicationWindow::handleConfigDir()
{
#ifdef Q_OS_WIN
// We use the registry for settings on Windows
QSettings oldSettings("ISIS", "MantidPlot");
QStringList keys = oldSettings.allKeys();
// If the keys are empty, we removed the MantidPlot entries
if (!keys.empty())
{
foreach (QString key, keys)
{
settings.setValue(key, oldSettings.value(key));
}
// This unfortunately cannot remove the top-level entry
oldSettings.remove("");
}
#else
QFileInfo curConfig(settings.fileName());
QString oldPath = settings.fileName();
oldPath.replace("Mantid", "ISIS");
Expand Down Expand Up @@ -281,6 +296,7 @@ void ApplicationWindow::handleConfigDir()
}
oldConfigDir.rmdir(oldConfig.path());
}
#endif
}

/**
Expand Down

0 comments on commit 0083e40

Please sign in to comment.