diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index e274b7626a..dda79e3d0e 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -376,9 +376,6 @@ void BitcoinApplication::initializeResult(int retval) returnValue = retval ? 0 : 1; if(retval) { - // Miscellaneous initialization after core is initialized - optionsModel->Upgrade(); // Must be done after AppInit2 - #ifdef ENABLE_WALLET PaymentServer::LoadRootCAs(); paymentServer->setOptionsModel(optionsModel); diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index c1dbd916b3..a2a2732b1c 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -130,69 +130,6 @@ void OptionsModel::Reset() // default setting for OptionsModel::StartAtStartup - disabled if (GUIUtil::GetStartOnSystemStartup()) GUIUtil::SetStartOnSystemStartup(false); - - // Ensure Upgrade() is not running again by setting the bImportFinished flag - settings.setValue("bImportFinished", true); -} - -void OptionsModel::Upgrade() -{ - QSettings settings; - - // Already upgraded - if (settings.contains("bImportFinished")) - return; - - settings.setValue("bImportFinished", true); - -#ifdef ENABLE_WALLET - // Move settings from old wallet.dat (if any): - CWalletDB walletdb(strWalletFile); - - QList intOptions; - intOptions << "nDisplayUnit" << "nTransactionFee"; - foreach(QString key, intOptions) - { - int value = 0; - if (walletdb.ReadSetting(key.toStdString(), value)) - { - settings.setValue(key, value); - walletdb.EraseSetting(key.toStdString()); - } - } - QList boolOptions; - boolOptions << "bDisplayAddresses" << "fMinimizeToTray" << "fMinimizeOnClose" << "fUseProxy" << "fUseUPnP"; - foreach(QString key, boolOptions) - { - bool value = false; - if (walletdb.ReadSetting(key.toStdString(), value)) - { - settings.setValue(key, value); - walletdb.EraseSetting(key.toStdString()); - } - } - try - { - CAddress addrProxyAddress; - if (walletdb.ReadSetting("addrProxy", addrProxyAddress)) - { - settings.setValue("addrProxy", addrProxyAddress.ToStringIPPort().c_str()); - walletdb.EraseSetting("addrProxy"); - } - } - catch (std::ios_base::failure &e) - { - // 0.6.0rc1 saved this as a CService, which causes failure when parsing as a CAddress - CService addrProxy; - if (walletdb.ReadSetting("addrProxy", addrProxy)) - { - settings.setValue("addrProxy", addrProxy.ToStringIPPort().c_str()); - walletdb.EraseSetting("addrProxy"); - } - } -#endif - - Init(); } int OptionsModel::rowCount(const QModelIndex & parent) const diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 7a71b772b2..e5c1e3e8b9 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -46,9 +46,6 @@ public: void Init(); void Reset(); - /* Migrate settings from wallet.dat after app initialization */ - void Upgrade(); - int rowCount(const QModelIndex & parent = QModelIndex()) const; QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);