KIO::NetAccess Class Reference
Net Transparency. Provides an easy, synchronous interface to KIO file operations. More...
#include <netaccess.h>
Inheritance diagram for KIO::NetAccess:

Static Public Member Functions | |
bool | download (const KURL &src, QString &target, QWidget *window) |
bool | download (const KURL &src, QString &target) KDE_DEPRECATED |
void | removeTempFile (const QString &name) |
bool | upload (const QString &src, const KURL &target, QWidget *window) |
bool | upload (const QString &src, const KURL &target) KDE_DEPRECATED |
bool | copy (const KURL &src, const KURL &target, QWidget *window) |
bool | copy (const KURL &src, const KURL &target) KDE_DEPRECATED |
bool | file_copy (const KURL &src, const KURL &dest, int permissions=-1, bool overwrite=false, bool resume=false, QWidget *window=0L) |
bool | file_move (const KURL &src, const KURL &target, int permissions=-1, bool overwrite=false, bool resume=false, QWidget *window=0L) |
bool | dircopy (const KURL &src, const KURL &target, QWidget *window) |
bool | dircopy (const KURL &src, const KURL &target) KDE_DEPRECATED |
bool | dircopy (const KURL::List &src, const KURL &target, QWidget *window=0L) |
bool | move (const KURL &src, const KURL &target, QWidget *window=0L) |
bool | move (const KURL::List &src, const KURL &target, QWidget *window=0L) |
bool | exists (const KURL &url, bool source, QWidget *window) |
bool | exists (const KURL &url, QWidget *window) KDE_DEPRECATED |
bool | exists (const KURL &url) KDE_DEPRECATED |
bool | exists (const KURL &url, bool source) KDE_DEPRECATED |
bool | stat (const KURL &url, KIO::UDSEntry &entry, QWidget *window) |
bool | stat (const KURL &url, KIO::UDSEntry &entry) KDE_DEPRECATED |
bool | del (const KURL &url, QWidget *window) |
bool | del (const KURL &url) KDE_DEPRECATED |
bool | mkdir (const KURL &url, QWidget *window, int permissions=-1) |
bool | mkdir (const KURL &url, int permissions=-1) KDE_DEPRECATED |
QString | fish_execute (const KURL &url, const QString command, QWidget *window) |
QString | mimetype (const KURL &url, QWidget *window) |
QString | mimetype (const KURL &url) KDE_DEPRECATED |
QString | lastErrorString () |
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 60 of file netaccess.h.
Member Function Documentation
|
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 ) ) { loadFile( tmpFile ); KIO::NetAccess::removeTempFile( tmpFile ); } Of course, your user interface will still process exposure/repaint events during the download.
References QString::arg(), filecopyInternal(), QString::isEmpty(), KURL::isLocalFile(), KTempFile::name(), KURL::path(), and KURL::setPath(). Referenced by download(). |
|
References download(). |
|
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.
|
|
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.
References filecopyInternal(), KURL::isEmpty(), KURL::isLocalFile(), KURL::path(), and KURL::setPath(). Referenced by KIO::pasteData(), and upload(). |
|
References upload(). |
|
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.
References file_copy(). |
|
References file_copy(). |
|
Full-fledged equivalent of KIO::file_copy. Definition at line 117 of file netaccess.cpp. References filecopyInternal(). Referenced by copy(). |
|
Full-fledged equivalent of KIO::file_move. Moves or renames *one file*.
References filecopyInternal(). |
|
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()).
References QValueList::append(). Referenced by dircopy(). |
|
References dircopy(). |
|
Overloaded method, which takes a list of source urls. Definition at line 146 of file netaccess.cpp. References dircopyInternal(). |
|
Full-fledged equivalent of KIO::move. Moves or renames one file or directory.
References QValueList::append(). |
|
Full-fledged equivalent of KIO::move. Moves or renames a list of files or directories.
References dircopyInternal(). |
|
Tests whether a URL exists.
References QFile::exists(), KURL::isLocalFile(), KURL::path(), and statInternal(). Referenced by exists(), and KDirOperator::mkdir(). |
|
References exists(). |
|
References exists(). |
|
References exists(). |
|
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).
References m_entry, statInternal(), and KIO::UDSEntry. Referenced by KPropertiesDialog::KPropertiesDialog(), and stat(). |
|
References stat(), and KIO::UDSEntry. |
|
Deletes a file or a directory in an synchronous way. This is a convenience function for KIO::del (it saves creating a slot and testing for the job result).
References delInternal(). Referenced by del(). |
|
References del(). |
|
Creates a directory in a synchronous way.
This is a convenience function for
References mkdirInternal(). Referenced by mkdir(), and KDirOperator::mkdir(). |
|
References mkdir(). |
|
Executes a remote process via the fish ioslave in a synchrounous way.
References fish_executeInternal(). |
|
References mimetypeInternal(). |
|
Returns the error string for the last job, in case it failed.
|
The documentation for this class was generated from the following files: