mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
feat: 支持打包时从 debian/changelog 自动获取构建版本号并写入关于窗口
修改 debian/rules 文件,configure 时 qmake 添加环境变量 BUILD_VERSION,用于 .pro 文件中获取构建版本号并设置宏定义,在关于窗口中显示 Log: 修改并整理 debian 构建文件夹;修改 .pro 文件,支持打包时自动获取构建版本号;添加 usr/share/dsg/org.deepin.dtkwidget.feature-display.json,用于控制版本特性窗口显示提醒
This commit is contained in:
@@ -50,7 +50,6 @@ Application::Application(int &argc, char **argv)
|
||||
|
||||
// 获取版本特性信息
|
||||
m_featuresJsonObj = Utils::parseFeatureJsonFile();
|
||||
m_version = m_featuresJsonObj.value("version").toString(); // 获取版本号
|
||||
}
|
||||
|
||||
void Application::handleAboutAction()
|
||||
@@ -87,18 +86,16 @@ void Application::checkAppConfigLocation()
|
||||
|
||||
void Application::setBuildDateTime(const QString &buildDateTime)
|
||||
{
|
||||
m_buildDateTime = buildDateTime;
|
||||
|
||||
QSettings config(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) + "/config.ini", QSettings::IniFormat);
|
||||
if (config.value("build/version").toString() != m_version) {
|
||||
if (config.value("build/version").toString() != QString(APP_VERSION)) {
|
||||
qDebug() << "Spark Store has been updated!";
|
||||
|
||||
config.setValue("build/version", m_version);
|
||||
config.setValue("build/time", m_buildDateTime);
|
||||
config.setValue("build/version", QString(APP_VERSION));
|
||||
config.setValue("build/time", buildDateTime);
|
||||
config.sync();
|
||||
}
|
||||
|
||||
setApplicationVersion(DApplication::buildVersion(config.value("build/version").toString() + "-" + "Flamescion" + "-" + config.value("build/time").toString()));
|
||||
setApplicationVersion(DApplication::buildVersion(QString(APP_VERSION) + "-" + "Flamescion" + "-" + buildDateTime));
|
||||
}
|
||||
|
||||
void Application::setMainWindow(MainWindow *window)
|
||||
|
||||
@@ -30,8 +30,6 @@ private:
|
||||
|
||||
private:
|
||||
QJsonObject m_featuresJsonObj;
|
||||
QString m_version;
|
||||
QString m_buildDateTime;
|
||||
|
||||
MainWindow *m_mainWindow = nullptr;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{
|
||||
"version": "4.2.3",
|
||||
"title": "Features",
|
||||
"title[zh_CN]": "版本特性",
|
||||
"items": [
|
||||
|
||||
@@ -22,8 +22,13 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
# Get build version from qmake
|
||||
VERSION = $$BUILD_VERSION
|
||||
isEmpty(VERSION): VERSION = 4.0.0
|
||||
DEFINES += APP_VERSION=\\\"'$${VERSION}'\\\"
|
||||
|
||||
# Disable qWarning / qDebug output in Release
|
||||
# CONFIG(release, debug|release): DEFINES += QT_NO_WARNING_OUTPUT QT_NO_DEBUG_OUTPUT
|
||||
#CONFIG(release, debug | release): DEFINES += QT_NO_WARNING_OUTPUT QT_NO_DEBUG_OUTPUT
|
||||
|
||||
CONFIG += c++11 link_pkgconfig
|
||||
PKGCONFIG += dtkcore dtkgui dtkwidget
|
||||
|
||||
Reference in New Issue
Block a user