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 () |
Friends | |
class | I_like_this_class |
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.
Definition at line 53 of file netaccess.cpp. References QString::arg(), filecopyInternal(), QString::isEmpty(), KURL::isLocalFile(), KTempFile::name(), KURL::path(), and KURL::setPath(). |
|
Definition at line 48 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 242 of file netaccess.cpp. References QFile::encodeName(), and KStdAccel::name(). |
|
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 89 of file netaccess.cpp. References filecopyInternal(), KURL::isEmpty(), KURL::isLocalFile(), KURL::path(), and KURL::setPath(). Referenced by KIO::pasteData(). |
|
Definition at line 84 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 112 of file netaccess.cpp. |
|
Definition at line 107 of file netaccess.cpp. |
|
Full-fledged equivalent of KIO::file_copy.
Definition at line 117 of file netaccess.cpp. References filecopyInternal(). |
|
Full-fledged equivalent of KIO::file_move. Moves or renames *one file*.
Definition at line 126 of file netaccess.cpp. 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()).
Definition at line 139 of file netaccess.cpp. References QValueList< KURL >::append(). |
|
Definition at line 134 of file netaccess.cpp. |
|
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.
Definition at line 152 of file netaccess.cpp. References QValueList< KURL >::append(). |
|
Full-fledged equivalent of KIO::move. Moves or renames a list of files or directories.
Definition at line 159 of file netaccess.cpp. References dircopyInternal(). |
|
Tests whether a URL exists.
Definition at line 180 of file netaccess.cpp. References QFile::exists(), KURL::isLocalFile(), KURL::path(), and statInternal(). Referenced by KDirOperator::mkdir(). |
|
Definition at line 170 of file netaccess.cpp. |
|
Definition at line 165 of file netaccess.cpp. |
|
Definition at line 175 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 193 of file netaccess.cpp. References m_entry, statInternal(), and KIO::UDSEntry. Referenced by KPropertiesDialog::KPropertiesDialog(). |
|
Definition at line 188 of file netaccess.cpp. References 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).
Definition at line 207 of file netaccess.cpp. References delInternal(). |
|
Definition at line 202 of file netaccess.cpp. |
|
Creates a directory in a synchronous way.
This is a convenience function for
Definition at line 218 of file netaccess.cpp. References mkdirInternal(). Referenced by KDirOperator::mkdir(). |
|
Definition at line 213 of file netaccess.cpp. |
|
Executes a remote process via the fish ioslave in a synchrounous way.
Definition at line 224 of file netaccess.cpp. References fish_executeInternal(). |
|
Definition at line 230 of file netaccess.cpp. References mimetypeInternal(). |
|
Returns the error string for the last job, in case it failed.
Definition at line 392 of file netaccess.h. |
The documentation for this class was generated from the following files: