Changeset View
Changeset View
Standalone View
Standalone View
mtp/kio_mtp.cpp
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 186 | if (pathItems.isEmpty()) { | |||
---|---|---|---|---|---|
196 | qCDebug(LOG_KIO_MTP) << "[SUCCESS] :: Devices:" << m_kmtpDaemon.devices().size(); | 196 | qCDebug(LOG_KIO_MTP) << "[SUCCESS] :: Devices:" << m_kmtpDaemon.devices().size(); | ||
197 | finished(); | 197 | finished(); | ||
198 | return; | 198 | return; | ||
199 | } | 199 | } | ||
200 | 200 | | |||
201 | // traverse into device | 201 | // traverse into device | ||
202 | const KMTPDeviceInterface *mtpDevice = m_kmtpDaemon.deviceFromName(pathItems.first()); | 202 | const KMTPDeviceInterface *mtpDevice = m_kmtpDaemon.deviceFromName(pathItems.first()); | ||
203 | if (mtpDevice) { | 203 | if (mtpDevice) { | ||
204 | // list storages | 204 | // list storage media | ||
205 | if (pathItems.size() == 1) { | 205 | if (pathItems.size() == 1) { | ||
206 | qCDebug(LOG_KIO_MTP) << "Listing storages for device " << pathItems.first(); | 206 | qCDebug(LOG_KIO_MTP) << "Listing storage media for device " << pathItems.first(); | ||
207 | 207 | | |||
208 | const auto storages = mtpDevice->storages(); | 208 | const auto storages = mtpDevice->storages(); | ||
209 | totalSize(filesize_t(storages.size())); | 209 | totalSize(filesize_t(storages.size())); | ||
210 | 210 | | |||
211 | if (storages.count() > 0) { | 211 | if (storages.count() > 0) { | ||
212 | for (KMTPStorageInterface *storage : storages) { | 212 | for (KMTPStorageInterface *storage : storages) { | ||
213 | listEntry(getEntry(storage)); | 213 | listEntry(getEntry(storage)); | ||
214 | } | 214 | } | ||
215 | 215 | | |||
216 | finished(); | 216 | finished(); | ||
217 | qCDebug(LOG_KIO_MTP) << "[SUCCESS] :: Storages:" << storages.count(); | 217 | qCDebug(LOG_KIO_MTP) << "[SUCCESS] :: Storage media:" << storages.count(); | ||
218 | } else { | 218 | } else { | ||
219 | error(ERR_SLAVE_DEFINED, i18n("No storages found. Make sure your device is unlocked and has MTP enabled in its USB connection settings.")); | 219 | error(ERR_SLAVE_DEFINED, i18n("No storage media found. Make sure your device is unlocked and has MTP enabled in its USB connection settings.")); | ||
220 | } | 220 | } | ||
221 | } else { | 221 | } else { | ||
222 | // list files and folders | 222 | // list files and folders | ||
223 | const KMTPStorageInterface *storage = mtpDevice->storageFromDescription(pathItems.at(1)); | 223 | const KMTPStorageInterface *storage = mtpDevice->storageFromDescription(pathItems.at(1)); | ||
224 | if (storage) { | 224 | if (storage) { | ||
225 | int result; | 225 | int result; | ||
226 | const QString path = convertPath(url.path()); | 226 | const QString path = convertPath(url.path()); | ||
227 | const KMTPFileList files = storage->getFilesAndFolders(path, result); | 227 | const KMTPFileList files = storage->getFilesAndFolders(path, result); | ||
▲ Show 20 Lines • Show All 639 Lines • Show Last 20 Lines |