diff --git a/tests/unit/api/test_settings.py b/tests/unit/api/test_settings.py index 514c478c7..db847460e 100644 --- a/tests/unit/api/test_settings.py +++ b/tests/unit/api/test_settings.py @@ -154,18 +154,18 @@ def ask_question(*args, **kwargs): def test_set_order_setting(): - o = settings.ImageOrderSetting("imageorder", "name") - o.value = "name-desc" - assert o.value == "name-desc" + o = settings.ImageOrderSetting("imageorder", "alphabetical") + o.value = "alphabetical-desc" + assert o.value == "alphabetical-desc" def test_set_order_setting_non_str(): - o = settings.OrderSetting("order", "name") + o = settings.OrderSetting("order", "alphabetical") with pytest.raises(ValueError, match="must be one of"): o.value = 1 def test_set_order_setting_non_valid(): - o = settings.OrderSetting("order", "name") + o = settings.OrderSetting("order", "alphabetical") with pytest.raises(ValueError, match="must be one of"): o.value = "invalid" diff --git a/vimiv/api/settings.py b/vimiv/api/settings.py index 051958966..365c94174 100644 --- a/vimiv/api/settings.py +++ b/vimiv/api/settings.py @@ -359,14 +359,14 @@ class ImageOrderSetting(OrderSetting): """Stores an image ordering setting.""" ORDER_TYPES = { - "name": (os.path.basename, False), - "name-desc": (os.path.basename, True), - "name-natural": (OrderSetting._natural_sort, False), - "name-natural-desc": (OrderSetting._natural_sort, True), - "modify": (os.path.getmtime, False), - "modify-desc": (os.path.getmtime, True), - "size": (os.path.getsize, False), - "size-desc": (os.path.getsize, True), + "alphabetical": (os.path.basename, False), + "alphabetical-desc": (os.path.basename, True), + "natural": (OrderSetting._natural_sort, False), + "natural-desc": (OrderSetting._natural_sort, True), + "recently-modify-first": (os.path.getmtime, False), + "recently-modify-last": (os.path.getmtime, True), + "smallest-first": (os.path.getsize, False), + "largest-first": (os.path.getsize, True), } def __str__(self) -> str: @@ -377,14 +377,14 @@ class DirectoryOrderSetting(OrderSetting): """Stores an directory ordering setting.""" ORDER_TYPES = { - "name": (os.path.basename, False), - "name-desc": (os.path.basename, True), - "name-natural": (OrderSetting._natural_sort, False), - "name-natural-desc": (OrderSetting._natural_sort, True), - "modify": (os.path.getmtime, False), - "modify-desc": (os.path.getmtime, True), - "size": (lambda e: len(os.listdir(e)), True), - "size-desc": (lambda e: len(os.listdir(e)), False), + "alphabetical": (os.path.basename, False), + "alphabetical-desc": (os.path.basename, True), + "natural": (OrderSetting._natural_sort, False), + "natural-desc": (OrderSetting._natural_sort, True), + "recently-modify-first": (os.path.getmtime, False), + "recently-modify-last": (os.path.getmtime, True), + "smallest-first": (lambda e: len(os.listdir(e)), True), + "largest-first": (lambda e: len(os.listdir(e)), False), } def __str__(self) -> str: @@ -409,9 +409,11 @@ def __str__(self) -> str: read_only = BoolSetting( "read_only", False, desc="Disable any commands that are able to edit files on disk" ) -image_order = ImageOrderSetting("image_order", "name", desc="Set image ordering.",) +image_order = ImageOrderSetting( + "image_order", "alphabetical", desc="Set image ordering.", +) directory_order = DirectoryOrderSetting( - "directory_order", "name", desc="Set directory ordering.", + "directory_order", "alphabetical", desc="Set directory ordering.", )