• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

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

#include <jobclasses.h>

Inheritance diagram for TDEIO::CopyJob:
TDEIO::Job

Public Types

enum  CopyMode { Copy , Move , Link }
 

Signals

void totalFiles (TDEIO::Job *job, unsigned long files)
 
void totalDirs (TDEIO::Job *job, unsigned long dirs)
 
void aboutToCreate (TDEIO::Job *job, const TQValueList< TDEIO::CopyInfo > &files)
 
void processedFiles (TDEIO::Job *job, unsigned long files)
 
void processedDirs (TDEIO::Job *job, unsigned long dirs)
 
void copying (TDEIO::Job *job, const KURL &from, const KURL &to)
 
void linking (TDEIO::Job *job, const TQString &target, const KURL &to)
 
void moving (TDEIO::Job *job, const KURL &from, const KURL &to)
 
void creatingDir (TDEIO::Job *job, const KURL &dir)
 
void renamed (TDEIO::Job *job, const KURL &from, const KURL &to)
 
void copyingDone (TDEIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed)
 
void copyingLinkDone (TDEIO::Job *job, const KURL &from, const TQString &target, const KURL &to)
 
- Signals inherited from TDEIO::Job
void result (TDEIO::Job *job)
 
void canceled (TDEIO::Job *job)
 
void infoMessage (TDEIO::Job *job, const TQString &msg)
 
void warning (TDEIO::Job *job, const TQString &msg)
 
void connected (TDEIO::Job *job)
 
void percent (TDEIO::Job *job, unsigned long percent)
 
void totalSize (TDEIO::Job *job, TDEIO::filesize_t size)
 
void processedSize (TDEIO::Job *job, TDEIO::filesize_t size)
 
void speed (TDEIO::Job *job, unsigned long speed)
 

Public Member Functions

 CopyJob (const KURL::List &src, const KURL &dest, CopyMode mode, bool asMethod, bool showProgressInfo)
 
KURL::List srcURLs () const
 
KURL destURL () const
 
void setDefaultPermissions (bool b)
 
void setInteractive (bool b)
 
- Public Member Functions inherited from TDEIO::Job
virtual void kill (bool quietly=true)
 
int error () const
 
int progressId () const
 
const TQString & errorText () const
 
TQString errorString () const
 
TQStringList detailedErrorStrings (const KURL *reqUrl=0L, int method=-1) const
 
void showErrorDialog (TQWidget *parent=0L)
 
void setAutoErrorHandlingEnabled (bool enable, TQWidget *parentWidget=0)
 
bool isAutoErrorHandlingEnabled () const
 
void setAutoWarningHandlingEnabled (bool enable)
 
bool isAutoWarningHandlingEnabled () const
 
void setInteractive (bool enable)
 
bool isInteractive () const
 
void setWindow (TQWidget *window)
 
TQWidget * window () const
 
void updateUserTimestamp (unsigned long time)
 
void setParentJob (Job *parentJob)
 
Job * parentJob () const
 
void setMetaData (const TDEIO::MetaData &metaData)
 
void addMetaData (const TQString &key, const TQString &value)
 
void addMetaData (const TQMap< TQString, TQString > &values)
 
void mergeMetaData (const TQMap< TQString, TQString > &values)
 
MetaData outgoingMetaData () const
 
MetaData metaData () const
 
TQString queryMetaData (const TQString &key)
 
TDEIO::filesize_t getProcessedSize ()
 

Protected Slots

void slotStart ()
 
void slotEntries (TDEIO::Job *, const TDEIO::UDSEntryList &list)
 
virtual void slotResult (TDEIO::Job *job)
 
void slotProcessedSize (TDEIO::Job *, TDEIO::filesize_t data_size)
 
void slotTotalSize (TDEIO::Job *, TDEIO::filesize_t size)
 
void slotReport ()
 
- Protected Slots inherited from TDEIO::Job
virtual void slotResult (TDEIO::Job *job)
 
void slotSpeed (TDEIO::Job *job, unsigned long speed)
 
void slotInfoMessage (TDEIO::Job *job, const TQString &msg)
 
void slotSpeedTimeout ()
 

Protected Member Functions

void statCurrentSrc ()
 
void statNextSrc ()
 
void slotResultStating (TDEIO::Job *job)
 
void startListing (const KURL &src)
 
void slotResultCreatingDirs (TDEIO::Job *job)
 
void slotResultConflictCreatingDirs (TDEIO::Job *job)
 
void createNextDir ()
 
void slotResultCopyingFiles (TDEIO::Job *job)
 
void slotResultConflictCopyingFiles (TDEIO::Job *job)
 
void copyNextFile ()
 
void slotResultDeletingDirs (TDEIO::Job *job)
 
void deleteNextDir ()
 
void skip (const KURL &sourceURL)
 
void slotResultRenaming (TDEIO::Job *job)
 
void setNextDirAttribute ()
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from TDEIO::Job
 Job (bool showProgressInfo)
 
virtual void addSubjob (Job *job, bool inheritMetaData=true)
 
virtual void removeSubjob (Job *job)
 
void removeSubjob (Job *job, bool mergeMetaData, bool emitResultIfLast)
 
void emitPercent (TDEIO::filesize_t processedSize, TDEIO::filesize_t totalSize)
 
void emitSpeed (unsigned long speed)
 
void emitResult ()
 
void setProcessedSize (TDEIO::filesize_t size)
 
unsigned long userTimestamp () const
 
int & extraFlags ()
 

Friends

class CopyJobPrivate
 

Additional Inherited Members

- Protected Types inherited from TDEIO::Job
enum  { EF_TransferJobAsync = (1 << 0) , EF_TransferJobNeedData = (1 << 1) , EF_TransferJobDataSent = (1 << 2) , EF_ListJobUnrestricted = (1 << 3) }
 
- Protected Attributes inherited from TDEIO::Job
TQPtrList< Job > subjobs
 
int m_error
 
TQString m_errorText
 
unsigned long m_percent
 
int m_progressId
 
TQTimer * m_speedTimer
 
TQGuardedPtr< TQWidget > m_window
 
MetaData m_outgoingMetaData
 
MetaData m_incomingMetaData
 

Detailed Description

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

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

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

Definition at line 1507 of file jobclasses.h.

Member Enumeration Documentation

◆ CopyMode

enum TDEIO::CopyJob::CopyMode

Defines the mode of the operation.

Definition at line 1514 of file jobclasses.h.

Constructor & Destructor Documentation

◆ CopyJob()

CopyJob::CopyJob ( const KURL::List &  src,
const KURL &  dest,
CopyMode  mode,
bool  asMethod,
bool  showProgressInfo 
)

Do not create a CopyJob directly.

Use TDEIO::copy(), TDEIO::move(), TDEIO::link() and friends instead.

Parameters
srcthe list of source URLs
destthe destination URL
modespecifies whether the job should copy, move or link
asMethodif true, behaves like TDEIO::copyAs(), TDEIO::moveAs() or TDEIO::linkAs()
showProgressInfotrue to show progress information to the user
See also
TDEIO::copy()
TDEIO::copyAs()
TDEIO::move()
TDEIO::moveAs()
TDEIO::link()
TDEIO::linkAs()

States: STATE_STATING for the dest STATE_STATING for each src url (statNextSrc) for each: if dir -> STATE_LISTING (filling 'dirs' and 'files') but if direct rename possible: STATE_RENAMING instead. STATE_CREATING_DIRS (createNextDir, iterating over 'dirs') if conflict: STATE_CONFLICT_CREATING_DIRS STATE_COPYING_FILES (copyNextFile, iterating over 'files') if conflict: STATE_CONFLICT_COPYING_FILES STATE_DELETING_DIRS (deleteNextDir) (if moving) STATE_SETTING_DIR_ATTRIBUTES (setNextDirAttribute, iterating over d->m_directoriesCopied) done.

Definition at line 2278 of file job.cpp.

Member Function Documentation

◆ aboutToCreate

void TDEIO::CopyJob::aboutToCreate ( TDEIO::Job *  job,
const TQValueList< TDEIO::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 TDEIO::CopyJob::copying ( TDEIO::Job *  job,
const KURL &  from,
const KURL &  to 
)
signal
The job is copying a file or directory.
Parameters
jobthe job that emitted this signal
fromthe URl of the file or directory that is currently being copied
tothe destination of the current operation

◆ copyingDone

void TDEIO::CopyJob::copyingDone ( TDEIO::Job *  job,
const KURL &  from,
const KURL &  to,
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.
Parameters
jobthe job that emitted this signal
fromthe source URL
tothe destination URL
directoryindicates whether a file or directory was successfully copied/moved. true for a directoy, 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 TDEIO::CopyJob::copyingLinkDone ( TDEIO::Job *  job,
const KURL &  from,
const TQString &  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 TDEIO::CopyJob::creatingDir ( TDEIO::Job *  job,
const KURL &  dir 
)
signal
The job is creating the directory @p dir.
Parameters
jobthe job that emitted this signal
dirthe directory that is currently being created

◆ destURL()

KURL TDEIO::CopyJob::destURL ( ) const
inline

Returns the destination URL.

Returns
the destination URL

Definition at line 1547 of file jobclasses.h.

◆ linking

void TDEIO::CopyJob::linking ( TDEIO::Job *  job,
const TQString &  target,
const KURL &  to 
)
signal
The job is creating a symbolic link.
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 TDEIO::CopyJob::moving ( TDEIO::Job *  job,
const KURL &  from,
const KURL &  to 
)
signal
The job is moving a file or directory.
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

◆ processedDirs

void TDEIO::CopyJob::processedDirs ( TDEIO::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 TDEIO::CopyJob::processedFiles ( TDEIO::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 TDEIO::CopyJob::renamed ( TDEIO::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

◆ setDefaultPermissions()

void TDEIO::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)

TODO KDE4: consider adding this as bool to copy/copyAs?

Since
3.2.3

Definition at line 3939 of file job.cpp.

◆ setInteractive()

void TDEIO::CopyJob::setInteractive ( bool  b)

When an error happens while copying/moving a file, the user will be presented with a dialog for skipping the file that can't be copied/moved.

Or if the error is that the destination file already exists, the standard rename dialog is shown. If the program doesn't want CopyJob to show dialogs, but to simply fail on error, call setInteractive( false ).

KDE4: remove, already in Job

Since
3.4

Definition at line 3945 of file job.cpp.

◆ slotProcessedSize

void CopyJob::slotProcessedSize ( TDEIO::Job *  ,
TDEIO::filesize_t  data_size 
)
protectedslot

Forward signal from subjob.

Definition at line 3637 of file job.cpp.

◆ slotStart

void CopyJob::slotStart ( )
protectedslot

We call the functions directly instead of using signals. Calling a function via a signal takes approx. 65 times the time compared to calling it directly (at least on my machine). aleXXX

Definition at line 2321 of file job.cpp.

◆ slotTotalSize

void CopyJob::slotTotalSize ( TDEIO::Job *  ,
TDEIO::filesize_t  size 
)
protectedslot
Forward signal from subjob
Parameters
sizethe total size

Definition at line 3654 of file job.cpp.

◆ srcURLs()

KURL::List TDEIO::CopyJob::srcURLs ( ) const
inline

Returns the list of source URLs.

Returns
the list of source URLs.

Definition at line 1541 of file jobclasses.h.

◆ totalDirs

void TDEIO::CopyJob::totalDirs ( TDEIO::Job *  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 TDEIO::CopyJob::totalFiles ( TDEIO::Job *  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:
  • jobclasses.h
  • job.cpp

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.9.1
This website is maintained by Timothy Pearson.