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.";
402}
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;
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
void deleteGroup(const char *group, WriteConfigFlags flags=Normal)
SimpleConfig
This class is intended to make it easier to prompt for, cache and retrieve authorization information.
Definition: authinfo.h:58
bool isModified() const
Use this method to check if the object was modified.
Definition: authinfo.cpp:165
void setModified(bool flag)
Use this method to indicate that this object has been modified.
Definition: authinfo.cpp:170
void setExtraField(const QString &fieldName, const QVariant &value)
Set Extra Field Value.
Definition: authinfo.cpp:177
bool checkAuthInfo(KIO::AuthInfo &info, qlonglong windowId, qlonglong usertime)
Check if kpasswdserver has cached authentication information regarding an AuthInfo object.
Definition: kpasswdserver.cpp:47
void addAuthInfo(const KIO::AuthInfo &info, qlonglong windowId)
Manually add authentication information to kpasswdserver's cache.
Definition: kpasswdserver.cpp:185
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
There are two classes that specifies the protocol between application (job) and kioslave.
Definition: slavebase.h:51
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition: slavebase.cpp:1269
virtual void setModificationTime(const KUrl &url, const QDateTime &mtime)
Sets the modification time for @url For instance this is what CopyJob uses to set mtime on dirs at th...
Definition: slavebase.cpp:796
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the mimetype.
Definition: slavebase.cpp:588
virtual void dispatch(int command, const QByteArray &data)
Definition: slavebase.cpp:946
virtual void copy(const KUrl &src, const KUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition: slavebase.cpp:786
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition: slavebase.cpp:346
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition: slavebase.cpp:380
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
virtual void mkdir(const KUrl &url, int permissions)
Create a directory.
Definition: slavebase.cpp:792
virtual void put(const KUrl &url, int permissions, JobFlags flags)
put, i.e.
Definition: slavebase.cpp:762
virtual void del(const KUrl &url, bool isfile)
Delete a file or directory.
Definition: slavebase.cpp:788
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 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
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e.
Definition: slavebase.cpp:809
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
virtual void mimetype(const KUrl &url)
Finds mimetype for one file or directory.
Definition: slavebase.cpp:780
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition: slavebase.cpp:638
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition: slavebase.cpp:447
virtual void openConnection()
Opens the connection (forced) When this function gets called the slave is operating in connection-ori...
Definition: slavebase.cpp:756
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition: slavebase.cpp:482
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
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
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition: slavebase.cpp:1215
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
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
bool requestNetwork(const QString &host=QString())
Used by the slave to check if it can connect to a given host.
Definition: slavebase.cpp:650
void sendMetaData()
Internal function to transmit meta data to the application.
Definition: slavebase.cpp:374
SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
Definition: slavebase.cpp:179
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
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
bool openPasswordDialog(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition: slavebase.cpp:815
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition: slavebase.cpp:752
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition: slavebase.cpp:442
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition: slavebase.cpp:389
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition: slavebase.cpp:1183
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition: slavebase.cpp:927
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 virtual_hook(int id, void *data)
Definition: slavebase.cpp:1288
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
virtual void stat(const KUrl &url)
Finds all details for one file or directory.
Definition: slavebase.cpp:760
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 special(const QByteArray &data)
Used for any command that is specific to this slave (protocol) Examples are : HTTP POST,...
Definition: slavebase.cpp:764
void dropNetwork(const QString &host=QString())
Used by the slave to withdraw a connection requested by requestNetwork.
Definition: slavebase.cpp:665
void data(const QByteArray &data)
Sends data in the slave to the job (i.e.
Definition: slavebase.cpp:398
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition: slavebase.cpp:704
virtual void setLinkDest(const KUrl &url, const QString &target)
Change the destination of a symlink.
Definition: slavebase.cpp:790
void listEntry(const UDSEntry &_entry, bool ready)
internal function to be called by the slave.
Definition: slavebase.cpp:677
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition: slavebase.cpp:497
virtual void closeConnection()
Closes the connection (forced) Called when the application disconnects the slave to close any open ne...
Definition: slavebase.cpp:758
void needSubUrlData()
Call to signal that data from the sub-URL is needed.
Definition: slavebase.cpp:469
virtual void setSubUrl(const KUrl &url)
Prepare slave for streaming operation.
Definition: slavebase.cpp:800
virtual void rename(const KUrl &src, const KUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition: slavebase.cpp:782
void canResume()
Call this at the beginning of get(), if the "resume" metadata was set and resuming is implemented by ...
Definition: slavebase.cpp:492
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition: slavebase.cpp:1175
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
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition: slavebase.cpp:369
Allows encoding and decoding properly remote filenames into Unicode.
Definition: kremoteencoding.h:45
#define kDebug
#define kWarning
static void emitSignal(const QString &signalName, const QVariantList &args)
Definition: kdirnotify.cpp:28
int timeout
QString i18n(const char *text)
void setCrashHandler(HandlerType handler=defaultCrashHandler)
QString caption()
KSharedConfigPtr config()
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
@ Resume
When set, automatically append to the destination file if it exists already.
Definition: jobclasses.h:60
@ Overwrite
When set, automatically overwrite the destination if it exists already.
Definition: jobclasses.h:67
QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:63
group
KGuiItem ok()
const KShortcut & end()
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.