From c0ad3cab8fdba5c00b108b930a15bd6d77bbdc40 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 13 Sep 2018 08:59:23 +0200 Subject: [PATCH] Make sure to build with strict compile flags + port to no deprecated method --- CMakeLists.txt | 6 +++++- src/kselectionproxymodel.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e2c8b2..23874d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,7 +34,11 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KITEMMODELS PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5ItemModelsConfigVersion.cmake" SOVERSION 5) - +add_definitions(-DQT_NO_CAST_FROM_ASCII) +add_definitions(-DQT_NO_CAST_TO_ASCII) +add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT) +add_definitions(-DQT_NO_URL_CAST_FROM_STRING) +add_definitions(-DQT_USE_QSTRINGBUILDER) add_subdirectory(src) if (BUILD_TESTING) add_subdirectory(autotests) diff --git a/src/kselectionproxymodel.cpp b/src/kselectionproxymodel.cpp index b8099b4..167fc58 100644 --- a/src/kselectionproxymodel.cpp +++ b/src/kselectionproxymodel.cpp @@ -399,7 +399,7 @@ static QItemSelection kNormalizeSelection(QItemSelection selection) } RangeLessThan lt; - qSort(selection.begin(), selection.end(), lt); + std::sort(selection.begin(), selection.end(), lt); return stableNormalizeSelection(selection); }