Core: Remove legacy settings reading from 2014

Change-Id: I2833be6d3dae1787fdf29cc5a9daccd68fa0f82e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Eike Ziller
2020-12-10 10:48:03 +01:00
parent ca769055e0
commit e2eab0e016

View File

@@ -35,37 +35,17 @@
#include <QApplication>
static const char settingsGroupC[] = "General";
static const char legacySettingsGroupC[] = "VCS";
static const char patchCommandKeyC[] = "PatchCommand";
static const char patchCommandDefaultC[] = "patch";
namespace Core {
static QString readLegacyCommand()
{
QSettings *s = ICore::settings();
s->beginGroup(QLatin1String(legacySettingsGroupC));
const bool legacyExists = s->contains(QLatin1String(patchCommandKeyC));
const QString legacyCommand = s->value(QLatin1String(patchCommandKeyC), QLatin1String(patchCommandDefaultC)).toString();
if (legacyExists)
s->remove(QLatin1String(patchCommandKeyC));
s->endGroup();
if (legacyExists && legacyCommand != QLatin1String(patchCommandDefaultC))
PatchTool::setPatchCommand(legacyCommand);
return legacyCommand;
}
QString PatchTool::patchCommand()
{
QSettings *s = ICore::settings();
const QString defaultCommand = readLegacyCommand(); // replace it with QLatin1String(patchCommandDefaultC) when dropping legacy stuff
s->beginGroup(QLatin1String(settingsGroupC));
const QString command = s->value(QLatin1String(patchCommandKeyC), defaultCommand).toString();
s->beginGroup(settingsGroupC);
const QString command = s->value(patchCommandKeyC, patchCommandDefaultC).toString();
s->endGroup();
return command;