KIO
filecopyjob.cpp
33 FileCopyJobPrivate(const QUrl &src, const QUrl &dest, int permissions, bool move, JobFlags flags)
90 static inline FileCopyJob *newJob(const QUrl &src, const QUrl &dest, int permissions, bool move, JobFlags flags)
93 FileCopyJob *job = new FileCopyJob(*new FileCopyJobPrivate(src, dest, permissions, move, flags));
166 } else if (m_dest.isLocalFile() && KProtocolManager::canCopyToFile(m_src) && !KIO::Scheduler::isWorkerOnHoldFor(m_src)) {
216 m_copyJob->addMetaData(QStringLiteral("modified"), m_modificationTime.toString(Qt::ISODate)); // #55804
233 m_moveJob->addMetaData(QStringLiteral("modified"), m_modificationTime.toString(Qt::ISODate)); // #55804
330 q->connect(m_putJob, &KIO::TransferJob::canResume, q, [this](KIO::Job *job, KIO::filesize_t offset) {
362 q->connect(askUserActionInterface, renameSignal, q, [=](KIO::RenameDialog_Result result, const QUrl &, const KJob *askJob) {
390 qCWarning(KIO_CORE) << "unknown job=" << job << "m_getJob=" << m_getJob << "m_putJob=" << m_putJob;
393 void FileCopyJobPrivate::processCanResumeResult(KIO::Job *job, RenameDialog_Result result, KIO::filesize_t offset)
434 q->connect(m_getJob, &KIO::TransferJob::canResume, q, [this](KIO::Job *job, KIO::filesize_t offset) {
445 q->connect(m_getJob, &KIO::TransferJob::data, q, [this](KIO::Job *job, const QByteArray &data) {
448 q->connect(m_getJob, &KIO::TransferJob::mimeTypeFound, q, [this](KIO::Job *job, const QString &type) {
481 q->setErrorText(QStringLiteral("'Put' job did not send canResume or 'Get' job did not send data!"));
@ Overwrite
When set, automatically overwrite the destination if it exists already.
Definition: job_base.h:291
void setSourceSize(KIO::filesize_t size)
If you know the size of the source file, call this method to inform this job.
Definition: filecopyjob.cpp:177
virtual ClipboardUpdater * createClipboardUpdater(Job *job, ClipboardUpdaterMode mode)
Creates a clipboard updater as a child of the given job.
Definition: jobuidelegateextension.cpp:21
virtual void registerJob(KJob *job)
static bool canCopyToFile(const QUrl &url)
Returns whether the protocol can copy files/objects directly to the filesystem itself.
Definition: kprotocolmanager.cpp:1130
static bool canRenameFromFile(const QUrl &url)
Returns whether the protocol can rename (i.e.
Definition: kprotocolmanager.cpp:1140
KIOCORE_EXPORT SimpleJob * file_delete(const QUrl &src, JobFlags flags=DefaultFlags)
Delete a single file.
Definition: job.cpp:380
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void setErrorText(const QString &errorText)
bool suspend()
KIOCORE_EXPORT TransferJob * put(const QUrl &url, int permissions, JobFlags flags=DefaultFlags)
Put (means: write)
Definition: storedtransferjob.cpp:449
bool remove()
void percentChanged(KJob *job, unsigned long percent)
QString scheme() const const
singleShot
@ NoPrivilegeExecution
When set, notifies the worker that application/job does not want privilege execution.
Definition: job_base.h:300
Definition: simplejob.h:26
void addMetaData(const QString &key, const QString &value)
Add key/value pair to the meta data that is sent to the worker.
Definition: job.cpp:228
QString userName(QUrl::ComponentFormattingOptions options) const const
KIOCORE_EXPORT TransferJob * get(const QUrl &url, LoadType reload=NoReload, JobFlags flags=DefaultFlags)
Get (means: read).
Definition: transferjob.cpp:471
bool kill(KillVerbosity verbosity=Quietly)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
KIOCORE_EXPORT FileCopyJob * file_copy(const QUrl &src, const QUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Copy a single file.
Definition: filecopyjob.cpp:639
KIOCORE_EXPORT KJobTrackerInterface * getJobTracker()
Returns the job tracker to be used by all KIO jobs (in which HideProgressInfo is not set)
Definition: jobtracker.cpp:14
static bool autoResume()
Returns true if partial downloads should be automatically resumed.
Definition: kprotocolmanager.cpp:946
QString toString(QUrl::FormattingOptions options) const const
void setTotalAmount(Unit unit, qulonglong amount)
QString i18n(const char *text, const TYPE &arg...)
KIOCORE_EXPORT ChmodJob * chmod(const KFileItemList &lstItems, int permissions, int mask, const QString &newOwner, const QString &newGroup, bool recursive, JobFlags flags=DefaultFlags)
Creates a job that changes permissions/ownership on several files or directories, optionally recursiv...
Definition: chmodjob.cpp:288
void canResume(KIO::Job *job, KIO::filesize_t offset)
QString errorText() const
KIOCORE_EXPORT CopyJob * move(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
Moves a file or directory src to the given destination dest.
Definition: copyjob.cpp:2649
Definition: job_base.h:44
@ RenameDialog_Overwrite
We have an existing destination, show details about it and offer to overwrite it.
Definition: jobuidelegateextension.h:28
KIOCORE_EXPORT KJobUiDelegate * createDefaultJobUiDelegate()
Convenience method: use default factory, if there's one, to create a delegate and return it.
Definition: jobuidelegatefactory.cpp:23
bool addSubjob(KJob *job) override
Add a job that has to be finished before a result is emitted.
Definition: job.cpp:63
static bool isWorkerOnHoldFor(const QUrl &url)
Returns true if there is a worker on hold for url.
Definition: scheduler.cpp:842
KIOCORE_EXPORT FileCopyJob * file_move(const QUrl &src, const QUrl &dest, int permissions=-1, JobFlags flags=DefaultFlags)
Move a single file.
Definition: filecopyjob.cpp:644
static bool canRenameToFile(const QUrl &url)
Returns whether the protocol can rename (i.e.
Definition: kprotocolmanager.cpp:1150
QFlags< RenameDialog_Option > RenameDialog_Options
Stores a combination of RenameDialog_Option values.
Definition: jobuidelegateextension.h:45
bool setProperty(const char *name, const QVariant &value)
void slotResult(KJob *job) override
Called whenever a subjob finishes.
Definition: filecopyjob.cpp:505
QString host(QUrl::ComponentFormattingOptions options) const const
void askUserRenameResult(KIO::RenameDialog_Result result, const QUrl &newUrl, KJob *parentJob)
Implementations of this interface must emit this signal when the rename dialog finishes,...
void totalSize(KJob *job, qulonglong size)
void setModificationTime(const QDateTime &mtime)
Sets the modification time of the file to be created (by KIO::put) Note that some KIO workers might i...
Definition: transferjob.cpp:466
static bool canCopyFromFile(const QUrl &url)
Returns whether the protocol can copy files/objects directly from the filesystem itself.
Definition: kprotocolmanager.cpp:1120
void mimeTypeFound(KIO::Job *job, const QString &mimeType)
MIME type determined.
int port(int defaultPort) const const
bool isLocalFile() const const
void setUiDelegate(KJobUiDelegate *delegate)
Definition: filecopyjob.h:25
bool isValid() const const
QString password(QUrl::ComponentFormattingOptions options) const const
@ HideProgressInfo
Hide progress information dialog, i.e. don't show a GUI.
Definition: job_base.h:275
KIOCORE_EXPORT QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:55
void processedSize(KJob *job, qulonglong size)
JobUiDelegateExtension * uiDelegateExtension() const
Retrieves the UI delegate extension used by this job.
Definition: job.cpp:51
void emitResult()
int error() const
QString toString(Qt::DateFormat format) const const
bool hasSubjobs() const
void data(KIO::Job *job, const QByteArray &data)
Data from the worker has arrived.
void setError(int errorCode)
void setModificationTime(const QDateTime &mtime)
Sets the modification time of the file.
Definition: filecopyjob.cpp:186
@ RenameDialog_Resume
Offer a "Resume" button (plus "Resume All" if RenameDialog_MultipleItems).
Definition: jobuidelegateextension.h:33
ISODate
Q_D(Todo)
Bytes
virtual QVariant get(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
Definition: transferjob.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:51:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 9 2023 03:51:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.