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