diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index f5c890738..1c3f89d7f 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -80,6 +80,7 @@ using namespace libtorrent; QBtSession* QBtSession::m_instance = 0; +const qreal QBtSession::MAX_RATIO = 9999.; const int MAX_TRACKER_ERRORS = 2; enum VersionType { NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL }; diff --git a/src/qtlibtorrent/qbtsession.h b/src/qtlibtorrent/qbtsession.h index d60646b00..b36d8e07f 100644 --- a/src/qtlibtorrent/qbtsession.h +++ b/src/qtlibtorrent/qbtsession.h @@ -66,7 +66,7 @@ class QBtSession : public QObject { Q_DISABLE_COPY(QBtSession) public: - static const qreal MAX_RATIO = 9999.; + static const qreal MAX_RATIO; private: explicit QBtSession(); diff --git a/src/src.pro b/src/src.pro index 58680de36..58df1c96f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -52,6 +52,10 @@ DEFINES += QT_NO_CAST_TO_ASCII # Fast concatenation (Qt >= 4.6) DEFINES += QT_USE_FAST_CONCATENATION QT_USE_FAST_OPERATOR_PLUS +# Fixes compilation with Boost >= v1.46 where boost +# filesystem v3 is the default. +DEFINES += BOOST_FILESYSTEM_VERSION=2 + INCLUDEPATH += $$PWD diff --git a/src/torrentcreator/torrentcreatorthread.cpp b/src/torrentcreator/torrentcreatorthread.cpp index bcd244820..800a2e513 100644 --- a/src/torrentcreator/torrentcreatorthread.cpp +++ b/src/torrentcreator/torrentcreatorthread.cpp @@ -85,16 +85,11 @@ void TorrentCreatorThread::sendProgressSignal(int progress) { void TorrentCreatorThread::run() { emit updateProgress(0); - char const* creator_str = "qBittorrent "VERSION; + QString creator_str("qBittorrent "VERSION); try { file_storage fs; -#if LIBTORRENT_VERSION_MINOR >= 16 - add_files(fs, input_path.toUtf8().constData(), file_filter); -#else // Adding files to the torrent - path full_path = path(input_path.toUtf8().constData()); - add_files(fs, full_path, file_filter); -#endif + add_files(fs, input_path.toUtf8().constData(), file_filter); if(abort) return; create_torrent t(fs, piece_size); @@ -107,20 +102,12 @@ void TorrentCreatorThread::run() { } if(abort) return; // calculate the hash for all pieces -#if LIBTORRENT_VERSION_MINOR >= 16 - QString parent_path = input_path.replace("\\", "/"); - QStringList parts = parent_path.split("/"/*, QString::SkipEmptyParts*/); - parts.removeLast(); - parent_path = parts.join("/"); + const QString parent_path = misc::branchPath(input_path); set_piece_hashes(t, parent_path.toUtf8().constData(), boost::bind(&sendProgressUpdateSignal, _1, t.num_pieces(), this)); -#else - QString parent_path = misc::toQStringU(full_path.branch_path().string()); - set_piece_hashes(t, full_path.branch_path(), boost::bind(&sendProgressUpdateSignal, _1, t.num_pieces(), this)); -#endif // Set qBittorrent as creator and add user comment to // torrent_info structure - t.set_creator(creator_str); - t.set_comment((const char*)comment.toUtf8()); + t.set_creator(creator_str.toUtf8().constData()); + t.set_comment(comment.toUtf8().constData()); // Is private ? t.set_priv(is_private); if(abort) return; diff --git a/winconf.pri b/winconf.pri index 2fce6d5a1..b87de692f 100644 --- a/winconf.pri +++ b/winconf.pri @@ -1,5 +1,5 @@ # Adapt these paths on Windows -INCLUDEPATH += $$quote(C:/qBittorrent/boost_1_44_0) +INCLUDEPATH += $$quote(C:/qBittorrent/boost_1_46_0) INCLUDEPATH += $$quote(C:/qBittorrent/RC_0_15/include) INCLUDEPATH += $$quote(C:/qBittorrent/RC_0_15/zlib) INCLUDEPATH += $$quote(C:/OpenSSL/include)