mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
- Display more information regarding the torrent in its properties pannel
- Made properties pannel scrollable, it behaves better with the splitter
This commit is contained in:
10
src/misc.h
10
src/misc.h
@@ -41,6 +41,10 @@
|
||||
#include <QList>
|
||||
#include <QPair>
|
||||
#include <QThread>
|
||||
#include <ctime>
|
||||
#include <QDateTime>
|
||||
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
||||
#include <boost/date_time/posix_time/conversion.hpp>
|
||||
|
||||
#ifndef Q_WS_WIN
|
||||
#ifdef Q_WS_MAC
|
||||
@@ -308,6 +312,12 @@ public:
|
||||
return hash;
|
||||
}
|
||||
|
||||
static QString boostTimeToQString(boost::optional<boost::posix_time::ptime> boostDate) {
|
||||
if(!boostDate) return tr("Unknown");
|
||||
struct std::tm tm = boost::posix_time::to_tm(*boostDate);
|
||||
return QDateTime::fromTime_t(mktime(&tm)).toString(Qt::DefaultLocaleLongDate);
|
||||
}
|
||||
|
||||
// Take a number of seconds and return an user-friendly
|
||||
// time duration like "1d 2h 10m".
|
||||
static QString userFriendlyDuration(qlonglong seconds) {
|
||||
|
||||
Reference in New Issue
Block a user