From 7513667c6ec5e41cc62ac743bc63202a25aa17dd Mon Sep 17 00:00:00 2001 From: Floating dream <2422586862@qq.com> Date: Thu, 8 Jun 2023 11:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0LingmoOS=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/appintopage.cpp | 61 +++++++++++++++++-------------- src/pages/appintopage.ui | 2 +- translations/spark-store_zh_CN.ts | 12 +++--- 3 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/pages/appintopage.cpp b/src/pages/appintopage.cpp index 54beb0f..5fcbcc7 100644 --- a/src/pages/appintopage.cpp +++ b/src/pages/appintopage.cpp @@ -196,7 +196,7 @@ void AppIntoPage::clear() ui->tag_dwine2->hide(); ui->tag_dwine5->hide(); ui->tag_ubuntu->hide(); - ui->tag_lingmo->hide(); + // ui->tag_lingmo->hide(); ui->tag_community->hide(); ui->icon->clear(); ui->title->clear(); @@ -349,11 +349,11 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList) ui->tag_ubuntu->show(); ubuntuSupport = true; } - else if (tag == "lingmo") - { - ui->tag_lingmo->show(); - lingmoSupport = true; - } + // else if (tag == "lingmo") + // { + // ui->tag_lingmo->show(); + // lingmoSupport = true; + // } else if (tag == "deepin") { ui->tag_deepin->show(); @@ -392,39 +392,44 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSuppo bool checkdeepin = (isDeepin && !deepinSupport); bool checkuos = (isUOS && !uosSupport); bool isLingmo = false; + // if (!checkdeepin && !checkuos) + // { + // // 检查是否为 Lingmo OS + // QFile lsb("/etc/lsb-release"); + // //由于LingmoOS没有lsb-release,所以创建一个lsb,只供星火商店检测。 + // if (!lsb.open(QIODevice::ReadOnly)) + // { + // qDebug() << "打开 /etc/lsb-release 失败"; + // } + // else if (lsb.readAll().contains("Lingmo")) + // { + // isLingmo = true; + // lsb.close(); + // } + // } + // bool checklingmo = (isLingmo && !lingmoSupport); + + bool isUbuntu = false; if (!checkdeepin && !checkuos) { - // 检查是否为 Lingmo OS + // 检查是否为 ubuntu 或LingmoOS QFile lsb("/etc/lsb-release"); - //由于LingmoOS没有lsb-release,所以创建一个lsb,只供星火商店检测。 if (!lsb.open(QIODevice::ReadOnly)) { qDebug() << "打开 /etc/lsb-release 失败"; } else if (lsb.readAll().contains("Lingmo")) { - isLingmo = true; + isUbuntu = true; lsb.close(); } - } - bool checklingmo = (isLingmo && !lingmoSupport); - - bool isUbuntu = false; - if (!checkdeepin && !checkuos) - { - // 检查是否为 ubuntu 系统 - QFile lsb("/etc/lsb-release"); - if (!lsb.open(QIODevice::ReadOnly)) - { - qDebug() << "打开 /etc/lsb-release 失败"; - } else if (lsb.readAll().contains("Ubuntu")) { isUbuntu = true; lsb.close(); } } - bool checkubuntu = (isUbuntu && !ubuntuSupport); + bool checkubuntu = (isUbuntu && !ubuntuSupport && !isLingmo && lingmoSupport); if (checkdeepin) { @@ -436,13 +441,13 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSuppo } else if (checkubuntu) { - Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu, there may be problems")); + Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu or LingmoOS, there may be problems")); } - else if (checklingmo) - { - Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support LingmoOS, there may be problems")); - } - else if (!isUbuntu && !isLingmo && !isDeepin && !isUOS) + // else if (checklingmo) + // { + // Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support LingmoOS, there may be problems")); + // } + else if (!isUbuntu && !isDeepin && !isUOS) { Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support current platform, there may be problems")); } diff --git a/src/pages/appintopage.ui b/src/pages/appintopage.ui index f6f5fdf..7b4de86 100644 --- a/src/pages/appintopage.ui +++ b/src/pages/appintopage.ui @@ -437,7 +437,7 @@ - + 30 diff --git a/translations/spark-store_zh_CN.ts b/translations/spark-store_zh_CN.ts index 66eaaaa..850352e 100644 --- a/translations/spark-store_zh_CN.ts +++ b/translations/spark-store_zh_CN.ts @@ -47,12 +47,12 @@ <html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html> - - - - <html><head/><body><p>Capable to Lingmo OS</p></body></html> - <html><head/><body><p>支持 Lingmo OS</p></body></html> - + // + // + // + // <html><head/><body><p>Capable to Lingmo OS</p></body></html> + // <html><head/><body><p>支持 Lingmo OS</p></body></html> + //