From 9df3962f678c098f307454dcfe86863a816a6a49 Mon Sep 17 00:00:00 2001 From: pei-jiankang Date: Thu, 7 Apr 2022 13:33:57 +0800 Subject: [PATCH] modify version is error --- menumodule.cpp | 22 ++++ translations/kylin-music_zh_CN.ts | 210 +++++++++++++++--------------- 2 files changed, 127 insertions(+), 105 deletions(-) diff --git a/menumodule.cpp b/menumodule.cpp index 806c98d..40472c3 100644 --- a/menumodule.cpp +++ b/menumodule.cpp @@ -237,6 +237,28 @@ QVBoxLayout* menuModule::initBody(){ // bodyAppName->setText(tr(appShowingName.toLocal8Bit())); bodyAppName->setText(tr("kylin music")); bodyAppName->setStyleSheet("font-size:18px;"); + FILE *pp = NULL; + char *line = NULL; + char *q = NULL; + size_t len = 0; + ssize_t read; + + pp = popen("rpm -qa kylin-music", "r"); + if(pp) { while((read = getline(&line, &len, pp)) != -1){ + q = strrchr(line, '\n'); + *q = '\0'; + QString content = line; + QStringList list = content.split("-"); + if (list.size() >= 3) + appVersion = list.at(2); + } + } + if(line){ + free(line); + line = NULL; + } + pclose(pp); + QLabel* bodyAppVersion = new QLabel(); bodyAppVersion->setFixedHeight(24); bodyAppVersion->setText(tr("Version: ") + appVersion); diff --git a/translations/kylin-music_zh_CN.ts b/translations/kylin-music_zh_CN.ts index e45eb8f..8e8a3c0 100644 --- a/translations/kylin-music_zh_CN.ts +++ b/translations/kylin-music_zh_CN.ts @@ -121,40 +121,40 @@ 播放/暂停 - + Kylin music 麒麟音乐 - + maximize 最大化 - + reduction 还原 - + rename 重命名 - + Delete the playlist 删除歌单 - - - - + + + + play 播放 - + The following piece 下一首 @@ -163,69 +163,69 @@ 添加到我喜欢 - + Remove from the song list 从歌曲列表中删除 - + Add to playlist 添加到歌单 - + Song information 歌曲信息 - + pause 暂停 - + The song name: 歌曲名称: - + singer: 歌曲歌手: - + album: 歌曲专辑: - + The file type: 文件类型: - + The file size: 文件大小: - + File length: 文件时长: - + File location: 文件位置: - - + + 警告 - - + + 暂无法打开文件,请检查路径和文件名称 @@ -234,7 +234,7 @@ 麒麟音乐 - + volume 音量调节 @@ -263,52 +263,52 @@ 默认歌单无法重命名! - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + A total of - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + The first @@ -341,49 +341,49 @@ 文件位置 - - - + + + 00:00 00:00 - - - - - - + + + + + + A list of circulation 列表循环 - - - - - - + + + + + + Random broadcast 随机播放 - - - - - - + + + + + + Order of play 顺序播放 - - - - - - + + + + + + Single cycle 单曲循环 @@ -796,8 +796,8 @@ 麒麟音乐 - - + + Service & Support: 服务与支持: @@ -821,7 +821,7 @@ 深色主题 - + Version: 版本号: @@ -830,8 +830,8 @@ 开发者:support@kylinos.cn - - + + kylin music 麒麟音乐 @@ -844,23 +844,23 @@ 麒麟音乐 - - + + 列表循环 - + 随机播放 - + 顺序播放 - + 单曲循环 -- 2.33.0