Ensure disk device path has /dev/ prefix
This commit is contained in:
@@ -89,8 +89,13 @@ class StoragePage(Adw.Bin):
|
|||||||
|
|
||||||
def on_disk_toggled(self, button, device_name):
|
def on_disk_toggled(self, button, device_name):
|
||||||
if button.get_active():
|
if button.get_active():
|
||||||
self.selected_disk = device_name
|
# Prepend /dev/ if it's just the name
|
||||||
self.emit("disk-selected", device_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):
|
def get_selected_disk(self):
|
||||||
return self.selected_disk
|
return self.selected_disk
|
||||||
|
|||||||
Reference in New Issue
Block a user