From 969f45afd6b104d5a16e559c7789e6116879c66d Mon Sep 17 00:00:00 2001 From: peri4 Date: Thu, 14 Apr 2022 16:12:32 +0300 Subject: [PATCH] piintrospector/containers_view.cpp --- utils/piintrospector/containers_view.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/piintrospector/containers_view.cpp b/utils/piintrospector/containers_view.cpp index eaa52f5..087a341 100644 --- a/utils/piintrospector/containers_view.cpp +++ b/utils/piintrospector/containers_view.cpp @@ -158,19 +158,19 @@ Qt::ItemFlags ContainersModel::flags(const QModelIndex & index) const { //bool cmp(const PIIntrospectionContainers::TypeInfo & a, const PIIntrospectionContainers::TypeInfo & b); -#if PIP_VERSION > PIP_MAKE_VERSION(2,34,1) +#if PIP_VERSION >= PIP_MAKE_VERSION(2,35,0) bool cmp_func_name_a(const PIIntrospectionContainers::TypeInfo & t0, const PIIntrospectionContainers::TypeInfo & t1) { - return QString::localeAwareCompare(PI2QString(t0.name), PI2QString(t1.name)) > 0; + return QString::localeAwareCompare(PI2QString(t0.name), PI2QString(t1.name)) < 0; } bool cmp_func_name_d(const PIIntrospectionContainers::TypeInfo & t0, const PIIntrospectionContainers::TypeInfo & t1) { - return -cmp_func_name_a(t0, t1); + return !cmp_func_name_a(t0, t1); } # define CMP_FUNC(field) \ bool cmp_func_##field##_a(const PIIntrospectionContainers::TypeInfo & t0, const PIIntrospectionContainers::TypeInfo & t1) { \ return t0.field < t1.field; \ } \ bool cmp_func_##field##_d(const PIIntrospectionContainers::TypeInfo & t0, const PIIntrospectionContainers::TypeInfo & t1) { \ - return -cmp_func_##field##_a(t0, t1); \ + return t0.field > t1.field; \ } #else int cmp_func_name_a(const PIIntrospectionContainers::TypeInfo * t0, const PIIntrospectionContainers::TypeInfo * t1) { @@ -198,11 +198,11 @@ void ContainersModel::sort(int column, Qt::SortOrder order) { if (cur_data.isEmpty()) return; PIVector::CompareFunc cf = nullptr; switch (column) { - case ccType : cf = order == Qt::AscendingOrder ? cmp_func_name_a : cmp_func_name_d; break; + case ccType : cf = order == Qt::AscendingOrder ? cmp_func_name_a : cmp_func_name_d ; break; case ccItemSize : cf = order == Qt::AscendingOrder ? cmp_func_item_size_a : cmp_func_item_size_d; break; - case ccCount : cf = order == Qt::AscendingOrder ? cmp_func_count_a : cmp_func_count_d; break; + case ccCount : cf = order == Qt::AscendingOrder ? cmp_func_count_a : cmp_func_count_d ; break; case ccBytesAllocated: cf = order == Qt::AscendingOrder ? cmp_func_allocated_a : cmp_func_allocated_d; break; - case ccBytesUsed : cf = order == Qt::AscendingOrder ? cmp_func_used_a : cmp_func_used_d; break; + case ccBytesUsed : cf = order == Qt::AscendingOrder ? cmp_func_used_a : cmp_func_used_d ; break; default : break; } if (cf)