回退 'Pull Request !218 : 添加对LingmoOS的支持'

This commit is contained in:
2023-06-08 12:00:47 +00:00
committed by Gitee
parent b715f1c54b
commit 5cf8b587ee
11 changed files with 7 additions and 82 deletions

View File

@@ -196,7 +196,6 @@ void AppIntoPage::clear()
ui->tag_dwine2->hide();
ui->tag_dwine5->hide();
ui->tag_ubuntu->hide();
// ui->tag_lingmo->hide();
ui->tag_community->hide();
ui->icon->clear();
ui->title->clear();
@@ -335,7 +334,6 @@ void AppIntoPage::isDownloading(const QUrl &url)
void AppIntoPage::setAppinfoTags(const QStringList &tagList)
{
bool ubuntuSupport = false;
bool lingmoSupport = false;
bool deepinSupport = false;
bool uosSupport = false;
foreach (const QString &tag, tagList)
@@ -349,11 +347,6 @@ 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 == "deepin")
{
ui->tag_deepin->show();
@@ -382,54 +375,31 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
ui->tag_a2d->show();
}
}
notifyUserUnsupportedTags(ubuntuSupport, lingmoSupport, deepinSupport, uosSupport);
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport);
}
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSupport, bool deepinSupport, bool uosSupport)
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport)
{
bool isDeepin = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Deepin;
bool isUOS = Dtk::Core::DSysInfo::productType() == Dtk::Core::DSysInfo::Uos;
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)
{
// 检查是否为 ubuntu 或LingmoOS
// 检查是否为 ubuntu 系统
QFile lsb("/etc/lsb-release");
if (!lsb.open(QIODevice::ReadOnly))
{
qDebug() << "打开 /etc/lsb-release 失败";
}
else if (lsb.readAll().contains("Lingmo"))
{
isUbuntu = true;
lsb.close();
}
else if (lsb.readAll().contains("Ubuntu"))
{
isUbuntu = true;
lsb.close();
}
}
bool checkubuntu = (isUbuntu && !ubuntuSupport && !isLingmo && lingmoSupport);
bool checkubuntu = (isUbuntu && !ubuntuSupport);
if (checkdeepin)
{
@@ -441,12 +411,8 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSuppo
}
else if (checkubuntu)
{
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu or LingmoOS, there may be problems"));
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support Ubuntu, 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 && !isDeepin && !isUOS)
{
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support current platform, there may be problems"));