Initial port to libtorrent v0.16

This commit is contained in:
Christophe Dumez
2011-04-17 10:29:44 +00:00
parent 4412476109
commit 3995af6489
15 changed files with 382 additions and 154 deletions

View File

@@ -31,6 +31,9 @@
#ifndef MISC_H
#define MISC_H
#include <libtorrent/version.hpp>
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/torrent_handle.hpp>
#include <sstream>
#include <QString>
#include <QStringList>
@@ -45,9 +48,6 @@
#include <QIcon>
#endif
#include <libtorrent/torrent_info.hpp>
#include <libtorrent/torrent_handle.hpp>
const qlonglong MAX_ETA = 8640000;
/* Miscellaneaous functions that can be useful */
@@ -104,8 +104,9 @@ public:
static inline QString file_extension(const QString &filename) {
QString extension;
if(filename.contains(".")) {
extension = filename.mid(filename.lastIndexOf(".")+1);
int point_index = filename.lastIndexOf(".");
if(point_index >= 0) {
extension = filename.mid(point_index+1);
}
return extension;
}