KIO
slavebase.cpp
Go to the documentation of this file.
136 kWarning(7019) << cmdName << "called finished() or error(), but it's not supposed to! Please fix the KIO slave.";
727 qsnprintf(buffer, sizeof(buffer), "kioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig);
797 { error( ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(mProtocol, CMD_SETMODIFICATIONTIME)); }
820 if (metaData(QLatin1String("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
861 kDebug(7019) << "messageBox " << type << " " << text << " - " << caption << buttonYes << buttonNo;
QString unsupportedActionErrorString(const QString &protocol, int cmd)
Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORT...
Definition: global.cpp:376
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition: slavebase.cpp:447
QString i18n(const char *text)
void redirection(const KUrl &_url)
Call this to signal a redirection The job will take care of going to that url.
Definition: slavebase.cpp:565
When set, automatically overwrite the destination if it exists already.
Definition: jobclasses.h:67
void dropNetwork(const QString &host=QString())
Used by the slave to withdraw a connection requested by requestNetwork.
Definition: slavebase.cpp:665
Definition: slaveinterface.h:58
Definition: slaveinterface.h:56
Definition: slaveinterface.h:48
Definition: slaveinterface.h:57
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition: slavebase.cpp:638
Definition: global.h:181
Definition: global.h:177
virtual void virtual_hook(int id, void *data)
Definition: slavebase.cpp:1288
Definition: global.h:151
virtual void put(const KUrl &url, int permissions, JobFlags flags)
put, i.e.
Definition: slavebase.cpp:762
virtual void chown(const KUrl &url, const QString &owner, const QString &group)
Change ownership of url The slave emits ERR_DOES_NOT_EXIST or ERR_CANNOT_CHOWN.
Definition: slavebase.cpp:798
void setExtraField(const QString &fieldName, const QVariant &value)
Set Extra Field Value.
Definition: authinfo.cpp:177
int timeout
Definition: global.h:154
virtual void copy(const KUrl &src, const KUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition: slavebase.cpp:786
bool checkAuthInfo(KIO::AuthInfo &info, qlonglong windowId, qlonglong usertime)
Check if kpasswdserver has cached authentication information regarding an AuthInfo object...
Definition: kpasswdserver.cpp:47
virtual void dispatch(int command, const QByteArray &data)
Definition: slavebase.cpp:946
Definition: global.h:174
Definition: global.h:161
virtual void symlink(const QString &target, const KUrl &dest, JobFlags flags)
Creates a symbolic link named dest, pointing to target, which may be a relative or an absolute path...
Definition: slavebase.cpp:784
bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition: slavebase.cpp:815
Allows encoding and decoding properly remote filenames into Unicode.
Definition: kremoteencoding.h:44
This class is intended to make it easier to prompt for, cache and retrieve authorization information...
Definition: authinfo.h:57
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition: slavebase.cpp:1269
Definition: global.h:180
virtual void setSubUrl(const KUrl &url)
Prepare slave for streaming operation.
Definition: slavebase.cpp:800
Definition: global.h:162
Definition: slaveinterface.h:71
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition: slavebase.cpp:1175
Definition: global.h:152
Definition: global.h:169
Definition: global.h:156
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Definition: slaveinterface.h:68
virtual void mimetype(const KUrl &url)
Finds mimetype for one file or directory.
Definition: slavebase.cpp:780
void setMetaData(const QString &key, const QString &value)
Sets meta-data to be send to the application before the first data() or finished() signal...
Definition: slavebase.cpp:341
void connectSlave(const QString &path)
internal function to connect a slave to/ disconnect from either the slave pool or the application ...
Definition: slavebase.cpp:321
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e.
Definition: slavebase.cpp:809
Definition: slaveinterface.h:77
Definition: global.h:182
Definition: global.h:172
Definition: global.h:179
KSharedConfigPtr config()
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the mimetype.
Definition: slavebase.cpp:588
virtual void special(const QByteArray &data)
Used for any command that is specific to this slave (protocol) Examples are : HTTP POST...
Definition: slavebase.cpp:764
virtual void del(const KUrl &url, bool isfile)
Delete a file or directory.
Definition: slavebase.cpp:788
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition: slavebase.cpp:497
Definition: global.h:163
Definition: slaveinterface.h:72
void processedPercent(float percent)
Only use this if you can't know in advance the size of the copied data.
Definition: slavebase.cpp:553
virtual void stat(const KUrl &url)
Finds all details for one file or directory.
Definition: slavebase.cpp:760
Definition: slaveinterface.h:76
virtual void chmod(const KUrl &url, int permissions)
Change permissions on url The slave emits ERR_DOES_NOT_EXIST or ERR_CANNOT_CHMOD. ...
Definition: slavebase.cpp:794
Definition: global.h:170
Definition: global.h:166
Definition: slaveinterface.h:74
int messageBox(MessageBoxType type, const QString &text, const QString &caption=QString(), const QString &buttonYes=i18n("&Yes"), const QString &buttonNo=i18n("&No"))
Call this to show a message box from the slave.
Definition: slavebase.cpp:851
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition: slavebase.cpp:442
void infoMessage(const QString &msg)
Call to signal a message, to be displayed if the application wants to, for instance in a status bar...
Definition: slavebase.cpp:644
void processedSize(KIO::filesize_t _bytes)
Call this during get and copy, once in a while, to give some info about the current state...
Definition: slavebase.cpp:507
void canResume()
Call this at the beginning of get(), if the "resume" metadata was set and resuming is implemented by ...
Definition: slavebase.cpp:492
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition: slavebase.cpp:369
Definition: slaveinterface.h:80
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition: slavebase.cpp:1183
bool isModified() const
Use this method to check if the object was modified.
Definition: authinfo.cpp:165
void setTimeoutSpecialCommand(int timeout, const QByteArray &data=QByteArray())
This function sets a timeout of timeout seconds and calls special(data) when the timeout occurs as if...
Definition: slavebase.cpp:934
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:50
When set, automatically append to the destination file if it exists already.
Definition: jobclasses.h:60
void statEntry(const UDSEntry &_entry)
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms...
Definition: slavebase.cpp:671
Definition: slaveinterface.h:81
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition: slavebase.cpp:1215
bool requestNetwork(const QString &host=QString())
Used by the slave to check if it can connect to a given host.
Definition: slavebase.cpp:650
virtual void setLinkDest(const KUrl &url, const QString &target)
Change the destination of a symlink.
Definition: slavebase.cpp:790
Definition: slaveinterface.h:73
Definition: slaveinterface.h:79
Definition: slavebase.h:897
Definition: global.h:160
virtual void closeConnection()
Closes the connection (forced) Called when the application disconnects the slave to close any open ne...
Definition: slavebase.cpp:758
bool hasMetaData(const QString &key) const
Queries for the existence of a certain config/meta-data entry send by the application to the slave...
Definition: slavebase.cpp:360
static void emitSignal(const QString &signalName, const QVariantList &args)
Definition: kdirnotify.cpp:28
Definition: global.h:165
void data(const QByteArray &data)
Sends data in the slave to the job (i.e.
Definition: slavebase.cpp:398
qlonglong queryAuthInfo(KIO::AuthInfo &info, const QString &errorMsg, qlonglong windowId, qlonglong seqNr, qlonglong usertime)
Let kpasswdserver ask the user for authentication information.
Definition: kpasswdserver.cpp:113
Definition: slaveinterface.h:47
Definition: global.h:167
Definition: global.h:164
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition: slavebase.cpp:389
Definition: global.h:184
virtual void mkdir(const KUrl &url, int permissions)
Create a directory.
Definition: slavebase.cpp:792
Definition: global.h:176
Definition: slaveinterface.h:53
Definition: global.h:175
KGuiItem ok()
Definition: global.h:185
Definition: slaveinterface.h:60
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition: slavebase.cpp:380
Definition: slaveinterface.h:49
Definition: global.h:153
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition: slavebase.cpp:346
Definition: slaveinterface.h:59
Definition: slaveinterface.h:50
void needSubUrlData()
Call to signal that data from the sub-URL is needed.
Definition: slavebase.cpp:469
Definition: global.h:168
void setModified(bool flag)
Use this method to indicate that this object has been modified.
Definition: authinfo.cpp:170
void listEntry(const UDSEntry &_entry, bool ready)
internal function to be called by the slave.
Definition: slavebase.cpp:677
Definition: slaveinterface.h:69
Definition: global.h:157
virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition: slavebase.cpp:782
virtual void setModificationTime(const KUrl &url, const QDateTime &mtime)
Sets the modification time for For instance this is what CopyJob uses to set mtime on dirs at the en...
Definition: slavebase.cpp:796
void speed(unsigned long _bytes_per_second)
Call this in get and copy, to give the current transfer speed, but only if it can't be calculated out...
Definition: slavebase.cpp:559
Definition: slaveinterface.h:86
Definition: global.h:202
void sendMetaData()
Internal function to transmit meta data to the application.
Definition: slavebase.cpp:374
static QDebug kWarning(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
Definition: slaveinterface.h:78
void addAuthInfo(const KIO::AuthInfo &info, qlonglong windowId)
Manually add authentication information to kpasswdserver's cache.
Definition: kpasswdserver.cpp:185
Definition: global.h:155
int waitForAnswer(int expected1, int expected2, QByteArray &data, int *pCmd=0)
Wait for an answer to our request, until we get expected1 or expected2.
Definition: slavebase.cpp:897
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition: slavebase.cpp:482
Definition: global.h:178
Definition: slaveinterface.h:70
Definition: slaveinterface.h:82
SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
Definition: slavebase.cpp:179
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition: slavebase.cpp:704
const KShortcut & end()
Definition: slaveinterface.h:85
Definition: global.h:186
Definition: slaveinterface.h:87
static QDebug kFatal(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition: slavebase.cpp:927
Definition: global.h:173
virtual void openConnection()
Opens the connection (forced) When this function gets called the slave is operating in connection-ori...
Definition: slavebase.cpp:756
Definition: global.h:183
Definition: global.h:171
Definition: netaccess.h:36
void setCrashHandler(HandlerType handler=defaultCrashHandler)
Definition: slaveinterface.h:52
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:63
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition: slavebase.cpp:752
QStringList list(const QString &fileClass)
Returns a list of directories associated with this file-class.
Definition: krecentdirs.cpp:60
Definition: global.h:159
Definition: slaveinterface.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:50:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.