回退 '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

@@ -59,8 +59,6 @@
<file>tags/logo_icon.svg</file>
<file>tags/ubuntu-small.png</file>
<file>tags/ubuntu.png</file>
<file>tags/lingmo-small.png</file>
<file>tags/lingmo.png</file>
<file>tags/uos-authorize.svg</file>
<file>tags/uos-small.png</file>
<file>tags/uos.svg</file>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

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

View File

@@ -29,7 +29,7 @@ private:
void initConnections();
void isDownloading(const QUrl &url);
void setAppinfoTags(const QStringList &tagList);
void notifyUserUnsupportedTags(bool ubuntuSupport, bool lingmoSupport, bool deepinSupport, bool uosSupport);
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport);
signals:
void clickedDownloadBtn();

View File

@@ -436,25 +436,6 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tag_ubuntu">
<property name="maximumSize">
<size>
<width>30</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&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;</string>
</property>
<property name="whatsThis">
<string>&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;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/tags/lingmo-small.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tag_uos">
<property name="maximumSize">