Skip to content

Commit 056aba2

Browse files
committed
Remove fallbacks for boost_filesystem < v3
Minimum boost version was bumped to 1.47.0 in #8920, which means the configure step won't even pass with older boost. This version has boost filesystem v3, which means the (crappy) fallbacks for older versions can go.
1 parent 36f9d3a commit 056aba2

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;
@@ -860,7 +856,6 @@ void setClipboard(const QString& str)
860856
QApplication::clipboard()->setText(str, QClipboard::Selection);
861857
}
862858

863-
#if BOOST_FILESYSTEM_VERSION >= 3
864859
boost::filesystem::path qstringToBoostPath(const QString &path)
865860
{
866861
return boost::filesystem::path(path.toStdString(), utf8);
@@ -870,18 +865,6 @@ QString boostPathToQString(const boost::filesystem::path &path)
870865
{
871866
return QString::fromStdString(path.string(utf8));
872867
}
873-
#else
874-
#warning Conversion between boost path and QString can use invalid character encoding with boost_filesystem v2 and older
875-
boost::filesystem::path qstringToBoostPath(const QString &path)
876-
{
877-
return boost::filesystem::path(path.toStdString());
878-
}
879-
880-
QString boostPathToQString(const boost::filesystem::path &path)
881-
{
882-
return QString::fromStdString(path.string());
883-
}
884-
#endif
885868

886869
QString formatDurationStr(int secs)
887870
{

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
@@ -3874,11 +3874,7 @@ bool CWallet::BackupWallet(const std::string& strDest)
38743874
pathDest /= strWalletFile;
38753875

38763876
try {
3877-
#if BOOST_VERSION >= 104000
38783877
boost::filesystem::copy_file(pathSrc, pathDest, boost::filesystem::copy_option::overwrite_if_exists);
3879-
#else
3880-
boost::filesystem::copy_file(pathSrc, pathDest);
3881-
#endif
38823878
LogPrintf("copied %s to %s\n", strWalletFile, pathDest.string());
38833879
return true;
38843880
} catch (const boost::filesystem::filesystem_error& e) {

0 commit comments

Comments
 (0)