OSDN Git Service

kget: libtorrent v1.2+ compatibility
authorIvailo Monev <xakepa10@gmail.com>
Sat, 2 Oct 2021 18:40:15 +0000 (21:40 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Sat, 2 Oct 2021 18:40:26 +0000 (21:40 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kget/transfer-plugins/torrent/transferTorrent.cpp

index 51ff68e..776577f 100644 (file)
@@ -520,7 +520,11 @@ void TransferTorrent::start()
         ltparams.upload_limit = (m_uploadLimit * 1024);
         ltparams.download_limit = (m_downloadLimit * 1024);
         m_lthandle = m_ltsession->add_torrent(ltparams);
+#if LIBTORRENT_VERSION_MAJOR <= 1 && LIBTORRENT_VERSION_MINOR <= 1
     } catch(lt::libtorrent_exception &err) {
+#else
+    } catch(boost::system::system_error &err) {
+#endif
         const QString errormesssage = QString::fromStdString(err.what());
         setError(errormesssage, SmallIcon("dialog-error"), Job::NotSolveable);
         setLog(errormesssage, Transfer::Log_Error);