mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-09 06:17:58 +00:00
Remove misc::time_tToQString()
This commit is contained in:
parent
ed468083c5
commit
0c9dbc15f9
@ -724,14 +724,6 @@ QString misc::magnetUriToHash(QString magnet_uri) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString misc::time_tToQString(const boost::optional<time_t> &t) {
|
|
||||||
if(!t.is_initialized() || *t < 0) return tr("Unknown");
|
|
||||||
QDateTime dt = QDateTime::fromTime_t(*t);
|
|
||||||
if(dt.isNull() || !dt.isValid())
|
|
||||||
return tr("Unknown");
|
|
||||||
return dt.toString(Qt::DefaultLocaleLongDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Replace ~ in path
|
// Replace ~ in path
|
||||||
QString misc::expandPath(QString path) {
|
QString misc::expandPath(QString path) {
|
||||||
path = path.trimmed();
|
path = path.trimmed();
|
||||||
|
@ -132,7 +132,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 time_tToQString(const boost::optional<time_t> &t);
|
|
||||||
// Replace ~ in path
|
// Replace ~ in path
|
||||||
static QString expandPath(QString path);
|
static QString expandPath(QString path);
|
||||||
// Take a number of seconds and return an user-friendly
|
// Take a number of seconds and return an user-friendly
|
||||||
|
@ -72,7 +72,9 @@ QString QTorrentHandle::name() const {
|
|||||||
QString QTorrentHandle::creation_date() const {
|
QString QTorrentHandle::creation_date() const {
|
||||||
#if LIBTORRENT_VERSION_MINOR > 15
|
#if LIBTORRENT_VERSION_MINOR > 15
|
||||||
boost::optional<time_t> t = torrent_handle::get_torrent_info().creation_date();
|
boost::optional<time_t> t = torrent_handle::get_torrent_info().creation_date();
|
||||||
return misc::time_tToQString(t);
|
if (t)
|
||||||
|
return QDateTime::fromTime_t(*t).toString(Qt::DefaultLocaleLongDate);
|
||||||
|
return tr("Unknown");
|
||||||
#else
|
#else
|
||||||
boost::optional<boost::posix_time::ptime> boostDate = torrent_handle::get_torrent_info().creation_date();
|
boost::optional<boost::posix_time::ptime> boostDate = torrent_handle::get_torrent_info().creation_date();
|
||||||
return misc::boostTimeToQString(boostDate);
|
return misc::boostTimeToQString(boostDate);
|
||||||
|
Loading…
Reference in New Issue
Block a user