Changeset View
Changeset View
Standalone View
Standalone View
src/core/slavebase.h
Show First 20 Lines • Show All 356 Lines • ▼ Show 20 Line(s) | 63 | public: | |||
---|---|---|---|---|---|
357 | int configValue(QString key, int defaultValue) const; | 357 | int configValue(QString key, int defaultValue) const; | ||
358 | 358 | | |||
359 | /** | 359 | /** | ||
360 | * Returns a QString from the config/meta-data information. | 360 | * Returns a QString from the config/meta-data information. | ||
361 | * @since 5.64 | 361 | * @since 5.64 | ||
362 | */ | 362 | */ | ||
363 | QString configValue(QString key, const QString &defaultValue=QString()) const; | 363 | QString configValue(QString key, const QString &defaultValue=QString()) const; | ||
364 | 364 | | |||
365 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 64) | ||||
365 | /** | 366 | /** | ||
366 | * Returns a configuration object to query config/meta-data information | 367 | * Returns a configuration object to query config/meta-data information | ||
367 | * from. | 368 | * from. | ||
368 | * | 369 | * | ||
369 | * The application provides the slave with all configuration information | 370 | * The application provides the slave with all configuration information | ||
370 | * relevant for the current protocol and host. | 371 | * relevant for the current protocol and host. | ||
371 | * | 372 | * | ||
372 | * TODO KF6: remove, perhaps rename mapConfig() to config() | | |||
373 | * @deprecated since 5.64 use mapConfig instead | 373 | * @deprecated since 5.64 use mapConfig instead | ||
374 | */ | 374 | */ | ||
375 | KIOCORE_DEPRECATED KConfigGroup *config(); | 375 | KIOCORE_DEPRECATED_VERSION(5, 64, "Use SlaveBase::mapConfig()") | ||
376 | KConfigGroup *config(); | ||||
377 | // KF6: perhaps rename mapConfig() to config() when removing this | ||||
378 | #endif | ||||
376 | 379 | | |||
377 | /** | 380 | /** | ||
378 | * Returns an object that can translate remote filenames into proper | 381 | * Returns an object that can translate remote filenames into proper | ||
379 | * Unicode forms. This encoding can be set by the user. | 382 | * Unicode forms. This encoding can be set by the user. | ||
380 | */ | 383 | */ | ||
381 | KRemoteEncoding *remoteEncoding(); | 384 | KRemoteEncoding *remoteEncoding(); | ||
382 | 385 | | |||
383 | /////////// | 386 | /////////// | ||
▲ Show 20 Lines • Show All 348 Lines • ▼ Show 20 Line(s) | |||||
732 | * | 735 | * | ||
733 | * @param buffer buffer where data is stored | 736 | * @param buffer buffer where data is stored | ||
734 | * @return 0 on end of data, | 737 | * @return 0 on end of data, | ||
735 | * > 0 bytes read | 738 | * > 0 bytes read | ||
736 | * < 0 error | 739 | * < 0 error | ||
737 | **/ | 740 | **/ | ||
738 | int readData(QByteArray &buffer); | 741 | int readData(QByteArray &buffer); | ||
739 | 742 | | |||
743 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
740 | /** | 744 | /** | ||
741 | * It collects entries and emits them via listEntries | 745 | * It collects entries and emits them via listEntries | ||
742 | * when enough of them are there or a certain time | 746 | * when enough of them are there or a certain time | ||
743 | * frame exceeded (to make sure the app gets some | 747 | * frame exceeded (to make sure the app gets some | ||
744 | * items in time but not too many items one by one | 748 | * items in time but not too many items one by one | ||
745 | * as this will cause a drastic performance penalty). | 749 | * as this will cause a drastic performance penalty). | ||
746 | * @param _entry The UDSEntry containing all of the object attributes. | 750 | * @param _entry The UDSEntry containing all of the object attributes. | ||
747 | * @param ready set to true after emitting all items. @p _entry is not | 751 | * @param ready set to true after emitting all items. @p _entry is not | ||
748 | * used in this case | 752 | * used in this case | ||
749 | * @deprecated since 5.0. the listEntry(entry, true) indicated | 753 | * @deprecated since 5.0. the listEntry(entry, true) indicated | ||
750 | * that the entry listing was completed. However, each slave should | 754 | * that the entry listing was completed. However, each slave should | ||
751 | * already call finished() to also tell us that we're done listing. | 755 | * already call finished() to also tell us that we're done listing. | ||
752 | * You should make sure that finished() is called when the entry | 756 | * You should make sure that finished() is called when the entry | ||
753 | * listing is completed and simply remove the call to listEntry(entry, true). | 757 | * listing is completed and simply remove the call to listEntry(entry, true). | ||
754 | */ | 758 | */ | ||
755 | #ifndef KIOCORE_NO_DEPRECATED | 759 | KIOCORE_DEPRECATED_VERSION(5, 0, "See API docs") | ||
756 | KIOCORE_DEPRECATED void listEntry(const UDSEntry &_entry, bool ready); | 760 | void listEntry(const UDSEntry &_entry, bool ready); | ||
757 | #endif | 761 | #endif | ||
758 | 762 | | |||
759 | /** | 763 | /** | ||
760 | * It collects entries and emits them via listEntries | 764 | * It collects entries and emits them via listEntries | ||
761 | * when enough of them are there or a certain time | 765 | * when enough of them are there or a certain time | ||
762 | * frame exceeded (to make sure the app gets some | 766 | * frame exceeded (to make sure the app gets some | ||
763 | * items in time but not too many items one by one | 767 | * items in time but not too many items one by one | ||
764 | * as this will cause a drastic performance penalty). | 768 | * as this will cause a drastic performance penalty). | ||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Line(s) | |||||
819 | * | 823 | * | ||
820 | * @see checkCachedAuthentication | 824 | * @see checkCachedAuthentication | ||
821 | * @param info See AuthInfo. | 825 | * @param info See AuthInfo. | ||
822 | * @param errorMsg Error message to show | 826 | * @param errorMsg Error message to show | ||
823 | * @return a KIO error code: NoError (0), KIO::USER_CANCELED, or other error codes. | 827 | * @return a KIO error code: NoError (0), KIO::USER_CANCELED, or other error codes. | ||
824 | */ | 828 | */ | ||
825 | int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg = QString()); | 829 | int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg = QString()); | ||
826 | 830 | | |||
831 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 24) | ||||
827 | /** | 832 | /** | ||
828 | * @deprecated since KF 5.24, use openPasswordDialogV2. | 833 | * @deprecated since KF 5.24, use openPasswordDialogV2. | ||
829 | * The return value works differently: | 834 | * The return value works differently: | ||
830 | * instead of | 835 | * instead of | ||
831 | * if (!openPasswordDialog()) { error(USER_CANCELED); } | 836 | * if (!openPasswordDialog()) { error(USER_CANCELED); } | ||
832 | * store and pass the return value to error(), when NOT zero, | 837 | * store and pass the return value to error(), when NOT zero, | ||
833 | * as shown documentation for openPasswordDialogV2(). | 838 | * as shown documentation for openPasswordDialogV2(). | ||
834 | */ | 839 | */ | ||
835 | KIOCORE_DEPRECATED bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg = QString()); | 840 | KIOCORE_DEPRECATED_VERSION(5, 24, "Use SlaveBase::openPasswordDialogV2(...)") | ||
841 | bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg = QString()); | ||||
842 | #endif | ||||
836 | 843 | | |||
837 | /** | 844 | /** | ||
838 | * Checks for cached authentication based on parameters | 845 | * Checks for cached authentication based on parameters | ||
839 | * given by @p info. | 846 | * given by @p info. | ||
840 | * | 847 | * | ||
841 | * Use this function to check if any cached password exists | 848 | * Use this function to check if any cached password exists | ||
842 | * for the URL given by @p info. If @p AuthInfo::realmValue | 849 | * for the URL given by @p info. If @p AuthInfo::realmValue | ||
843 | * and/or @p AuthInfo::verifyPath flag is specified, then | 850 | * and/or @p AuthInfo::verifyPath flag is specified, then | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
886 | * } | 893 | * } | ||
887 | * \endcode | 894 | * \endcode | ||
888 | * | 895 | * | ||
889 | * @param info See AuthInfo. | 896 | * @param info See AuthInfo. | ||
890 | * @return @p true if @p info was successfully cached. | 897 | * @return @p true if @p info was successfully cached. | ||
891 | */ | 898 | */ | ||
892 | bool cacheAuthentication(const AuthInfo &info); | 899 | bool cacheAuthentication(const AuthInfo &info); | ||
893 | 900 | | |||
901 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
894 | /** | 902 | /** | ||
895 | * @deprecated for a very very long time, not implemented anymore | | |||
896 | * Probably dates back to model dialup times. | | |||
897 | * | | |||
898 | * Used by the slave to check if it can connect | 903 | * Used by the slave to check if it can connect | ||
899 | * to a given host. This should be called where the slave is ready | 904 | * to a given host. This should be called where the slave is ready | ||
900 | * to do a ::connect() on a socket. For each call to | 905 | * to do a ::connect() on a socket. For each call to | ||
901 | * requestNetwork must exist a matching call to | 906 | * requestNetwork must exist a matching call to | ||
902 | * dropNetwork, or the system will stay online until | 907 | * dropNetwork, or the system will stay online until | ||
903 | * KNetMgr gets closed (or the SlaveBase gets destructed)! | 908 | * KNetMgr gets closed (or the SlaveBase gets destructed)! | ||
904 | * | 909 | * | ||
905 | * If KNetMgr is not running, then this is a no-op and returns true | 910 | * If KNetMgr is not running, then this is a no-op and returns true | ||
906 | * | 911 | * | ||
907 | * @param host tells the netmgr the host the slave wants to connect | 912 | * @param host tells the netmgr the host the slave wants to connect | ||
908 | * to. As this could also be a proxy, we can't just take | 913 | * to. As this could also be a proxy, we can't just take | ||
909 | * the host currently connected to (but that's the default | 914 | * the host currently connected to (but that's the default | ||
910 | * value) | 915 | * value) | ||
911 | * | 916 | * | ||
912 | * @return true in theory, the host is reachable | 917 | * @return true in theory, the host is reachable | ||
913 | * false the system is offline and the host is in a remote network. | 918 | * false the system is offline and the host is in a remote network. | ||
919 | * | ||||
920 | * @deprecated Since 5.0, for a very very long time, not implemented anymore | ||||
921 | * Probably dates back to model dialup times. | ||||
914 | */ | 922 | */ | ||
915 | #ifndef KIOCORE_NO_DEPRECATED | 923 | KIOCORE_DEPRECATED_VERSION(5, 0, "Not implemented & used") | ||
916 | bool requestNetwork(const QString &host = QString()); | 924 | bool requestNetwork(const QString &host = QString()); | ||
917 | #endif | 925 | #endif | ||
918 | 926 | | |||
927 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
919 | /** | 928 | /** | ||
920 | * @deprecated for a very very long time, not implemented anymore | | |||
921 | * Probably dates back to model dialup times. | | |||
922 | * | 929 | * | ||
923 | * Used by the slave to withdraw a connection requested by | 930 | * Used by the slave to withdraw a connection requested by | ||
924 | * requestNetwork. This function cancels the last call to | 931 | * requestNetwork. This function cancels the last call to | ||
925 | * requestNetwork. If a client uses more than one internet | 932 | * requestNetwork. If a client uses more than one internet | ||
926 | * connection, it must use dropNetwork(host) to | 933 | * connection, it must use dropNetwork(host) to | ||
927 | * stop each request. | 934 | * stop each request. | ||
928 | * | 935 | * | ||
929 | * If KNetMgr is not running, then this is a no-op. | 936 | * If KNetMgr is not running, then this is a no-op. | ||
930 | * | 937 | * | ||
931 | * @param host the host passed to requestNetwork | 938 | * @param host the host passed to requestNetwork | ||
932 | * | 939 | * | ||
933 | * A slave should call this function every time it disconnect from a host. | 940 | * A slave should call this function every time it disconnect from a host. | ||
941 | * * | ||||
942 | * @deprecated Since 5.0, for a very very long time, not implemented anymore | ||||
943 | * Probably dates back to model dialup times. | ||||
934 | * */ | 944 | * */ | ||
935 | #ifndef KIOCORE_NO_DEPRECATED | 945 | KIOCORE_DEPRECATED_VERSION(5, 0, "Not implemented & used") | ||
936 | void dropNetwork(const QString &host = QString()); | 946 | void dropNetwork(const QString &host = QString()); | ||
937 | #endif | 947 | #endif | ||
938 | 948 | | |||
939 | /** | 949 | /** | ||
940 | * Wait for an answer to our request, until we get @p expected1 or @p expected2 | 950 | * Wait for an answer to our request, until we get @p expected1 or @p expected2 | ||
941 | * @return the result from readData, as well as the cmd in *pCmd if set, and the data in @p data | 951 | * @return the result from readData, as well as the cmd in *pCmd if set, and the data in @p data | ||
942 | */ | 952 | */ | ||
943 | int waitForAnswer(int expected1, int expected2, QByteArray &data, int *pCmd = nullptr); | 953 | int waitForAnswer(int expected1, int expected2, QByteArray &data, int *pCmd = nullptr); | ||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |