Skip to content

Commit e0ae541

Browse files
committed
Merge bitcoin-core/gui#523: scripted-diff: Rename functions to drop mention of boost
3c4f5d2 scripted-diff: Rename functions to drop mention of boost (Hennadii Stepanov) Pull request description: Nothing specific to Boost is in `GUIUtil::qstringToBoostPath` and `GUIUtil::boostPathToQString` functions. Related to bitcoin/bitcoin#20744. ACKs for top commit: laanwj: Concept and code review ACK 3c4f5d2 promag: Code review ACK 3c4f5d2 👋 Tree-SHA512: 0c8790979783a067811f7699b4ce4c204f6e0818d5f32986ec24b2c71583b4496d7a0e0c0361dd77c7e641a75d983fee35cd51ef722bbca9a5f13194efb3b4c0
2 parents 318c79e + 3c4f5d2 commit e0ae541

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/qt/clientmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,12 @@ QString ClientModel::formatClientStartupTime() const
221221

222222
QString ClientModel::dataDir() const
223223
{
224-
return GUIUtil::boostPathToQString(gArgs.GetDataDirNet());
224+
return GUIUtil::PathToQString(gArgs.GetDataDirNet());
225225
}
226226

227227
QString ClientModel::blocksDir() const
228228
{
229-
return GUIUtil::boostPathToQString(gArgs.GetBlocksDirPath());
229+
return GUIUtil::PathToQString(gArgs.GetBlocksDirPath());
230230
}
231231

232232
void ClientModel::updateBanlist()

src/qt/guiutil.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void LoadFont(const QString& file_name)
281281

282282
QString getDefaultDataDirectory()
283283
{
284-
return boostPathToQString(GetDefaultDataDir());
284+
return PathToQString(GetDefaultDataDir());
285285
}
286286

287287
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir,
@@ -418,7 +418,7 @@ void openDebugLogfile()
418418

419419
/* Open debug.log with the associated application */
420420
if (fs::exists(pathDebug))
421-
QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathDebug)));
421+
QDesktopServices::openUrl(QUrl::fromLocalFile(PathToQString(pathDebug)));
422422
}
423423

424424
bool openBitcoinConf()
@@ -434,11 +434,11 @@ bool openBitcoinConf()
434434
configFile.close();
435435

436436
/* Open bitcoin.conf with the associated application */
437-
bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(boostPathToQString(pathConfig)));
437+
bool res = QDesktopServices::openUrl(QUrl::fromLocalFile(PathToQString(pathConfig)));
438438
#ifdef Q_OS_MAC
439439
// Workaround for macOS-specific behavior; see #15409.
440440
if (!res) {
441-
res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", boostPathToQString(pathConfig)});
441+
res = QProcess::startDetached("/usr/bin/open", QStringList{"-t", PathToQString(pathConfig)});
442442
}
443443
#endif
444444

@@ -652,12 +652,12 @@ void setClipboard(const QString& str)
652652
}
653653
}
654654

655-
fs::path qstringToBoostPath(const QString &path)
655+
fs::path QStringToPath(const QString &path)
656656
{
657657
return fs::u8path(path.toStdString());
658658
}
659659

660-
QString boostPathToQString(const fs::path &path)
660+
QString PathToQString(const fs::path &path)
661661
{
662662
return QString::fromStdString(path.u8string());
663663
}

src/qt/guiutil.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ namespace GUIUtil
209209
bool SetStartOnSystemStartup(bool fAutoStart);
210210

211211
/** Convert QString to OS specific boost path through UTF-8 */
212-
fs::path qstringToBoostPath(const QString &path);
212+
fs::path QStringToPath(const QString &path);
213213

214214
/** Convert OS specific boost path to QString through UTF-8 */
215-
QString boostPathToQString(const fs::path &path);
215+
QString PathToQString(const fs::path &path);
216216

217217
/** Convert enum Network to QString */
218218
QString NetworkToQString(Network net);

src/qt/intro.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ FreespaceChecker::FreespaceChecker(Intro *_intro)
6767
void FreespaceChecker::check()
6868
{
6969
QString dataDirStr = intro->getPathToCheck();
70-
fs::path dataDir = GUIUtil::qstringToBoostPath(dataDirStr);
70+
fs::path dataDir = GUIUtil::QStringToPath(dataDirStr);
7171
uint64_t freeBytesAvailable = 0;
7272
int replyStatus = ST_OK;
7373
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)
216216
/* 2) Allow QSettings to override default dir */
217217
dataDir = settings.value("strDataDir", dataDir).toString();
218218

219-
if(!fs::exists(GUIUtil::qstringToBoostPath(dataDir)) || gArgs.GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || gArgs.GetBoolArg("-resetguisettings", false))
219+
if(!fs::exists(GUIUtil::QStringToPath(dataDir)) || gArgs.GetBoolArg("-choosedatadir", DEFAULT_CHOOSE_DATADIR) || settings.value("fReset", false).toBool() || gArgs.GetBoolArg("-resetguisettings", false))
220220
{
221221
/* Use selectParams here to guarantee Params() can be used by node interface */
222222
try {
@@ -240,9 +240,9 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
240240
}
241241
dataDir = intro.getDataDirectory();
242242
try {
243-
if (TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir))) {
243+
if (TryCreateDirectories(GUIUtil::QStringToPath(dataDir))) {
244244
// If a new data directory has been created, make wallets subdirectory too
245-
TryCreateDirectories(GUIUtil::qstringToBoostPath(dataDir) / "wallets");
245+
TryCreateDirectories(GUIUtil::QStringToPath(dataDir) / "wallets");
246246
}
247247
break;
248248
} catch (const fs::filesystem_error&) {
@@ -263,7 +263,7 @@ bool Intro::showIfNeeded(bool& did_show_intro, int64_t& prune_MiB)
263263
* (to be consistent with bitcoind behavior)
264264
*/
265265
if(dataDir != GUIUtil::getDefaultDataDirectory()) {
266-
gArgs.SoftSetArg("-datadir", fs::PathToString(GUIUtil::qstringToBoostPath(dataDir))); // use OS locale for path setting
266+
gArgs.SoftSetArg("-datadir", fs::PathToString(GUIUtil::QStringToPath(dataDir))); // use OS locale for path setting
267267
}
268268
return true;
269269
}

src/qt/optionsmodel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ static void CopySettings(QSettings& dst, const QSettings& src)
209209
/** Back up a QSettings to an ini-formatted file. */
210210
static void BackupSettings(const fs::path& filename, const QSettings& src)
211211
{
212-
qInfo() << "Backing up GUI settings to" << GUIUtil::boostPathToQString(filename);
213-
QSettings dst(GUIUtil::boostPathToQString(filename), QSettings::IniFormat);
212+
qInfo() << "Backing up GUI settings to" << GUIUtil::PathToQString(filename);
213+
QSettings dst(GUIUtil::PathToQString(filename), QSettings::IniFormat);
214214
dst.clear();
215215
CopySettings(dst, src);
216216
}

src/qt/paymentserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static QString ipcServerName()
5151
// Append a simple hash of the datadir
5252
// Note that gArgs.GetDataDirNet() returns a different path
5353
// for -testnet versus main net
54-
QString ddir(GUIUtil::boostPathToQString(gArgs.GetDataDirNet()));
54+
QString ddir(GUIUtil::PathToQString(gArgs.GetDataDirNet()));
5555
name.append(QString::number(qHash(ddir)));
5656

5757
return name;

0 commit comments

Comments
 (0)