class KProtocolManager

Information about I/O (Internet, etc. More...

Definition#include <kprotocolmanager.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Static Methods


Detailed Description

Information about I/O (Internet, etc.) settings.

KProtocolManager has a heap of static functions that allow you to read and write IO related KDE settings. These include proxies, resuming, timeouts.

However, please note that these settings apply to all applications. This means that the proxy, timeouts etc. are saved in the users config file and not in the config file of the application.

int  readTimeout ()

readTimeout

[static]

bool  markPartial ()

markPartial

[static]

int  minimumKeepSize ()

minimumKeepSize

[static]

bool  autoResume ()

autoResume

[static]

bool  persistentConnections ()

persistentConnections

[static]

int  connectTimeout ()

connectTimeout

[static]

Returns the preffered timeout value for remote connections in secs.

The maximum value that can be set by the user is 6 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultConnectTimeout().

Returns: timeout value for remote connection in secs.

int  proxyConnectTimeout ()

proxyConnectTimeout

[static]

Returns the preffered timeout value for proxy connections in secs.

The maximum value that can be set by the user is 2 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultProxyConnectTimeout()

Returns: timeout value for proxy connection in secs.

int  responseTimeout ()

responseTimeout

[static]

Returns the preffered response timeout value for remote connecting in secs.

The maximum value that can be set by the user is 6 minutes while the minimum is 3 seconds. If the value is set above or below the threshold limit, this function will return the default value given by defaultResponseTimeout()

Returns: timeout value for remote connection in secs.

int  defaultConnectTimeout ()

defaultConnectTimeout

[static]

Returns (in seconds) the set default timeout value for connecting to remote machines.

This method returns the value defined by DEFAULT_CONNECT_TIMEOUT in the source file.

int  defaultProxyConnectTimeout ()

defaultProxyConnectTimeout

[static]

Returns (in seconds) the set default timeout value for connecting to a proxy machine.

This method returns the value defined by DEFAULT_PROXY_CONNECT_TIMEOUT in the source file.

int  defaultResponseTimeout ()

defaultResponseTimeout

[static]

Returns (in seconds) the set default timeout value for connecting to a proxy machine.

This method returns the value defined by DEFAULT_RESPONSE_TIMEOUT in the source file.

int  minimumTimeoutThreshold ()

minimumTimeoutThreshold

[static]

Returns the minimum timeout value that can be assigned for connecting and responses to and from remote and proxy machines.

This method returns the value defined by MIN_TIMEOUT_VALUE in the source file.

bool  useProxy ()

useProxy

[static]

Returns whether or not the user specified the use of proxy server to make connections.

QString  ftpProxy ()

ftpProxy

[static]

QString  httpProxy ()

httpProxy

[static]

QString  noProxyFor ()

noProxyFor

[static]

Returns the strings for hosts that should contacted DIRECT bypassing any proxy settings.

QString  proxyFor ( const QString& )

proxyFor

[static]

QString  proxyForURL ( const KURL& )

proxyForURL

[static]

Returns the Proxy server address for a given URL If automatic proxy configuration is configured, KPAC is used to determine the proxy server, otherwise the return value of proxyFor for the URL's protocol is used. If an empty string is returned, the request is to be aborted, a return value of "DIRECT" requests a direct connection.

Parameters:
urlthe URL whose proxy info is needed

Returns: the proxy server address if one is available

void  badProxy ( const QString & )

badProxy

[static]

Marks this proxy as bad (down). It will not be used for the next 30 minutes. (The script may supply an alternate proxy)

bool  hasProxyConfigScript ()

hasProxyConfigScript

[static]

Returns whether a proxy config script is being used

Returns: true if a proxy config script is used

QString  slaveProtocol ( const QString & protocol )

slaveProtocol

[static]

Return the protocol to use in order to handle the given protocol It's usually the same, except that FTP, when handled by a proxy, needs an HTTP ioslave.

bool  useCache ()

useCache

[static]

Returns true/false to indicate whether a cache should be used

int  maxCacheAge ()

maxCacheAge

[static]

Returns the maximum age (in seconds) cached files should be kept before they are deleted.

int  maxCacheSize ()

maxCacheSize

[static]

Returns the maximum age (in seconds) cached files should be kept before they are deleted.

void  setReadTimeout ( int _time )

setReadTimeout

[static]

Sets timeout for read operations. This applies to FTP and HTTP connections. If after a time timeout, the read operation doesn't finish reading a packet, the read operation is stopped with alarm command and the operation is restarted. This value is used if the remote server supports resuming. For the opposite case see setReadTimeoutNoResume()

void  setMarkPartial ( bool _mode )

setMarkPartial

[static]

Set this flag if you want slaves to add the extension .PART to all files during transfer. This extension will be removed when file is fully transferred.

This is a better way to discern finished transfers in case of transfer errors.

Parameters:
_modeDefault value is false: Don't add the extension .PART.

void  setMinimumKeepSize ( int _size )

setMinimumKeepSize

[static]

Set the minimum size for keeping an interrupted transfer.

A downloaded file whose transfer was interrupted will only be kept if its size is bigger than @ _size, otherwise it will be deleted.

Default value is 5000 bytes

void  setAutoResume ( bool _mode )

setAutoResume

[static]

Set this flag if you want slaves to automatically resume downloading files without asking the user in the "rename" dialog.

Parameters:
_modeDefault value is false: Don't resume automatically.

void  setPersistentConnections ( bool _mode )

setPersistentConnections

[static]

Set this flag if you want slaves to have persistent connections (FTP).

Parameters:
_modeDefault value is true: Keep persistent connections.

void  setUseCache ( bool _mode )

setUseCache

[static]

void  setMaxCacheSize ( int cache_size )

setMaxCacheSize

[static]

void  setMaxCacheAge ( int cache_age )

setMaxCacheAge

[static]

void  setUseProxy ( bool _mode )

setUseProxy

[static]

Set this flag if you want use proxies.

Parameters:
Defaultvalue is false: Don't use proxies.

void  setFtpProxy ( const QString& _proxy )

setFtpProxy

[static]

Set the proxy for FTP transfer.

This method has been deprecated, please use setProxyFor.

void  setHttpProxy ( const QString& _proxy )

setHttpProxy

[static]

Set the proxy for HTTP transfer

This method has been deprecated, please use setProxyFor.

void  setProxyFor ( const QString& , const QString& )

setProxyFor

[static]

void  setNoProxyFor ( const QString& _noproxy )

setNoProxyFor

[static]

Set the URLs for which we should not use the proxy.

void  setProxyConfigScript ( const QString & )

setProxyConfigScript

[static]

Set the URL of the script for automatic proxy configuration

void  reparseConfiguration ()

reparseConfiguration

[static]

Force a reload of the general config file of io-slaves ( kioslaverc).

QString  userAgentForHost ( const QString& )

userAgentForHost

[static]

Returns the userAgent string configured for the specified host.

If hostname is not found or is empty (i.e. "" or QString::null) this function will return the default agent string as defined above in DEFAULT_USERAGENT_STRING.

Parameters:
hostnamename of the host

Returns: specified userAgent string

void  setUserAgentList ( const QStringList& )

setUserAgentList

[static]

Sets the list of userAgent.

Sets the user agent name to be sent when connecting to different sites. The default user agent string is defined above by DEFAULT_USERAGENT_STRING.

Parameters:
listthe list of user agent strings to use.

QStringList  userAgentList ()

userAgentList

[static]

Returns the list of user agents.

Returns: the list of user agent strings.