Commit 51910056 authored by Alexander Lohnau's avatar Alexander Lohnau 💬
Browse files

Port away from deprecated QDateTime methods

parent b6d4fb26
......@@ -77,7 +77,7 @@ QVariant MediaModel::data(const QModelIndex &index, int role) const
case Qt::UserRole: // user role is for finding out if a torrent is complete
return mf->fullyAvailable();
case Qt::UserRole + 1:
return QFileInfo(mf->path()).lastModified().toTime_t();
return QFileInfo(mf->path()).lastModified().toSecsSinceEpoch();
default:
return QVariant();
}
......
......@@ -186,7 +186,7 @@ void FeedWidget::selectionChanged(const QItemSelection &sel, const QItemSelectio
Syndication::ItemPtr item = model->itemForIndex(m_item_list->selectionModel()->selectedRows().front());
if (item) {
m_item_view->setHtml(item_template.arg(item->title())
.arg(QLocale().toString(QDateTime::fromTime_t(item->datePublished()), QLocale::ShortFormat))
.arg(QLocale().toString(QDateTime::fromSecsSinceEpoch(item->datePublished()), QLocale::ShortFormat))
.arg(item->description())
.arg(QApplication::palette().text().color().name(QColor::NameFormat::HexRgb)),
QUrl(feed->feedData()->link()));
......
......@@ -96,7 +96,7 @@ QVariant FeedWidgetModel::data(const QModelIndex &index, int role) const
case 0:
return item->title();
case 1:
return QLocale().toString(QDateTime::fromTime_t(item->datePublished()), QLocale::ShortFormat);
return QLocale().toString(QDateTime::fromSecsSinceEpoch(item->datePublished()), QLocale::ShortFormat);
case 2:
return TorrentUrlFromItem(item);
default:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment