mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-06-01 22:19:51 +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-small.png</file>
|
||||||
<file>tags/uos.svg</file>
|
<file>tags/uos.svg</file>
|
||||||
<file>translations/qtwebengine_zh.qm</file>
|
<file>translations/qtwebengine_zh.qm</file>
|
||||||
|
<file>tags/debian.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</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_deepin->hide();
|
||||||
ui->tag_dwine2->hide();
|
ui->tag_dwine2->hide();
|
||||||
ui->tag_dwine5->hide();
|
ui->tag_dwine5->hide();
|
||||||
|
ui->tag_debian->hide();
|
||||||
ui->tag_ubuntu->hide();
|
ui->tag_ubuntu->hide();
|
||||||
ui->tag_community->hide();
|
ui->tag_community->hide();
|
||||||
ui->icon->clear();
|
ui->icon->clear();
|
||||||
@ -402,12 +403,18 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
|
|||||||
bool ubuntuSupport = false;
|
bool ubuntuSupport = false;
|
||||||
bool deepinSupport = false;
|
bool deepinSupport = false;
|
||||||
bool uosSupport = false;
|
bool uosSupport = false;
|
||||||
|
bool debianSupport = false;
|
||||||
foreach (const QString &tag, tagList)
|
foreach (const QString &tag, tagList)
|
||||||
{
|
{
|
||||||
if (tag == "community")
|
if (tag == "community")
|
||||||
{
|
{
|
||||||
ui->tag_community->show();
|
ui->tag_community->show();
|
||||||
}
|
}
|
||||||
|
else if (tag == "debian")
|
||||||
|
{
|
||||||
|
ui->tag_debian->show();
|
||||||
|
debianSupport = true;
|
||||||
|
}
|
||||||
else if (tag == "ubuntu")
|
else if (tag == "ubuntu")
|
||||||
{
|
{
|
||||||
ui->tag_ubuntu->show();
|
ui->tag_ubuntu->show();
|
||||||
@ -441,10 +448,10 @@ void AppIntoPage::setAppinfoTags(const QStringList &tagList)
|
|||||||
ui->tag_a2d->show();
|
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) {
|
if (!SettingsPage::needUncompatibleNotification) {
|
||||||
return;
|
return;
|
||||||
@ -455,30 +462,21 @@ void AppIntoPage::notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSuppo
|
|||||||
bool checkdeepin = (isDeepin && !deepinSupport);
|
bool checkdeepin = (isDeepin && !deepinSupport);
|
||||||
bool checkuos = (isUOS && !uosSupport);
|
bool checkuos = (isUOS && !uosSupport);
|
||||||
bool isUbuntu = false;
|
bool isUbuntu = false;
|
||||||
|
bool isDebian = false;
|
||||||
if (!checkdeepin && !checkuos)
|
if (!checkdeepin && !checkuos)
|
||||||
{
|
{
|
||||||
// 检查是否为 ubuntu 系统
|
// 使用更可靠的/etc/os-release检测
|
||||||
QFile lsb("/etc/lsb-release");
|
QFile osRelease("/etc/os-release");
|
||||||
if (!lsb.open(QIODevice::ReadOnly))
|
if (osRelease.open(QIODevice::ReadOnly)) {
|
||||||
{
|
QString content = osRelease.readAll();
|
||||||
qDebug() << "打开 /etc/lsb-release 失败";
|
isUbuntu = content.contains("ID=ubuntu");
|
||||||
}
|
isDebian = content.contains("ID=debian") || content.contains("ID_LIKE=debian"); // 合并Debian系检测
|
||||||
else {
|
osRelease.close();
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkubuntu = (isUbuntu && !ubuntuSupport);
|
bool checkubuntu = (isUbuntu && !ubuntuSupport);
|
||||||
|
bool checkdebian = (isDebian && !debianSupport);
|
||||||
|
|
||||||
if (checkdeepin)
|
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"));
|
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"));
|
Utils::sendNotification("spark-store", tr("Warning"), tr("The current application does not support or tested on current platform, there may be problems"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppIntoPage::on_downloadButton_clicked()
|
void AppIntoPage::on_downloadButton_clicked()
|
||||||
|
@ -29,7 +29,7 @@ private:
|
|||||||
void initConnections();
|
void initConnections();
|
||||||
void isDownloading(const QUrl &url);
|
void isDownloading(const QUrl &url);
|
||||||
void setAppinfoTags(const QStringList &tagList);
|
void setAppinfoTags(const QStringList &tagList);
|
||||||
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport);
|
void notifyUserUnsupportedTags(bool ubuntuSupport, bool deepinSupport, bool uosSupport, bool debianSupport);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clickedDownloadBtn();
|
void clickedDownloadBtn();
|
||||||
|
@ -160,7 +160,6 @@
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>14</pointsize>
|
<pointsize>14</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</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>
|
<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>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -432,7 +431,7 @@
|
|||||||
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
<string><html><head/><body><p>Capable to Ubuntu 22.04</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -451,7 +450,7 @@
|
|||||||
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
<string><html><head/><body><p>Capable to UOS home 20</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<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>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -508,7 +507,7 @@
|
|||||||
<string><html><head/><body><p>Capable to deepin 20</p></body></html></string>
|
<string><html><head/><body><p>Capable to deepin 20</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -527,7 +526,7 @@
|
|||||||
<string><html><head/><body><p>An Appimage to deb app.</p></body></html></string>
|
<string><html><head/><body><p>An Appimage to deb app.</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<string><html><head/><body><p>A Wine app.Spark Store will automatically configure the wine kit for you</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -676,7 +685,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>482</width>
|
<width>477</width>
|
||||||
<height>601</height>
|
<height>601</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -757,7 +766,6 @@
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
@ -895,7 +903,6 @@
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
@ -1060,7 +1067,6 @@ QListWidget::item::selected
|
|||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
|
@ -106,3 +106,5 @@ TRANSLATIONS += \
|
|||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/durapps/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
DISTFILES +=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user