mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 08:16:16 -07:00
Remove unused code
This commit is contained in:
parent
fb03682df4
commit
16071ec266
2 changed files with 0 additions and 20 deletions
17
src/misc.cpp
17
src/misc.cpp
|
@ -768,23 +768,6 @@ QString misc::magnetUriToHash(QString magnet_uri) {
|
|||
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) {
|
||||
if(!t.is_initialized() || *t < 0) return tr("Unknown");
|
||||
QDateTime dt = QDateTime::fromTime_t(*t);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue