• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KIO

  • KIO
  • CopyJob
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
KIO::CopyJob Class Reference

#include <copyjob.h>

Inheritance diagram for KIO::CopyJob:
KIO::Job KCompositeJob KJob QObject

Public Types

enum  CopyMode { Copy , Move , Link }
 
- Public Types inherited from KJob
enum  Capability
 
enum  KillVerbosity
 
enum  Unit
 

Signals

void aboutToCreate (KIO::Job *job, const QList< KIO::CopyInfo > &files)
 
void copying (KIO::Job *job, const KUrl &src, const KUrl &dest)
 
void copyingDone (KIO::Job *job, const KUrl &from, const KUrl &to, time_t mtime, bool directory, bool renamed)
 
void copyingLinkDone (KIO::Job *job, const KUrl &from, const QString &target, const KUrl &to)
 
void creatingDir (KIO::Job *job, const KUrl &dir)
 
void linking (KIO::Job *job, const QString &target, const KUrl &to)
 
void moving (KIO::Job *job, const KUrl &from, const KUrl &to)
 
void processedDirs (KIO::Job *job, unsigned long dirs)
 
void processedFiles (KIO::Job *job, unsigned long files)
 
void renamed (KIO::Job *job, const KUrl &from, const KUrl &to)
 
void totalDirs (KJob *job, unsigned long dirs)
 
void totalFiles (KJob *job, unsigned long files)
 
- Signals inherited from KIO::Job
void canceled (KJob *job)
 
void connected (KIO::Job *job)
 
- Signals inherited from KJob
void description (KJob *job, const QString &title, const QPair< QString, QString > &field1=qMakePair(QString(), QString()), const QPair< QString, QString > &field2=qMakePair(QString(), QString()))
 
void finished (KJob *job)
 
void infoMessage (KJob *job, const QString &plain, const QString &rich=QString())
 
void percent (KJob *job, unsigned long percent)
 
void processedAmount (KJob *job, KJob::Unit unit, qulonglong amount)
 
void processedSize (KJob *job, qulonglong size)
 
void result (KJob *job)
 
void resumed (KJob *job)
 
void speed (KJob *job, unsigned long speed)
 
void suspended (KJob *job)
 
void totalAmount (KJob *job, KJob::Unit unit, qulonglong amount)
 
void totalSize (KJob *job, qulonglong size)
 
void warning (KJob *job, const QString &plain, const QString &rich=QString())
 

Public Member Functions

virtual ~CopyJob ()
 
KUrl destUrl () const
 
virtual bool doSuspend ()
 
CopyMode operationMode () const
 
void setAutoRename (bool autoRename)
 
void setAutoSkip (bool autoSkip)
 
void setDefaultPermissions (bool b)
 
void setWriteIntoExistingDirectories (bool overwriteAllDirs)
 
KUrl::List srcUrls () const
 
- Public Member Functions inherited from KIO::Job
virtual ~Job ()
 
void addMetaData (const QMap< QString, QString > &values)
 
void addMetaData (const QString &key, const QString &value)
 
QStringList detailedErrorStrings (const KUrl *reqUrl=0L, int method=-1) const
 
QString errorString () const
 
bool isInteractive () const
 
void mergeMetaData (const QMap< QString, QString > &values)
 
MetaData metaData () const
 
MetaData outgoingMetaData () const
 
Job * parentJob () const
 
QString queryMetaData (const QString &key)
 
void setMetaData (const KIO::MetaData &metaData)
 
void setParentJob (Job *parentJob)
 
void showErrorDialog (QWidget *parent=0)
 
void start ()
 
JobUiDelegate * ui () const
 
- Public Member Functions inherited from KCompositeJob
 KCompositeJob (QObject *parent=0)
 
virtual ~KCompositeJob ()
 
- Public Member Functions inherited from KJob
 KJob (QObject *parent=0)
 
virtual ~KJob ()
 
Capabilities capabilities () const
 
int error () const
 
virtual QString errorString () const
 
QString errorText () const
 
bool exec ()
 
bool isAutoDelete () const
 
bool isSuspended () const
 
unsigned long percent () const
 
qulonglong processedAmount (Unit unit) const
 
void setAutoDelete (bool autodelete)
 
void setUiDelegate (KJobUiDelegate *delegate)
 
virtual void start ()=0
 
qulonglong totalAmount (Unit unit) const
 
KJobUiDelegate * uiDelegate () const
 

Protected Slots

virtual void slotResult (KJob *job)
 
- Protected Slots inherited from KCompositeJob
virtual void slotInfoMessage (KJob *job, const QString &plain, const QString &rich)
 
virtual void slotResult (KJob *job)
 

Protected Member Functions

 CopyJob (CopyJobPrivate &dd)
 
void emitResult ()
 
- Protected Member Functions inherited from KIO::Job
 Job ()
 
 Job (JobPrivate &dd)
 
virtual bool addSubjob (KJob *job)
 
virtual bool doKill ()
 
virtual bool doResume ()
 
virtual bool doSuspend ()
 
virtual bool removeSubjob (KJob *job)
 
- Protected Member Functions inherited from KCompositeJob
 KCompositeJob (KCompositeJobPrivate &dd, QObject *parent)
 
virtual bool addSubjob (KJob *job)
 
void clearSubjobs ()
 
bool hasSubjobs ()
 
virtual bool removeSubjob (KJob *job)
 
const QList< KJob * > & subjobs () const
 
- Protected Member Functions inherited from KJob
 KJob (KJobPrivate &dd, QObject *parent)
 
virtual bool doKill ()
 
virtual bool doResume ()
 
virtual bool doSuspend ()
 
void emitPercent (qulonglong processedAmount, qulonglong totalAmount)
 
void emitResult ()
 
void emitSpeed (unsigned long speed)
 
void setCapabilities (Capabilities capabilities)
 
void setError (int errorCode)
 
void setErrorText (const QString &errorText)
 
void setPercent (unsigned long percentage)
 
void setProcessedAmount (Unit unit, qulonglong amount)
 
void setTotalAmount (Unit unit, qulonglong amount)
 

Additional Inherited Members

- Public Slots inherited from KJob
bool kill (KillVerbosity verbosity=Quietly)
 
bool resume ()
 
bool suspend ()
 
- Public Attributes inherited from KJob
 Bytes
 
 Directories
 
 EmitResult
 
 Files
 
 Killable
 
 KilledJobError
 
 NoCapabilities
 
 NoError
 
 Quietly
 
 Suspendable
 
 UserDefinedError
 
- Protected Attributes inherited from KJob
KJobPrivate *const d_ptr
 

Detailed Description

CopyJob is used to move, copy or symlink files and directories.

Don't create the job directly, but use KIO::copy(), KIO::move(), KIO::link() and friends.

See also
KIO::copy()
KIO::copyAs()
KIO::move()
KIO::moveAs()
KIO::link()
KIO::linkAs()

Definition at line 65 of file copyjob.h.

Member Enumeration Documentation

◆ CopyMode

enum KIO::CopyJob::CopyMode

Defines the mode of the operation.

Enumerator
Copy 
Move 
Link 

Definition at line 73 of file copyjob.h.

Constructor & Destructor Documentation

◆ ~CopyJob()

CopyJob::~CopyJob ( )
virtual

Definition at line 263 of file copyjob.cpp.

◆ CopyJob()

CopyJob::CopyJob ( CopyJobPrivate &  dd)
protected

Definition at line 255 of file copyjob.cpp.

Member Function Documentation

◆ aboutToCreate

void KIO::CopyJob::aboutToCreate ( KIO::Job *  job,
const QList< KIO::CopyInfo > &  files 
)
signal

Emitted when it is known which files / directories are going to be created.

Note that this may still change e.g. when existing files with the same name are discovered.

Parameters
jobthe job that emitted this signal
filesa list of items that are about to be created.

◆ copying

void KIO::CopyJob::copying ( KIO::Job *  job,
const KUrl &  src,
const KUrl &  dest 
)
signal
The job is copying a file or directory.

Note: This signal is used for progress dialogs, it's not emitted for
every file or directory (this would be too slow), but every 200ms.
Parameters
jobthe job that emitted this signal
srcthe URL of the file or directory that is currently being copied
destthe destination of the current operation

◆ copyingDone

void KIO::CopyJob::copyingDone ( KIO::Job *  job,
const KUrl &  from,
const KUrl &  to,
time_t  mtime,
bool  directory,
bool  renamed 
)
signal
The job emits this signal when copying or moving a file or directory successfully finished.
This signal is mainly for the Undo feature.
If you simply want to know when a copy job is done, use result().
Parameters
jobthe job that emitted this signal
fromthe source URL
tothe destination URL
mtimethe modification time of the source file, hopefully set on the destination file too (when the kioslave supports it).
directoryindicates whether a file or directory was successfully copied/moved. true for a directory, false for file
renamedindicates that the destination URL was created using a rename operation (i.e. fast directory moving). true if is has been renamed

◆ copyingLinkDone

void KIO::CopyJob::copyingLinkDone ( KIO::Job *  job,
const KUrl &  from,
const QString &  target,
const KUrl &  to 
)
signal
The job is copying or moving a symbolic link, that points to target.
The new link is created in @p to. The existing one is/was in @p from.
This signal is mainly for the Undo feature.
Parameters
jobthe job that emitted this signal
fromthe source URL
targetthe target
tothe destination URL

◆ creatingDir

void KIO::CopyJob::creatingDir ( KIO::Job *  job,
const KUrl &  dir 
)
signal
The job is creating the directory @p dir.

This signal is emitted for every directory being created.
Parameters
jobthe job that emitted this signal
dirthe directory that is currently being created

◆ destUrl()

KUrl CopyJob::destUrl ( ) const

Returns the destination URL.

Returns
the destination URL

Definition at line 272 of file copyjob.cpp.

◆ doSuspend()

bool CopyJob::doSuspend ( )
virtual

Reimplemented for internal reasons.

Reimplemented from KIO::Job.

Definition at line 486 of file copyjob.cpp.

◆ emitResult()

void CopyJob::emitResult ( )
protected

Definition at line 1747 of file copyjob.cpp.

◆ linking

void KIO::CopyJob::linking ( KIO::Job *  job,
const QString &  target,
const KUrl &  to 
)
signal
The job is creating a symbolic link.

Note: This signal is used for progress dialogs, it's not emitted for
every file or directory (this would be too slow), but every 200ms.
Parameters
jobthe job that emitted this signal
targetthe URL of the file or directory that is currently being linked
tothe destination of the current operation

◆ moving

void KIO::CopyJob::moving ( KIO::Job *  job,
const KUrl &  from,
const KUrl &  to 
)
signal
The job is moving a file or directory.

Note: This signal is used for progress dialogs, it's not emitted for
every file or directory (this would be too slow), but every 200ms.
Parameters
jobthe job that emitted this signal
fromthe URL of the file or directory that is currently being moved
tothe destination of the current operation

◆ operationMode()

KIO::CopyJob::CopyMode KIO::CopyJob::operationMode ( ) const

Returns the mode of the operation (copy, move, or link), depending on whether KIO::copy(), KIO::move() or KIO::link() was called.

Definition at line 2142 of file copyjob.cpp.

◆ processedDirs

void KIO::CopyJob::processedDirs ( KIO::Job *  job,
unsigned long  dirs 
)
signal

Sends the number of processed directories.

Parameters
jobthe job that emitted this signal
dirsthe number of processed dirs

◆ processedFiles

void KIO::CopyJob::processedFiles ( KIO::Job *  job,
unsigned long  files 
)
signal

Sends the number of processed files.

Parameters
jobthe job that emitted this signal
filesthe number of processed files

◆ renamed

void KIO::CopyJob::renamed ( KIO::Job *  job,
const KUrl &  from,
const KUrl &  to 
)
signal
The user chose to rename @p from to @p to.
Parameters
jobthe job that emitted this signal
fromthe original name
tothe new name

◆ setAutoRename()

void KIO::CopyJob::setAutoRename ( bool  autoRename)

Rename files automatically when the destination already exists, instead of the default behavior (interactive mode: showing a dialog to the user, non-interactive mode: aborting with an error).

Initially added for a unit test.

Since
4.7

Definition at line 2153 of file copyjob.cpp.

◆ setAutoSkip()

void KIO::CopyJob::setAutoSkip ( bool  autoSkip)

Skip copying or moving any file when the destination already exists, instead of the default behavior (interactive mode: showing a dialog to the user, non-interactive mode: aborting with an error).

Initially added for a unit test.

Since
4.2

Definition at line 2147 of file copyjob.cpp.

◆ setDefaultPermissions()

void KIO::CopyJob::setDefaultPermissions ( bool  b)

By default the permissions of the copied files will be those of the source files.

But when copying "template" files to "new" files, people prefer the umask to apply, rather than the template's permissions. For that case, call setDefaultPermissions(true)

Definition at line 2137 of file copyjob.cpp.

◆ setWriteIntoExistingDirectories()

void KIO::CopyJob::setWriteIntoExistingDirectories ( bool  overwriteAllDirs)

Reuse any directory that already exists, instead of the default behavior (interactive mode: showing a dialog to the user, non-interactive mode: aborting with an error).

Since
4.2

Definition at line 2159 of file copyjob.cpp.

◆ slotResult

void CopyJob::slotResult ( KJob *  job)
protectedvirtualslot

Definition at line 2082 of file copyjob.cpp.

◆ srcUrls()

KUrl::List CopyJob::srcUrls ( ) const

Returns the list of source URLs.

Returns
the list of source URLs.

Definition at line 267 of file copyjob.cpp.

◆ totalDirs

void KIO::CopyJob::totalDirs ( KJob *  job,
unsigned long  dirs 
)
signal

Emitted when the toal number of direcotries is known.

Parameters
jobthe job that emitted this signal
dirsthe total number of directories

◆ totalFiles

void KIO::CopyJob::totalFiles ( KJob *  job,
unsigned long  files 
)
signal

Emitted when the total number of files is known.

Parameters
jobthe job that emitted this signal
filesthe total number of files

The documentation for this class was generated from the following files:
  • copyjob.h
  • copyjob.cpp
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

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal