KIO
slavebase.cpp
110 << "KIOSLAVE_ENABLE_TESTMODE is deprecated for KF6, and will be unsupported soon. Please use KIOWORKER_ENABLE_TESTMODE with KF6.";
210 qUtf8Printable(QStringLiteral("%1 did not call finished() or error()! Please fix the %2 KIO worker.")
227 qUtf8Printable(QStringLiteral("%1 called finished() or error(), but it's not supposed to! Please fix the %2 KIO worker.")
271SlaveBase::SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
468 d->configGroup->writeEntry(it.key(), it->toString().toUtf8(), KConfigGroup::WriteConfigFlags());
532 qUtf8Printable(QStringLiteral("error() was called, but it's not supposed to! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
537 qUtf8Printable(QStringLiteral("error() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
543 qUtf8Printable(QStringLiteral("error() called after finished()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
574 qCWarning(KIO_CORE) << "UDSEntry for '.' not found, creating a default one. Please fix the" << QCoreApplication::applicationName() << "KIO worker.";
580 entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
592 QStringLiteral("finished() was called, but it's not supposed to! Please fix the %2 KIO worker.").arg(QCoreApplication::applicationName())));
597 qUtf8Printable(QStringLiteral("finished() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
603 qUtf8Printable(QStringLiteral("finished() called after error()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
965 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_SETMODIFICATIONTIME));
988 if (metaData(QStringLiteral("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
1004 const int errCode = passwdServerClient->queryAuthInfo(&dlgInfo, errorMessage, windowId, userTimestamp);
1014int SlaveBase::messageBox(MessageBoxType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText)
1363 return (passwdServerClient->checkAuthInfo(&info, metaData(QStringLiteral("window-id")).toLong(), metaData(QStringLiteral("user-timestamp")).toULong()));
1498 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_FILESYSTEMFREESPACE));
1556 if (metaData(QStringLiteral("UnitTesting")) != QLatin1String("true") && d->m_privilegeOperationStatus == OperationAllowed && !d->m_confirmationAsked) {
1559 // As workaround details are passed instead via metadata before and then cached by the WorkerInterface,
1566 int result = messageBox(d->m_warningMessage, WarningContinueCancelDetailed, d->m_warningTitle, QString(), QString(), QString());
static void setApplicationData(const KAboutData &aboutData)
AuthorizedStatus
SimpleConfig
This class is intended to make it easier to prompt for, cache and retrieve authorization information.
void setModified(bool flag)
Use this method to indicate that this object has been modified.
Definition authinfo.cpp:147
void setExtraField(const QString &fieldName, const QVariant &value)
Set Extra Field Value.
Definition authinfo.cpp:154
MetaData is a simple map of key/value strings.
There are two classes that specifies the protocol between application (job) and kioslave.
void addTemporaryAuthorization(const QString &action)
Adds action to the list of PolicyKit actions which the slave is authorized to perform.
Definition slavebase.cpp:1574
virtual void mimetype(const QUrl &url)
Finds MIME type for one file or directory.
Definition slavebase.cpp:931
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition slavebase.cpp:1462
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the MIME type.
Definition slavebase.cpp:711
virtual void dispatch(int command, const QByteArray &data)
Definition slavebase.cpp:1120
QMap< QString, QVariant > mapConfig() const
Returns a map to query config/meta-data information from.
Definition slavebase.cpp:439
PrivilegeOperationStatus requestPrivilegeOperation(const QString &operationDetails)
Checks with job if privilege operation is allowed.
Definition slavebase.cpp:1546
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition slavebase.cpp:414
int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition slavebase.cpp:983
virtual void copy(const QUrl &src, const QUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition slavebase.cpp:943
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:481
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:689
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:773
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:643
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e. proxy settings).
Definition slavebase.cpp:977
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:1105
int messageBox(MessageBoxType type, const QString &text, const QString &title=QString(), const QString &primaryActionText=QString(), const QString &secondaryActionText=QString())
Call this to show a message box from the slave.
Definition slavebase.cpp:1014
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition slavebase.cpp:767
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition slavebase.cpp:566
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition slavebase.cpp:621
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition slavebase.cpp:1409
virtual void rename(const QUrl &src, const QUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition slavebase.cpp:935
virtual void setLinkDest(const QUrl &url, const QString &target)
Change the destination of a symlink.
Definition slavebase.cpp:951
void sendMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:475
void listEntry(const UDSEntry &entry)
It collects entries and emits them via listEntries when enough of them are there or a certain time fr...
Definition slavebase.cpp:785
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:428
void statEntry(const UDSEntry &_entry)
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms...
Definition slavebase.cpp:779
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition slavebase.cpp:834
virtual void chown(const QUrl &url, const QString &owner, const QString &group)
Change ownership of url.
Definition slavebase.cpp:967
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition slavebase.cpp:561
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition slavebase.cpp:490
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition slavebase.cpp:1369
virtual void symlink(const QString &target, const QUrl &dest, JobFlags flags)
Creates a symbolic link named dest, pointing to target, which may be a relative or an absolute path.
Definition slavebase.cpp:939
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition slavebase.cpp:1098
void connectSlave(const QString &path)
internal function to connect a slave to/ disconnect from either the slave pool or the application
Definition slavebase.cpp:391
virtual void put(const QUrl &url, int permissions, JobFlags flags)
put, i.e. write data into a file.
Definition slavebase.cpp:895
void processedPercent(float percent)
Only use this if you can't know in advance the size of the copied data.
Definition slavebase.cpp:684
virtual void special(const QByteArray &data)
Used for any command that is specific to this slave (protocol).
Definition slavebase.cpp:899
virtual void del(const QUrl &url, bool isfile)
Delete a file or directory.
Definition slavebase.cpp:947
void data(const QByteArray &data)
Sends data in the slave to the job (i.e. in get).
Definition slavebase.cpp:500
virtual void chmod(const QUrl &url, int permissions)
Change permissions on url.
Definition slavebase.cpp:959
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition slavebase.cpp:811
virtual void setModificationTime(const QUrl &url, const QDateTime &mtime)
Sets the modification time for url.
Definition slavebase.cpp:963
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition slavebase.cpp:634
virtual void stat(const QUrl &url)
Finds all details for one file or directory.
Definition slavebase.cpp:891
int waitForAnswer(int expected1, int expected2, QByteArray &data, int *pCmd=nullptr)
Wait for an answer to our request, until we get expected1 or expected2.
Definition slavebase.cpp:1071
void canResume()
Call this at the beginning of get(), if the "range-start" metadata was set and returning byte ranges ...
Definition slavebase.cpp:629
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition slavebase.cpp:1359
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:409
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition slavebase.cpp:459
bool configValue(const QString &key, bool defaultValue) const
Returns a bool from the config/meta-data information.
Definition slavebase.cpp:444
Universal Directory Service.
void reserve(int size)
Calling this function before inserting items into an empty UDSEntry may save time and memory.
Definition udsentry.cpp:385
void fastInsert(uint field, const QString &value)
insert field with string value, it will assert if the field is already inserted.
Definition udsentry.cpp:390
@ UDS_FILE_TYPE
File type, part of the mode returned by stat (for a link, this returns the file type of the pointed i...
Definition udsentry.h:243
void addAuthInfo(const KIO::AuthInfo &info, qlonglong windowId)
Manually add authentication information to kpasswdserver's cache.
Definition kpasswdserverclient.cpp:121
bool checkAuthInfo(KIO::AuthInfo *info, qlonglong windowId, qlonglong usertime)
Check if kpasswdserver has cached authentication information regarding an AuthInfo object.
Definition kpasswdserverclient.cpp:41
int queryAuthInfo(KIO::AuthInfo *info, const QString &errorMsg, qlonglong windowId, qlonglong usertime)
Let kpasswdserver ask the user for authentication information.
Definition kpasswdserverclient.cpp:75
Allows encoding and decoding properly remote filenames into Unicode.
Definition kremoteencoding.h:37
QString i18n(const char *text, const TYPE &arg...)
KCRASH_EXPORT void initialize()
QAction * end(const QObject *recvr, const char *slot, QObject *parent)
KIOCORE_EXPORT QString unsupportedActionErrorString(const QString &protocol, int cmd)
Returns an appropriate error message if the given command cmd is an unsupported action (ERR_UNSUPPORT...
Definition slavebase.cpp:843
@ Resume
When set, automatically append to the destination file if it exists already.
Definition job_base.h:260
@ Overwrite
When set, automatically overwrite the destination if it exists already.
Definition job_base.h:267
const char * constData() const const
bool isEmpty() const const
applicationName
QStringList arguments()
void sendPostedEvents(QObject *receiver, int event_type)
DeferredDelete
QString decodeName(const QByteArray &localFileName)
UnknownError
void setAddresses(const QList< QHostAddress > &addresses)
void setError(HostInfoError error)
void setErrorString(const QString &str)
void setHostName(const QString &hostName)
WriteOnly
void reserve(qsizetype size)
ConstIterator
void clear()
const_iterator constBegin() const const
const_iterator constEnd() const const
bool contains(const Key &key) const const
iterator end()
iterator find(const Key &key)
iterator insert(const Key &key, const T &value)
bool isEmpty() const const
QThread * thread() const const
iterator begin()
iterator end()
iterator erase(const_iterator pos)
bool isEmpty() const const
void setTestModeEnabled(bool testMode)
QString fromUtf8(QByteArrayView str)
QString number(double n, char format, int precision)
int toInt(bool *ok, int base) const const
long toLong(bool *ok, int base) const const
ulong toULong(bool *ok, int base) const const
CaseInsensitive
QThread * currentThread()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 25 2024 11:54:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 25 2024 11:54:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.