From ca03d2741ee3c5976b548870f3a844c7fe62e85f Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sun, 11 Feb 2024 03:54:47 +0000 Subject: Total weight sorting --- src/gui/models/sortlistmodelbuy.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/gui/models/sortlistmodelbuy.h') diff --git a/src/gui/models/sortlistmodelbuy.h b/src/gui/models/sortlistmodelbuy.h index 2b2f56d12..19ef70cc6 100644 --- a/src/gui/models/sortlistmodelbuy.h +++ b/src/gui/models/sortlistmodelbuy.h @@ -28,7 +28,9 @@ #include "utils/gettext.h" -static const char *const SORT_NAME_BUY[7] = +#define NUM_ELEMENTS(a) sizeof(a) / sizeof(a[0]) + +static const char *const SORT_NAME_BUY[8] = { // TRANSLATORS: buy dialog sort type. N_("unsorted"), @@ -40,6 +42,8 @@ static const char *const SORT_NAME_BUY[7] = N_("by id"), // TRANSLATORS: buy dialog sort type. N_("by weight"), + // TRANSLATORS: inventory sort mode + N_("by total weight"), // TRANSLATORS: buy dialog sort type. N_("by amount"), // TRANSLATORS: buy dialog sort type. @@ -56,7 +60,7 @@ class SortListModelBuy final : public ListModel A_DELETE_COPY(SortListModelBuy) int getNumberOfElements() override final - { return 7; } + { return NUM_ELEMENTS(SORT_NAME_BUY); } std::string getElementAt(int i) override final { -- cgit v1.2.3-60-g2f50