kio Library API Documentation

KIO Namespace Reference

A namespace for KIO globals. More...


Compounds

class  AuthInfo
 This class is intended to make it easier to prompt for, cache and retrieve authorization information. A two way messaging class for passing authentication information. More...

class  NetRC
 A Singleton class that provides access to passwords stored in .netrc files for automatic login purposes. An interface to the ftp .netrc files. More...

struct  AutoLogin
 Contains auto login information. More...

class  ChmodJob
 This job changes permissions on a list of files or directories, optionally in a recursive manner. More...

class  Connection
 This class provides a simple means for IPC between two applications via a pipe. More...

class  DataProtocol
 This kioslave provides support of data urls as specified by rfc 2397. More...

class  DataSlave
 This class provides a high performance implementation for the data url scheme (rfc2397). More...

struct  QueueStruct
 structure for queueing. More...

class  DavJob
 The transfer job pumps data into and/or out of a Slave. More...

class  MetaData
 MetaData is a simple map of key/value strings. More...

class  Job
 The base class for all jobs. More...

class  SimpleJob
 A simple job (one url and one command). More...

class  StatJob
 A KIO job that retrieves information about a file or directory. More...

class  TransferJob
 The transfer job pumps data into and/or out of a Slave. More...

class  MultiGetJob
 The MultiGetJob is a TransferJob that allows you to get several files from a single server. More...

class  MimetypeJob
 A MimetypeJob is a TransferJob that allows you to get the mime type of an URL. More...

class  FileCopyJob
 The FileCopyJob copies data from one place to another. More...

class  ListJob
 A ListJob is allows you to get the get the content of a directory. More...

class  CopyJob
 CopyJob is used to move, copy or symlink files and directories. More...

class  DeleteJob
 A more complex Job to delete files and directories. More...

class  MetaInfoJob
 MetaInfoJob is a KIO Job to retrieve meta information from files. KIO Job to retrieve meta information from files.
Since:
3.1.
More...


class  NetAccess
 Net Transparency. Provides an easy, synchronous interface to KIO file operations. More...

class  PasswordDialog
 A dialog for requesting a login and a password from the end user. dialog for requesting login and password from the end user. More...

class  PreviewJob
 KIO Job to get a thumbnail picture. More...

class  ProgressBase
 This class does all initialization stuff for progress, like connecting signals to slots. Base class for IO progress dialogs. More...

class  RenameDlg
 A dialog for the options to rename two files. A dialog for renaming files.
Since:
3.1.
More...


class  Scheduler
 The KIO::Scheduler manages io-slaves for the application. More...

class  SlaveBase
 There are two classes that specifies the protocol between application (job) and kioslave. More...

class  SlaveConfig
 SlaveConfig. More...

class  SlaveInterface
 There are two classes that specifies the protocol between application ( KIO::Job) and kioslave. More...

class  StatusbarProgress
 This is a special IO progress widget. IO progress widget for embedding in a statusbar. More...

class  TCPSlaveBase
 There are two classes that specifies the protocol between application (job) and kioslave. More...


Typedefs

typedef signed long long int fileoffset_t
typedef unsigned long long int filesize_t
typedef QValueList< UDSAtom > UDSEntry

Enumerations

enum  Command
enum  Error
enum  UDSAtomTypes {
  UDS_STRING = 1 , UDS_SIZE = 8 | UDS_LONG , UDS_USER = 16 | UDS_STRING, UDS_ICON_NAME = 24 | UDS_STRING,
  UDS_GROUP = 32 | UDS_STRING, UDS_EXTRA = 48 | UDS_STRING, UDS_NAME = 64 | UDS_STRING, UDS_ACCESS = 128 | UDS_LONG,
  UDS_MODIFICATION_TIME = 256 | UDS_TIME, UDS_ACCESS_TIME = 512 | UDS_TIME, UDS_CREATION_TIME = 1024 | UDS_TIME, UDS_FILE_TYPE = 2048 | UDS_LONG,
  UDS_LINK_DEST = 4096 | UDS_STRING, UDS_URL = 8192 | UDS_STRING, UDS_MIME_TYPE = 16384 | UDS_STRING, UDS_GUESSED_MIME_TYPE = 16392 | UDS_STRING,
  UDS_XML_PROPERTIES = 32768 | UDS_STRING
}
enum  CacheControl {
  CC_CacheOnly, CC_Cache, CC_Verify, CC_Refresh,
  CC_Reload
}
enum  RenameDlg_Result
enum  Info
enum  Message

Functions

ChmodJobchmod (const KFileItemList &lstItems, int permissions, int mask, QString newOwner, QString newGroup, bool recursive, bool showProgressInfo=true)
DavJobdavPropFind (const KURL &url, const QDomDocument &properties, QString depth, bool showProgressInfo=true)
DavJobdavPropPatch (const KURL &url, const QDomDocument &properties, bool showProgressInfo=true)
DavJobdavSearch (const KURL &url, const QString &nsURI, const QString &qName, const QString &query, bool showProgressInfo=true)
QString convertSize (KIO::filesize_t size)
QString number (KIO::filesize_t size)
QString convertSizeFromKB (KIO::filesize_t kbSize)
QTime calculateRemaining (KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
QString itemsSummaryString (uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize)
QString encodeFileName (const QString &str)
QString decodeFileName (const QString &str)
QString buildErrorString (int errorCode, const QString &errorText)
QString buildHTMLErrorString (int errorCode, const QString &errorText, const KURL *reqUrl=0L, int method=-1)
QByteArray rawErrorDetail (int errorCode, const QString &errorText, const KURL *reqUrl=0L, int method=-1)
QString unsupportedActionErrorString (const QString &protocol, int cmd)
KIO::CacheControl parseCacheControl (const QString &cacheControl)
QString getCacheControlString (KIO::CacheControl cacheControl)
QString findDeviceMountPoint (const QString &device)
QString findPathMountPoint (const QString &filename)
bool probably_slow_mounted (const QString &filename)
bool manually_mounted (const QString &filename)
bool testFileSystemFlag (const QString &filename, FileSystemFlag flag)
SimpleJobmkdir (const KURL &url, int permissions=-1)
SimpleJobrmdir (const KURL &url)
SimpleJobchmod (const KURL &url, int permissions)
SimpleJobrename (const KURL &src, const KURL &dest, bool overwrite)
SimpleJobsymlink (const QString &target, const KURL &dest, bool overwrite, bool showProgressInfo=true)
SimpleJobspecial (const KURL &url, const QByteArray &data, bool showProgressInfo=true)
SimpleJobmount (bool ro, const char *fstype, const QString &dev, const QString &point, bool showProgressInfo=true)
SimpleJobunmount (const QString &point, bool showProgressInfo=true)
SimpleJobhttp_update_cache (const KURL &url, bool no_cache, time_t expireDate)
StatJobstat (const KURL &url, bool showProgressInfo=true)
StatJobstat (const KURL &url, bool sideIsSource, short int details, bool showProgressInfo=true)
TransferJobget (const KURL &url, bool reload=false, bool showProgressInfo=true)
TransferJobput (const KURL &url, int permissions, bool overwrite, bool resume, bool showProgressInfo=true)
TransferJobhttp_post (const KURL &url, const QByteArray &postData, bool showProgressInfo=true)
MultiGetJobmulti_get (long id, const KURL &url, const MetaData &metaData)
MimetypeJobmimetype (const KURL &url, bool showProgressInfo=true)
FileCopyJobfile_copy (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
FileCopyJobfile_move (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, bool showProgressInfo=true)
SimpleJobfile_delete (const KURL &src, bool showProgressInfo=true)
ListJoblistDir (const KURL &url, bool showProgressInfo=true, bool includeHidden=true)
ListJoblistRecursive (const KURL &url, bool showProgressInfo=true, bool includeHidden=true)
CopyJobcopy (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJobcopyAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJobcopy (const KURL::List &src, const KURL &dest, bool showProgressInfo=true)
CopyJobmove (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJobmoveAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
CopyJobmove (const KURL::List &src, const KURL &dest, bool showProgressInfo=true)
CopyJoblink (const KURL &src, const KURL &destDir, bool showProgressInfo=true)
CopyJoblink (const KURL::List &src, const KURL &destDir, bool showProgressInfo=true)
CopyJoblinkAs (const KURL &src, const KURL &dest, bool showProgressInfo=true)
DeleteJobdel (const KURL &src, bool shred=false, bool showProgressInfo=true)
DeleteJobdel (const KURL::List &src, bool shred=false, bool showProgressInfo=true)
MetaInfoJobfileMetaInfo (const KFileItemList &items)
MetaInfoJobfileMetaInfo (const KURL::List &items)
JobpasteClipboard (const KURL &_dest_url, bool move=false)
void pasteData (const KURL &_dest_url, const QByteArray &_data)
CopyJobpasteDataAsync (const KURL &_dest_url, const QByteArray &_data)
bool isClipboardEmpty ()
PreviewJobfilePreview (const KFileItemList &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)
PreviewJobfilePreview (const KURL::List &items, int width, int height=0, int iconSize=0, int iconAlpha=70, bool scale=true, bool save=true, const QStringList *enabledPlugins=0)


Detailed Description

A namespace for KIO globals.

Typedef Documentation

typedef signed long long int KIO::fileoffset_t
 

64-bit file offset

Definition at line 37 of file global.h.

typedef unsigned long long int KIO::filesize_t
 

64-bit file size

Definition at line 39 of file global.h.

Referenced by KIO::PreviewJob::slotResult().

typedef QValueList<UDSAtom> KIO::UDSEntry
 

An entry is the list of atoms containing all the informations for a file or URL.

Definition at line 448 of file global.h.

Referenced by KFileItem::refresh().


Enumeration Type Documentation

enum KIO::Command
 

Commands that can be invoked by a job.

Definition at line 106 of file global.h.

enum KIO::Error
 

Error codes that can be emitted by KIO.

Definition at line 142 of file global.h.

enum KIO::UDSAtomTypes
 

Constants used to specify the type of a KUDSAtom.

Enumeration values:
UDS_STRING  First let's define the item types.
UDS_SIZE  Size of the file.
UDS_USER  User ID of the file owner.
UDS_ICON_NAME  Name of the icon, that should be used for displaying.

It overrides all other detection mechanisms

Since:
3.2
UDS_GROUP  Group ID of the file owner.
UDS_EXTRA  Extra data (used only if you specified Columns/ColumnsTypes) This is the only UDS entry that can be repeated.

Since:
3.2
UDS_NAME  Filename.
UDS_ACCESS  Access permissions (part of the mode returned by stat).
UDS_MODIFICATION_TIME  The last time the file was modified.
UDS_ACCESS_TIME  The last time the file was opened.
UDS_CREATION_TIME  The time the file was created.
UDS_FILE_TYPE  File type, part of the mode returned by stat (for a link, this returns the file type of the pointed item) check UDS_LINK_DEST to know if this is a link.
UDS_LINK_DEST  Name of the file where the link points to Allows to check for a symlink (don't use S_ISLNK !).
UDS_URL  An alternative URL (If different from the caption).
UDS_MIME_TYPE  A mime type; prevents guessing.
UDS_GUESSED_MIME_TYPE  A mime type to be used for displaying only.

But when 'running' the file, the mimetype is re-determined

UDS_XML_PROPERTIES  XML properties, e.g.

for WebDAV

Since:
3.1

Definition at line 274 of file global.h.

enum KIO::CacheControl
 

Specifies how to use the cache.

See also:
parseCacheControl() , getCacheControlString()
Enumeration values:
CC_CacheOnly  Fail request if not in cache.
CC_Cache  Use cached entry if available.
CC_Verify  Validate cached entry with remote site if expired.
CC_Refresh  Always validate cached entry with remote site
Since:
3.1.
CC_Reload  Always fetch from remote site.

Definition at line 329 of file global.h.

enum KIO::RenameDlg_Result
 

The result of open_RenameDlg().

Definition at line 39 of file renamedlg.h.

Referenced by KIO::FileCopyJob::slotCanResume(), and KIO::CopyJob::slotResult().

enum KIO::Info
 

Identifiers for KIO informational messages.

Definition at line 46 of file slaveinterface.h.

enum KIO::Message
 

Identifiers for KIO data messages.

Definition at line 66 of file slaveinterface.h.


Function Documentation

ChmodJob * KIO::chmod const KFileItemList &    lstItems,
int    permissions,
int    mask,
QString    newOwner,
QString    newGroup,
bool    recursive,
bool    showProgressInfo = true
 

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.

Parameters:
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 progess information
Returns:
The job handling the operation.

Definition at line 237 of file chmodjob.cpp.

References QFile::encodeName(), and QString::isEmpty().

Referenced by KFilePermissionsPropsPlugin::applyChanges().

DavJob * KIO::davPropFind const KURL   url,
const QDomDocument   properties,
QString    depth,
bool    showProgressInfo = true
 

Creates a new DavJob that issues a PROPFIND command.

PROPFIND retrieves the properties of the resource identified by the given url.

Parameters:
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

Definition at line 114 of file davjob.cpp.

References QDomDocument::toString().

DavJob * KIO::davPropPatch const KURL   url,
const QDomDocument   properties,
bool    showProgressInfo = true
 

Creates a new DavJob that issues a PROPPATCH command.

PROPPATCH sets the properties of the resource identified by the given url.

Parameters:
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

Definition at line 122 of file davjob.cpp.

References QDomDocument::toString().

DavJob * KIO::davSearch const KURL   url,
const QString   nsURI,
const QString   qName,
const QString   query,
bool    showProgressInfo = true
 

Creates a new DavJob that issues a SEARCH command.

Parameters:
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

Definition at line 127 of file davjob.cpp.

References QDomDocument::createElementNS(), QDomDocument::createTextNode(), and QDomDocument::toString().

QString KIO::convertSize KIO::filesize_t    size
 

Converts size from bytes to the string representation.

Parameters:
size  size in bytes
Returns:
converted size as a string - e.g. 123.4 kB , 12.0 MB

Definition at line 46 of file global.cpp.

References QString::arg(), and KGlobal::locale().

Referenced by convertSizeFromKB(), KFileItem::getToolTipText(), and KFileMimeTypeInfo::ItemInfo::string().

QString KIO::number KIO::filesize_t    size
 

Converts a size to a string representation Not unlike QString::number(...).

Parameters:
size  size in bytes
Returns:
converted size as a string - e.g. 123456789

Definition at line 85 of file global.cpp.

References QString::fromLatin1().

Referenced by KIO::SlaveBase::canResume(), KBookmarkManager::findByAddress(), KURLBar::readItem(), KFileView::sortingKey(), and KURLBar::writeItem().

QString KIO::convertSizeFromKB KIO::filesize_t    kbSize
 

Converts size from kilo-bytes to the string representation.

Parameters:
kbsize  size in kilo-bytes
Returns:
converted size as a string - e.g. 123.4 kB , 12.0 MB

Definition at line 80 of file global.cpp.

References convertSize().

Referenced by KFileMimeTypeInfo::ItemInfo::string().

QTime KIO::calculateRemaining KIO::filesize_t    totalSize,
KIO::filesize_t    processedSize,
KIO::filesize_t    speed
 

Calculates remaining time from total size, processed size and speed.

Parameters:
totalSize  total size in bytes
processedSize  processed size in bytes
speed  speed in bytes pre second
Returns:
calculated remaining time

Definition at line 92 of file global.cpp.

References QTime::setHMS().

QString KIO::itemsSummaryString uint    items,
uint    files,
uint    dirs,
KIO::filesize_t    size,
bool    showSize
 

Helper for showing information about a set of files and directories.

Parameters:
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

Definition at line 115 of file global.cpp.

References QString::arg().

QString KIO::encodeFileName const QString   str
 

Encodes (from the text displayed to the real filename) This translates % into %% and / into %2f Used by KIO::link, for instance.

Parameters:
str  the file name to encode
Returns:
the encoded file name

Definition at line 130 of file global.cpp.

References QString::find(), and QString::replace().

Referenced by KFilePropsPlugin::applyChanges().

QString KIO::decodeFileName const QString   str
 

Decodes (from the filename to the text displayed) This translates %2[fF] into / and %% into %.

Parameters:
str  the file name to decode
Returns:
the decoded file name

Definition at line 145 of file global.cpp.

References QString::append(), QString::length(), and QString::lower().

Referenced by KFileItem::KFileItem(), KFilePropsPlugin::KFilePropsPlugin(), KPropertiesDialog::KPropertiesDialog(), and KFileItem::setName().

QString KIO::buildErrorString int    errorCode,
const QString   errorText
 

Returns a translated error message for errorCode using the additional error information provided by errorText.

Parameters:
errorCode  the error code
errorText  the additional error text
Returns:
the created error string

Definition at line 178 of file global.cpp.

References QString::arg(), QString::fromLatin1(), and QString::isEmpty().

Referenced by KIO::Job::errorString(), and rawErrorDetail().

QString buildHTMLErrorString int    errorCode,
const QString   errorText,
const KURL   reqUrl = 0L,
int    method = -1
 

Returns a translated html error message for errorCode using the additional error information provided by errorText , reqUrl (the request URL), and the ioslave method .

Parameters:
errorCode  the error code
errorText  the additional error text
reqUrl  the request URL
method  the ioslave method
Returns:
the created error string

QByteArray KIO::rawErrorDetail int    errorCode,
const QString   errorText,
const KURL   reqUrl = 0L,
int    method = -1
 

Returns translated error details for errorCode using the additional error information provided by errorText , reqUrl (the request URL), and the ioslave method .

Parameters:
errorCode  the error code
errorText  the additional error text
reqUrl  the request URL
method  the ioslave method
Returns:
the following data:
  • QString errorName - the name of the error
  • QString techName - if not null, the more technical name of the error
  • QString description - a description of the error
  • QStringList causes - a list of possible causes of the error
  • QStringList solutions - a liso of solutions for the error

Definition at line 472 of file global.cpp.

References QString::arg(), buildErrorString(), KProtocolManager::connectTimeout(), QDateTime::currentDateTime(), KURL::fileName(), KLocale::formatDateTime(), KURL::host(), QString::isNull(), QString::left(), KGlobal::locale(), QString::mid(), KURL::path(), KURL::prettyURL(), KURL::protocol(), KProtocolManager::proxyConnectTimeout(), and KProtocolManager::responseTimeout().

Referenced by KIO::Job::detailedErrorStrings().

QString KIO::unsupportedActionErrorString const QString   protocol,
int    cmd
 

Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORTED_ACTION).

Parameters:
protocol  name of the protocol
cmd  given command
See also:
enum Command
Since:
3.2

Definition at line 383 of file global.cpp.

Referenced by KIO::SlaveBase::chmod(), KIO::SlaveBase::copy(), KIO::SlaveBase::del(), KIO::SlaveBase::get(), KIO::SlaveBase::listDir(), KIO::SlaveBase::mkdir(), KIO::SlaveBase::multiGet(), KIO::SlaveBase::openConnection(), KIO::SlaveBase::put(), KIO::SlaveBase::rename(), KIO::SlaveBase::setSubURL(), KIO::SlaveBase::special(), KIO::SlaveBase::stat(), and KIO::SlaveBase::symlink().

KIO::CacheControl KIO::parseCacheControl const QString   cacheControl
 

Parses the string representation of the cache control option.

Parameters:
cacheControl  the string representation
Returns:
the cache control value
See also:
getCacheControlString()

Definition at line 1894 of file global.cpp.

References QString::lower().

Referenced by KProtocolManager::cacheControl().

QString KIO::getCacheControlString KIO::CacheControl    cacheControl
 

Returns a string representation of the given cache control method.

Parameters:
cacheControl  the cache control method
Returns:
the string representation
See also:
parseCacheControl()

Definition at line 1913 of file global.cpp.

QString KIO::findDeviceMountPoint const QString   device
 

Returns the mount point where device is mounted right now.

This means, it has to be mounted, not just defined in fstab.

Definition at line 1320 of file global.cpp.

References QFile::encodeName(), QCString::isEmpty(), and QCString::length().

Referenced by KDEDesktopMimeType::builtinServices(), KDEDesktopMimeType::executeService(), and KDEDesktopMimeType::icon().

QString KIO::findPathMountPoint const QString   filename
 

Returns the mount point on which resides filename.

For instance if /home is a separate partition, findPathMountPoint("/home/user/blah") will return /home

Parameters:
filename  the file name to check
Returns:
the mount point of the given filename

Definition at line 1850 of file global.cpp.

Referenced by KDiskFreeSp::findUsageInfo(), and KFilePropsPlugin::KFilePropsPlugin().

bool KIO::probably_slow_mounted const QString   filename
 

Checks if the path belongs to a filesystem that is probably slow.

It checks for NFS or for paths belonging to automounted paths not yet mounted

Parameters:
filename  the file name to check
Returns:
true if the filesystem is probably slow

Definition at line 1865 of file global.cpp.

References QString::isNull().

bool KIO::manually_mounted const QString   filename
 

Checks if the path belongs to a filesystem that is manually mounted.

Parameters:
filename  the file name to check
Returns:
true if the filesystem is manually mounted

Definition at line 1857 of file global.cpp.

References QString::isNull().

bool KIO::testFileSystemFlag const QString   filename,
FileSystemFlag    flag
 

Checks the capabilities of the filesystem to which a given file belongs.

given feature (e.g. chmod).

Parameters:
flag  the flag to check
Returns:
true if the filesystem has that flag, false if not (or some error occurred)
The availables flags are:
  • SupportsChmod: returns true if the filesystem supports chmod (e.g. msdos filesystems return false)
  • SupportsChown: returns true if the filesystem supports chown (e.g. msdos filesystems return false)
  • SupportsUtime: returns true if the filesystems supports utime (e.g. msdos filesystems return false)
  • SupportsSymlinks: returns true if the filesystems supports symlinks (e.g. msdos filesystems return false)
  • CaseInsensitive: returns true if the filesystem treats "foo" and "FOO" as being the same file (true for msdos systems)

Definition at line 1873 of file global.cpp.

References QString::isNull().

SimpleJob * KIO::mkdir const KURL   url,
int    permissions = -1
 

Creates a single directory.

Parameters:
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.

Definition at line 603 of file job.cpp.

SimpleJob * KIO::rmdir const KURL   url
 

Removes a single directory.

The directory is assumed to be empty.

Parameters:
url  The URL of the directory to remove.
Returns:
A pointer to the job handling the operation.

Definition at line 610 of file job.cpp.

SimpleJob * KIO::chmod const KURL   url,
int    permissions
 

Changes permissions on a file or directory.

See the other chmod below for changing many files or directories.

Parameters:
url  The URL of file or directory.
permissions  The permissions to set.
Returns:
the job handling the operation.

Definition at line 617 of file job.cpp.

SimpleJob * KIO::rename const KURL   src,
const KURL   dest,
bool    overwrite
 

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.

Parameters:
src  The original URL
dest  The final URL
overwrite  whether to automatically overwrite if the dest exists
Returns:
the job handling the operation.

Definition at line 624 of file job.cpp.

SimpleJob * KIO::symlink const QString   target,
const KURL   dest,
bool    overwrite,
bool    showProgressInfo = true
 

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.

Parameters:
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.

Definition at line 631 of file job.cpp.

Referenced by KArchiveDirectory::KArchiveDirectory(), KArchiveEntry::KArchiveEntry(), KArchiveFile::KArchiveFile(), KZip::openArchive(), and KTar::openArchive().

SimpleJob * KIO::special const KURL   url,
const QByteArray   data,
bool    showProgressInfo = true
 

Execute any command that is specific to one slave (protocol).

Examples are : HTTP POST, mount and unmount (kio_file)

Parameters:
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.

Definition at line 638 of file job.cpp.

Referenced by mount(), and unmount().

SimpleJob * KIO::mount bool    ro,
const char *    fstype,
const QString   dev,
const QString   point,
bool    showProgressInfo = true
 

Mount filesystem.

Special job for kio_file.

Parameters:
ro  Mount read-only if true.
fstype  File system type (e.g. "ext2", can be 0L).
dev  Device (e.g. /dev/sda0).
point  Mount point, can be null.
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 644 of file job.cpp.

References QString::fromLatin1(), Observer::mounting(), Observer::self(), and special().

Referenced by KDEDesktopMimeType::builtinServices(), and KAutoMount::KAutoMount().

SimpleJob * KIO::unmount const QString   point,
bool    showProgressInfo = true
 

Unmount filesystem.

Special job for kio_file.

Parameters:
point  Point to unmount.
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 654 of file job.cpp.

References Observer::self(), special(), and Observer::unmounting().

Referenced by KDEDesktopMimeType::builtinServices(), and KAutoUnmount::KAutoUnmount().

SimpleJob * KIO::http_update_cache const KURL   url,
bool    no_cache,
time_t    expireDate
 

HTTP cache update.

Parameters:
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.

Definition at line 754 of file job.cpp.

References KURL::protocol().

StatJob * KIO::stat const KURL   url,
bool    showProgressInfo = true
 

Find all details for one file or directory.

Parameters:
url  the URL of the file
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 736 of file job.cpp.

Referenced by KIO::CopyJob::slotResult().

StatJob * KIO::stat const KURL   url,
bool    sideIsSource,
short int    details,
bool    showProgressInfo = true
 

Find all details for one file or directory.

This version of the call includes two additional booleans, sideIsSource and details.

Parameters:
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:
  • be optimistic if sideIsSource=true, i.e. it will assume the file exists, and if it doesn't this will appear when actually trying to download it
  • be pessimistic if sideIsSource=false, i.e. it will assume the file doesn't exist, to prevent showing "about to overwrite" errors to the user. If you simply want to check for existence without downloading/uploading afterwards, then you should use sideIsSource=false.
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.

Definition at line 742 of file job.cpp.

References KURL::prettyURL(), Observer::self(), KIO::StatJob::setDetails(), KIO::StatJob::setSide(), and Observer::stating().

TransferJob * KIO::get const KURL   url,
bool    reload = false,
bool    showProgressInfo = true
 

Get (a.k.a.

read).

The slave emits the data through data().

Parameters:
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.

Definition at line 1070 of file job.cpp.

References KIO::Job::addMetaData(), and KStdAccel::reload().

Referenced by KIO::FileCopyJob::slotCanResume().

TransferJob * KIO::put const KURL   url,
int    permissions,
bool    overwrite,
bool    resume,
bool    showProgressInfo = true
 

Put (a.k.a.

write)

Parameters:
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, false otherwise
showProgressInfo  true to show progress information
Returns:
the job handling the operation.
See also:
multi_get()

Definition at line 1228 of file job.cpp.

TransferJob * KIO::http_post const KURL   url,
const QByteArray   postData,
bool    showProgressInfo = true
 

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.

Parameters:
url  Where to write the data.
postData  Encoded data to post.
showProgressInfo  true to display
Returns:
the job handling the operation.

Definition at line 1093 of file job.cpp.

References QValueList< int >::begin(), QValueList< int >::contains(), QValueList< int >::end(), QString::isEmpty(), KURL::path(), KURL::port(), KURL::protocol(), KURL::setPath(), QTimer::singleShot(), and KURL::url().

MultiGetJob * KIO::multi_get long    id,
const KURL   url,
const MetaData   metaData
 

Creates a new mult-get job.

Parameters:
id  the id of the get operation
url  the URL of the file
Returns:
the job handling the operation.
See also:
get()

Definition at line 3817 of file job.cpp.

References KIO::MultiGetJob::get().

MimetypeJob * KIO::mimetype const KURL   url,
bool    showProgressInfo = true
 

Find mimetype for one file or directory.

Parameters:
url  the URL of the file
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 1285 of file job.cpp.

References Observer::self(), and Observer::stating().

Referenced by KFilterDev::device(), KFilterDev::deviceForFile(), KTar::KTar(), and KDataToolInfo::query().

FileCopyJob * KIO::file_copy const KURL   src,
const KURL   dest,
int    permissions = -1,
bool    overwrite = false,
bool    resume = false,
bool    showProgressInfo = true
 

Copy a single file.

Uses either SlaveBase::copy() if the slave supports that or get() and put() otherwise.

Parameters:
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
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 1659 of file job.cpp.

FileCopyJob * KIO::file_move const KURL   src,
const KURL   dest,
int    permissions = -1,
bool    overwrite = false,
bool    resume = false,
bool    showProgressInfo = true
 

Move a single file.

Use either SlaveBase::rename() if the slave supports that, or copy() and del() otherwise, or eventually get() & put() & del()

Parameters:
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
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 1665 of file job.cpp.

SimpleJob * KIO::file_delete const KURL   src,
bool    showProgressInfo = true
 

Delete a single file.

Parameters:
src  File to delete.
showProgressInfo  true to show progress information
Returns:
the job handling the operation.

Definition at line 1671 of file job.cpp.

Referenced by KIO::FileCopyJob::slotResult().

ListJob * KIO::listDir const KURL   url,
bool    showProgressInfo = true,
bool    includeHidden = true
 

List the contents of url, which is assumed to be a directory.

"." and ".." are returned, filter them out if you don't want them.

Parameters:
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.

Definition at line 1830 of file job.cpp.

ListJob * KIO::listRecursive const KURL   url,
bool    showProgressInfo = true,
bool    includeHidden = true
 

The same as the previous method, but recurses subdirectories.

"." and ".." are returned but only for the toplevel directory. Filter them out if you don't want them.

Parameters:
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.

Definition at line 1836 of file job.cpp.

Referenced by KIO::DeleteJob::slotResult().

CopyJob * KIO::copy const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

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.

Parameters:
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()

Definition at line 3160 of file job.cpp.

Referenced by KFilePropsPlugin::applyChanges(), and pasteClipboard().

CopyJob * KIO::copyAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

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.

Parameters:
src  the file or directory to copy
dest  the destination
showProgressInfo  true to show progress information
Returns:
the job handling the operation

Definition at line 3168 of file job.cpp.

CopyJob * KIO::copy const KURL::List   src,
const KURL   dest,
bool    showProgressInfo = true
 

Copy a list of file/dirs src into a destination directory dest.

Parameters:
src  the list of files and/or directories
dest  the destination
showProgressInfo  true to show progress information
Returns:
the job handling the operation

Definition at line 3176 of file job.cpp.

CopyJob * KIO::move const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

Moves a file or directory src to the given destination dest.

Parameters:
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() , moveAs()

Definition at line 3181 of file job.cpp.

Referenced by KFilePropsPlugin::applyChanges(), KIO::FileCopyJob::FileCopyJob(), pasteClipboard(), and pasteDataAsync().

CopyJob * KIO::moveAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

Moves a file or directory src to the given destination dest.

Unlike move() this operation will fail when the directory already exists.

Parameters:
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()

Definition at line 3188 of file job.cpp.

CopyJob * KIO::move const KURL::List   src,
const KURL   dest,
bool    showProgressInfo = true
 

Moves a list of files or directories src to the given destination dest.

Parameters:
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()

Definition at line 3195 of file job.cpp.

CopyJob * KIO::link const KURL   src,
const KURL   destDir,
bool    showProgressInfo = true
 

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.

Parameters:
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

Definition at line 3200 of file job.cpp.

CopyJob * KIO::link const KURL::List   src,
const KURL   destDir,
bool    showProgressInfo = true
 

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.

Parameters:
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()

Definition at line 3207 of file job.cpp.

CopyJob * KIO::linkAs const KURL   src,
const KURL   dest,
bool    showProgressInfo = true
 

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.

Parameters:
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
See also:
link () , copyAs()

Definition at line 3212 of file job.cpp.

DeleteJob * KIO::del const KURL   src,
bool    shred = false,
bool    showProgressInfo = true
 

Delete a file or directory.

Parameters:
src  file to delete
shred  If true, delete in a way that makes recovery impossible (only supported for local files currently)
showProgressInfo  true to show progress information
Returns:
the job handling the operation

Definition at line 3635 of file job.cpp.

Referenced by KDirOperator::del().

DeleteJob * KIO::del const KURL::List   src,
bool    shred = false,
bool    showProgressInfo = true
 

Deletes a list of files or directories.

Parameters:
src  the files to delete
shred  If true, delete in a way that makes recovery impossible (only supported for local files currently)
showProgressInfo  true to show progress information
Returns:
the job handling the operation

Definition at line 3643 of file job.cpp.

MetaInfoJob * KIO::fileMetaInfo const KFileItemList &    items
 

Retrieves meta information for the given items.

Parameters:
items  files to get metainfo for
Returns:
the MetaInfoJob to retrieve the items

Definition at line 172 of file metainfojob.cpp.

MetaInfoJob * KIO::fileMetaInfo const KURL::List   items
 

Retrieves meta information for the given items.

Parameters:
items  files to get metainfo for
Returns:
the MetaInfoJob to retrieve the items

Definition at line 177 of file metainfojob.cpp.

References QPtrList< KFileItem >::append().

KIO::Job * KIO::pasteClipboard const KURL   _dest_url,
bool    move = false
 

Pastes the content of the clipboard (e.g.

URLs) to the given destination URL.

Parameters:
_dest_url  the URL to receive the data
move  true to move the data, false to copy
Returns:
the job that handles the operation
See also:
pasteData()

Definition at line 92 of file paste.cpp.

References QTextDrag::canDecode(), QUriDrag::canDecode(), QApplication::clipboard(), copy(), QTextDrag::decode(), KURLDrag::decode(), KMessageBox::error(), KURL::isValid(), move(), pasteDataAsync(), KMessageBox::sorry(), QStringList::split(), and KURL::url().

void KIO::pasteData const KURL   _dest_url,
const QByteArray   _data
 

Pastes the given _data to the given destination URL.

Parameters:
_dest_url  the URL to receive the data
_data  the data to copy
See also:
pasteClipboard()

Definition at line 153 of file paste.cpp.

References KTempFile::close(), KTempFile::dataStream(), KURL::isEmpty(), KTempFile::name(), KTempFile::setAutoDelete(), KIO::NetAccess::upload(), and QDataStream::writeRawBytes().

KIO::CopyJob * KIO::pasteDataAsync const KURL   _dest_url,
const QByteArray   _data
 

Pastes the given _data to the given destination URL.

Parameters:
_dest_url  the URL to receive the data
_data  the data to copy
See also:
pasteClipboard()

Definition at line 170 of file paste.cpp.

References KTempFile::close(), KTempFile::dataStream(), KURL::isEmpty(), move(), KTempFile::name(), KURL::setPath(), and QDataStream::writeRawBytes().

Referenced by pasteClipboard().

bool KIO::isClipboardEmpty  
 

Checks whether the clipboard is empty.

Returns:
true if empty

Definition at line 76 of file paste.cpp.

References QApplication::clipboard(), QString::contains(), QMimeSource::encodedData(), and QMimeSource::provides().

PreviewJob * KIO::filePreview const KFileItemList &    items,
int    width,
int    height = 0,
int    iconSize = 0,
int    iconAlpha = 70,
bool    scale = true,
bool    save = true,
const QStringList   enabledPlugins = 0
 

Creates a PreviewJob to generate or retrieve a preview image for the given URL.

Parameters:
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()

Definition at line 498 of file previewjob.cpp.

Referenced by KFileIconView::showPreviews().

PreviewJob * KIO::filePreview const KURL::List   items,
int    width,
int    height = 0,
int    iconSize = 0,
int    iconAlpha = 70,
bool    scale = true,
bool    save = true,
const QStringList   enabledPlugins = 0
 

Creates a PreviewJob to generate or retrieve a preview image for the given URL.

Parameters:
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()

Definition at line 506 of file previewjob.cpp.

References QPtrList< KFileItem >::append().

KDE Logo
This file is part of the documentation for kio Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:35:16 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003