Skip to content

FileDialog shows too many drives on Ubuntu 20.04 #250

@rds1983

Description

@rds1983

image

Code for filling up the drives ListBox is like this:

var drives = DriveInfo.GetDrives();

foreach (var d in drives)
{
    if (d.DriveType == DriveType.Ram)
    {
        continue;
    }

    try
    {
        var s = d.RootDirectory.Name;

        if (!string.IsNullOrEmpty(d.VolumeLabel) && d.VolumeLabel != d.RootDirectory.Name)
        {
            s += " (" + d.VolumeLabel + ")";
        }

        _listBoxPlaces.Items.Add(new ListItem(s, null, d.RootDirectory.Name)
        {
            Image = iconDrive,
            ImageTextSpacing = ImageTextSpacing
        });
    }
    catch (Exception)
    {
    }
}

Some linux-specific hacks should be added to that code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions