From 3c4f5d2a2024a71523a2e43e8144cdb0818dee6f Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 11 Jan 2022 18:32:11 +0200 Subject: scripted-diff: Rename functions to drop mention of boost -BEGIN VERIFY SCRIPT- FILES=$(git ls-files src/qt) sed -i 's/boostPathToQString/PathToQString/g' -- $FILES sed -i 's/qstringToBoostPath/QStringToPath/g' -- $FILES -END VERIFY SCRIPT- --- src/qt/clientmodel.cpp | 4 ++-- src/qt/guiutil.cpp | 12 ++++++------ src/qt/guiutil.h | 4 ++-- src/qt/intro.cpp | 10 +++++----- src/qt/optionsmodel.cpp | 4 ++-- src/qt/paymentserver.cpp | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index d3519edf7f..cc771594dc 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -221,12 +221,12 @@ QString ClientModel::formatClientStartupTime() const QString ClientModel::dataDir() const { - return GUIUtil::boostPathToQString(gArgs.GetDataDirNet()); + return GUIUtil::PathToQString(gArgs.GetDataDirNet()); } QString ClientModel::blocksDir() const { - return GUIUtil::boostPathToQString(gArgs.GetBlocksDirPath()); + return GUIUtil::PathToQString(gArgs.GetBlocksDirPath()); } void ClientModel::updateBanlist() diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index f9f0ea81ba..c6c8f7b7a6 100644 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -281,7 +281,7 @@ void LoadFont(const QString& file_name) QString getDefaultDataDirectory() { - return boostPathToQString(GetDefaultDataDir()); + return PathToQString(GetDefaultDataDir()); } QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, @@ -418,7 +418,7 @@ void openDebugLogfile() /* Open debug.log with the associated application */ if (fs::exists(pathDebug)) - QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug))); + QDesktopServices::openUrl(QUrl::fromLocalFile(PathToQString(pathDebug))); } bool openBitcoinConf() @@ -434,11 +434,11 @@ bool openBitcoinConf() configFile.close(); /* Open bitcoin.conf with the associated application */ - bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig))); + bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(PathToQString(pathConfig))); #ifdef Q_OS_MAC // Workaround for macOS-specific behavior; see #15409. if (!res) { - res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", boostPathToQString(pathConfig)}); + res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", PathToQString(pathConfig)}); } #endif @@ -652,12 +652,12 @@ void setClipboard(const QString& str) } } -fs::path qstringToBoostPath(const QString &path) +fs::path QStringToPath(const QString &path) { return fs::u8path(path.toStdString()); } -QString boostPathToQString(const fs::path &path) +QString PathToQString(const fs::path &path) { return QString::fromStdString(path.u8string()); } diff --git a/src/qt/guiutil.h b/src/qt/guiutil.h index aaed0ea690..9b25b77325 100644 --- a/src/qt/guiutil.h +++ b/src/qt/guiutil.h @@ -209,10 +209,10 @@ namespace GUIUtil bool SetStartOnSystemStartup(bool fAutoStart); /** Convert QString to OS specific boost path through UTF-8 */ - fs::path qstringToBoostPath(const QString &path); + fs::path QStringToPath(const QString &path); /** Convert OS specific boost path to QString through UTF-8 */ - QString boostPathToQString(const fs::path &path); + QString PathToQString(const fs::path &path); /** Convert enum Network to QString */ QString NetworkToQString(Network net); diff --git a/src/qt/intro.cpp b/src/qt/intro.cpp index c2d6104658..e9a4034e62 100644 --- a/src/qt/intro.cpp +++ b/src/qt/intro.cpp @@ -67,7 +67,7 @@ FreespaceChecker::FreespaceChecker(Intro *_intro) void FreespaceChecker::check() { QString dataDirStr = intro->getPathToCheck(); - fs::path dataDir = GUIUtil::qstringToBoostPath(dataDirStr); + fs::path dataDir = GUIUtil::QStringToPath(dataDirStr); uint64_t freeBytesAvailable = 0; int replyStatus = ST_OK; QString replyMessage = tr("A new data directory will be created."); @@ -216,7 +216,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB) /* 2) Allow QSettings to override default dir */ dataDir = settings.value("strDataDir", dataDir).toString(); - if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || gArgs.GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || gArgs.GetBoolArg("-resetguisettings", false)) + if(!fs::exists(GUIUtil::QStringToPath(dataDir)) || gArgs.GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || gArgs.GetBoolArg("-resetguisettings", false)) { /* Use selectParams here to guarantee Params() can be used by node interface */ try { @@ -240,9 +240,9 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB) } dataDir = intro.getDataDirectory(); try { - if (TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir))) { + if (TryCreateDirectories(GUIUtil::QStringToPath(dataDir))) { // If a new data directory has been created, make wallets subdirectory too - TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir) / "wallets"); + TryCreateDirectories(GUIUtil::QStringToPath(dataDir) / "wallets"); } break; } catch (const fs::filesystem_error&) { @@ -263,7 +263,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB) * (to be consistent with bitcoind behavior) */ if(dataDir != GUIUtil::getDefaultDataDirectory()) { - gArgs.SoftSetArg("-datadir", fs::PathToString(GUIUtil::qstringToBoostPath(dataDir))); // use OS locale for path setting + gArgs.SoftSetArg("-datadir", fs::PathToString(GUIUtil::QStringToPath(dataDir))); // use OS locale for path setting } return true; } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index e0219084b7..5d9ed5bf23 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -209,8 +209,8 @@ static void CopySettings(QSettings& dst, const QSettings& src) /** Back up a QSettings to an ini-formatted file. */ static void BackupSettings(const fs::path& filename, const QSettings& src) { - qInfo() << "Backing up GUI settings to" << GUIUtil::boostPathToQString(filename); - QSettings dst(GUIUtil::boostPathToQString(filename), QSettings::IniFormat); + qInfo() << "Backing up GUI settings to" << GUIUtil::PathToQString(filename); + QSettings dst(GUIUtil::PathToQString(filename), QSettings::IniFormat); dst.clear(); CopySettings(dst, src); } diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 0cf311a360..cb09035b45 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -51,7 +51,7 @@ static QString ipcServerName() // Append a simple hash of the datadir // Note that gArgs.GetDataDirNet() returns a different path // for -testnet versus main net - QString ddir(GUIUtil::boostPathToQString(gArgs.GetDataDirNet())); + QString ddir(GUIUtil::PathToQString(gArgs.GetDataDirNet())); name.append(QString::number(qHash(ddir))); return name; -- cgit v1.2.3