Changeset View
Changeset View
Standalone View
Standalone View
src/core/slavebase.cpp
Show First 20 Lines • Show All 747 Lines • ▼ Show 20 Line(s) | |||||
748 | } | 748 | } | ||
749 | 749 | | |||
750 | void SlaveBase::infoMessage(const QString &_msg) | 750 | void SlaveBase::infoMessage(const QString &_msg) | ||
751 | { | 751 | { | ||
752 | KIO_DATA << _msg; | 752 | KIO_DATA << _msg; | ||
753 | send(INF_INFOMESSAGE, data); | 753 | send(INF_INFOMESSAGE, data); | ||
754 | } | 754 | } | ||
755 | 755 | | |||
756 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 0) | ||||
756 | bool SlaveBase::requestNetwork(const QString &host) | 757 | bool SlaveBase::requestNetwork(const QString &host) | ||
757 | { | 758 | { | ||
758 | KIO_DATA << host << d->slaveid; | 759 | KIO_DATA << host << d->slaveid; | ||
759 | send(MSG_NET_REQUEST, data); | 760 | send(MSG_NET_REQUEST, data); | ||
760 | 761 | | |||
761 | if (waitForAnswer(INF_NETWORK_STATUS, 0, data) != -1) { | 762 | if (waitForAnswer(INF_NETWORK_STATUS, 0, data) != -1) { | ||
762 | bool status; | 763 | bool status; | ||
763 | QDataStream stream(data); | 764 | QDataStream stream(data); | ||
764 | stream >> status; | 765 | stream >> status; | ||
765 | return status; | 766 | return status; | ||
766 | } else { | 767 | } else { | ||
767 | return false; | 768 | return false; | ||
768 | } | 769 | } | ||
769 | } | 770 | } | ||
771 | #endif | ||||
770 | 772 | | |||
773 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 0) | ||||
771 | void SlaveBase::dropNetwork(const QString &host) | 774 | void SlaveBase::dropNetwork(const QString &host) | ||
772 | { | 775 | { | ||
773 | KIO_DATA << host << d->slaveid; | 776 | KIO_DATA << host << d->slaveid; | ||
774 | send(MSG_NET_DROP, data); | 777 | send(MSG_NET_DROP, data); | ||
775 | } | 778 | } | ||
779 | #endif | ||||
776 | 780 | | |||
777 | void SlaveBase::statEntry(const UDSEntry &entry) | 781 | void SlaveBase::statEntry(const UDSEntry &entry) | ||
778 | { | 782 | { | ||
779 | KIO_DATA << entry; | 783 | KIO_DATA << entry; | ||
780 | send(MSG_STAT_ENTRY, data); | 784 | send(MSG_STAT_ENTRY, data); | ||
781 | } | 785 | } | ||
782 | 786 | | |||
787 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 0) | ||||
783 | void SlaveBase::listEntry(const UDSEntry &entry, bool _ready) | 788 | void SlaveBase::listEntry(const UDSEntry &entry, bool _ready) | ||
784 | { | 789 | { | ||
785 | if (_ready) { | 790 | if (_ready) { | ||
786 | // #366795: many slaves don't create an entry for ".", so we keep track if they do | 791 | // #366795: many slaves don't create an entry for ".", so we keep track if they do | ||
787 | // and we provide a fallback in finished() otherwise. | 792 | // and we provide a fallback in finished() otherwise. | ||
788 | if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1Char('.')) { | 793 | if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1Char('.')) { | ||
789 | d->m_rootEntryListed = true; | 794 | d->m_rootEntryListed = true; | ||
790 | } | 795 | } | ||
791 | listEntries(d->pendingListEntries); | 796 | listEntries(d->pendingListEntries); | ||
792 | d->pendingListEntries.clear(); | 797 | d->pendingListEntries.clear(); | ||
793 | } else { | 798 | } else { | ||
794 | listEntry(entry); | 799 | listEntry(entry); | ||
795 | } | 800 | } | ||
796 | } | 801 | } | ||
802 | #endif | ||||
797 | 803 | | |||
798 | void SlaveBase::listEntry(const UDSEntry &entry) | 804 | void SlaveBase::listEntry(const UDSEntry &entry) | ||
799 | { | 805 | { | ||
800 | // #366795: many slaves don't create an entry for ".", so we keep track if they do | 806 | // #366795: many slaves don't create an entry for ".", so we keep track if they do | ||
801 | // and we provide a fallback in finished() otherwise. | 807 | // and we provide a fallback in finished() otherwise. | ||
802 | if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1Char('.')) { | 808 | if (entry.stringValue(KIO::UDSEntry::UDS_NAME) == QLatin1Char('.')) { | ||
803 | d->m_rootEntryListed = true; | 809 | d->m_rootEntryListed = true; | ||
804 | } | 810 | } | ||
▲ Show 20 Lines • Show All 188 Lines • ▼ Show 20 Line(s) | |||||
993 | } | 999 | } | ||
994 | 1000 | | |||
995 | void SlaveBase::reparseConfiguration() | 1001 | void SlaveBase::reparseConfiguration() | ||
996 | { | 1002 | { | ||
997 | delete d->remotefile; | 1003 | delete d->remotefile; | ||
998 | d->remotefile = nullptr; | 1004 | d->remotefile = nullptr; | ||
999 | } | 1005 | } | ||
1000 | 1006 | | |||
1007 | #if KIOCORE_BUILD_DEPRECATED_SINCE(5, 24) | ||||
1001 | bool SlaveBase::openPasswordDialog(AuthInfo &info, const QString &errorMsg) | 1008 | bool SlaveBase::openPasswordDialog(AuthInfo &info, const QString &errorMsg) | ||
1002 | { | 1009 | { | ||
1003 | const int errorCode = openPasswordDialogV2(info, errorMsg); | 1010 | const int errorCode = openPasswordDialogV2(info, errorMsg); | ||
1004 | return errorCode == KJob::NoError; | 1011 | return errorCode == KJob::NoError; | ||
1005 | } | 1012 | } | ||
1013 | #endif | ||||
1006 | 1014 | | |||
1007 | int SlaveBase::openPasswordDialogV2(AuthInfo &info, const QString &errorMsg) | 1015 | int SlaveBase::openPasswordDialogV2(AuthInfo &info, const QString &errorMsg) | ||
1008 | { | 1016 | { | ||
1009 | const long windowId = metaData(QStringLiteral("window-id")).toLong(); | 1017 | const long windowId = metaData(QStringLiteral("window-id")).toLong(); | ||
1010 | const unsigned long userTimestamp = metaData(QStringLiteral("user-timestamp")).toULong(); | 1018 | const unsigned long userTimestamp = metaData(QStringLiteral("user-timestamp")).toULong(); | ||
1011 | QString errorMessage; | 1019 | QString errorMessage; | ||
1012 | if (metaData(QStringLiteral("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) { | 1020 | if (metaData(QStringLiteral("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) { | ||
1013 | errorMessage = QStringLiteral("<NoAuthPrompt>"); | 1021 | errorMessage = QStringLiteral("<NoAuthPrompt>"); | ||
▲ Show 20 Lines • Show All 566 Lines • Show Last 20 Lines |