mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
qt: Drop custom migration logic (#4135)
Use OptionsModel::checkAndMigrate() instead and clean up the mess one more time. Also fixes `-resetguisettings`.
This commit is contained in:
parent
645e59205e
commit
392828bb51
@ -1013,18 +1013,6 @@ bool SetStartOnSystemStartup(bool fAutoStart) { return false; }
|
||||
|
||||
#endif
|
||||
|
||||
void migrateQtSettings()
|
||||
{
|
||||
// Migration (12.1)
|
||||
QSettings settings;
|
||||
if(!settings.value("fMigrationDone121", false).toBool()) {
|
||||
settings.remove("theme");
|
||||
settings.remove("nWindowPos");
|
||||
settings.remove("nWindowSize");
|
||||
settings.setValue("fMigrationDone121", true);
|
||||
}
|
||||
}
|
||||
|
||||
void setStyleSheetDirectory(const QString& path)
|
||||
{
|
||||
stylesheetDirectory = path;
|
||||
|
@ -253,9 +253,6 @@ namespace GUIUtil
|
||||
bool GetStartOnSystemStartup();
|
||||
bool SetStartOnSystemStartup(bool fAutoStart);
|
||||
|
||||
/** Modify Qt network specific settings on migration */
|
||||
void migrateQtSettings();
|
||||
|
||||
/** Change the stylesheet directory. This is used by
|
||||
the parameter -custom-css-dir.*/
|
||||
void setStyleSheetDirectory(const QString& path);
|
||||
|
@ -69,8 +69,6 @@ NetworkStyle::NetworkStyle(const QString &_appName, const int iconColorHueShift,
|
||||
{
|
||||
// Allow for separate UI settings for testnets
|
||||
QApplication::setApplicationName(appName);
|
||||
// Make sure settings migrated properly
|
||||
GUIUtil::migrateQtSettings();
|
||||
// load pixmap
|
||||
QPixmap appIconPixmap(":/icons/dash");
|
||||
|
||||
|
@ -721,6 +721,16 @@ void OptionsModel::checkAndMigrate()
|
||||
if (settingsVersion < 130000 && settings.contains("nDatabaseCache") && settings.value("nDatabaseCache").toLongLong() == 100)
|
||||
settings.setValue("nDatabaseCache", (qint64)nDefaultDbCache);
|
||||
|
||||
if (settingsVersion < 170000) {
|
||||
settings.remove("nWindowPos");
|
||||
settings.remove("nWindowSize");
|
||||
settings.remove("fMigrationDone121");
|
||||
settings.remove("bUseInstantX");
|
||||
settings.remove("bUseInstantSend");
|
||||
settings.remove("bUseDarkSend");
|
||||
settings.remove("bUsePrivateSend");
|
||||
}
|
||||
|
||||
settings.setValue(strSettingsVersionKey, CLIENT_VERSION);
|
||||
}
|
||||
|
||||
|
@ -94,24 +94,6 @@ SendCoinsDialog::SendCoinsDialog(bool _fCoinJoin, QWidget* parent) :
|
||||
connect(ui->checkBoxCoinControlChange, SIGNAL(stateChanged(int)), this, SLOT(coinControlChangeChecked(int)));
|
||||
connect(ui->lineEditCoinControlChange, SIGNAL(textEdited(const QString &)), this, SLOT(coinControlChangeEdited(const QString &)));
|
||||
|
||||
// Dash specific
|
||||
QSettings settings;
|
||||
//TODO remove Darksend sometime after 0.14.1
|
||||
if (settings.contains("bUseDarkSend")) {
|
||||
settings.setValue("bUseCoinJoin", settings.value("bUseDarkSend").toBool());
|
||||
settings.remove("bUseDarkSend");
|
||||
}
|
||||
if (!settings.contains("bUseCoinJoin"))
|
||||
settings.setValue("bUseCoinJoin", false);
|
||||
|
||||
//TODO remove InstantX sometime after 0.14.1
|
||||
if (settings.contains("bUseInstantX")) {
|
||||
settings.remove("bUseInstantX");
|
||||
}
|
||||
if (settings.contains("bUseInstantSend")) {
|
||||
settings.remove("bUseInstantSend");
|
||||
}
|
||||
|
||||
// Coin Control: clipboard actions
|
||||
QAction *clipboardQuantityAction = new QAction(tr("Copy quantity"), this);
|
||||
QAction *clipboardAmountAction = new QAction(tr("Copy amount"), this);
|
||||
@ -136,6 +118,7 @@ SendCoinsDialog::SendCoinsDialog(bool _fCoinJoin, QWidget* parent) :
|
||||
ui->labelCoinControlChange->addAction(clipboardChangeAction);
|
||||
|
||||
// init transaction fee section
|
||||
QSettings settings;
|
||||
if (!settings.contains("fFeeSectionMinimized"))
|
||||
settings.setValue("fFeeSectionMinimized", true);
|
||||
if (!settings.contains("nFeeRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility
|
||||
|
Loading…
Reference in New Issue
Block a user