piintrospector/containers_view.cpp works proper with old and new PIP
This commit is contained in:
@@ -214,8 +214,13 @@ int cmp_func_name_d(const PIIntrospectionContainers::TypeInfo * t0, const PIIntr
|
|||||||
#endif
|
#endif
|
||||||
CMP_FUNC(item_size)
|
CMP_FUNC(item_size)
|
||||||
CMP_FUNC(count)
|
CMP_FUNC(count)
|
||||||
|
#if PIP_VERSION >= PIP_MAKE_VERSION(2,35,0)
|
||||||
|
CMP_FUNC(allocated_bytes)
|
||||||
|
CMP_FUNC(used_bytes)
|
||||||
|
#else
|
||||||
CMP_FUNC(allocated)
|
CMP_FUNC(allocated)
|
||||||
CMP_FUNC(used)
|
CMP_FUNC(used)
|
||||||
|
#endif
|
||||||
#undef CMP_FUNC
|
#undef CMP_FUNC
|
||||||
void ContainersModel::sort(int column, Qt::SortOrder order) {
|
void ContainersModel::sort(int column, Qt::SortOrder order) {
|
||||||
ls_column = column;
|
ls_column = column;
|
||||||
@@ -228,17 +233,11 @@ void ContainersModel::sort(int column, Qt::SortOrder order) {
|
|||||||
case ccType : cf = order == Qt::AscendingOrder ? cmp_func_name_a : cmp_func_name_d ; pf = print_func_name; break;
|
case ccType : cf = order == Qt::AscendingOrder ? cmp_func_name_a : cmp_func_name_d ; pf = print_func_name; break;
|
||||||
case ccItemSize : cf = order == Qt::AscendingOrder ? cmp_func_item_size_a : cmp_func_item_size_d; pf = print_func_item_size; break;
|
case ccItemSize : cf = order == Qt::AscendingOrder ? cmp_func_item_size_a : cmp_func_item_size_d; pf = print_func_item_size; break;
|
||||||
case ccCount : cf = order == Qt::AscendingOrder ? cmp_func_count_a : cmp_func_count_d ; pf = print_func_count; break;
|
case ccCount : cf = order == Qt::AscendingOrder ? cmp_func_count_a : cmp_func_count_d ; pf = print_func_count; break;
|
||||||
case ccBytesAllocated: cf = order == Qt::AscendingOrder ? cmp_func_allocated_a : cmp_func_allocated_d; pf = print_func_allocated; break;
|
case ccBytesAllocated: cf = order == Qt::AscendingOrder ? cmp_func_allocated_bytes_a : cmp_func_allocated_bytes_d; pf = print_func_allocated_bytes; break;
|
||||||
case ccBytesUsed : cf = order == Qt::AscendingOrder ? cmp_func_used_a : cmp_func_used_d ; pf = print_func_used; break;
|
case ccBytesUsed : cf = order == Qt::AscendingOrder ? cmp_func_used_bytes_a : cmp_func_used_bytes_d ; pf = print_func_used_bytes; break;
|
||||||
default : break;
|
default : break;
|
||||||
}
|
}
|
||||||
if (cf) {
|
if (cf) cur_data.sort(cf);
|
||||||
qDebug() << "\nsrc" << column << order;
|
|
||||||
cur_data.forEach(pf);
|
|
||||||
cur_data.sort(cf);
|
|
||||||
qDebug() << "sort" << column << order;
|
|
||||||
cur_data.forEach(pf);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
switch (column) {
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user