KIO
slavebase.cpp
108 << "KIOSLAVE_ENABLE_TESTMODE is deprecated for KF6, and will be unsupported soon. Please use KIOWORKER_ENABLE_TESTMODE with KF6.";
208 qUtf8Printable(QStringLiteral("%1 did not call finished() or error()! Please fix the %2 KIO worker.")
225 qUtf8Printable(QStringLiteral("%1 called finished() or error(), but it's not supposed to! Please fix the %2 KIO worker.")
269SlaveBase::SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
461 d->configGroup->writeEntry(it.key(), it->toString().toUtf8(), KConfigGroup::WriteConfigFlags());
525 qUtf8Printable(QStringLiteral("error() was called, but it's not supposed to! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
530 qUtf8Printable(QStringLiteral("error() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
536 qUtf8Printable(QStringLiteral("error() called after finished()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
567 qCWarning(KIO_CORE) << "UDSEntry for '.' not found, creating a default one. Please fix the" << QCoreApplication::applicationName() << "KIO worker.";
573 entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
585 QStringLiteral("finished() was called, but it's not supposed to! Please fix the %2 KIO worker.").arg(QCoreApplication::applicationName())));
590 qUtf8Printable(QStringLiteral("finished() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
596 qUtf8Printable(QStringLiteral("finished() called after error()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
963 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_SETMODIFICATIONTIME));
986 if (metaData(QStringLiteral("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
1002 const int errCode = passwdServerClient->queryAuthInfo(&dlgInfo, errorMessage, windowId, userTimestamp);
1012int SlaveBase::messageBox(MessageBoxType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText)
1361 return (passwdServerClient->checkAuthInfo(&info, metaData(QStringLiteral("window-id")).toLong(), metaData(QStringLiteral("user-timestamp")).toULong()));
1496 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_FILESYSTEMFREESPACE));
1554 if (metaData(QStringLiteral("UnitTesting")) != QLatin1String("true") && d->m_privilegeOperationStatus == OperationAllowed && !d->m_confirmationAsked) {
1557 // As workaround details are passed instead via metadata before and then cached by the WorkerInterface,
1564 int result = messageBox(d->m_warningMessage, WarningContinueCancelDetailed, d->m_warningTitle, QString(), QString(), QString());
AuthorizedStatus
QFlags< WriteConfigFlag > WriteConfigFlags
SimpleConfig
This class is intended to make it easier to prompt for, cache and retrieve authorization information.
Definition authinfo.h:50
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
There are two classes that specifies the protocol between application (job) and kioslave.
Definition slavebase.h:56
void addTemporaryAuthorization(const QString &action)
Adds action to the list of PolicyKit actions which the slave is authorized to perform.
Definition slavebase.cpp:1572
virtual void mimetype(const QUrl &url)
Finds MIME type for one file or directory.
Definition slavebase.cpp:929
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition slavebase.cpp:1460
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the MIME type.
Definition slavebase.cpp:709
virtual void dispatch(int command, const QByteArray &data)
Definition slavebase.cpp:1118
QMap< QString, QVariant > mapConfig() const
Returns a map to query config/meta-data information from.
Definition slavebase.cpp:432
PrivilegeOperationStatus requestPrivilegeOperation(const QString &operationDetails)
Checks with job if privilege operation is allowed.
Definition slavebase.cpp:1544
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition slavebase.cpp:407
int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition slavebase.cpp:981
virtual void copy(const QUrl &src, const QUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition slavebase.cpp:941
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:474
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:682
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:771
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:636
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e. proxy settings).
Definition slavebase.cpp:975
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:1103
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:1012
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition slavebase.cpp:765
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition slavebase.cpp:559
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition slavebase.cpp:614
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition slavebase.cpp:1407
virtual void rename(const QUrl &src, const QUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition slavebase.cpp:933
virtual void setLinkDest(const QUrl &url, const QString &target)
Change the destination of a symlink.
Definition slavebase.cpp:949
void sendMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:468
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:783
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:421
void statEntry(const UDSEntry &_entry)
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms...
Definition slavebase.cpp:777
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition slavebase.cpp:832
virtual void chown(const QUrl &url, const QString &owner, const QString &group)
Change ownership of url.
Definition slavebase.cpp:965
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition slavebase.cpp:554
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition slavebase.cpp:483
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition slavebase.cpp:1367
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:937
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition slavebase.cpp:1096
void connectSlave(const QString &path)
internal function to connect a slave to/ disconnect from either the slave pool or the application
Definition slavebase.cpp:384
virtual void put(const QUrl &url, int permissions, JobFlags flags)
put, i.e. write data into a file.
Definition slavebase.cpp:893
void processedPercent(float percent)
Only use this if you can't know in advance the size of the copied data.
Definition slavebase.cpp:677
virtual void special(const QByteArray &data)
Used for any command that is specific to this slave (protocol).
Definition slavebase.cpp:897
virtual void del(const QUrl &url, bool isfile)
Delete a file or directory.
Definition slavebase.cpp:945
void data(const QByteArray &data)
Sends data in the slave to the job (i.e. in get).
Definition slavebase.cpp:493
virtual void chmod(const QUrl &url, int permissions)
Change permissions on url.
Definition slavebase.cpp:957
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition slavebase.cpp:809
virtual void setModificationTime(const QUrl &url, const QDateTime &mtime)
Sets the modification time for url.
Definition slavebase.cpp:961
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition slavebase.cpp:627
virtual void stat(const QUrl &url)
Finds all details for one file or directory.
Definition slavebase.cpp:889
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:1069
void canResume()
Call this at the beginning of get(), if the "range-start" metadata was set and returning byte ranges ...
Definition slavebase.cpp:622
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition slavebase.cpp:1357
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:402
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition slavebase.cpp:452
bool configValue(const QString &key, bool defaultValue) const
Returns a bool from the config/meta-data information.
Definition slavebase.cpp:437
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:242
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()
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:841
@ 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 QList< QKeySequence > & end()
const char * constData() const const
bool isEmpty() const const
applicationName
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)
typedef 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 Tue Mar 26 2024 11:18:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:51 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.