Skip to content

Commit 5f0556d

Browse files
committed
Merge #9727: Remove fallbacks for boost_filesystem < v3
056aba2 Remove fallbacks for boost_filesystem < v3 (Wladimir J. van der Laan)
2 parents 8528d6a + 056aba2 commit 5f0556d

File tree

3 files changed

+0
-39
lines changed

3 files changed

+0
-39
lines changed

src/qt/guiutil.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@
3737

3838
#include <boost/filesystem.hpp>
3939
#include <boost/filesystem/fstream.hpp>
40-
#if BOOST_FILESYSTEM_VERSION >= 3
4140
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
42-
#endif
4341
#include <boost/scoped_array.hpp>
4442

4543
#include <QAbstractItemView>
@@ -67,9 +65,7 @@
6765
#include <QFontDatabase>
6866
#endif
6967

70-
#if BOOST_FILESYSTEM_VERSION >= 3
7168
static boost::filesystem::detail::utf8_codecvt_facet utf8;
72-
#endif
7369

7470
#if defined(Q_OS_MAC)
7571
extern double NSAppKitVersionNumber;
@@ -863,7 +859,6 @@ void setClipboard(const QString& str)
863859
QApplication::clipboard()->setText(str, QClipboard::Selection);
864860
}
865861

866-
#if BOOST_FILESYSTEM_VERSION >= 3
867862
boost::filesystem::path qstringToBoostPath(const QString &path)
868863
{
869864
return boost::filesystem::path(path.toStdString(), utf8);
@@ -873,18 +868,6 @@ QString boostPathToQString(const boost::filesystem::path &path)
873868
{
874869
return QString::fromStdString(path.string(utf8));
875870
}
876-
#else
877-
#warning Conversion between boost path and QString can use invalid character encoding with boost_filesystem v2 and older
878-
boost::filesystem::path qstringToBoostPath(const QString &path)
879-
{
880-
return boost::filesystem::path(path.toStdString());
881-
}
882-
883-
QString boostPathToQString(const boost::filesystem::path &path)
884-
{
885-
return QString::fromStdString(path.string());
886-
}
887-
#endif
888871

889872
QString formatDurationStr(int secs)
890873
{

src/test/testutil.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,5 @@
1111
#include <boost/filesystem.hpp>
1212

1313
boost::filesystem::path GetTempPath() {
14-
#if BOOST_FILESYSTEM_VERSION == 3
1514
return boost::filesystem::temp_directory_path();
16-
#else
17-
// TODO: remove when we don't support filesystem v2 anymore
18-
boost::filesystem::path path;
19-
#ifdef WIN32
20-
char pszPath[MAX_PATH] = "";
21-
22-
if (GetTempPathA(MAX_PATH, pszPath))
23-
path = boost::filesystem::path(pszPath);
24-
#else
25-
path = boost::filesystem::path("/tmp");
26-
#endif
27-
if (path.empty() || !boost::filesystem::is_directory(path)) {
28-
LogPrintf("GetTempPath(): failed to find temp path\n");
29-
return boost::filesystem::path("");
30-
}
31-
return path;
32-
#endif
3315
}

src/wallet/wallet.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3892,11 +3892,7 @@ bool CWallet::BackupWallet(const std::string& strDest)
38923892
pathDest /= strWalletFile;
38933893

38943894
try {
3895-
#if BOOST_VERSION >= 104000
38963895
boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists);
3897-
#else
3898-
boost::filesystem::copy_file(pathSrc, pathDest);
3899-
#endif
39003896
LogPrintf("copied %s to %s\n", strWalletFile, pathDest.string());
39013897
return true;
39023898
} catch (const boost::filesystem::filesystem_error& e) {

0 commit comments

Comments
 (0)