From 0b1500cd2b8c60cfbff372a41329c59ce7c6efea Mon Sep 17 00:00:00 2001
From: zty199 <1282441920@qq.com>
Date: Tue, 24 Nov 2020 22:15:42 +0800
Subject: [PATCH] Bump version to 1.6

Fix a bug that command line option "-v" doesn't show current version.
---
 spark-webapp-runtime/globaldefine.h           |   2 +
 spark-webapp-runtime/main.cpp                 |   3 +-
 .../spark-webapp-runtime_zh_CN.qm             | Bin 1985 -> 1988 bytes
 .../spark-webapp-runtime_zh_CN.ts             |  42 +++++++++---------
 4 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/spark-webapp-runtime/globaldefine.h b/spark-webapp-runtime/globaldefine.h
index 1413827..49de701 100644
--- a/spark-webapp-runtime/globaldefine.h
+++ b/spark-webapp-runtime/globaldefine.h
@@ -16,4 +16,6 @@
 #define DEFAULT_ROOT    QString()
 #define DEFAULT_PORT    0
 
+#define CURRENT_VER     (1.6)
+
 #endif // GLOBALDEFINE_H
diff --git a/spark-webapp-runtime/main.cpp b/spark-webapp-runtime/main.cpp
index 4508629..b60da06 100644
--- a/spark-webapp-runtime/main.cpp
+++ b/spark-webapp-runtime/main.cpp
@@ -25,6 +25,7 @@ int main(int argc, char *argv[])
     a.loadTranslator();
 
     a.setAttribute(Qt::AA_UseHighDpiPixmaps);
+    a.setApplicationVersion(QString::number(CURRENT_VER));
     a.setOrganizationName("spark-union");       // 添加组织名称,和商店主体的文件夹同在 ~/.local/share/spark-union 文件夹下
     a.setApplicationName("SparkWebAppRuntime"); // 这里不要翻译,否则 ~/.local/share 中文件夹名也会被翻译
 
@@ -38,7 +39,7 @@ int main(int argc, char *argv[])
     // ProductName
     dialog->setProductName(QString("<span>%1</span>").arg(DEFAULT_TITLE));
     // Version
-    dialog->setVersion(DApplication::buildVersion(QString("%1 %2").arg(QObject::tr("Version")).arg("1.5")));
+    dialog->setVersion(QString("%1 %2").arg(QObject::tr("Version:")).arg(CURRENT_VER));
     // CompanyLogo
     dialog->setCompanyLogo(QPixmap(":/images/Logo-Spark.png"));
     // Description
diff --git a/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.qm b/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.qm
index b79bbcbba1c492c838cd31ea4ef32c2820b78d65..5ae136eddb5864e1f4c87829be47d409bf0b4dcb 100644
GIT binary patch
delta 60
zcmX@ee}sQR3GZzVj{b)X3=By;vlwqpY_w-$XWDpZE1M)+kw?1De<=>26ayO&bA+W9
O6=&w>SxxR`Hvs@b6%msF

delta 57
zcmX@Ye~^Dd3GWRKj{b)X3=By;Cl~NdY_w-$`@iwfRyHw~B9C+(4xj`B8xXUHr4|)u
L=I2eGz-|HnAFdHN

diff --git a/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.ts b/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.ts
index 8dd6e90..e15294b 100644
--- a/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.ts
+++ b/spark-webapp-runtime/translations/spark-webapp-runtime_zh_CN.ts
@@ -4,12 +4,12 @@
 <context>
     <name>MainWindow</name>
     <message>
-        <location filename="../mainwindow.cpp" line="28"/>
+        <location filename="../mainwindow.cpp" line="27"/>
         <source>Fix Size</source>
         <translation>固定大小</translation>
     </message>
     <message>
-        <location filename="../mainwindow.cpp" line="29"/>
+        <location filename="../mainwindow.cpp" line="28"/>
         <source>Hide Buttons</source>
         <translation>隐藏按钮</translation>
     </message>
@@ -17,87 +17,87 @@
 <context>
     <name>QObject</name>
     <message>
-        <location filename="../main.cpp" line="48"/>
+        <location filename="../main.cpp" line="49"/>
         <source>Presented By Spark developers # HadesStudio</source>
         <translation>由 星火开发者联盟 @ 花心胡萝卜 提供</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="55"/>
+        <location filename="../main.cpp" line="56"/>
         <source>This program is open source under GPLv3</source>
         <translation>本程序按GPL第三版开源</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="41"/>
-        <source>Version</source>
-        <translation>版本</translation>
+        <location filename="../main.cpp" line="42"/>
+        <source>Version:</source>
+        <translation>版本:</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="59"/>
+        <location filename="../main.cpp" line="60"/>
         <source>Description: %1</source>
         <translation>描述:%1</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="64"/>
+        <location filename="../main.cpp" line="65"/>
         <source>Enable CommandLineParser. Default is false.</source>
         <translation>启用参数解析方式。默认顺序解析方式。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="68"/>
+        <location filename="../main.cpp" line="69"/>
         <source>The Title of Application. Default is %1.</source>
         <translation>设置程序的运行标题。默认是 %1。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="74"/>
+        <location filename="../main.cpp" line="75"/>
         <source>The target URL. Default is Blank.</source>
         <translation>设置要打开的目标 URL。默认是空。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="80"/>
+        <location filename="../main.cpp" line="81"/>
         <source>The Width of Application. Default is %1.</source>
         <translation>设置应用的窗口宽度。默认是 %1。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="86"/>
+        <location filename="../main.cpp" line="87"/>
         <source>The Height of Application. Default is %1.</source>
         <translation>设置应用的窗口高度。默认是 %1。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="92"/>
+        <location filename="../main.cpp" line="93"/>
         <source>Fix Window Size. Default is false.</source>
         <translation>固定窗口大小。默认关闭该功能。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="96"/>
+        <location filename="../main.cpp" line="97"/>
         <source>Hide Control Buttons. Default is false.</source>
         <translation>隐藏控制按钮。默认关闭该此功能。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="100"/>
+        <location filename="../main.cpp" line="101"/>
         <source>The ICON of Application.</source>
         <translation>设置应用的图标。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="106"/>
+        <location filename="../main.cpp" line="107"/>
         <source>The Description of Application.</source>
         <translation>设置应用的描述信息。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="112"/>
+        <location filename="../main.cpp" line="113"/>
         <source>The Configuration file of Application.</source>
         <translation>设置应用的配置文件。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="118"/>
+        <location filename="../main.cpp" line="119"/>
         <source>The root path of the program web service.</source>
         <translation>设置内置 WebServer 的根路径。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="125"/>
+        <location filename="../main.cpp" line="126"/>
         <source>The port number of the program web service.</source>
         <translation>设置内置 WebServer 的监听端口号。</translation>
     </message>
     <message>
-        <location filename="../main.cpp" line="132"/>
+        <location filename="../main.cpp" line="133"/>
         <source>The ssl port number of the program web service.</source>
         <translation>设置内置 WebServer 的 SSL 协议的监听端口号。</translation>
     </message>