KIO
slavebase.cpp
110 << "KIOSLAVE_ENABLE_TESTMODE is deprecated for KF6, and will be unsupported soon. Please use KIOWORKER_ENABLE_TESTMODE with KF6.";
216 qUtf8Printable(QStringLiteral("%1 did not call finished() or error()! Please fix the %2 KIO worker.")
233 qUtf8Printable(QStringLiteral("%1 called finished() or error(), but it's not supposed to! Please fix the %2 KIO worker.")
277SlaveBase::SlaveBase(const QByteArray &protocol, const QByteArray &pool_socket, const QByteArray &app_socket)
474 d->configGroup->writeEntry(it.key(), it->toString().toUtf8(), KConfigGroup::WriteConfigFlags());
538 qUtf8Printable(QStringLiteral("error() was called, but it's not supposed to! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
543 qUtf8Printable(QStringLiteral("error() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
549 qUtf8Printable(QStringLiteral("error() called after finished()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
580 qCWarning(KIO_CORE) << "UDSEntry for '.' not found, creating a default one. Please fix the" << QCoreApplication::applicationName() << "KIO worker.";
586 entry.fastInsert(KIO::UDSEntry::UDS_ACCESS, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
598 QStringLiteral("finished() was called, but it's not supposed to! Please fix the %2 KIO worker.").arg(QCoreApplication::applicationName())));
603 qUtf8Printable(QStringLiteral("finished() called twice! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
609 qUtf8Printable(QStringLiteral("finished() called after error()! Please fix the %1 KIO worker.").arg(QCoreApplication::applicationName())));
971 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_SETMODIFICATIONTIME));
994 if (metaData(QStringLiteral("no-auth-prompt")).compare(QLatin1String("true"), Qt::CaseInsensitive) == 0) {
1010 const int errCode = passwdServerClient->queryAuthInfo(&dlgInfo, errorMessage, windowId, userTimestamp);
1020int SlaveBase::messageBox(MessageBoxType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText)
1369 return (passwdServerClient->checkAuthInfo(&info, metaData(QStringLiteral("window-id")).toLong(), metaData(QStringLiteral("user-timestamp")).toULong()));
1504 error(ERR_UNSUPPORTED_ACTION, unsupportedActionErrorString(protocolName(), CMD_FILESYSTEMFREESPACE));
1562 if (metaData(QStringLiteral("UnitTesting")) != QLatin1String("true") && d->m_privilegeOperationStatus == OperationAllowed && !d->m_confirmationAsked) {
1565 // As workaround details are passed instead via metadata before and then cached by the WorkerInterface,
1572 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:1580
virtual void mimetype(const QUrl &url)
Finds MIME type for one file or directory.
Definition slavebase.cpp:937
bool wasKilled() const
If your ioslave was killed by a signal, wasKilled() returns true.
Definition slavebase.cpp:1468
void mimeType(const QString &_type)
Call this in mimetype() and in get(), when you know the MIME type.
Definition slavebase.cpp:717
virtual void dispatch(int command, const QByteArray &data)
Definition slavebase.cpp:1126
QMap< QString, QVariant > mapConfig() const
Returns a map to query config/meta-data information from.
Definition slavebase.cpp:445
PrivilegeOperationStatus requestPrivilegeOperation(const QString &operationDetails)
Checks with job if privilege operation is allowed.
Definition slavebase.cpp:1552
QString metaData(const QString &key) const
Queries for config/meta-data send by the application to the slave.
Definition slavebase.cpp:420
int openPasswordDialogV2(KIO::AuthInfo &info, const QString &errorMsg=QString())
Prompt the user for Authorization info (login & password).
Definition slavebase.cpp:989
virtual void copy(const QUrl &src, const QUrl &dest, int permissions, JobFlags flags)
Copy src into dest.
Definition slavebase.cpp:949
void sendAndKeepMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:487
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:695
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:779
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:649
virtual void reparseConfiguration()
Called by the scheduler to tell the slave that the configuration changed (i.e. proxy settings).
Definition slavebase.cpp:983
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:1111
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:1020
void warning(const QString &msg)
Call to signal a warning, to be displayed in a dialog box.
Definition slavebase.cpp:773
void finished()
Call to signal successful completion of any command besides openConnection and closeConnection.
Definition slavebase.cpp:572
void slaveStatus(const QString &host, bool connected)
Used to report the status of the slave.
Definition slavebase.cpp:627
bool cacheAuthentication(const AuthInfo &info)
Caches info in a persistent storage like KWallet.
Definition slavebase.cpp:1415
virtual void rename(const QUrl &src, const QUrl &dest, JobFlags flags)
Rename oldname into newname.
Definition slavebase.cpp:941
virtual void setLinkDest(const QUrl &url, const QString &target)
Change the destination of a symlink.
Definition slavebase.cpp:957
void sendMetaData()
Internal function to transmit meta data to the application.
Definition slavebase.cpp:481
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:791
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:434
void statEntry(const UDSEntry &_entry)
Call this from stat() to express details about an object, the UDSEntry customarily contains the atoms...
Definition slavebase.cpp:785
virtual void setHost(const QString &host, quint16 port, const QString &user, const QString &pass)
Set the host.
Definition slavebase.cpp:840
virtual void chown(const QUrl &url, const QString &owner, const QString &group)
Change ownership of url.
Definition slavebase.cpp:973
void connected()
Call in openConnection, if you reimplement it, when you're done.
Definition slavebase.cpp:567
KRemoteEncoding * remoteEncoding()
Returns an object that can translate remote filenames into proper Unicode forms.
Definition slavebase.cpp:496
virtual void dispatchOpenCommand(int command, const QByteArray &data)
Definition slavebase.cpp:1375
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:945
int readData(QByteArray &buffer)
Read data sent by the job, after a dataReq.
Definition slavebase.cpp:1104
void connectSlave(const QString &path)
internal function to connect a slave to/ disconnect from either the slave pool or the application
Definition slavebase.cpp:397
virtual void put(const QUrl &url, int permissions, JobFlags flags)
put, i.e. write data into a file.
Definition slavebase.cpp:901
void processedPercent(float percent)
Only use this if you can't know in advance the size of the copied data.
Definition slavebase.cpp:690
virtual void special(const QByteArray &data)
Used for any command that is specific to this slave (protocol).
Definition slavebase.cpp:905
virtual void del(const QUrl &url, bool isfile)
Delete a file or directory.
Definition slavebase.cpp:953
void data(const QByteArray &data)
Sends data in the slave to the job (i.e. in get).
Definition slavebase.cpp:506
virtual void chmod(const QUrl &url, int permissions)
Change permissions on url.
Definition slavebase.cpp:965
void listEntries(const UDSEntryList &_entry)
Call this in listDir, each time you have a bunch of entries to report.
Definition slavebase.cpp:817
virtual void setModificationTime(const QUrl &url, const QDateTime &mtime)
Sets the modification time for url.
Definition slavebase.cpp:969
void totalSize(KIO::filesize_t _bytes)
Call this in get and copy, to give the total size of the file.
Definition slavebase.cpp:640
virtual void stat(const QUrl &url)
Finds all details for one file or directory.
Definition slavebase.cpp:897
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:1077
void canResume()
Call this at the beginning of get(), if the "range-start" metadata was set and returning byte ranges ...
Definition slavebase.cpp:635
bool checkCachedAuthentication(AuthInfo &info)
Checks for cached authentication based on parameters given by info.
Definition slavebase.cpp:1365
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:415
KConfigGroup * config()
Returns a configuration object to query config/meta-data information from.
Definition slavebase.cpp:465
bool configValue(const QString &key, bool defaultValue) const
Returns a bool from the config/meta-data information.
Definition slavebase.cpp:450
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:242
void addAuthInfo(const KIO::AuthInfo &info, qlonglong windowId)
Manually add authentication information to kpasswdserver's cache.
Definition kpasswdserverclient.cpp:120
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:74
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:849
@ 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
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 Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.