udisks2: add support for 'safely removing storage'

mountutils lacks implemention of ejecting storage on Linux.
Add that to our own code (not to mountutils as it is hard to
do DBus calls from there).
This commit is contained in:
Floris Bos 2023-03-24 15:33:54 +01:00
parent b93fe29617
commit dc6ef75333
4 changed files with 32 additions and 1 deletions

View file

@ -17,6 +17,7 @@ class UDisks2Api : public QObject
public:
explicit UDisks2Api(QObject *parent = nullptr);
int authOpen(const QString &device, const QString &mode = "rw");
void ejectDrive(const QString &device);
bool formatDrive(const QString &device, bool mountAfterwards = true);
QString mountDevice(const QString &device);
void unmountDrive(const QString &device);