13 Star 0 Fork 17

src-openEuler/calamares

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0020-aboutPage-release-version-problem.patch 3.86 KB
一键复制 编辑 原始数据 按行查看 历史
From 104600c18bcc37e509c9059925963b1ff2da83be Mon Sep 17 00:00:00 2001
From: lizixin <2271170409@qq.com>
Date: Thu, 13 Mar 2025 15:02:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E6=B5=8B=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/libcalamares/CalamaresAbout.cpp | 117 ++++++++++++----------------
1 file changed, 51 insertions(+), 66 deletions(-)
diff --git a/src/libcalamares/CalamaresAbout.cpp b/src/libcalamares/CalamaresAbout.cpp
index 65a1b9d33..11a628463 100644
--- a/src/libcalamares/CalamaresAbout.cpp
+++ b/src/libcalamares/CalamaresAbout.cpp
@@ -7,69 +7,54 @@
*
*/
-#include "CalamaresAbout.h"
-
-#include "CalamaresVersionX.h"
-
-#include <QCoreApplication>
-
-static const char s_header[]
- = QT_TRANSLATE_NOOP( "AboutData", "<br/><h2>Release:%1</h2><br/>" );
-
-static const char s_footer[]
- = QT_TRANSLATE_NOOP( "AboutData",
- "<strong>Thanks to the openEuler team.</strong>");
-
-struct Maintainer
-{
- unsigned int start;
- unsigned int end;
- const char* name;
- const char* email;
- QString text() const
- {
- //: Copyright year-year Name <email-address>
- return QCoreApplication::translate( "AboutData", "Copyright %1-%2 %3 &lt;%4&gt;<br/>" )
- .arg( start )
- .arg( end )
- .arg( name )
- .arg( email );
- }
-};
-
-static constexpr const Maintainer maintainers[] = {
- // { 2014, 2017, "Teo Mrnjavac", "teo@kde.org" },
- // { 2017, 2022, "Adriaan de Groot", "groot@kde.org" },
- // { 2022, 2024, "Adriaan de Groot (community)", "groot@kde.org" },
-};
-
-static QString
-aboutMaintainers()
-{
- QStringList s;
- for ( const auto& m : maintainers )
- {
- s.append( m.text() );
- }
- return s.join( QString() );
-}
-
-static QString
-substituteVersions( const QString& s )
-{
- return s.arg( "openEuler-24.09" ).arg("");
-}
-
-const QString
-Calamares::aboutString()
-{
- return substituteVersions( QCoreApplication::translate( "AboutData", s_header ) ) + aboutMaintainers()
- + QCoreApplication::translate( "AboutData", s_footer );
- // return aboutMaintainers()+ QCoreApplication::translate( "AboutData", s_footer );
-}
-
-const QString
-Calamares::aboutStringUntranslated()
-{
- return substituteVersions( QString( s_header ) ) + aboutMaintainers() + QString( s_footer );
-}
+ #include "CalamaresAbout.h"
+
+ #include "CalamaresVersionX.h"
+
+ #include "utils/System.h"
+
+ #include <QCoreApplication>
+
+ static const char s_header[]
+ = QT_TRANSLATE_NOOP( "AboutData", "<br/><h2>Release:%1</h2><br/>" );
+
+ static const char s_footer[]
+ = QT_TRANSLATE_NOOP( "AboutData",
+ "<strong>Thanks to the openEuler team.</strong>");
+
+ struct Maintainer
+ {
+ unsigned int start;
+ unsigned int end;
+ const char* name;
+ const char* email;
+ QString text() const
+ {
+ return QCoreApplication::translate( "AboutData", "Copyright %1-%2 %3 &lt;%4&gt;<br/>" )
+ .arg( start )
+ .arg( end )
+ .arg( name )
+ .arg( email );
+ }
+ };
+
+ static QString
+ substituteVersions( const QString& s )
+ {
+ auto rse = Calamares::System::runCommand({"cat", "/etc/os-release"}, std::chrono::seconds(30));
+ QString osVersion = rse.getOutput().split("PRETTY_NAME=\"")[1].split("\"\n")[0].replace(" ", "-");
+ return s.arg( osVersion ).arg("");
+ }
+
+ const QString
+ Calamares::aboutString()
+ {
+ return substituteVersions( QCoreApplication::translate( "AboutData", s_header ) ) + QCoreApplication::translate( "AboutData", s_footer );
+ }
+
+ const QString
+ Calamares::aboutStringUntranslated()
+ {
+ return substituteVersions( QString( s_header ) ) + QString( s_footer );
+ }
+
\ No newline at end of file
--
2.46.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/calamares.git
git@gitee.com:src-openeuler/calamares.git
src-openeuler
calamares
calamares
master

搜索帮助