Changeset View
Changeset View
Standalone View
Standalone View
mtp/kio_mtp.cpp
Show First 20 Lines • Show All 587 Lines • ▼ Show 20 Line(s) | 587 | } else { | |||
---|---|---|---|---|---|
588 | error(ERR_UNSUPPORTED_ACTION, url.path()); | 588 | error(ERR_UNSUPPORTED_ACTION, url.path()); | ||
589 | } | 589 | } | ||
590 | } | 590 | } | ||
591 | 591 | | |||
592 | void MTPSlave::copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) | 592 | void MTPSlave::copy(const QUrl &src, const QUrl &dest, int, JobFlags flags) | ||
593 | { | 593 | { | ||
594 | qCDebug(LOG_KIO_MTP) << src.path() << dest.path(); | 594 | qCDebug(LOG_KIO_MTP) << src.path() << dest.path(); | ||
595 | 595 | | |||
596 | // mtp:/// to mtp:/// | | |||
597 | if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("mtp")) { | 596 | if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("mtp")) { | ||
598 | qCDebug(LOG_KIO_MTP) << "Copy on device: Not supported"; | 597 | qCDebug(LOG_KIO_MTP) << "Copy on device: Not supported"; | ||
599 | // MTP doesn't support moving files directly on the device, so we have to download and then upload... | 598 | // MTP doesn't support moving files directly on the device, so we have to download and then upload... | ||
600 | 599 | | |||
601 | error(ERR_UNSUPPORTED_ACTION, i18n("Cannot copy/move files on the device itself")); | 600 | error(ERR_UNSUPPORTED_ACTION, i18n("Cannot copy/move files on the device itself")); | ||
602 | } | 601 | } else if (src.scheme() == QLatin1String("file") && dest.scheme() == QLatin1String("mtp")) { | ||
603 | // file:/// tp mtp:/// | | |||
604 | if (src.scheme() == QLatin1String("file") && dest.scheme() == QLatin1String("mtp")) { | | |||
605 | int check = checkUrl(dest); | 602 | int check = checkUrl(dest); | ||
606 | switch (check) { | 603 | switch (check) { | ||
607 | case 0: | 604 | case 0: | ||
608 | break; | 605 | break; | ||
609 | default: | 606 | default: | ||
610 | error(ERR_MALFORMED_URL, dest.path()); | 607 | error(ERR_MALFORMED_URL, dest.path()); | ||
611 | return; | 608 | return; | ||
612 | } | 609 | } | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | |||||
675 | if (ret != 0) { | 672 | if (ret != 0) { | ||
676 | error(KIO::ERR_COULD_NOT_WRITE, urlFileName(dest)); | 673 | error(KIO::ERR_COULD_NOT_WRITE, urlFileName(dest)); | ||
677 | LIBMTP_Dump_Errorstack(device); | 674 | LIBMTP_Dump_Errorstack(device); | ||
678 | LIBMTP_Clear_Errorstack(device); | 675 | LIBMTP_Clear_Errorstack(device); | ||
679 | return; | 676 | return; | ||
680 | } | 677 | } | ||
681 | 678 | | |||
682 | qCDebug(LOG_KIO_MTP) << "Sent file"; | 679 | qCDebug(LOG_KIO_MTP) << "Sent file"; | ||
683 | } | 680 | } else if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("file")) { | ||
684 | // mtp:/// to file:/// | | |||
685 | if (src.scheme() == QLatin1String("mtp") && dest.scheme() == QLatin1String("file")) { | | |||
686 | int check = checkUrl(src); | 681 | int check = checkUrl(src); | ||
687 | switch (check) { | 682 | switch (check) { | ||
688 | case 0: | 683 | case 0: | ||
689 | break; | 684 | break; | ||
690 | default: | 685 | default: | ||
691 | error(ERR_MALFORMED_URL, src.path()); | 686 | error(ERR_MALFORMED_URL, src.path()); | ||
692 | return; | 687 | return; | ||
693 | } | 688 | } | ||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |