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

KIO

  • KIO
  • CopyJob
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions

KIO::CopyJob Class Reference

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

#include <copyjob.h>

Inheritance diagram for KIO::CopyJob:
Inheritance graph
[legend]

List of all members.

Public Types

enum  CopyMode { Copy, Move, Link }

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)

Public Member Functions

virtual ~CopyJob ()
KUrl destUrl () const
virtual bool doSuspend ()
CopyMode operationMode () const
void setAutoSkip (bool autoSkip)
void setDefaultPermissions (bool b)
void setWriteIntoExistingDirectories (bool overwriteAllDirs)
KUrl::List srcUrls () const

Protected Slots

virtual void slotResult (KJob *job)

Protected Member Functions

 CopyJob (CopyJobPrivate &dd)
void emitResult ()

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

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 ( ) [virtual]

Definition at line 255 of file copyjob.cpp.

CopyJob::CopyJob ( CopyJobPrivate &  dd) [protected]

Definition at line 248 of file copyjob.cpp.


Member Function Documentation

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.
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
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
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 to. The existing one is/was in from. This signal is mainly for the Undo feature.

Parameters:
jobthe job that emitted this signal
fromthe source URL
targetthe target
tothe destination URL
void KIO::CopyJob::creatingDir ( KIO::Job *  job,
const KUrl &  dir 
) [signal]

The job is creating the directory dir.

This signal is emitted for every directory being created.

Parameters:
jobthe job that emitted this signal
dirthe directory that is currently being created
KUrl CopyJob::destUrl ( ) const

Returns the destination URL.

Returns:
the destination URL

Definition at line 264 of file copyjob.cpp.

bool CopyJob::doSuspend ( ) [virtual]

Reimplemented for internal reasons.

Reimplemented from KIO::Job.

Definition at line 459 of file copyjob.cpp.

void CopyJob::emitResult ( ) [protected]

Reimplemented from KJob.

Definition at line 1685 of file copyjob.cpp.

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
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
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 2078 of file copyjob.cpp.

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
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
void KIO::CopyJob::renamed ( KIO::Job *  job,
const KUrl &  from,
const KUrl &  to 
) [signal]

The user chose to rename from to to.

Parameters:
jobthe job that emitted this signal
fromthe original name
tothe new name
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 2083 of file copyjob.cpp.

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 2073 of file copyjob.cpp.

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 2089 of file copyjob.cpp.

void CopyJob::slotResult ( KJob *  job) [protected, virtual, slot]

Reimplemented from KCompositeJob.

Definition at line 2018 of file copyjob.cpp.

KUrl::List CopyJob::srcUrls ( ) const

Returns the list of source URLs.

Returns:
the list of source URLs.

Definition at line 259 of file copyjob.cpp.

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
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

KIO

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal