Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/backends/udisks2/udisksstorageaccess.cpp
Show First 20 Lines • Show All 179 Lines • ▼ Show 20 Line(s) | 179 | } else if (!ctPath.isEmpty() && ctPath != "/") { | |||
---|---|---|---|---|---|
180 | callCryptoTeardown(true); // Lock crypted parent | 180 | callCryptoTeardown(true); // Lock crypted parent | ||
181 | } else { | 181 | } else { | ||
182 | // try to "eject" (aka safely remove) from the (parent) drive, e.g. SD card from a reader | 182 | // try to "eject" (aka safely remove) from the (parent) drive, e.g. SD card from a reader | ||
183 | QString drivePath = m_device->drivePath(); | 183 | QString drivePath = m_device->drivePath(); | ||
184 | if (!drivePath.isEmpty() || drivePath != "/") { | 184 | if (!drivePath.isEmpty() || drivePath != "/") { | ||
185 | Device drive(drivePath); | 185 | Device drive(drivePath); | ||
186 | QDBusConnection c = QDBusConnection::systemBus(); | 186 | QDBusConnection c = QDBusConnection::systemBus(); | ||
187 | 187 | | |||
188 | if (drive.prop("Ejectable").toBool() && | 188 | if (drive.prop("MediaRemovable").toBool() && | ||
189 | drive.prop("MediaAvailable").toBool() && | 189 | drive.prop("MediaAvailable").toBool() && | ||
190 | !m_device->isOpticalDisc()) { // optical drives have their Eject method | 190 | !m_device->isOpticalDisc()) { // optical drives have their Eject method | ||
191 | QDBusMessage msg = QDBusMessage::createMethodCall(UD2_DBUS_SERVICE, drivePath, UD2_DBUS_INTERFACE_DRIVE, "Eject"); | 191 | QDBusMessage msg = QDBusMessage::createMethodCall(UD2_DBUS_SERVICE, drivePath, UD2_DBUS_INTERFACE_DRIVE, "Eject"); | ||
192 | msg << QVariantMap(); // options, unused now | 192 | msg << QVariantMap(); // options, unused now | ||
193 | c.call(msg, QDBus::NoBlock); | 193 | c.call(msg, QDBus::NoBlock); | ||
194 | } else if (drive.prop("CanPowerOff").toBool() && | 194 | } else if (drive.prop("CanPowerOff").toBool() && | ||
195 | !m_device->isOpticalDisc()) { // avoid disconnecting optical drives from the bus | 195 | !m_device->isOpticalDisc()) { // avoid disconnecting optical drives from the bus | ||
196 | qCDebug(UDISKS2) << "Drive can power off:" << drivePath; | 196 | qCDebug(UDISKS2) << "Drive can power off:" << drivePath; | ||
▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines |