Changeset View
Changeset View
Standalone View
Standalone View
mtp/kiod_module/mtpdevice.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
70 | MTPDevice::~MTPDevice() | 70 | MTPDevice::~MTPDevice() | ||
71 | { | 71 | { | ||
72 | qCDebug(LOG_KIOD_KMTPD) << "release device:" << m_friendlyName; | 72 | qCDebug(LOG_KIOD_KMTPD) << "release device:" << m_friendlyName; | ||
73 | LIBMTP_Release_Device(m_mtpdevice); | 73 | LIBMTP_Release_Device(m_mtpdevice); | ||
74 | } | 74 | } | ||
75 | 75 | | |||
76 | LIBMTP_mtpdevice_t *MTPDevice::getDevice() | 76 | LIBMTP_mtpdevice_t *MTPDevice::getDevice() | ||
77 | { | 77 | { | ||
78 | if (!m_mtpdevice->storage) { | | |||
79 | qCDebug(LOG_KIOD_KMTPD) << "no storage found: reopen mtpdevice"; | | |||
80 | LIBMTP_Release_Device(m_mtpdevice); | | |||
81 | m_mtpdevice = LIBMTP_Open_Raw_Device_Uncached(&m_rawdevice); | | |||
82 | } | | |||
83 | | ||||
84 | return m_mtpdevice; | 78 | return m_mtpdevice; | ||
85 | } | 79 | } | ||
86 | 80 | | |||
87 | QString MTPDevice::dbusObjectName() const | 81 | QString MTPDevice::dbusObjectName() const | ||
88 | { | 82 | { | ||
89 | return m_dbusObjectName; | 83 | return m_dbusObjectName; | ||
90 | } | 84 | } | ||
91 | 85 | | |||
Show All 36 Lines |