Ensure disk device path has /dev/ prefix

This commit is contained in:
2026-02-03 17:01:36 +01:00
parent 2f9338af0a
commit efe25f3e11

View File

@@ -89,8 +89,13 @@ class StoragePage(Adw.Bin):
def on_disk_toggled(self, button, device_name):
if button.get_active():
self.selected_disk = device_name
self.emit("disk-selected", device_name)
# Prepend /dev/ if it's just the name
full_path = device_name
if not device_name.startswith("/dev/"):
full_path = f"/dev/{device_name}"
self.selected_disk = full_path
self.emit("disk-selected", full_path)
def get_selected_disk(self):
return self.selected_disk