From 15384ceb062d492cbd874e6f7f9c6add68c1332d Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Mon, 30 Sep 2024 16:37:39 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=EF=BC=8C#843,=E5=BD=95?= =?utf8?q?=E9=9F=B3=E6=96=87=E4=BB=B6=E6=8E=92=E5=BA=8F=E9=94=99=E4=B9=B1b?= =?utf8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/record/src/RecordingModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp index 9aa2e6ea2..35b31b4ff 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/record/src/RecordingModel.cpp @@ -13,6 +13,7 @@ #include #include #include "ConfigModel.h" +#include "cstring" namespace OHOS { std::string RecordingModel::recordTempDuration = 0; @@ -568,6 +569,19 @@ namespace OHOS } closedir(dir); } + // 使用冒泡排序进行排序 + for (int i = 0; i < mp3FileCount - 1; i++) + { + for (int j = 0; j < mp3FileCount - i - 1; j++) + { + if (strcmp(info[j].recordingFileName, info[j + 1].recordingFileName) < 0) + { + RecordingInfo temp = info[j]; + info[j] = info[j + 1]; + info[j + 1] = temp; + } + } + } } /* -- 2.17.1