mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-05-15 13:49:50 +08:00
支持 Debian / GXDE 系统识别
This commit is contained in:
parent
0566d546df
commit
46a1daeafc
@ -63,5 +63,6 @@
|
||||
<file>tags/uos-small.png</file>
|
||||
<file>tags/uos.svg</file>
|
||||
<file>translations/qtwebengine_zh.qm</file>
|
||||
<file>tags/debian.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
1
src/assets/tags/debian.svg
Normal file
1
src/assets/tags/debian.svg
Normal file
File diff suppressed because one or more lines are too long
After (image error) Size: 5.3 KiB |
@ -231,6 +231,7 @@ void AppIntoPage::clear()
|
||||
ui->tag_deepin->hide();
|
||||
ui->tag_dwine2->hide();
|
||||
ui->tag_dwine5->hide();
|
||||
ui->tag_debian->hide();
|
||||
ui->tag_ubuntu->hide();
|
||||
ui->tag_community->hide();
|
||||
ui->icon->clear();
|
||||
@ -402,12 +403,18 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
|
||||
bool ubuntuSupport = false;
|
||||
bool deepinSupport = false;
|
||||
bool uosSupport = false;
|
||||
bool debianSupport = false;
|
||||
foreach (const QString &tag, tagList)
|
||||
{
|
||||
if (tag == "community")
|
||||
{
|
||||
ui->tag_community->show();
|
||||
}
|
||||
else if (tag == "debian")
|
||||
{
|
||||
ui->tag_debian->show();
|
||||
debianSupport = true;
|
||||
}
|
||||
else if (tag == "ubuntu")
|
||||
{
|
||||
ui->tag_ubuntu->show();
|
||||
@ -441,10 +448,10 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
|
||||
ui->tag_a2d->show();
|
||||
}
|
||||
}
|
||||
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport);
|
||||
notifyUserUnsupportedTags(ubuntuSupport, deepinSupport, uosSupport ,debianSupport);
|
||||
}
|
||||
|
||||
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport)
|
||||
void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport)
|
||||
{
|
||||
if (!SettingsPage::needUncompatibleNotification) {
|
||||
return;
|
||||
@ -455,30 +462,21 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
|
||||
bool checkdeepin = (isDeepin && !deepinSupport);
|
||||
bool checkuos = (isUOS && !uosSupport);
|
||||
bool isUbuntu = false;
|
||||
bool isDebian = false;
|
||||
if (!checkdeepin && !checkuos)
|
||||
{
|
||||
// 检查是否为 ubuntu 系统
|
||||
QFile lsb("/etc/lsb-release");
|
||||
if (!lsb.open(QIODevice::ReadOnly))
|
||||
{
|
||||
qDebug() << "打开 /etc/lsb-release 失败";
|
||||
}
|
||||
else {
|
||||
QString lsbInfo = lsb.readAll(); // 因为使用 readAll 读取后会默认跳转到文件末尾导致读出的数据为空,所以用单独一个 string 存储
|
||||
if (lsbInfo.contains("Ubuntu"))
|
||||
{
|
||||
isUbuntu = true;
|
||||
lsb.close();
|
||||
}
|
||||
else if (lsbInfo.contains("GXDE"))
|
||||
{
|
||||
// GXDE 使用 Ubuntu 的 tag
|
||||
isUbuntu = true;
|
||||
lsb.close();
|
||||
}
|
||||
// 使用更可靠的/etc/os-release检测
|
||||
QFile osRelease("/etc/os-release");
|
||||
if (osRelease.open(QIODevice::ReadOnly)) {
|
||||
QString content = osRelease.readAll();
|
||||
isUbuntu = content.contains("ID=ubuntu");
|
||||
isDebian = content.contains("ID=debian") || content.contains("ID_LIKE=debian"); // 合并Debian系检测
|
||||
osRelease.close();
|
||||
}
|
||||
}
|
||||
|
||||
bool checkubuntu = (isUbuntu && !ubuntuSupport);
|
||||
bool checkdebian = (isDebian && !debianSupport);
|
||||
|
||||
if (checkdeepin)
|
||||
{
|
||||
@ -492,12 +490,17 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Ubuntu, there may be problems"));
|
||||
}
|
||||
else if (!isUbuntu && !isDeepin && !isUOS)
|
||||
else if (checkdebian)
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on Debian, there may be problems"));
|
||||
}
|
||||
if (!isUbuntu && !isDeepin && !isUOS && !isDebian)
|
||||
{
|
||||
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on current platform, there may be problems"));
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void AppIntoPage::on_downloadButton_clicked()
|
||||
|
@ -29,7 +29,7 @@ private:
|
||||
void initConnections();
|
||||
void isDownloading(const QUrl &url);
|
||||
void setAppinfoTags(const QStringList &tagList);
|
||||
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport);
|
||||
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport);
|
||||
|
||||
signals:
|
||||
void clickedDownloadBtn();
|
||||
|
@ -160,7 +160,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@ -413,7 +412,7 @@
|
||||
<string><html><head/><body><p>This app is developed by community user,we give this tag to honor those who contribute to the Linux Ecology</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/community-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/community.svg" height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -432,7 +431,7 @@
|
||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/ubuntu-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/ubuntu.png" width=30 height=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -451,7 +450,7 @@
|
||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/uos-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/uos-authorize.svg" height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -489,7 +488,7 @@
|
||||
<string><html><head/><body><p>This is a DTK5 app,which means it would have better effect on Deepin Desktop Environment</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/dtk-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/logo_icon.svg" height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -508,7 +507,7 @@
|
||||
<string><html><head/><body><p>Capable to deepin 20</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/deepin-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/deepin.svg" height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -527,7 +526,7 @@
|
||||
<string><html><head/><body><p>An Appimage to deb app.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/a2d-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/a2d.png"height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -546,7 +545,17 @@
|
||||
<string><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/dwine5-small.png"/></p></body></html></string>
|
||||
<string><html><head/><body><p><img src=":/tags/dwine5.svg" height=30 width=30 /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="tag_debian">
|
||||
<property name="whatsThis">
|
||||
<string><html><head/><body><p>Capable to Debian Stable</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/tags/debian.svg" height="30" width="30"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -676,7 +685,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>482</width>
|
||||
<width>477</width>
|
||||
<height>601</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -757,7 +766,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@ -895,7 +903,6 @@
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
@ -1060,7 +1067,6 @@ QListWidget::item::selected
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
|
@ -106,3 +106,5 @@ TRANSLATIONS += \
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
DISTFILES +=
|
||||
|
Loading…
x
Reference in New Issue
Block a user