代码拉取完成,页面将自动刷新
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 <%4><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 <%4><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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。