Namespace KIO |
|
|
A namespace for KIO globals
|
|
Returns a translated error message for errorCode using the additional error information provided by errorText. errorCode - the error code errorText - the additional error text Returns the created error string |
|
Returns a translated html error message for errorCode using the additional error information provided by errorText , reqUrl (the request URL), and the ioslave method . errorCode - the error code errorText - the additional error text reqUrl - the request URL method - the ioslave method Returns the created error string |
|
Calculates remaining time from total size, processed size and speed. Warning: As QTime is limited to 23:59:59, use calculateRemainingSeconds() instead
- totalSize total size in bytes - processedSize processed size in bytes - speed speed in bytes per second Returns calculated remaining time |
|
Calculates remaining time in seconds from total size, processed size and speed.
- totalSize total size in bytes - processedSize processed size in bytes - speed speed in bytes per second Returns calculated remaining time in seconds |
|
Creates a job that changes permissions/ownership on several files or directories, optionally recursively. This version of chmod uses a KFileItemList so that it directly knows what to do with the items. TODO: a version that takes a KUrl.List, and a general job that stats each url and returns a KFileItemList. Note that change of ownership is only supported for local files. Inside directories, the "x" bits will only be changed for files that had at least one "x" bit before, and for directories. This emulates the behavior of chmod +X.
lstItems - The file items representing several files or directories. permissions - the permissions we want to set mask - the bits we are allowed to change. For instance, if mask is 0077, we don't change the "user" bits, only "group" and "others". newOwner - If non-empty, the new owner for the files newGroup - If non-empty, the new group for the files recursive - whether to open directories recursively showProgressInfo - true to show progress information Returns The job handling the operation. |
|
Changes permissions on a file or directory. See the other chmod below for changing many files or directories.
url - The URL of file or directory. permissions - The permissions to set. Returns the job handling the operation. |
|
Changes ownership and group of a file or directory.
url - The URL of file or directory. owner - the new owner group - the new group Returns the job handling the operation. |
|
Convert seconds to a string representing number of days, hours, minutes and seconds
- seconds number of seconds to convert Returns string representation in a locale depending format |
|
Converts size from bytes to the string representation.
- size size in bytes Returns converted size as a string - e.g. 123.4 KiB , 12.0 MiB |
|
Converts size from kibi-bytes (2^10) to the string representation.
- kibSize size in kibi-bytes (2^10) Returns converted size as a string - e.g. 123.4 KiB , 12.0 MiB |
|
Copy a file or directory src into the destination dest, which can be a file (including the final filename) or a directory (into which src will be copied). This emulates the cp command completely.
src - the file or directory to copy dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation See also copyAs() |
|
Copy a list of file/dirs src into a destination directory dest.
src - the list of files and/or directories dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation |
|
Copy a file or directory src into the destination dest, which is the destination name in any case, even for a directory. As opposed to copy(), this doesn't emulate cp, but is the only way to copy a directory, giving it a new name and getting an error box if a directory already exists with the same name.
src - the file or directory to copy dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation |
|
Creates a new DavJob that issues a PROPFIND command. PROPFIND retrieves the properties of the resource identified by the given url.
url - the URL of the resource properties - a propfind document that describes the properties that should be retrieved depth - the depth of the request. Can be "0", "1" or "infinity" showProgressInfo - true to show progress information Returns the new DavJob |
|
Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets the properties of the resource identified by the given url.
url - the URL of the resource properties - a PROPPACTCH document that describes the properties that should be modified and its new values showProgressInfo - true to show progress information Returns the new DavJob |
|
Creates a new DavJob that issues a SEARCH command.
url - the URL of the resource nsURI - the URI of the search method's qualified name qName - the local part of the search method's qualified name query - the search string showProgressInfo - true to show progress information Returns the new DavJob |
|
Decodes (from the filename to the text displayed) This translates %2[fF] into / and %% into % str - the file name to decode Returns the decoded file name |
|
|
|
Computes a directory size (by doing a recursive listing). Connect to the result signal. Use NetAccess.synchronousRun for a synchronous version. This one lists a single directory. |
|
Computes a directory size (by doing a recursive listing). Connect to the result signal. Use NetAccess.synchronousRun for a synchronous version. This one lists the items from lstItems. The reason we asks for items instead of just urls, is so that we directly know if the item is a file or a directory, and in case of a file, we already have its size. |
|
Encodes (from the text displayed to the real filename) This translates % into %% and / into %2f Used by KIO.link, for instance. str - the file name to encode Returns the encoded file name |
|
Retrieves meta information for the given items.
items - files to get metainfo for Returns the MetaInfoJob to retrieve the items |
|
Retrieves meta information for the given items.
items - files to get metainfo for Returns the MetaInfoJob to retrieve the items |
|
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
items - files to get previews for width - the maximum width to use height - the maximum height to use, if this is 0, the same value as width is used. iconSize - the size of the mimetype icon to overlay over the preview or zero to not overlay an icon. This has no effect if the preview plugin that will be used doesn't use icon overlays. iconAlpha - transparency to use for the icon overlay scale - if the image is to be scaled to the requested size or returned in its original size save - if the image should be cached for later use enabledPlugins - if non-zero, this points to a list containing the names of the plugins that may be used. Returns the new PreviewJob See also PreviewJob.availablePlugins() |
|
Creates a PreviewJob to generate or retrieve a preview image for the given URL.
items - files to get previews for width - the maximum width to use height - the maximum height to use, if this is 0, the same value as width is used. iconSize - the size of the mimetype icon to overlay over the preview or zero to not overlay an icon. This has no effect if the preview plugin that will be used doesn't use icon overlays. iconAlpha - transparency to use for the icon overlay scale - if the image is to be scaled to the requested size or returned in its original size save - if the image should be cached for later use enabledPlugins - if non-zero, this points to a list containing the names of the plugins that may be used. Returns the new PreviewJob See also PreviewJob.availablePlugins() |
|
Copy a single file. Uses either SlaveBase.copy() if the slave supports that or get() and put() otherwise. src - Where to get the file. dest - Where to put the file. permissions - May be -1. In this case no special permission mode is set. overwrite - If true, any existing file will be overwritten. resume - true to resume an operation. Warning, setting this to true means that src will be appended to dest if dest exists. You probably don't want that, so leave it to false :)
showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Delete a single file.
src - File to delete. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Move a single file. Use either SlaveBase.rename() if the slave supports that, or copy() and del() otherwise, or eventually get() & put() & del() src - Where to get the file. dest - Where to put the file. permissions - May be -1. In this case no special permission mode is set. overwrite - If true, any existing file will be overwritten. resume - true to resume an operation. Warning, setting this to true means that src will be appended to dest if dest exists. You probably don't want that, so leave it to false :) showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Get (a.k.a. read). The slave emits the data through data(). url - the URL of the file reload - true to reload the file, false if it can be taken from the cache showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Returns a string representation of the given cache control method.
cacheControl - the cache control method Returns the string representation See also parseCacheControl() |
|
|
HTTP POST (for form data). Example: job = KIO.http_post( url, postData, false ); job->addMetaData("content-type", contentType ); job->addMetaData("referrer", referrerURL); postData is the data that you want to send and contentType is the complete HTTP header line that specifies the content's MIME type, for example "Content-Type: text/xml". You MUST specify content-type! Often contentType is "Content-Type: application/x-www-form-urlencoded" and the postData is then an ASCII string (without null-termination!) with characters like space, linefeed and percent escaped like %20, %0A and %25.
url - Where to write the data. postData - Encoded data to post. showProgressInfo - true to display Returns the job handling the operation. |
|
HTTP cache update
url - Url to update, protocol must be "http". no_cache - If true, cache entry for url is deleted. expireDate - Local machine time indicating when the entry is supposed to expire. Returns the job handling the operation. |
|
Helper for showing information about a set of files and directories items - the number of items (= files + dirs + number of symlinks :) files - the number of files dirs - the number of dirs size - the sum of the size of the files showSize - whether to show the size in the result Returns the summary string |
|
Create a link. If the protocols and hosts are the same, a Unix symlink will be created. Otherwise, a .desktop file of Type Link and pointing to the src URL will be created.
src - The existing file or directory, 'target' of the link. destDir - Destination directory where the link will be created. showProgressInfo - true to show progress information Returns the job handling the operation |
|
Create several links If the protocols and hosts are the same, a Unix symlink will be created. Otherwise, a .desktop file of Type Link and pointing to the src URL will be created.
src - The existing files or directories, 'targets' of the link. destDir - Destination directory where the links will be created. showProgressInfo - true to show progress information Returns the job handling the operation See also link() |
|
Create a link. Unlike link() this operation will fail when the directory already exists. If the protocols and hosts are the same, a Unix symlink will be created. Otherwise, a .desktop file of Type Link and pointing to the src URL will be created.
src - The existing file or directory, 'target' of the link. dest - Destination directory where the link will be created. showProgressInfo - true to show progress information Returns the job handling the operation See also link () See also copyAs() |
|
List the contents of url, which is assumed to be a directory. "." and ".." are returned, filter them out if you don't want them.
url - the url of the directory showProgressInfo - true to show progress information includeHidden - true for all files, false to cull out UNIX hidden files/dirs (whose names start with dot) Returns the job handling the operation. |
|
The same as the previous method, but recurses subdirectories. Directory links are not followed. "." and ".." are returned but only for the toplevel directory. Filter them out if you don't want them.
url - the url of the directory showProgressInfo - true to show progress information includeHidden - true for all files, false to cull out UNIX hidden files/dirs (whose names start with dot) Returns the job handling the operation. |
|
Find mimetype for one file or directory.
url - the URL of the file showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Creates a single directory.
url - The URL of the directory to create. permissions - The permissions to set after creating the directory (unix-style), -1 for default permissions. Returns A pointer to the job handling the operation. |
|
Mount filesystem. Special job for kio_file.
ro - Mount read-only if true. fstype - File system type (e.g. "ext2", can be empty). dev - Device (e.g. /dev/sda0). point - Mount point, can be null. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Moves a file or directory src to the given destination dest.
src - the file or directory to copy dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation See also copy() See also moveAs() |
|
Moves a list of files or directories src to the given destination dest.
src - the list of files or directories to copy dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation See also copy() |
|
Moves a file or directory src to the given destination dest. Unlike move() this operation will fail when the directory already exists.
src - the file or directory to copy dest - the destination showProgressInfo - true to show progress information Returns the job handling the operation See also copyAs() |
|
Creates a new multiple get job.
id - the id of the get operation url - the URL of the file metaData - the MetaData associated with the file Returns the job handling the operation. See also get() |
|
Converts a size to a string representation Not unlike QString.number(...)
size - size in bytes Returns converted size as a string - e.g. 123456789 |
|
Open ( random access I/O ) The file-job emits open() when opened url - the URL of the file mode - the access privileges: see OpenMode Returns The file-handling job. It will never return 0. Errors are handled asynchronously (emitted as signals). |
|
Parses the string representation of the cache control option.
cacheControl - the string representation Returns the cache control value See also getCacheControlString() |
|
Returns the text to use for the Paste action, when the application supports pasting files, urls, and clipboard data, using pasteClipboard(). Returns a string suitable for KAction.setText, or an empty string if pasting isn't possible right now. |
|
Pastes the content of the clipboard to the given destination URL. URLs are treated separately (performing a file copy) from other data (which is saved into a file after asking the user to choose a filename and the preferred data format)
destURL - the URL to receive the data widget - parent widget to use for dialogs move - true to move the data, false to copy Returns the job that handles the operation See also pasteData() |
|
Pastes the given data to the given destination URL. NOTE: This method is blocking (uses NetAccess for saving the data). Please consider using pasteDataAsync instead.
destURL - the URL of the directory where the data will be pasted. The filename to use in that directory is prompted by this method. data - the data to copy widget - parent widget to use for dialogs See also pasteClipboard() |
|
Pastes the given data to the given destination URL. Note that this method requires the caller to have chosen the QByteArray to paste before hand, unlike pasteClipboard and pasteMimeSource.
destURL - the URL of the directory where the data will be pasted. The filename to use in that directory is prompted by this method. data - the data to copy dialogText - the text to show in the dialog See also pasteClipboard() |
|
Save the given mimesource data to the given destination URL after offering the user to choose a data format. This is the method used when handling drops (of anything else than URLs) onto kdesktop and konqueror.
data - the QMimeData (from a QDropEvent or from the clipboard when pasting) destURL - the URL of the directory where the data will be pasted. The filename to use in that directory is prompted by this method. dialogText - the text to show in the dialog widget - parent widget to use for dialogs clipboard - whether the QMimeSource comes from QClipboard. If you use pasteClipboard for that case, you never have to worry about this parameter. See also pasteClipboard() |
|
Convenience method to find the pixmap for a URL. Call this one when you don't know the mimetype.
_url - URL for the file. _mode - the mode of the file. The mode may modify the icon with overlays that show special properties of the icon. Use 0 for default _group - The icon group where the icon is going to be used. _force_size - Override globally configured icon size. Use 0 for the default size _state - The icon state, one of: K3Icon.DefaultState, K3Icon.ActiveState or K3Icon.DisabledState. _path - Output parameter to get the full path. Seldom needed. Ignored if 0 Returns the pixmap of the URL, can be a default icon if not found |
|
Put (a.k.a. write)
url - Where to write data. permissions - May be -1. In this case no special permission mode is set. overwrite - If true, any existing file will be overwritten. resume - true to resume an operation. Warning, setting this to true means that the data will be appended to dest if dest exists. showProgressInfo - true to show progress information Returns the job handling the operation. See also multi_get() |
|
Returns translated error details for errorCode using the additional error information provided by errorText , reqUrl (the request URL), and the ioslave method .
errorCode - the error code errorText - the additional error text reqUrl - the request URL method - the ioslave method Returns the following data: |
|
Rename a file or directory. Warning: this operation fails if a direct renaming is not possible (like with files or dirs on separate partitions) Use move or file_move in this case.
src - The original URL dest - The final URL overwrite - whether to automatically overwrite if the dest exists Returns the job handling the operation. |
|
Removes a single directory. The directory is assumed to be empty.
url - The URL of the directory to remove. Returns A pointer to the job handling the operation. |
|
Changes the modification time on a file or directory.
url - The URL of file or directory. permissions - The permissions to set. Returns the job handling the operation. |
|
Execute any command that is specific to one slave (protocol). Examples are : HTTP POST, mount and unmount (kio_file)
url - The URL isn't passed to the slave, but is used to know which slave to send it to :-) data - Packed data. The meaning is completely dependent on the slave, but usually starts with an int for the command number. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Find all details for one file or directory.
url - the URL of the file showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Find all details for one file or directory. This version of the call includes two additional booleans, sideIsSource and details.
url - the URL of the file side - is SourceSide when stating a source file (we will do a get on it if the stat works) and DestinationSide when stating a destination file (target of a copy). The reason for this parameter is that in some cases the kioslave might not be able to determine a file's existence (e.g. HTTP doesn't allow it, FTP has issues with case-sensitivity on some systems). When the slave can't reliably determine the existence of a file, it will:
details - selects the level of details we want. By default this is 2 (all details wanted, including modification time, size, etc.), setDetails(1) is used when deleting: we don't need all the information if it takes too much time, no need to follow symlinks etc. setDetails(0) is used for very simple probing: we'll only get the answer "it's a file or a directory, or it doesn't exist". This is used by KRun. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Find all details for one file or directory. This version of the call includes two additional booleans, sideIsSource and details.
url - the URL of the file sideIsSource - is true when stating a source file (we will do a get on it if the stat works) and false when stating a destination file (target of a copy). The reason for this parameter is that in some cases the kioslave might not be able to determine a file's existence (e.g. HTTP doesn't allow it, FTP has issues with case-sensitivity on some systems). When the slave can't reliably determine the existence of a file, it will:
details - selects the level of details we want. By default this is 2 (all details wanted, including modification time, size, etc.), setDetails(1) is used when deleting: we don't need all the information if it takes too much time, no need to follow symlinks etc. setDetails(0) is used for very simple probing: we'll only get the answer "it's a file or a directory, or it doesn't exist". This is used by KRun. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Get (a.k.a. read), into a single QByteArray. See also StoredTransferJob
url - the URL of the file reload - true to reload the file, false if it can be taken from the cache showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Put (a.k.a. write) data from a single QByteArray. See also StoredTransferJob
arr - The data to write url - Where to write data. permissions - May be -1. In this case no special permission mode is set. overwrite - If true, any existing file will be overwritten. resume - true to resume an operation. Warning, setting this to true means that the data will be appended to dest if dest exists. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Create or move a symlink. This is the lowlevel operation, similar to file_copy and file_move. It doesn't do any check (other than those the slave does) and it doesn't show rename and skip dialogs - use KIO.link for that. target - The string that will become the "target" of the link (can be relative) dest - The symlink to create. overwrite - whether to automatically overwrite if the dest exists showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Trash a file or directory. This is currently only supported for local files and directories. Use "KUrl src; src.setPath( path );" to create a URL from a path.
src - file to delete showProgressInfo - true to show progress information Returns the job handling the operation |
|
Trash a list of files or directories. This is currently only supported for local files and directories.
src - the files to delete showProgressInfo - true to show progress information Returns the job handling the operation |
|
Unmount filesystem. Special job for kio_file.
point - Point to unmount. showProgressInfo - true to show progress information Returns the job handling the operation. |
|
Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORTED_ACTION). protocol - name of the protocol cmd - given command See also enum Command |