mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 18:04:32 +00:00
Remove unused code
This commit is contained in:
parent
fb03682df4
commit
16071ec266
17
src/misc.cpp
17
src/misc.cpp
@ -768,23 +768,6 @@ QString misc::magnetUriToHash(QString magnet_uri) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString misc::boostTimeToQString(const boost::optional<boost::posix_time::ptime> &boostDate) {
|
|
||||||
if(!boostDate || !boostDate.is_initialized() || boostDate->is_not_a_date_time()) return tr("Unknown");
|
|
||||||
struct std::tm tm;
|
|
||||||
try {
|
|
||||||
tm = boost::posix_time::to_tm(*boostDate);
|
|
||||||
} catch(std::exception e) {
|
|
||||||
return tr("Unknown");
|
|
||||||
}
|
|
||||||
const time_t t = mktime(&tm);
|
|
||||||
if(t < 0)
|
|
||||||
return tr("Unknown");
|
|
||||||
const QDateTime dt = QDateTime::fromTime_t(t);
|
|
||||||
if(dt.isNull() || !dt.isValid())
|
|
||||||
return tr("Unknown");
|
|
||||||
return dt.toString(Qt::DefaultLocaleLongDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString misc::time_tToQString(const boost::optional<time_t> &t) {
|
QString misc::time_tToQString(const boost::optional<time_t> &t) {
|
||||||
if(!t.is_initialized() || *t < 0) return tr("Unknown");
|
if(!t.is_initialized() || *t < 0) return tr("Unknown");
|
||||||
QDateTime dt = QDateTime::fromTime_t(*t);
|
QDateTime dt = QDateTime::fromTime_t(*t);
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
|
||||||
#include <boost/date_time/posix_time/conversion.hpp>
|
|
||||||
#include <QPoint>
|
#include <QPoint>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@ -168,7 +166,6 @@ public:
|
|||||||
static QString magnetUriToName(QString magnet_uri);
|
static QString magnetUriToName(QString magnet_uri);
|
||||||
static QString magnetUriToHash(QString magnet_uri);
|
static QString magnetUriToHash(QString magnet_uri);
|
||||||
static QString bcLinkToMagnet(QString bc_link);
|
static QString bcLinkToMagnet(QString bc_link);
|
||||||
static QString boostTimeToQString(const boost::optional<boost::posix_time::ptime> &boostDate);
|
|
||||||
static QString time_tToQString(const boost::optional<time_t> &t);
|
static QString time_tToQString(const boost::optional<time_t> &t);
|
||||||
// Replace ~ in path
|
// Replace ~ in path
|
||||||
static QString expandPath(QString path);
|
static QString expandPath(QString path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user