添加LingmoOS适配

This commit is contained in:
Floating dream
2023-06-08 11:22:21 +08:00
parent 0edf87c95c
commit 7513667c6e
3 changed files with 40 additions and 35 deletions

View File

@@ -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"));
}

View File

@@ -437,7 +437,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="tag_lingmo">
<widget class="QLabel" name="tag_ubuntu">
<property name="maximumSize">
<size>
<width>30</width>