From 2d718b013b41b673a43c9f9af3a1123573ab151b Mon Sep 17 00:00:00 2001 From: rewine Date: Sat, 25 Nov 2023 02:18:37 +0800 Subject: [PATCH] chore: use std::as_const() instead of qAsConst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Waring: constexpr typename std::add_const<_Tp>::type& qAsConst(T&) [with T = const QList; typename std::add_const<_Tp>::type = const QList]’ is deprecated: Use std::as_const() instead. [-Wdeprecated-declarations] --- CMakeLists.txt | 2 ++ app/playlistmanager.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a3a9c4..4e2a11f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,8 @@ include (FeatureSummary) option (EXIV2_METADATA_SUPPORT "Better image metadata support via libexiv2" ON) option (PREFER_QT_5 "Prefer to use Qt 5 even if we have Qt 6" ON) +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) set (CMAKE_AUTOMOC ON) set (CMAKE_AUTORCC ON) diff --git a/app/playlistmanager.cpp b/app/playlistmanager.cpp index 3f808db..f44d8bc 100644 --- a/app/playlistmanager.cpp +++ b/app/playlistmanager.cpp @@ -164,7 +164,7 @@ std::tuple PlaylistManager::currentFileUrl() const QList PlaylistManager::convertToUrlList(const QStringList &files) { QList urlList; - for (const QString & str : qAsConst(files)) { + for (const QString & str : std::as_const(files)) { QUrl url = QUrl::fromLocalFile(str); if (url.isValid()) { urlList.append(url);