mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
show subscription update time
This commit is contained in:
@@ -182,6 +182,7 @@ namespace NekoRay {
|
||||
_add(new configItem("order", &order, itemType::integerList));
|
||||
_add(new configItem("url", &url, itemType::string));
|
||||
_add(new configItem("info", &info, itemType::string));
|
||||
_add(new configItem("lastup", &last_update, itemType::integer64));
|
||||
}
|
||||
|
||||
QSharedPointer<Group> ProfileManager::LoadGroup(const QString &jsonPath) {
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace NekoRay {
|
||||
QList<int> order;
|
||||
QString url = "";
|
||||
QString info = "";
|
||||
qint64 last_update = 0;
|
||||
|
||||
Group();
|
||||
|
||||
|
||||
@@ -306,6 +306,7 @@ namespace NekoRay::sub {
|
||||
// 订阅解析前
|
||||
if (group != nullptr) {
|
||||
in = group->Profiles();
|
||||
group->last_update = QDateTime::currentSecsSinceEpoch();
|
||||
group->info = sub_user_info;
|
||||
group->order.clear();
|
||||
group->Save();
|
||||
|
||||
@@ -634,6 +634,10 @@
|
||||
<source>Update %1?</source>
|
||||
<translation>更新 %1 ?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Last update: %1</source>
|
||||
<translation>最后更新 %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>JsonEditor</name>
|
||||
|
||||
@@ -73,12 +73,19 @@ void GroupItem::refresh_data() {
|
||||
ui->update_sub->hide();
|
||||
} else {
|
||||
ui->url->setText(ent->url);
|
||||
QStringList info;
|
||||
if (ent->last_update != 0) {
|
||||
info << tr("Last update: %1").arg(DisplayTime(ent->last_update, QLocale::ShortFormat));
|
||||
}
|
||||
auto subinfo = ParseSubInfo(ent->info);
|
||||
if (subinfo.isEmpty()) {
|
||||
if (!ent->info.isEmpty()) {
|
||||
info << subinfo;
|
||||
}
|
||||
if (info.isEmpty()) {
|
||||
ui->subinfo->hide();
|
||||
} else {
|
||||
ui->subinfo->show();
|
||||
ui->subinfo->setText(subinfo);
|
||||
ui->subinfo->setText(info.join(" | "));
|
||||
}
|
||||
}
|
||||
runOnUiThread([=] {
|
||||
|
||||
Reference in New Issue
Block a user