KIO::NetAccess Class Reference
#include <netaccess.h>
Inheritance diagram for KIO::NetAccess:

Detailed Description
Net Transparency.Provides an easy, synchronous interface to KIO file operations.NetAccess allows you to do simple file operation (load, save, copy, delete...) without working with KIO::Job directly. Whereas a KIO::Job is asynchronous, meaning that the developer has to connect slots for it, KIO::NetAccess provides synchronous downloads and uploads, as well as temporary file creation and removal. The functions appear to be blocking, but the Qt event loop continues running while the operations are handled. This means that the GUI will not freeze.
This class isn't meant to be used as a class but only as a simple namespace for static functions, though an instance of the class is built for internal purposes.
Port to kio done by David Faure, faure@kde.org
Definition at line 59 of file netaccess.h.
Static Public Member Functions | |
static bool | download (const KURL &src, QString &target, QWidget *window) |
static bool | download (const KURL &src, QString &target) KDE_DEPRECATED |
static void | removeTempFile (const QString &name) |
static bool | upload (const QString &src, const KURL &target, QWidget *window) |
static bool | upload (const QString &src, const KURL &target) KDE_DEPRECATED |
static bool | copy (const KURL &src, const KURL &target, QWidget *window) |
static bool | copy (const KURL &src, const KURL &target) KDE_DEPRECATED |
static bool | file_copy (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, QWidget *window=0L) |
static bool | file_move (const KURL &src, const KURL &target, int permissions=-1, bool overwrite=false, bool resume=false, QWidget *window=0L) |
static bool | dircopy (const KURL &src, const KURL &target, QWidget *window) |
static bool | dircopy (const KURL &src, const KURL &target) KDE_DEPRECATED |
static bool | dircopy (const KURL::List &src, const KURL &target, QWidget *window=0L) |
static bool | move (const KURL &src, const KURL &target, QWidget *window=0L) |
static bool | move (const KURL::List &src, const KURL &target, QWidget *window=0L) |
static bool | exists (const KURL &url, bool source, QWidget *window) |
static bool | exists (const KURL &url, QWidget *window) KDE_DEPRECATED |
static bool | exists (const KURL &url) KDE_DEPRECATED |
static bool | exists (const KURL &url, bool source) KDE_DEPRECATED |
static bool | stat (const KURL &url, KIO::UDSEntry &entry, QWidget *window) |
static bool | stat (const KURL &url, KIO::UDSEntry &entry) KDE_DEPRECATED |
static KURL | mostLocalURL (const KURL &url, QWidget *window) |
static bool | del (const KURL &url, QWidget *window) |
static bool | del (const KURL &url) KDE_DEPRECATED |
static bool | mkdir (const KURL &url, QWidget *window, int permissions=-1) |
static bool | mkdir (const KURL &url, int permissions=-1) KDE_DEPRECATED |
static QString | fish_execute (const KURL &url, const QString command, QWidget *window) |
static bool | synchronousRun (Job *job, QWidget *window, QByteArray *data=0, KURL *finalURL=0, QMap< QString, QString > *metaData=0) |
static QString | mimetype (const KURL &url, QWidget *window) |
static QString | mimetype (const KURL &url) KDE_DEPRECATED |
static QString | lastErrorString () |
static int | lastError () |
Friends | |
class | I_like_this_class |
Member Function Documentation
|
Use the function above instead. Definition at line 112 of file netaccess.cpp. |
|
Alternative to upload for copying over the network.
Overwrite is false, so this will fail if This one takes two URLs and is a direct equivalent of KIO::file_copy (not KIO::copy!). It will be renamed file_copy in KDE4, so better use file_copy.
Definition at line 117 of file netaccess.cpp. |
|
Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. Definition at line 245 of file netaccess.cpp. |
|
Deletes a file or a directory in a synchronous way. This is a convenience function for KIO::del (it saves creating a slot and testing for the job result).
Definition at line 250 of file netaccess.cpp. |
|
Overloaded method, which takes a list of source URLs.
Definition at line 151 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 139 of file netaccess.cpp. |
|
Alternative method for copying over the network.
Overwrite is false, so this will fail if This one takes two URLs and is a direct equivalent of KIO::copy!. This means that it can copy files and directories alike (it should have been named copy()).
Definition at line 144 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 52 of file netaccess.cpp. |
|
Downloads a file from an arbitrary URL (
If the argument for
Special case: If the URL is of kind file:, then no downloading is processed but the full filename is returned in
Download is synchronous. That means you can use it like this, (assuming
QString tmpFile; if( KIO::NetAccess::download( u, tmpFile, window ) ) { loadFile( tmpFile ); KIO::NetAccess::removeTempFile( tmpFile ); } else { KMessageBox::error(this, KIO::NetAccess::lastErrorString() ); } Of course, your user interface will still process exposure/repaint events during the download. If the download fails, lastError() and lastErrorString() will be set.
Definition at line 57 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 180 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 170 of file netaccess.cpp. |
|
Use the function above instead.
Definition at line 175 of file netaccess.cpp. |
|
Tests whether a URL exists.
Definition at line 185 of file netaccess.cpp. |
|
Full-fledged equivalent of KIO::file_copy.
Definition at line 122 of file netaccess.cpp. |
|
Full-fledged equivalent of KIO::file_move. Moves or renames *one file*.
Definition at line 131 of file netaccess.cpp. |
|
Executes a remote process via the fish ioslave in a synchronous way.
Definition at line 267 of file netaccess.cpp. |
|
Returns the error code for the last job, in case it failed.
Definition at line 475 of file netaccess.h. |
|
Returns the error string for the last job, in case it failed. Note that this is already translated.
Definition at line 468 of file netaccess.h. |
|
Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. Definition at line 280 of file netaccess.cpp. |
|
Use the function above instead. Passing NULL as the additional argument will give the same behaviour, but you should try to identify a suitable parent widget if at all possible. Definition at line 256 of file netaccess.cpp. |
|
Creates a directory in a synchronous way.
This is a convenience function for
Definition at line 261 of file netaccess.cpp. |
|
Tries to map a local URL for the given URL. This is a convenience function for KIO::stat + parsing the resulting UDSEntry.
Definition at line 207 of file netaccess.cpp. |
|
Full-fledged equivalent of KIO::move. Moves or renames a list of files or directories.
Definition at line 164 of file netaccess.cpp. |
|
Full-fledged equivalent of KIO::move. Moves or renames one file or directory.
Definition at line 157 of file netaccess.cpp. |
|
Removes the specified file if and only if it was created by KIO::NetAccess as a temporary file for a former download. Note: This means that if you created your temporary with KTempFile, use KTempFile::unlink() or KTempFile::setAutoDelete() to have it removed.
Definition at line 292 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 193 of file netaccess.cpp. |
|
Tests whether a URL exists and return information on it. This is a convenience function for KIO::stat (it saves creating a slot and testing for the job result).
Definition at line 198 of file netaccess.cpp. |
|
This function executes a job in a synchronous way. If a job fetches some data, pass a QByteArray pointer as data parameter to this function and after the function returns it will contain all the data fetched by this job.
Definition at line 273 of file netaccess.cpp. |
|
Use the function above instead. Definition at line 89 of file netaccess.cpp. |
|
Uploads file Both must be specified, unlike download. Note that this is assumed to be used for saving a file over the network, so overwriting is set to true. This is not the case with copy.
Definition at line 94 of file netaccess.cpp. |
The documentation for this class was generated from the following files: