添加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_dwine2->hide();
ui->tag_dwine5->hide(); ui->tag_dwine5->hide();
ui->tag_ubuntu->hide(); ui->tag_ubuntu->hide();
ui->tag_lingmo->hide(); // ui->tag_lingmo->hide();
ui->tag_community->hide(); ui->tag_community->hide();
ui->icon->clear(); ui->icon->clear();
ui->title->clear(); ui->title->clear();
@ -349,11 +349,11 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
ui->tag_ubuntu->show(); ui->tag_ubuntu->show();
ubuntuSupport = true; ubuntuSupport = true;
} }
else if (tag == "lingmo") // else if (tag == "lingmo")
{ // {
ui->tag_lingmo->show(); // ui->tag_lingmo->show();
lingmoSupport = true; // lingmoSupport = true;
} // }
else if (tag == "deepin") else if (tag == "deepin")
{ {
ui->tag_deepin->show(); ui->tag_deepin->show();
@ -392,39 +392,44 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSuppo
bool checkdeepin = (isDeepin && !deepinSupport); bool checkdeepin = (isDeepin && !deepinSupport);
bool checkuos = (isUOS && !uosSupport); bool checkuos = (isUOS && !uosSupport);
bool isLingmo = false; 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) if (!checkdeepin && !checkuos)
{ {
// 检查是否为 Lingmo OS // 检查是否为 ubuntu 或LingmoOS
QFile lsb("/etc/lsb-release"); QFile lsb("/etc/lsb-release");
//由于LingmoOS没有lsb-release所以创建一个lsb只供星火商店检测。
if (!lsb.open(QIODevice::ReadOnly)) if (!lsb.open(QIODevice::ReadOnly))
{ {
qDebug() << "打开 /etc/lsb-release 失败"; qDebug() << "打开 /etc/lsb-release 失败";
} }
else if (lsb.readAll().contains("Lingmo")) else if (lsb.readAll().contains("Lingmo"))
{ {
isLingmo = true; isUbuntu = true;
lsb.close(); 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")) else if (lsb.readAll().contains("Ubuntu"))
{ {
isUbuntu = true; isUbuntu = true;
lsb.close(); lsb.close();
} }
} }
bool checkubuntu = (isUbuntu && !ubuntuSupport); bool checkubuntu = (isUbuntu && !ubuntuSupport && !isLingmo && lingmoSupport);
if (checkdeepin) if (checkdeepin)
{ {
@ -436,13 +441,13 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSuppo
} }
else if (checkubuntu) 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) // else if (checklingmo)
{ // {
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support LingmoOS, there may be problems")); // 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 (!isUbuntu && !isDeepin && !isUOS)
{ {
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support current platform, there may be problems")); 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> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="tag_lingmo"> <widget class="QLabel" name="tag_ubuntu">
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>30</width> <width>30</width>

View File

@ -47,12 +47,12 @@
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/ubuntu-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation></translation> <translation></translation>
</message> </message>
<message> // <message>
<location filename="../src/pages/appintopage.ui" line="448"/> // <location filename="../src/pages/appintopage.ui" line="448"/>
<Location filename="../src/pages/appintopage.ui" line="451"/> // <Location filename="../src/pages/appintopage.ui" line="451"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source> // <source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Capable to Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt; Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation> // <translation>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;支持 Lingmo OS&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message> // </message>
<message> <message>
<location filename="../src/pages/appintopage.ui" line="448"/> <location filename="../src/pages/appintopage.ui" line="448"/>
<location filename="../src/pages/appintopage.ui" line="451"/> <location filename="../src/pages/appintopage.ui" line="451"/>