KProtocolInfo Class Reference
from PyKDE4.kdecore import *
Inherits: KSycocaEntry
Detailed Description
\class KProtocolInfo kprotocolinfo.h <KProtocolInfo>
Information about I/O (Internet, etc.) protocols supported by KDE.
This class is useful if you want to know which protocols KDE supports. In addition you can find out lots of information about a certain protocol. A KProtocolInfo instance represents a single protocol. Most of the functionality is provided by the static methods that scan the *.protocol files of all installed kioslaves to get this information.
*.protocol files are installed in the "services" resource.
Method Documentation
__init__ | ( | self, | ||
QDataStream | _str, | |||
int | offset | |||
) |
- Internal:
- construct a KProtocolInfo from a stream
__init__ | ( | self, | ||
QString | path | |||
) |
Read a protocol description file
- Parameters:
-
path the path of the description file
QStringList archiveMimeTypes | ( | self ) |
@internal. Use KProtocolManager instead.
bool canDeleteRecursive | ( | self ) |
bool canRenameFromFile | ( | self ) |
bool canRenameToFile | ( | self ) |
QStringList capabilities | ( | QString | protocol | |
) |
Returns the list of capabilities provided by the kioslave implementing this protocol.
This corresponds to the "Capabilities=" field in the protocol description file.
The capability names are not defined globally, they are up to each slave implementation. For example when adding support for a new special command for mounting, one would add the string "Mount" to the capabilities list, and applications could check for that string before sending a special() command that would otherwise do nothing on older kioslave implementations.
- Parameters:
-
protocol the protocol to check
- Returns:
- the list of capabilities.
Returns the name of the config file associated with the specified protocol. This is useful if two similar protocols need to share a single config file, e.g. http and https.
This corresponds to the "config=" field in the protocol description file. The default is the protocol name, see name()
- Parameters:
-
protocol the protocol to check
- Returns:
- the config file, or an empty string if unknown
QString defaultMimeType | ( | self ) |
@internal. Use KProtocolManager instead.
bool determineMimetypeFromExtension | ( | QString | protocol | |
) |
Returns whether mimetypes can be determined based on extension for this protocol. For some protocols, e.g. http, the filename extension in the URL can not be trusted to truly reflect the file type.
This corresponds to the "determineMimetypeFromExtension=" field in the protocol description file. Valid values for this field are "true" (default) or "false".
- Parameters:
-
protocol the protocol to check
- Returns:
- true if the mime types can be determined by extension
Returns the documentation path for the specified protocol.
This corresponds to the "X-DocPath=" or "DocPath=" field in the protocol description file.
- Parameters:
-
protocol the protocol to check
- Returns:
- the docpath of the protocol, or an empty string if unknown
Returns the library / executable to open for the protocol protocol Example : "kio_ftp", meaning either the executable "kio_ftp" or the library "kio_ftp.la" (recommended), whichever is available.
This corresponds to the "exec=" field in the protocol description file.
- Parameters:
-
protocol the protocol to check
- Returns:
- the executable of library to open, or QString() for unsupported protocols
- See also:
- KUrl.protocol()
KProtocolInfo.ExtraFieldList extraFields | ( | KUrl | url | |
) |
Definition of extra fields in the UDS entries, returned by a listDir operation.
This corresponds to the "ExtraNames=" and "ExtraTypes=" fields in the protocol description file. Those two lists should be separated with ',' in the protocol description file. See ExtraField for details about names and types
KProtocolInfo.FileNameUsedForCopying fileNameUsedForCopying | ( | self ) |
Returns the name of the icon, associated with the specified protocol.
This corresponds to the "Icon=" field in the protocol description file.
- Parameters:
-
protocol the protocol to check
- Returns:
- the icon of the protocol, or an empty string if unknown
bool isFilterProtocol | ( | KUrl | url | |
) |
Returns whether the protocol can act as a filter protocol.
A filter protocol can operate on data that is passed to it but does not retrieve/store data itself, like gzip. A filter protocol is the opposite of a source protocol.
The "source=" field in the protocol description file determines whether a protocol is a source protocol or a filter protocol. Valid values for this field are "true" (default) for source protocol or "false" for filter protocol.
- Parameters:
-
url the url to check
- Returns:
- true if the protocol is a filter (e.g. gzip), false if the protocol is a helper or source
bool isFilterProtocol | ( | QString | protocol | |
) |
Same as above except you can supply just the protocol instead of the whole URL.
bool isHelperProtocol | ( | KUrl | url | |
) |
Returns whether the protocol can act as a helper protocol. A helper protocol invokes an external application and does not return a file or stream.
This corresponds to the "helper=" field in the protocol description file. Valid values for this field are "true" or "false" (default).
- Parameters:
-
url the url to check
- Returns:
- true if the protocol is a helper protocol (e.g. vnc), false if not (e.g. http)
bool isHelperProtocol | ( | QString | protocol | |
) |
Same as above except you can supply just the protocol instead of the whole URL.
bool isKnownProtocol | ( | KUrl | url | |
) |
Returns whether a protocol is installed that is able to handle url.
- Parameters:
-
url the url to check
- Returns:
- true if the protocol is known
- See also:
- name()
bool isKnownProtocol | ( | QString | protocol | |
) |
Same as above except you can supply just the protocol instead of the whole URL.
int maxSlaves | ( | QString | protocol | |
) |
Returns the soft limit on the number of slaves for this protocol. This limits the number of slaves used for a single operation, note that multiple operations may result in a number of instances that exceeds this soft limit.
This corresponds to the "maxInstances=" field in the protocol description file. The default is 1.
- Parameters:
-
protocol the protocol to check
- Returns:
- the maximum number of slaves, or 1 if unknown
Returns the protocol class for the specified protocol.
This corresponds to the "Class=" field in the protocol description file.
The following classes are defined:
Protocol classes always start with a ':' so that they can not be confused with the protocols themselves.
- Parameters:
-
protocol the protocol to check
- Returns:
- the class of the protocol, or an empty string if unknown
QStringList protocols | ( | ) |
Returns list of all known protocols.
- Returns:
- a list of all known protocols
Returns the name of the protocol through which the request will be routed if proxy support is enabled.
A good example of this is the ftp protocol for which proxy support is commonly handled by the http protocol.
This corresponds to the "ProxiedBy=" in the protocol description file.
bool showFilePreview | ( | QString | protocol | |
) |
Returns whether file previews should be shown for the specified protocol.
This corresponds to the "ShowPreviews=" field in the protocol description file.
By default previews are shown if protocolClass is :local.
- Parameters:
-
protocol the protocol to check
- Returns:
- true if previews should be shown by default, false otherwise
bool supportsListing | ( | self ) |
@internal. Use KProtocolManager instead.
Enumeration Documentation
FileNameUsedForCopying |
- Enumerator:
-
Name FromUrl
Type |
Describes the type of a protocol. For instance ftp:// appears as a filesystem with folders and files, while bzip2:// appears as a single file (a stream of data), and telnet:// doesn't output anything.
- See also:
- outputType
- Enumerator:
-
T_STREAM T_FILESYSTEM T_NONE T_ERROR